Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problem with Add() in a strategy

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

    Problem with Add() in a strategy

    Hello. Im developping a strategy and this work well. But as I use a 10-minute graph i want to work in the strategy with another dataseries of 5-minute too.
    Well, when i add a 5-minute bars object to the strategy i use the sentence 'Add(Instrument, PeriodType.Minute, 5);' in the Initialize method. If I do this and I try to charge the strategy it don't work. From now the Onbarupdate method is not called. Can someone help me?. Thanks.

    #2
    Hello Alibanez,

    Welcome to the NinjaTrader forums!

    Add used like this will add a secondary series. The primary series is always what you are running the strategy against. You can see a sample multiTimeFrame strategy by opening Tools > Edit NinjaScript > Strategy > Sample Multi TimeFrame.

    Documentation for this is available here.

    Review the sample and the link above. If you continue to have issues, please share the code you're using and a brief explanation of what you expect it to do.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Ok, perfect. I've tried and it worked. Thank you very much.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      672 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      379 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      111 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      577 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      582 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X