Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

During replay, strategy always starts with a position

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

    During replay, strategy always starts with a position

    Hello,

    I was testing a strategy in real-time using Market Replay. I had no issues applying the strategy, running playback, observing, stopping playback, making modifications to strategy code, resetting the playback time (moving the slider, which resets the strategy as well), and continuing to test.

    However, at some point along the way, it got out of whack. Now every time I enable the strategy, it immediately shows as being in a position, even before starting the market replay. The Playback101 account has no positions in it, nothing in the DOM, Sync status in the strategy pane also shows true.

    I have tried the following with no success:
    - reverting code to a state where it worked perfectly before
    - saving strategy as a different name, re-compiling, and applying to chart
    - deleting the market replay data and re-downloading (using a few different days also)
    - removing the strategy from the chart, and also making sure it was removed from the main strategy pane, then adding it back
    - deleting the cache folder from the Documents > Ninja Trader 8 > db directory (saw this mentioned in another post, so thought I would try it)
    - Close the workspace I was in, and attempting in another workspace
    - used a completely different strategy (built with strategy builder), and it started with a position as well (same symptoms)
    - Restart NT8
    - Update NT8 (from 8.0.26 to 8.0.26.1)

    It doesn't make much sense to me why it was working fine before, and now it won't work at all. Perhaps there is some other cache causing the problem, but I really don't know. Very frustrating indeed. Any help would be much appreciated.

    -Chris
    Last edited by risteon; 06-11-2022, 06:25 PM.

    #2
    Hello risteon,

    The playback starts in realtime when the live data starts playing, if the strategy is applied to a chart with historical data on it then it will still do a historical backtest which may result in a virtual strategy position. The strategy would need to be flat to start working in realtime using the default start behavior of wait until flat.

    The place in time you start will affect if the strategy enters a position or not before you have realtime data playing, if the point in time you select results in a historical position you would need to either adjust the time so that does no happen or make the strategy work only in realtime to avoid using historical orders

    You can confirm this is happening when playing forward by looking in the control center strategies tab to check if its color is yellow/orange to mean that it is waiting to exit a historical position.





    .

    Comment


      #3
      Hi Jesse,

      I do recall seeing the strategy name was colored yellow. Thanks for the info regarding the historical aspect. I will test further and reply back if I still have issues.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      60 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      39 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      21 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      23 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      51 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X