Esempio n. 1
0
 /// <summary>
 /// Constructor for the option security
 /// </summary>
 /// <param name="symbol">The symbol of the security</param>
 /// <param name="exchangeHours">Defines the hours this exchange is open</param>
 /// <param name="quoteCurrency">The cash object that represent the quote currency</param>
 /// <param name="symbolProperties">The symbol properties for this security</param>
 /// <param name="currencyConverter">Currency converter used to convert <see cref="CashAmount"/>
 /// instances into units of the account currency</param>
 /// <param name="registeredTypes">Provides all data types registered in the algorithm</param>
 public Option(Symbol symbol,
               SecurityExchangeHours exchangeHours,
               Cash quoteCurrency,
               OptionSymbolProperties symbolProperties,
               ICurrencyConverter currencyConverter,
               IRegisteredSecurityDataTypesProvider registeredTypes,
               SecurityCache securityCache)
     : base(symbol,
            quoteCurrency,
            symbolProperties,
            new OptionExchange(exchangeHours),
            securityCache,
            new OptionPortfolioModel(),
            new ImmediateFillModel(),
            new InteractiveBrokersFeeModel(),
            new ConstantSlippageModel(0),
            new ImmediateSettlementModel(),
            Securities.VolatilityModel.Null,
            new OptionMarginModel(),
            new OptionDataFilter(),
            new SecurityPriceVariationModel(),
            currencyConverter,
            registeredTypes
            )
 {
     ExerciseSettlement = SettlementType.PhysicalDelivery;
     SetDataNormalizationMode(DataNormalizationMode.Raw);
     OptionExerciseModel = new DefaultExerciseModel();
     PriceModel          = new CurrentPriceOptionPriceModel();
     Holdings            = new OptionHolding(this, currencyConverter);
     _symbolProperties   = symbolProperties;
     SetFilter(-1, 1, TimeSpan.Zero, TimeSpan.FromDays(35));
 }
Esempio n. 2
0
 /// <summary>
 /// Constructor for the option security
 /// </summary>
 /// <param name="exchangeHours">Defines the hours this exchange is open</param>
 /// <param name="quoteCurrency">The cash object that represent the quote currency</param>
 /// <param name="config">The subscription configuration for this security</param>
 /// <param name="symbolProperties">The symbol properties for this security</param>
 public Option(SecurityExchangeHours exchangeHours, SubscriptionDataConfig config, Cash quoteCurrency, OptionSymbolProperties symbolProperties)
     : base(config,
            quoteCurrency,
            symbolProperties,
            new OptionExchange(exchangeHours),
            new OptionCache(),
            new OptionPortfolioModel(),
            new ImmediateFillModel(),
            new InteractiveBrokersFeeModel(),
            new ConstantSlippageModel(0),
            new ImmediateSettlementModel(),
            Securities.VolatilityModel.Null,
            new OptionMarginModel(),
            new OptionDataFilter(),
            new SecurityPriceVariationModel()
            )
 {
     ExerciseSettlement = SettlementType.PhysicalDelivery;
     SetDataNormalizationMode(DataNormalizationMode.Raw);
     OptionExerciseModel = new DefaultExerciseModel();
     PriceModel          = new CurrentPriceOptionPriceModel();
     Holdings            = new OptionHolding(this);
     _symbolProperties   = symbolProperties;
     SetFilter(-1, 1, TimeSpan.Zero, TimeSpan.FromDays(35));
 }
Esempio n. 3
0
 /// <summary>
 /// Creates instance of the Option class.
 /// </summary>
 /// <remarks>
 /// Allows for the forwarding of the security configuration to the
 /// base Security constructor
 /// </remarks>
 protected Option(Symbol symbol,
                  Cash quoteCurrency,
                  SymbolProperties symbolProperties,
                  SecurityExchange exchange,
                  SecurityCache cache,
                  ISecurityPortfolioModel portfolioModel,
                  IFillModel fillModel,
                  IFeeModel feeModel,
                  ISlippageModel slippageModel,
                  ISettlementModel settlementModel,
                  IVolatilityModel volatilityModel,
                  IBuyingPowerModel buyingPowerModel,
                  ISecurityDataFilter dataFilter,
                  IPriceVariationModel priceVariationModel,
                  ICurrencyConverter currencyConverter,
                  IRegisteredSecurityDataTypesProvider registeredTypesProvider,
                  Security underlying
                  ) : base(
         symbol,
         quoteCurrency,
         symbolProperties,
         exchange,
         cache,
         portfolioModel,
         fillModel,
         feeModel,
         slippageModel,
         settlementModel,
         volatilityModel,
         buyingPowerModel,
         dataFilter,
         priceVariationModel,
         currencyConverter,
         registeredTypesProvider
         )
 {
     ExerciseSettlement = SettlementType.PhysicalDelivery;
     SetDataNormalizationMode(DataNormalizationMode.Raw);
     OptionExerciseModel = new DefaultExerciseModel();
     PriceModel          = new CurrentPriceOptionPriceModel();
     Holdings            = new OptionHolding(this, currencyConverter);
     _symbolProperties   = (OptionSymbolProperties)symbolProperties;
     SetFilter(-1, 1, TimeSpan.Zero, TimeSpan.FromDays(35));
     Underlying = underlying;
 }
Esempio n. 4
0
 /// <summary>
 /// Constructor for the option security
 /// </summary>
 /// <param name="exchangeHours">Defines the hours this exchange is open</param>
 /// <param name="quoteCurrency">The cash object that represent the quote currency</param>
 /// <param name="config">The subscription configuration for this security</param>
 /// <param name="symbolProperties">The symbol properties for this security</param>
 public Option(SecurityExchangeHours exchangeHours, SubscriptionDataConfig config, Cash quoteCurrency, SymbolProperties symbolProperties)
     : base(config,
            quoteCurrency,
            symbolProperties,
            new OptionExchange(exchangeHours),
            new OptionCache(),
            new SecurityPortfolioModel(),
            new ImmediateFillModel(),
            new InteractiveBrokersFeeModel(),
            new SpreadSlippageModel(),
            new ImmediateSettlementModel(),
            Securities.VolatilityModel.Null,
            new SecurityMarginModel(2m),
            new OptionDataFilter()
            )
 {
     PriceModel     = new CurrentPriceOptionPriceModel();
     ContractFilter = new StrikeExpiryOptionFilter(-5, 5, TimeSpan.Zero, TimeSpan.FromDays(35));
 }
Esempio n. 5
0
 /// <summary>
 /// Constructor for the option security
 /// </summary>
 /// <param name="exchangeHours">Defines the hours this exchange is open</param>
 /// <param name="quoteCurrency">The cash object that represent the quote currency</param>
 /// <param name="config">The subscription configuration for this security</param>
 /// <param name="symbolProperties">The symbol properties for this security</param>
 public Option(SecurityExchangeHours exchangeHours, SubscriptionDataConfig config, Cash quoteCurrency, SymbolProperties symbolProperties)
     : base(config,
         quoteCurrency,
         symbolProperties,
         new OptionExchange(exchangeHours),
         new OptionCache(),
         new SecurityPortfolioModel(),
         new ImmediateFillModel(),
         new InteractiveBrokersFeeModel(),
         new SpreadSlippageModel(),
         new ImmediateSettlementModel(),
         Securities.VolatilityModel.Null,
         new SecurityMarginModel(2m),
         new OptionDataFilter()
         )
 {
     PriceModel = new CurrentPriceOptionPriceModel();
     ContractFilter = new StrikeExpiryOptionFilter(-5, 5, TimeSpan.Zero, TimeSpan.FromDays(35));
 }