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 Segwin, 05-07-2018, 02:15 PM
          14 responses
          1,788 views
          0 likes
          Last Post aligator  
          Started by Jimmyk, 01-26-2018, 05:19 AM
          6 responses
          837 views
          0 likes
          Last Post emuns
          by emuns
           
          Started by jxs_xrj, 01-12-2020, 09:49 AM
          6 responses
          3,292 views
          1 like
          Last Post jgualdronc  
          Started by Touch-Ups, Today, 10:36 AM
          0 responses
          12 views
          0 likes
          Last Post Touch-Ups  
          Started by geddyisodin, 04-25-2024, 05:20 AM
          11 responses
          62 views
          0 likes
          Last Post halgo_boulder  
          Working...
          X