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 kinfxhk, 07-14-2026, 09:39 AM
    0 responses
    7 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 10:18 AM
    0 responses
    59 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 09:50 AM
    0 responses
    41 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 07:21 AM
    0 responses
    47 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-11-2026, 02:11 AM
    0 responses
    38 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X