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 NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        71 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        143 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        76 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        47 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        51 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X