Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

One Day Data Series Strategy enter position from to historic data

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

    One Day Data Series Strategy enter position from to historic data

    Hi all,

    I have a strategy which uses 1 day data series. Whenever I start the strategy, it would submit an order but the order is caused by historic date. For example, when I turn on the strategy today on September 26th, the strategy submit an order because of the data from September 21st.

    The strategy should have opened a position on September 21st and exit in the same day due to a stoploss. It should not have opened a position on September 26th. How can I fix this issue?

    Thanks

    #2
    Hello op1031,

    When you enable a strategy it will start processing in historical and may place trades in historical based on your conditions.

    It will not be able to enter an order on the same day that it exits while using a daily bar in historical, there is not enough granularity for that. You would need to use a bar type that will have multiple bars in that day in order to exit within the same day. In realtime the target could fill within the same bar because you have access to the more granular live data.

    If it opened a position on the 26th that would mean the condition to enter a trade became true on the 26th.

    Comment


      #3
      Hi Jesse,

      If it opened a position on the 26th that would mean the condition to enter a trade became true on the 26th.
      I stepped through the debugger and saw the position was submitted because of the historic on September 21st. The exit was caused by a stoploss from a different time series (seconds).
      Does this mean that if I don't have the seconds data for September 21st to September 26th, then my strategy won't exit? If so, that means if I exit in a different time series, then I would need to download the historic data for that time series every day. Is that true?


      Comment


        #4
        Hello op1031,

        I would suggest using prints instead of the debugger for any type of forum post question, we cannot assist with the debugger but we can assist with prints because if you post the code with the print we can see where in the code your print is and compare that against the output you provide.

        If you are unsure if you have second data you would need to use a chart or the historical data manager to view if you have that data, we wouldn't be able to tell if you have that data from a description. You do need data for all series that you use.

        Exiting on a specific series would be to allow for intrabar granularity, you can see an sample of doing that here: https://ninjatrader.com/support/help...ipt_strate.htm

        Comment


          #5
          Hi Jessie,

          Originally posted by NinjaTrader_Jesse View Post
          If you are unsure if you have second data you would need to use a chart or the historical data manager to view if you have that data, we wouldn't be able to tell if you have that data from a description. You do need data for all series that you use.

          Exiting on a specific series would be to allow for intrabar granularity
          I know that I do not have the seconds data for the last few months, so that explains why my the strategy submitted an order on September 21st, but never exited...
          Thanks for the answer

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Yesterday, 05:17 AM
          0 responses
          56 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          132 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          73 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          45 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          49 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X