Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Playback Connection: I don't want to wait until flat

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

    Playback Connection: I don't want to wait until flat

    So I have a intrabar strategy I have to test in playback. As you may know, when I enable the strategy it shows historical fills on the chart already and sometimes it is in the middle of a historically filled order.

    The whole purpose of my doing a playback test is because it is an "on each tick" strategy which in "on bar close" would fill one bar later and so back test (which seems to be an "on bar close" only) doesn't work. However, the historical fills displayed on the playback chart will always show an "on bar close" fill anyway??? And so, if I enable my strategy and it is in the middle of a historically filled order, I have to wait until flat. This means there is no way to test it during those periods???!

    Is there anyway to not have historical fills come up but simply start with a blank slate? I don't want to "wait until flat", and the other options aren't better.

    Please advise.
    Last edited by smcllr; 05-31-2021, 06:28 PM.

    #2
    Hello? Any Ninjatrader Devs capable of answering this?

    Comment


      #3
      Hello smcllr,

      Thank you for your post.

      When a strategy is enabled, it processes historical data to determine trades that the strategy would have made on the data that is already on the PC/chart and to determine what position the strategy is in. (Strategy positions are separate from actual Account positions.)

      If you do not want the strategy to calculate a position from processing historical data, you could add if (State == State.Historical) return; to the top of your strategy logic so historical processing is skipped. The strategy will then always start from a flat position because it has not calculated any orders.

      Please note that if you skip historical processing, the strategy would not be able to be backtested using the Strategy Analyzer. You would need to use the Playback Connection with Market Replay data to test the strategy.

      Something you could do is add a bool input in your script that when true will skip historical processing. This way you could toggle historical processing on/off when enabling and testing your strategy.

      See the help guide documentation below for more information:
      Strategy vs. Account Position — https://ninjatrader.com/support/help..._account_p.htm
      Start Behaviors — https://ninjatrader.com/support/help..._positions.htm

      Let us know if we may assist further.
      <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      109 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
      37 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      40 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      77 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X