Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multi time frame limitation at ninjascript issue

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

    Multi time frame limitation at ninjascript issue

    Hello,

    during my coding exercise, I was trying to add upto total 20 MTF-multi time frame security functions


    -------------------
    question is: At ninjatrader max of barsinprogress is 17

    I confirmed it by code testing

    i want to call barsinprogress until 22


    Attached Files

    #2
    i want to increase this bars in progress limit upto 22

    Comment


      #3
      Hello manitshah915,

      Thanks for your post.

      There is no hard-coded limit to the number of times you can call AddDataSeries() in a script. The only limitations would be performance limitations of the PC on which the script is running and whether that data is available from the data provider or not.

      It seems you are using variables in your calls of AddDataSeries() which is not supported. Please see the following warning in 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 similar to: Unable to load bars series. Your NinjaScript may be trying to use an additional data series dynamically in an unsupported manner.​"
      If you call AddDataSeries() 22 times with hard-coded values, it should work as desired. BarsInProgress will print which bars object is calling OnBarUpdate() so you should also keep in mind how frequently the bars in question are updated:


      Please let us know if we may be of further assistance.

      Comment


        #4
        NinjaTrader_Emily- Hi Emily. I read and understood your response. But it is not helping me. Let me explain actual real scenario.

        So, I am using 5 minutes chart for NQ 03-2024. But I want to use RSI value - 10 Mins, SMA-15 mins etc..so for using this Higher timeframe input value in coding, I added barprogressupdate.

        But after adding 17 inputs to use different indicator values on Higher time frame/multi time frame- I could not get any output of Ninjascript.

        so, how can I resolve this problem? Because I want total 22 choices instead of current maximum 17 limit, where I got stuck

        Comment


          #5
          Originally posted by manitshah915 View Post
          NinjaTrader_Emily- Hi Emily. I read and understood your response. But it is not helping me. Let me explain actual real scenario.

          So, I am using 5 minutes chart for NQ 03-2024. But I want to use RSI value - 10 Mins, SMA-15 mins etc..so for using this Higher timeframe input value in coding, I added barprogressupdate.

          But after adding 17 inputs to use different indicator values on Higher time frame/multi time frame- I could not get any output of Ninjascript.

          so, how can I resolve this problem? Because I want total 22 choices instead of current maximum 17 limit, where I got stuck
          What are the results if you add Time[0] to your print? If your added series are higher values, such as 10-min or 15-min, then you may see multiple prints for the smaller timeframes before seeing that BarsInProgress call OnBarUpdate(). For example, if you had a 1-minute series and a 5-minute series, then you would see prints from the 1 minute series 5 times for every one print from the 5 minute series. Adding Time[0] and even CurrentBar to your prints should help shed some more light on the subject. There is not a limit of 17 series.

          For more details on using prints efficiently to debug a script's behavior:


          If you are unsure of the meaning of the output after adding Time[0] and CurrentBar to your prints of BarsInProgress, please right-click the output window and select Save as to save the output to a text file that may be attached to your reply.

          Please let me know if I may be of further assistance.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          85 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          47 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          29 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          32 views
          0 likes
          Last Post TheRealMorford  
          Started by Mindset, 02-28-2026, 06:16 AM
          0 responses
          67 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Working...
          X