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.
      Brandon H.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by chbruno, 04-24-2024, 04:10 PM
      4 responses
      50 views
      0 likes
      Last Post chbruno
      by chbruno
       
      Started by TraderG23, 12-08-2023, 07:56 AM
      10 responses
      398 views
      1 like
      Last Post beobast
      by beobast
       
      Started by lorem, Yesterday, 09:18 AM
      5 responses
      20 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by WHICKED, Today, 12:56 PM
      2 responses
      15 views
      0 likes
      Last Post WHICKED
      by WHICKED
       
      Started by Felix Reichert, Today, 02:12 PM
      0 responses
      4 views
      0 likes
      Last Post Felix Reichert  
      Working...
      X