/// <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, IPriceVariationModel priceVariationModel ) : this(config.Symbol, quoteCurrency, symbolProperties, exchange, cache, portfolioModel, fillModel, feeModel, slippageModel, settlementModel, volatilityModel, marginModel, dataFilter, priceVariationModel ) { SubscriptionsBag.Add(config); }
/******************************************************** * CONSTRUCTOR DEFINITION *********************************************************/ /// <summary> /// Create a new holding class instance setting the initial properties to $0. /// </summary> /// <param name="security">The security being held</param> /// <param name="transactionModel">The transaction model used for the security</param> /// <param name="marginModel">The margin model used for the security</param> public SecurityHolding(Security security, ISecurityTransactionModel transactionModel, ISecurityMarginModel marginModel) { _security = security; TransactionModel = transactionModel; MarginModel = marginModel; //Total Sales Volume for the day _totalSaleVolume = 0; _lastTradeProfit = 0; }
/// <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, IPriceVariationModel priceVariationModel ) { 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; PriceVariationModel = priceVariationModel; PortfolioModel = portfolioModel; MarginModel = marginModel; FillModel = fillModel; FeeModel = feeModel; SlippageModel = slippageModel; SettlementModel = settlementModel; VolatilityModel = volatilityModel; Holdings = new SecurityHolding(this); UpdateSubscriptionProperties(); }
/// <summary> /// Construct a new security vehicle based on the user options. /// </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 ) { 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"); } _config = config; QuoteCurrency = quoteCurrency; SymbolProperties = symbolProperties; IsTradable = !config.IsInternalFeed; Cache = cache; Exchange = exchange; DataFilter = dataFilter; PortfolioModel = portfolioModel; MarginModel = marginModel; FillModel = fillModel; FeeModel = feeModel; SlippageModel = slippageModel; SettlementModel = settlementModel; VolatilityModel = volatilityModel; Holdings = new SecurityHolding(this); }
/// <summary> /// Construct a new security vehicle based on the user options. /// </summary> protected Security(SubscriptionDataConfig config, SecurityExchange exchange, SecurityCache cache, ISecurityPortfolioModel portfolioModel, IFillModel fillModel, IFeeModel feeModel, ISlippageModel slippageModel, ISettlementModel settlementModel, ISecurityMarginModel marginModel, ISecurityDataFilter dataFilter ) { _config = config; Cache = cache; Exchange = exchange; DataFilter = dataFilter; PortfolioModel = portfolioModel; MarginModel = marginModel; FillModel = fillModel; FeeModel = feeModel; SlippageModel = slippageModel; SettlementModel = settlementModel; Holdings = new SecurityHolding(this); }
/// <summary> /// Construct a new security vehicle based on the user options. /// </summary> protected Security(SubscriptionDataConfig config, Cash quoteCurrency, SymbolProperties symbolProperties, SecurityExchange exchange, SecurityCache cache, ISecurityPortfolioModel portfolioModel, IFillModel fillModel, IFeeModel feeModel, ISlippageModel slippageModel, ISettlementModel settlementModel, 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"); } _config = config; QuoteCurrency = quoteCurrency; SymbolProperties = symbolProperties; Cache = cache; Exchange = exchange; DataFilter = dataFilter; PortfolioModel = portfolioModel; MarginModel = marginModel; FillModel = fillModel; FeeModel = feeModel; SlippageModel = slippageModel; SettlementModel = settlementModel; Holdings = new SecurityHolding(this); }
/// <summary> /// Constructor for equities holdings. /// </summary> /// <param name="security">The security being held</param> /// <param name="transactionModel">The transaction model used for the security</param> /// <param name="marginModel">The margin model used for the security</param> public EquityHolding(Security security, ISecurityTransactionModel transactionModel, ISecurityMarginModel marginModel) : base(security) { }
/******************************************************** * CLASS VARIABLES *********************************************************/ /******************************************************** * CONSTRUCTOR/DELEGATE DEFINITIONS *********************************************************/ /// <summary> /// Constructor for equities holdings. /// </summary> /// <param name="security">The security being held</param> /// <param name="transactionModel">The transaction model used for the security</param> /// <param name="marginModel">The margin model used for the security</param> public EquityHolding(Security security, ISecurityTransactionModel transactionModel, ISecurityMarginModel marginModel) : base(security) { }
/// <summary> /// Forex Holding Class /// </summary> /// <param name="security">The forex security being held</param> /// <param name="transactionModel">The transaction model used for the security</param> /// <param name="marginModel">The margin model used for the security</param> public ForexHolding(Forex security, ISecurityTransactionModel transactionModel, ISecurityMarginModel marginModel) : base(security) { _forex = security; }
/// <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); }
/******************************************************** * CONSTRUCTOR/DELEGATE DEFINITIONS *********************************************************/ /// <summary> /// Forex Holding Class /// </summary> /// <param name="security">The forex security being held</param> /// <param name="transactionModel">The transaction model used for the security</param> /// <param name="marginModel">The margin model used for the security</param> public ForexHolding(Forex security, ISecurityTransactionModel transactionModel, ISecurityMarginModel marginModel) : base(security) { _forex = security; }
/// <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, IPriceVariationModel priceVariationModel ) { 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; PriceVariationModel = priceVariationModel; PortfolioModel = portfolioModel; MarginModel = marginModel; FillModel = fillModel; FeeModel = feeModel; SlippageModel = slippageModel; SettlementModel = settlementModel; VolatilityModel = volatilityModel; Holdings = new SecurityHolding(this); }