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

Multitimeframe BarsArray question

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

    Multitimeframe BarsArray question

    I would like to attach a strategy to a quick chart (eg 1 min) but it needs to check a 200 day MA in its calculations.
    So I added the bars object of a daily chart to the BarsArray.

    My question is: does this 1min chart have to have the necessary amount of data to calculate a 200 day MA loaded? (Which is 1440 * 200 = 288000 bars at least, which seems to be a lot)

    Thanks

    #2
    Hi Zapzap,

    That depends on how many days of historical data you have set for your chart.

    What is the days to load value in the chart Data Series... parameters for the primary instrument?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Chelsea: That would be the question. What should I set it to? 200+ days (which is 288000 bars)?

      Comment


        #4
        Hi Zapzap,

        If you want to calculate 200 days in an moving average, you need 200 days of historical data on your chart.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Even if it's calculated from another timeframe chart (by adding bars object)?

          It's not obvious, and I couldn't find data on it in the manual: the 5 min chart itself takes its data from the database. Where do the added bars objects take thir data from?
          The chart on which the ATS using it is running, or from the database as well?

          Comment


            #6
            Hello Zapzap,

            It would be the database as well, but you would need to set DaysToLoad to 200 in order to properly run the test. Are you adding in a PeriodType.Day to the code?

            Comment


              #7
              Patrick: thanks for your answer.

              I am adding 1440 mins.

              Comment


                #8
                Hi Zapzap,

                All data series will use the same amount of days as what is set on the chart or what is added to the strategy under days or bars to load (if you are adding this directly to the Strategies tab of the Control Center).

                The primary and secondary days to load will always match. If you have more downloaded data than the other, the trades will start where both data series have data and they will still have the same.
                Chelsea B.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by cmtjoancolmenero, Yesterday, 03:58 PM
                2 responses
                19 views
                0 likes
                Last Post cmtjoancolmenero  
                Started by Stanfillirenfro, Today, 07:23 AM
                0 responses
                2 views
                0 likes
                Last Post Stanfillirenfro  
                Started by olisav57, Yesterday, 07:39 PM
                1 response
                9 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by cocoescala, 10-12-2018, 11:02 PM
                7 responses
                942 views
                0 likes
                Last Post Jquiroz1975  
                Started by oviejo, Today, 12:28 AM
                1 response
                11 views
                0 likes
                Last Post NinjaTrader_Gaby  
                Working...
                X