Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Backtesting Algorithm

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Backtesting Algorithm

    Hi....a question.
    I have a strategy with a profit target of 96 & a trailing stop of 26.
    During backtest there is a trade within a single one hour bar with OHLC of 13506, 13550, 13469 & 13460.
    The trade enters at 13506 as expected, but there is a trailing stop executed at 13495.
    I don't understand how this could be correct ?!?!?!
    There are many examples of this during the backtest results.

    Also, is it not possible in backtest mode to have more than one trade per bar?

    many thx
    David

    #2
    apologies - should have said that this is a SHORT strategy. thx

    Comment


      #3
      >> The trade enters at 13506 as expected, but there is a trailing stop executed at 13495.
      What is the problem with that? Note: backtest fills could be outside the OHCL range of a bar, dependent on your fill logic. Please search for "liberal" in the help guide to get more information on that.

      >> Also, is it not possible in backtest mode to have more than one trade per bar?
      Unfortunately no.

      Comment


        #4
        the reason why i would think it is a problem is that the trailing stop is 26 yet the open price/order entry price (13506) rises to a high of 13550 (& does not get stopped out) to eventually give a trailing stop at 13495. But you say that even though it states an entry price of 13506, the actual fill could be outside the OHLC range?

        I will read more in the help guide later. thx. David

        Comment


          #5
          >> the actual fill could be outside the OHLC range
          correct

          Comment


            #6
            The low of the bar is 13469 (+ 26 for the trailing stop since you are short) and you get a price of 13495 which is withing the bar and therefore the order is filled.
            RayNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            111 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            59 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            38 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            41 views
            0 likes
            Last Post TheRealMorford  
            Started by Mindset, 02-28-2026, 06:16 AM
            0 responses
            78 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Working...
            X