Watch for gaps, was: ApplyStop Profit

I am trying a simple scalping algo for ES futures. I have set a profit stop
at 0.25 point but the backtest gives me more profit than just 0.25 much of the time.

What settings do I need to get the point profit I programmed?


Slippage = 0.25;

BuyPrice = Close + Slippage;

RSI_P = RSI(3 );

tn = TimeNum();
startTime = 95000; // start in HHMMSS format
endTime = 152500;  // end in HHMMSS format

timeOK = tn >= startTime AND tn <= endTime;

Buy = Cross(10, RSI_P) AND timeOK;
Sell = 0;



Things to try

  • Turn on ActivateStopsImmediately in backtester
  • set ExitAtStop to 1
  • Make sure the bad trades are not gaps

Thanks, I will check that out.

Gaps in general and gaps on open (between close of previous bar and open of next bar) are your answer. Stops don't occur in void. They occur in actual tradeable price levels. If that happens that gap is wider then you will get more profit.

It would be nice to have an option to disable price improvement when using profit stops. In my experience, when trading intraday, a resting limit order will usually be filled at the limit price, not higher.

I understand. Thanks for the info.

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.