Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Index was outside the bounds of the array

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

    #16
    I see thank you.
    Last question when backtesting in strategy analyzer if i start from 01/01/23 till present, do i just enter mnq 09-23 contract or i have to start with contract that was back in january? I have merge back adjusted selected.

    Comment


      #17
      And so i cant supply arguments to adddataseries dynamically, but i can at least to have a bool whether to select to use higher time frame or not. Right? WOuld this be valid?

      if(HigherTimeFrame)
      {
      AddDataSeries(Data.BarsPeriodType.Tick, 2000);
      }​

      Comment


        #18
        Hello tkaboris,

        Thanks for your notes.

        "do i just enter mnq 09-23 contract or i have to start with contract that was back in january?"

        You could specify the current contract month, such as MNQ 09-23, when calling AddDataSeries() in your script.

        "And so i cant supply arguments to adddataseries dynamically"

        Correct, you must hardcode the arguments into the AddDataSeries() method instead of call AddDataSeries() dynamically.

        "but i can at least to have a bool whether to select to use higher time frame or not."

        No, you should not dynamically add a data series by calling AddDataSeries() when a certain bool is true. This is considered dynamically adding a data series based on runtime variables and should be avoided.

        From the help guide: ": "Arguments supplied to AddDataSeries() should be hardcoded and NOT dependent on run-time variables which cannot be reliably obtained during State.Configure (e.g., Instrument, Bars, or user input). Attempting to add a data series dynamically is NOT guaranteed and therefore should be avoided. Trying to load bars dynamically may result in an error​"​"
        <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        80 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        40 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        63 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        63 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        54 views
        0 likes
        Last Post CarlTrading  
        Working...
        X