Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Accuracy of trail stop

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

    Accuracy of trail stop

    I have back tested my strategy on a certain day with a trail stop but when I run the strategy on the same day with market replay the trail stop executes on different prices then the backtest, and I have read in the ninjatrader help guide that trail stop Are amended on a tick by tick basis, so the trail stop should execute at the same points as the back test

    Why is the trailing stop doing this ?
    And how do I make it exactly like the backtest?

    Note:
    The entire are all good, they are at the same point as the back test
    The strategy runs on bar close, on both the reply and back test

    Ps I just remembered I have market replay at 500x speed, will this effect the accuracy of the replay ?
    Last edited by maaz1598; 06-23-2016, 04:51 AM.

    #2
    Hello maaz1598,

    Thank you for your post.

    In Backtesting calculation and fills are based on the closed bars and not the ticks that built each bar. This is due to the fact that backtesting the data is historical only. In Market Replay you are playing back tick by tick and the fill engine uses that information.

    For information on differences on historical backtests and realtime performance (much like Market Replay fills) please visit the following link: http://ninjatrader.com/support/helpG...ime_vs_bac.htm

    Please let me know if you have any questions.

    Comment


      #3
      Thanks I found the problem
      Since I am using three line break charts the candlesticks don't have a wick, meaning that in a backtest which is calculated on bar close the trail stop would not consider the prices below the open(for green candles) because there is no data points there on bar close

      Comment


        #4
        found the problem,
        but cant seem to solve it
        referring to backtest :
        just wanted to know how the trail stop operates with multi time frame data ?
        how do i make the trail stop execute on the 1 minute bar ? instead of the 3 line break data series

        Comment


          #5
          Hello maaz1598,

          Thank you for your response.

          SetTrailStop would always execute on the primary series in backtesting. If you are backtesting and want an exit on a secondary series you would need to use the Exit methods and the barsInProgress index overload.

          Please take a look at the overloads in the Help Guide for the ExitLongStop for example: http://ninjatrader.com/support/helpG...itlongstop.htm

          Please let me know if you have any questions.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by ender_wiggum, Today, 09:50 AM
          1 response
          5 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by rajendrasubedi2023, Today, 09:50 AM
          1 response
          11 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Started by geotrades1, Today, 10:02 AM
          0 responses
          4 views
          0 likes
          Last Post geotrades1  
          Started by bmartz, Today, 09:30 AM
          1 response
          8 views
          0 likes
          Last Post NinjaTrader_Erick  
          Started by geddyisodin, Today, 05:20 AM
          3 responses
          25 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Working...
          X