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 frslvr, 04-11-2024, 07:26 AM
                9 responses
                123 views
                1 like
                Last Post caryc123  
                Started by rocketman7, Today, 09:41 AM
                4 responses
                15 views
                0 likes
                Last Post rocketman7  
                Started by selu72, Today, 02:01 PM
                1 response
                9 views
                0 likes
                Last Post NinjaTrader_Zachary  
                Started by WHICKED, Today, 02:02 PM
                2 responses
                16 views
                0 likes
                Last Post WHICKED
                by WHICKED
                 
                Started by f.saeidi, Today, 12:14 PM
                8 responses
                21 views
                0 likes
                Last Post f.saeidi  
                Working...
                X