FLASH CRASH DIAGNOSYS BY EA

 

DOES ANYONE KNOWS AMONG PROFESSIONAL TRADERS HOW TO CODE AN EA TO DIAGNOSE FLASH CRASH OF MARKET LIKE.

JAN 2015 CHF PAIRS FLASH CRASH?

WHICH STRATEGY AND COD WORKS BETTER.

THIS IS CRUCIAL FOR ANY ROBOT.

THANK YOU

 

I am curious of this as well. Sometimes when I run full backtesting on diff pairs, i have to recall that  flash crashes will affect the end result (especially the Jan 2015 CHF) or presidential election. The only thing i come up with is something that says only "x" amount of trade per day. That will solve the excessive entries caused in the backtesting (or live trading for that matter). If the strategy has SL, that may control it as well (but if the SL is far, a flash is still enough to still trigger it). But i think you probably talking about more marginal type strategies, so again, X amount of trade per day would help if you have no SL. The good about flash crashes in they tend to recover in the same day (3 at most).


I tried before an indicator that could measure the speed of price changes, but that does not catch the "flash" quick enough because it was based on average price movement.......only big news related movements were correctly filtered. 

 

I think this would mostly effect martingale ea's, when they start making hundreds of trades in a few seconds... minutes.


What I did is any Ea that uses martingale, I wrote a function that would check the last opening time of previous trade and if it was less then a certain time, say 60 seconds then to disable trading so it would not open any subsequent trades which can potentially kill your whole fund.

 
if((close[rates_total-2]-close[rates_total-1])>0.1*close[rates_total-1]) FLASH_CRASH=true;
 

Please don't shout.

There is no way to *code* yourself out of such event. By means of Code/EA you will detect when event is actually happening at best. Then, when detected you want to get out maybe? Probably you are at that time against wide spread and a long list of traders in front of you who wants the exact same.

These flash crash happens rarely. Probably it will cost you more to protect yourself from such event then it would pay off when trading small account.

In the end only a decent regulated broker covered by Investor Compensation schemes like MiFID/FCA for example, with low stop out levels will keep your deposit *safe* . Brokers can go bankrupt (and some did) in such event.

 

i think one of the ways is that if market moves more than x pips in x seconds or milli seconds your ea must stop trading or so..

another way is if market moves more than %10 of pair value its time to stop trading and stay inside and wait.

what do you think?

 
kypa:

can you tell me what this code do?

 
Enrique Dangeroux:

Please don't shout.

There is no way to *code* yourself out of such event. By means of Code/EA you will detect when event is actually happening at best. Then, when detected you want to get out maybe? Probably you are at that time against wide spread and a long list of traders in front of you who wants the exact same.

These flash crash happens rarely. Probably it will cost you more to protect yourself from such event then it would pay off when trading small account.

In the end only a decent regulated broker covered by Investor Compensation schemes like MiFID/FCA for example, with low stop out levels will keep your deposit *safe* . Brokers can go bankrupt (and some did) in such event.

you said right but this cant stop us to make ready ourselves in such bad events. flash crashes are real market conditions. markets produced them before and will do the same at the future too because of hft traders. there is no guarantee that they will not occur again. so we have to find a way to protect ourselves against this kind of bad events. i am working with alpari.ru that have 20 years in the market and they gone out of the flash crashes healthy  before .

 
Seyedmajid Masharian:

i think one of the ways is that if market moves more than x pips in x seconds or milli seconds your ea must stop trading or so..

another way is if market moves more than %10 of pair value its time to stop trading and stay inside and wait.

what do you think?

does anyone know how to calculate daily volatility percent ?

 
Seyedmajid Masharian:

does anyone know how to calculate daily volatility percent ?

define volatility percent.

but you can improvise an effective variable by performing statistic analyze of daily (or shorter/longer time frames) ATRs, both ( high-ranged and small-ranged ).
that can flag an (possible) ongoing price crisis. (which means detection at best, but not prediction).
the problem is how much these crisis-detection sensor of yours is smart/useful to filter out usual but unusual market fluctuations. :))

hope i make sense to you.

 
Code2219 or probably 2319:

define volatility percent.

but you can improvise an effective variable by performing statistic analyze of daily (or shorter/longer time frames) ATRs, both ( high-ranged and small-ranged ).
that can flag an (possible) ongoing price crisis. (which means detection at best, but not prediction).
the problem is how much these crisis-detection sensor of yours is smart/useful to filter out usual but unusual market fluctuations. :))

hope i make sense to you.

what do you think about each movement more than 500 pips a day on any pair as suspicious movement/

Reason: