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

Backtest w multiple targets get filled as single exit, at wrong levels

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

    Backtest w multiple targets get filled as single exit, at wrong levels

    My strategy that uses tick replay and multiple profit targets generate backtest fills as single exit. Plus most targets and stoplosses are filled at wrong price levels. ie. historical exits all got executed at the opens of the next bar of where they were supposed to take place, not during the bars.

    Running live the strategy performs as expected.
    The strategy calculates on bar close, resets stoploss order price depending on target fills. It does not reset target prices.
    What's the potential cause of this behavior?
    Last edited by yubo27; 05-07-2021, 09:13 AM.

    #2
    Hello yubo27,

    Thank you for your post.

    It should be noted that Tick Replay would help indicators to calculate tick by tick historically, but wouldn't have any effect on fill prices. Adding intrabar granularity, however, can give more accurate fill prices.

    I'd take a look at this example from our help guide that goes into how you can enter a trade using one time frame and exit on another:


    Here is a link to our forums that goes into depth on using Order Fill Resolution and Tick Replay to ensure your backtests are as close to real time results as possible:

    https://ninjatrader.com/support/foru...mance?t=102504

    High Fill Order Resolution and TickReplay cannot be used together, but it is still possible to add intra-bar granularity to a script in the code itself for order fill accuracy and use TickReplay to update indicators with Calculate set to OnPriceChange or OnEachTick historically.

    Thanks in advance; I look forward to assisting you further.
    Kate W.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by arvidvanstaey, Today, 02:19 PM
    4 responses
    11 views
    0 likes
    Last Post arvidvanstaey  
    Started by samish18, 04-17-2024, 08:57 AM
    16 responses
    61 views
    0 likes
    Last Post samish18  
    Started by jordanq2, Today, 03:10 PM
    2 responses
    9 views
    0 likes
    Last Post jordanq2  
    Started by traderqz, Today, 12:06 AM
    10 responses
    18 views
    0 likes
    Last Post traderqz  
    Started by algospoke, 04-17-2024, 06:40 PM
    5 responses
    48 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X