/// <summary> /// Temporary convenience constructor /// </summary> protected Security(SubscriptionDataConfig config, Cash quoteCurrency, SymbolProperties symbolProperties, SecurityExchange exchange, SecurityCache cache, ISecurityPortfolioModel portfolioModel, IFillModel fillModel, IFeeModel feeModel, ISlippageModel slippageModel, ISettlementModel settlementModel, IVolatilityModel volatilityModel, ISecurityMarginModel marginModel, ISecurityDataFilter dataFilter ) : this(config.Symbol, quoteCurrency, symbolProperties, exchange, cache, portfolioModel, fillModel, feeModel, slippageModel, settlementModel, volatilityModel, marginModel, dataFilter ) { SubscriptionsBag.Add(config); }
/// <summary> /// Construct a new security vehicle based on the user options. /// </summary> protected Security(Symbol symbol, Cash quoteCurrency, SymbolProperties symbolProperties, SecurityExchange exchange, SecurityCache cache, ISecurityPortfolioModel portfolioModel, IFillModel fillModel, IFeeModel feeModel, ISlippageModel slippageModel, ISettlementModel settlementModel, IVolatilityModel volatilityModel, ISecurityMarginModel marginModel, ISecurityDataFilter dataFilter ) { if (symbolProperties == null) { throw new ArgumentNullException("symbolProperties", "Security requires a valid SymbolProperties instance."); } if (symbolProperties.QuoteCurrency != quoteCurrency.Symbol) { throw new ArgumentException("symbolProperties.QuoteCurrency must match the quoteCurrency.Symbol"); } _symbol = symbol; SubscriptionsBag = new ConcurrentBag <SubscriptionDataConfig>(); QuoteCurrency = quoteCurrency; SymbolProperties = symbolProperties; IsTradable = true; Cache = cache; Exchange = exchange; DataFilter = dataFilter; PortfolioModel = portfolioModel; MarginModel = marginModel; FillModel = fillModel; FeeModel = feeModel; SlippageModel = slippageModel; SettlementModel = settlementModel; VolatilityModel = volatilityModel; Holdings = new SecurityHolding(this); }