I don't use exchange margins, they too low, I use 40%. Plus, I have positions spread over many futures for diversification.
Ok, I can ask you questions as hints. How can an algorithm know that there's a flash crash happening?
It won't. flash happens, then it reacts. if You're on the right side then you're making money. If you're on the wrong side then the questions is how much slippage are you getting with regards to your planned stop loss. Doesnt really give you anything to define a flash crash by doing (avg vola) - (current vola analysis), does it when your live position is hurting.
Let me point you to this article. It links circuit breakers and levels of sudden changes in volatility. A volatility that has been measured in advance in order to identify sudden changes to trigger the circuit breaker. https://www.sciencedirect.com/scien...sh Crashâ and concerns,as well as across time.
It could, but it won't. If you haven't lived through that moment, you won't understand. There's no way to know whether this is just another orderly selloff or it's the REAL panic. Just take a look at this video and you can palpably feel the panic in the squawk.
If you use stop LIMIT, you won't get filled. It will just get skipped over. If you use stop MARKET, who knows where you'll get filled. Maybe 2000 points below (500 ES in 2010 equivalent to today?) after 5 to 10 minutes later??? It's very possible that 1 bad (unlucky) trade could wipe you out.
I have max_spread parameter for liquidity taking algos that would prevent them from entering. As far as exiting, nothing I can do but eat it(assuming your algo trades with stops). BTW, we now have circuit breakers which we did not have during the flash crash. That would at least give you a chance to discretionary make some sort of decision.
"U.S. regulations have three levels of a circuit breaker, which are set to halt trading when the S&P 500 Index drops 7%, 13%, and 20%." More info here.