Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

20 Min. bars still applied to current day's market data even Days to load is 2

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

    20 Min. bars still applied to current day's market data even Days to load is 2

    Hi,


    I setup a strategy as attached image for automatic intraday trading at Monday, July 18th, 2011. Data bar type is 5 minutes. Days to load is 2 and Min. bars required is 20.


    The time zone I am living is UTC-07:00 Mountain Time, so the US stock market opens at 7:30AM of my local time. However, the first OnBarUpdate() of Monday was triggered at 9:15AM which was 20 data bars after market open.


    Since I already setup Days to load to 2, I expected this 20 Min. bars should be applied to the very beginning of the loaded previous day's data and this Monday's OnBarUpdate() should be triggered right after market open instead of 20 bars later.


    Why this 20 Min. bars still applied to this Monday's market data?

    Thanks,
    weiwei
    Attached Files

    #2
    Hello weiwei,

    Days to load tells the strategy how many previous days of data to load.

    Minimum bars required tells it to wait so many bars before processing strategy logic.

    Since I already setup Days to load to 2, I expected this 20 Min. bars should be applied to the very beginning of the loaded previous day's data and this Monday's OnBarUpdate() should be triggered right after market open instead of 20 bars later.
    This assumption is not correct. Min bars required simply looks at the available data, and doesn't process strategy logic until the number of bars has been satisfied. If you want it to start right away, set minimum bars required = 0.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Hi Ryan,

      The OnBarUpdate() was triggered right away today's morning for the same 20 Min. bars setting. I noticed this kind "issue" usually happens at Monday's morning. Can I understand the reason is because, for Monday, the previous 2 days are Saturday and Sunday, which do not have market data. So 20 Min. bars setting applies on Monday open. Whilst for other weekdays like Tuesday, 20 Min. bars can apply to previous day's market data.

      Thanks,
      weiwei

      Comment


        #4
        Yes, that's a good observation and likely explains why you did not see what you were expecting. The days to load setting is calendar days, not trading days.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Thanks,
          weiwei

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by cls71, Today, 04:45 AM
          0 responses
          1 view
          0 likes
          Last Post cls71
          by cls71
           
          Started by mjairg, 07-20-2023, 11:57 PM
          3 responses
          213 views
          1 like
          Last Post PaulMohn  
          Started by TheWhiteDragon, 01-21-2019, 12:44 PM
          4 responses
          544 views
          0 likes
          Last Post PaulMohn  
          Started by GLFX005, Today, 03:23 AM
          0 responses
          3 views
          0 likes
          Last Post GLFX005
          by GLFX005
           
          Started by XXtrader, Yesterday, 11:30 PM
          2 responses
          12 views
          0 likes
          Last Post XXtrader  
          Working...
          X