Attn: Experienced Backtesters -- Best Way to Model an Intraday Stop Loss?

Discussion in 'Trading' started by catmango, Jun 14, 2003.

  1. Stop losses have always been difficult for me to model on backtesting systems, particularly on overnight holds. However, for a system that is based on intraday trades (I'm using 5 min bars), what's the best way to model a stop loss?

    My approach would be the following (using a long position as an example):

    1) Assuming that I enter long at P(E) and I set my stop at P(S), where P(S) < P(E). For each subsequent 5 min bar, perform steps 2 and 3.

    2) If the 5 min bar open B(O) is <= P(S) then set the exit price P(X) at the open less slippage S --

    3) If B(O) is > P(S), then if the 5 min bar low B(L) is <= P(S), then set the exit price at P(S) less slippage --

    Since I'm backtesting an e-mini intraday trading system, I'm assuming that the slippage is one tick (.5 for NQ, .25 for ES).

    Any comments? Would this be the best way to model a stop loss, or is there a better way?

    Thanks!
     
  2. PetaDollar

    PetaDollar Moderator

    Whatever algorithm you program should act like you trade.
    In this case, the algorithm would model reality very well if:
    • after buying, you take no action until the open of the next bar
    • if the open is less than or equal to your stop you instantly market sell
    • if the open is higher than your stop, you instantly place a stop order

    If this is the case then your algorithm is 'good'.
    Also you can get rid of the slippage in this case.
    I know i'll be taken out of context on this one, but with the emini
    and the above rules, the backtest will model reality more closely without that fudge factor.