Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multiple of the *same* instrument

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

    Multiple of the *same* instrument

    Hi,

    I'm looking into integrating all of my instruments into a single strategy run... so that instead of launching 20 charts, I only need to launch one.

    So, my plan is to Initialize() and add all of the instruments I'm working with (including multiple timeframes for each strategy). I assume that part will work correctly.

    Now... what if I want to include the same instrument *twice* here? Will that work? Will orders be allocated to the correct copy of the instrument? Here's what I mean, exactly:

    In initialize():

    Add("MSFT", PeriodType.Minute, 5);
    Add("MSFT", PeriodType.Minute, 10);
    Add("MSFT", PeriodType.Minute, 30);
    Add("MSFT", PeriodType.Minute, 5);
    Add("MSFT", PeriodType.Minute, 10);
    Add("MSFT", PeriodType.Minute, 30);

    ... will I get two calls into OnBarUpdate, one for each of MSFT at 5 minutes, with their own context set correctly? Or will I break things? I can test the OnBarUpdate part, but what about order handling? Will OnOrderUpdate() be able to figure out which execution belongs to which context?

    #2
    It will create the additional bars series, but other than that you are just going to have to play with it to see which triggers first. OnOrderUpdate() will only be able to figure out things to the extent of how you keep track of them via entrySignal names and IOrder objects.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Josh View Post
      It will create the additional bars series, but other than that you are just going to have to play with it to see which triggers first. OnOrderUpdate() will only be able to figure out things to the extent of how you keep track of them via entrySignal names and IOrder objects.
      Ah, that's right, of course... entrySignal will be very helpful here. Will give it a shot.

      In addition to creating additional bar series, you believe OnBarUpdate() will be called, correct? Well, as I said, I'll test and report back if otherwise.

      Comment


        #4
        Right, they will be called. You have the bars series so they will trigger.
        Josh P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        576 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        334 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        553 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        551 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X