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

AddDataSeries very inconsistant

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

    AddDataSeries very inconsistant

    I am adding 4 additional Daily bars series to a chart for AAPL,MSFT,FB and NFLX. I am using this for each one:
    Code:
    AddDataSeries("MSFT", new BarsPeriod {BarsPeriodType = BarsPeriodType.Day, Value = 1}, 30, "US Equities RTH", true);
    However, sometimes, I use the BarsArray[1].Count method and it only returns 6 while I am expecting 30. To make matters worse, it seems very inconsistent. Sometimes there are 30, other times there are 6. Is this common and if so, what approach can be taken to insure the correct number of bars are loaded into the chart?

    #2
    Hello swcooke,

    Thanks for your post.

    I wanted to clarify, in your indicator are you adding 4 additional data series? (30 daily bars for AAPL,MSFT,FB and NFLX)?

    What is the charts primary series instrument and time frame (and bars to load or days to load)?

    What data feed do you connect to?

    When you apply the indicator, do you see any error messages in the "log" tab of the control center?



    Paul H.NinjaTrader Customer Service

    Comment


      #3
      I am adding all four series in State.Configure. The primary instrument is a 5 minute AAPL chart with 5 days of View Period. I am using IQFeed. Please note that AAPL and MSFT both have the correct number of bars while FB and NFLX only have 6. Why do they differ?

      Comment


        #4
        Hello swcooke,

        Thanks for your reply.

        Based on your reply i have tried to recreate and I do not see any issue. Can you provide a simple test script that demonstrates this?

        An alternative would be to use a different AddDataSeries() overload method and change the days to load in the chart to match however many day bars you want loaded.
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          I figured out that the issue was, that I was calling BarsArray[1].Count in State.Dataloaded. I misunderstood what was available during that State. The issue was solved by calling in State.Historical. Thanks for your help.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by PaulMohn, Today, 12:36 PM
          2 responses
          16 views
          0 likes
          Last Post PaulMohn  
          Started by Conceptzx, 10-11-2022, 06:38 AM
          2 responses
          53 views
          0 likes
          Last Post PhillT
          by PhillT
           
          Started by Kaledus, Today, 01:29 PM
          0 responses
          4 views
          0 likes
          Last Post Kaledus
          by Kaledus
           
          Started by yertle, Yesterday, 08:38 AM
          8 responses
          37 views
          0 likes
          Last Post ryjoga
          by ryjoga
           
          Started by rdtdale, Today, 01:02 PM
          1 response
          6 views
          0 likes
          Last Post NinjaTrader_LuisH  
          Working...
          X