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

Daily Series is not loading enough days

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

    Daily Series is not loading enough days

    Hey guys for some reason NT is not allowing me to load enough days. I created a simple strategy with BetterRenko 2 brick size for ES futures. Then I added the daily series as:

    Add(PeriodType.Day, 1); //REFER TO SERIES AS CLOSE[1][0] EXAMPLE

    In the bar update I coded:

    //CREATE SMA
    for (int xz = 0; xz < (32); xz++)
    {
    smaTotal = smaTotal + Closes[1][xz];
    Print("Closes 1: " + Closes[1][xz]);
    }

    When I activate the above code in the SIM 101 account, it errors out after 2 prints.
    I asked it to load 60 days but as you can see, it only loads 2 days, any ideas?

    My data provider is Kinetick.
    The session is a custom session that goes between 3am and 10pm monday through friday.

    #2
    elitetradernyc,

    Do you have a current bar check in place before running the loop?

    if(CurrentBars[0] < 32 || CurrentBars[1] < 32)
    return;
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Hi, no I do not, but wouldn't it have already loaded at least 60 days worth of data once it starts executing?

      Comment


        #4
        Correct, but you need to ensure that there is enough data being loaded for the script to operate.
        This article explains it in more detail -
        http://www.ninjatrader.com/support/f...ead.php?t=3170
        Cal H.NinjaTrader Customer Service

        Comment


          #5
          Got it, that worked, thanks.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by ScottW, Today, 06:09 PM
          1 response
          4 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by ScottWalsh, Today, 06:52 PM
          0 responses
          3 views
          0 likes
          Last Post ScottWalsh  
          Started by ftsc2022, 10-25-2022, 12:03 PM
          5 responses
          256 views
          0 likes
          Last Post KeyonMatthews  
          Started by Board game geek, 10-29-2023, 12:00 PM
          14 responses
          244 views
          0 likes
          Last Post DJ888
          by DJ888
           
          Started by Waxavi, 04-19-2024, 02:10 AM
          4 responses
          56 views
          0 likes
          Last Post sonia0101  
          Working...
          X