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 NullPointStrategies, Today, 05:17 AM
    0 responses
    52 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    130 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    70 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    44 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    48 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X