Announcement

Collapse
No announcement yet.

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:	332
Size:	45.7 KB
ID:	1063251

    Comment


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

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      87 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      134 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      118 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      67 views
      0 likes
      Last Post PaulMohn  
      Working...
      X