src/FastQuant/Runtime/Strategy.cs
/// <summary>
/// Add instrument and subscribe with a DataProvider.
/// </summary>
Add instrument and subscribe with a DataProvider.
Add instrument and subscribe with a DataProvider .
public void AddInstrument(Instrument instrument, IDataProvider provider)
        {
            if (SubscriptionList.Contains(instrument, provider))
            {
                Console.WriteLine($"Strategy::AddInstrument Strategy is already subscribed for instrument {instrument} and provider {provider}");
                return;
            }
            SubscriptionList.Add(instrument, provider);
            if (!Instruments.Contains(instrument))
            {
                Instruments.Add(instrument);
                EmitInstrumentAdded(instrument);
            }
            if (Status == StrategyStatus.Running)
                this.SubscribeWithDataProvider(instrument, provider);
        }
public void AddInstrument ( Instrument instrument , IDataProvider provider ) { if ( SubscriptionList . Contains ( instrument , provider ) ) { Console . WriteLine ( $" Strategy::AddInstrument Strategy is already subscribed for instrument  { instrument }  and provider  { provider } " ) ; return ; } SubscriptionList . Add ( instrument , provider ) ; if ( ! Instruments . Contains ( instrument ) ) { Instruments . Add ( instrument ) ; EmitInstrumentAdded ( instrument ) ; } if ( Status == StrategyStatus . Running ) this . SubscribeWithDataProvider ( instrument , provider ) ; }
Add instrument and subscribe with a DataProvider.
Add instrument and subscribe with a DataProvider .
instrument
Instrument
provider
IDataProvider