Topic: Realistic SL in backtesting after (weekend) gap

Hi Miroslav,

I just saw that you´ve been mentioning this in the latest EA Studio update:

"- Fixed close on Take Profit in a gap to be at current Open."

Which is the right way to do it after a gap indeed. But how about the SL? After a weekend gap, it will also be executed at the next open price, even if it was surpassed by whatever amount of pips. E.g., say we have a SL of 50 pips, the trade carries on during the weekend, then the market opens 100 pips below our set SL. The trade would be closed at a loss of 150 pips instead of 50 pips. Does EA Studio simulate that correctly yet? It doesn´t look like to me, but it would be the correct way to simulate this during backtesting because exactly this happens in real trading.

Thank you :-)

Re: Realistic SL in backtesting after (weekend) gap

> Does EA Studio simulate that correctly yet?

Yes, EA Studio correctly simulates the SL, TP and Trailing Stop Loss.
If there is a gap and the SL or TP appears in the gap, EA Studio close at bar Open (+ spread for the short positions).
It does so because the bar Open is the first possible price to close.


> I just saw that you´ve been mentioning this in the latest EA Studio update: "- Fixed close on Take Profit in a gap to be at current Open."

I fixed a bug where EA Studio was closing at the TP after a gap. Now it closes at Bar Open (in our favour smile ), but this is how I think should be.

3 (edited by geektrader 2022-08-07 17:10:16)

Re: Realistic SL in backtesting after (weekend) gap

OK, perfect, I´ll be testing this once more, as these scenarios are very rare, it must have slipped me that EA Studio already simulates this correctly - amazing!

Yes, I absolutely agree about the fixed TP handling, this is how it should be and happens in reality.

Thanks again for thinking about everything :-) I am eager to see what further performance improvements will follow this year, I know you´ve got a lot of stuff in the pipeline :-) EA Studio, already now, is the fastest system generator out there by a margin of at least x10 - and I am using pretty much any other generator out there, be it StrategyQuant, Build Alpha, Adaptrade Builder, etc.

Keep up the great work :-)