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 WeyldFalcon, 08-07-2020, 06:13 AM
      11 responses
      1,422 views
      0 likes
      Last Post jculp
      by jculp
       
      Started by RubenCazorla, Today, 09:07 AM
      0 responses
      4 views
      0 likes
      Last Post RubenCazorla  
      Started by BarzTrading, Today, 07:25 AM
      2 responses
      29 views
      1 like
      Last Post BarzTrading  
      Started by devatechnologies, 04-14-2024, 02:58 PM
      3 responses
      21 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Started by tkaboris, Today, 08:01 AM
      0 responses
      6 views
      0 likes
      Last Post tkaboris  
      Working...
      X