Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Expiry selection for multi future instrument's Strategy

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

    Expiry selection for multi future instrument's Strategy


    SampleMultiInstrument shows how we can access data for a different stock.

    But I'd like to access data for a differente future contract.

    Suppose I'm running on NQ and I'd like to use ES data on the strategy. What should I do to sync it with MasterInstrument's expiry ?

    if (State == State.Configure)
    {
    AddDataSeries("MNQ SEP24", Data.BarsPeriodType.Minute, 1, Data.MarketDataType.Last);
    AddDataSeries("MES SEP24", Data.BarsPeriodType.Minute, 1, Data.MarketDataType.Last);
    }​​


    Ideally, I'd like to extract the expiry for the MasterInstrument and apply it for the DataSeries needed.

    Best regards,​

    #2
    Hello fmbraga,

    You can use null as the instrument to assume the master instrument. For any other instrument you would need to type in the full instrument and expiry. At this time it is not supported to dynamically add data by using variables with AddDataSeries.

    AddDataSeries(null, Data.BarsPeriodType.Minute, 1, Data.MarketDataType.Last);

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    47 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    23 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    33 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    51 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    42 views
    0 likes
    Last Post CarlTrading  
    Working...
    X