January 15, 2025

Death from slipping.

If you work with crypto, create algorithms, build a fund, come to my little telegram blog, whereпишу что делаю на пути создания алгоритмического фонда – https://t.me/drsombre ,  2 головы лучше 1 🙂
——————- 
While working on the reverse yesterdayalgorithm (at stop, position reversal) for BTCUSD, I realized that getting into a panic sell/buy is now 100% likely, since exiting a deal can only be by stop loss and we are always in a position.

Therefore, I did not average for each transactionslippage by the asset, and specifically to each, by the logic that slippage = (high / stoploss-1) * 0.7 (That is, we close “Tipo” on the market in the second half of the candle).

I did this at 4h candles and ofigel that the peak values ​​reached 20% of the span.

But then 4h, I decided to conduct a study more carefully, studying 1 minute.

For 3 years he made a minute tablet and substituted for each minute to count as the price gulnula to high or low from the opening point.

Peak values ​​reach 18%! The problem is not in 4 hours, everything happens in 1 minute.
Clap and margin call.
Or an order closed by the market that is n times greater than the risk.
Or the limit order is not fulfilled and the paper loss is even greater.

Then I saw that after the peak, the second minute, toowith a high value, but the opposite, then someone simply throws off the glass on the market, buys it in the moment, and he does not have time to fill up with new orders.

Made a column next to open previousminutes. And after all, I deduced the formula in such a way that it would be necessary to calculate what slippage should be put in the limiter, so that when the glass was sucked in, the price would return to it and close at the most pleasant limiter price.

Personal findings:
1) 12 out of 14 jumps were in 2017, more than half at the beginning of the year due to low liquidity, now things are better, but it takes place.

2) Sitting with ~ 3 + leverage on the entire deposit is a matter of time margin.

3) The maximum slippage to which the glass6.4% returned, i.e. laying in the limiter the price from the stop trigger is 7%, with a probability of 99% closing will be at the best price at critical moments, but worse at snot times up to 7% with a pullback.

4) In just 3 years there were 5 moments where there was the highest slippage with return, the rest do not exceed 2%.

5) If you take into account the risk of 2% (adjustable volumepositions depending on the stop) on the deal, then in 3 years there was 5 times falling into a panic and the loss would reach up to 3.75%, i.e. almost double excess.

6) In this case, the reverse would increase the loss by going to the end of the tail.

Solutions:
1) You need to open a reversal not immediately, but after at least a few minutes, maybe when the n-minute (hourly) candle closes.

2) Lay slippage in the calculation of risk in6.4% instead of 2% is not an option, because there will be a significant decrease in volume, and hence profit. Calculations show that it is better to be prepared for a 2-fold loss.

3) In calculating the position volume, lay 2.1% slippage on this asset, also set 2.1% of the trigger in the limiter.

4) If the SL is not executed, then after 3-5 minutes to close with handles on the market, the glass should be filled in time, it will be better than immediately on the market. Ideally, in a robot you need to gash such a control element.

5) Diversification on exchanges to avoid a shortage of liquidity in a glass.
5.1) Trade the chart not of a specific exchange, but the average price of all, on which 70% of the asset volume. We will avoid solo exchange tails.
5.2) With SL/TP/OPEN (trigger and orders on my side on the average price index), execute on the exchange where the price to the index and liquidity are better. Will it be some kind of arbitrage?

P.S. Please express your opinion, ideas and the main criticism of where I am messing with, objectivity from all sides is important for me to fix errors in my head.
Now we need to calculate:
1) What is the maximum safe leverage that can be taken to avoid a margin call?
2) How would slippage change given the size of my position and what is the maximum depth for minor impact on the market.
3) What are the indicators of altcoins and especially other markets, for example Sber or oil futures.
Death from slipping.