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

Multi Timeframe and Strategy

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

    Multi Timeframe and Strategy

    Hi!
    i saw the post # 105183 and this video (https://paul-ninjatrader.tinytake.co...QxNl82NDM3NjQx)
    and tried to rebuild.
    unfortunaltely i receive an error message:
    "Error on calling ''OnBarUpdate" method. You are accessing an index with a value that is invalide since its out of range...."

    attached the draft i tried

    what's wrong?
    is there a way to run this in strategy builder / strategy analyzer without manual coding?
    in case there is a way, how do i have to do it?
    thank you
    Attached Files

    #2
    Hello Tradexxx,

    Thanks for your post.

    The issue is likely that the code is trying to access a bar from the added data series before there is any bar loaded. For example if the added data series is 15 minute bars and you apply the strategy to a 1 minute chart then on the first bar of the 1 minute data series your code is trying to access the current bar of the 15 minute series which hasn't even loaded the first 15 minute bar yet. What you would need to do is, in each set that would access the added data series, include a check to make sure that the current bar of the added data series is greater than 1.

    I've attached an example of this that shows the end statement in the set and then the edit window that shows how it is constructed.

    Click image for larger version

Name:	Tradexxx-1.PNG
Views:	261
Size:	45.7 KB
ID:	1063251
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Hi Paul!
      Thank you very much for the info!!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by love2code2trade, 04-17-2024, 01:45 PM
      4 responses
      37 views
      0 likes
      Last Post love2code2trade  
      Started by alifarahani, Today, 09:40 AM
      2 responses
      13 views
      0 likes
      Last Post alifarahani  
      Started by junkone, Today, 11:37 AM
      3 responses
      16 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by pickmyonlineclass, Today, 12:23 PM
      0 responses
      3 views
      0 likes
      Last Post pickmyonlineclass  
      Started by frankthearm, Yesterday, 09:08 AM
      12 responses
      44 views
      0 likes
      Last Post NinjaTrader_Clayton  
      Working...
      X