Reply

vicious loop in a EA

1 replies

TJ#

Customer, bbp_participant, community, 144 replies.

Visit profile

9 years ago #112841

Dear Admin,

 

I have an testing EA that is working fine but occasionally it will end up in a rabbit hole(vicious loop) that cause huge losses on backtest. 

 

Is there any way to stop participating a trade after 2 consecutive losses within the a candle,  a period a time? Also, how would you exit the EA from this loop?  

 

Thank you. 🙂

 

Regards,

 

TJ

File: loop.pngloop.png

0

Mark Fric

Administrator, sq-ultimate, 2 replies.

Visit profile

9 years ago #127372

you can use Strategy Control -> Total Losses to count total losses in the last X trades, but there’s no function to give you total losses in some time period.

 

It would have to be done by a custom programming by creating a custom function for that.

 

But you can maybe create some conditions by combining Total Losses with another function Bars Since Order Closed which returns number of bars since the last trade closed.

Mark
StrategyQuant architect

0

Viewing 1 replies (of 1 total)