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 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
    128 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    65 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    117 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