/******************************************************** * CONSTRUCTOR/DELEGATE DEFINITIONS *********************************************************/ /// <summary> /// Construct the Market Vehicle /// </summary> public Security(string symbol, SecurityType type, Resolution resolution, bool fillDataForward, decimal leverage, bool extendedMarketHours, bool useQuantConnectData = false) { //Set Basics: this._symbol = symbol; this._type = type; this._resolution = resolution; this._isFillDataForward = fillDataForward; this._leverage = leverage; this._isExtendedMarketHours = extendedMarketHours; this._isQuantConnectData = useQuantConnectData; //Setup Transaction Model for this Asset switch (type) { case SecurityType.Equity: Model = new EquityTransactionModel(); break; case SecurityType.Forex: Model = new ForexTransactionModel(); break; case SecurityType.Base: Model = new SecurityTransactionModel(); break; } //Holdings for new Vehicle: Cache = new SecurityCache(); Holdings = new SecurityHolding(symbol, Model); Exchange = new SecurityExchange(); }
/******************************************************** * CONSTRUCTOR/DELEGATE DEFINITIONS *********************************************************/ /// <summary> /// Construct a new security vehicle based on the user options. /// </summary> public Security(string symbol, SecurityType type, Resolution resolution, bool fillDataForward, decimal leverage, bool extendedMarketHours, bool useQuantConnectData = false) { //Set Basics: _symbol = symbol; _type = type; _resolution = resolution; _isFillDataForward = fillDataForward; _leverage = leverage; _isExtendedMarketHours = extendedMarketHours; _isQuantConnectData = useQuantConnectData; //Setup Transaction Model for this Asset switch (type) { case SecurityType.Equity: Model = new EquityTransactionModel(); DataFilter = new EquityDataFilter(); break; case SecurityType.Forex: Model = new ForexTransactionModel(); DataFilter = new ForexDataFilter(); break; case SecurityType.Base: Model = new SecurityTransactionModel(); DataFilter = new SecurityDataFilter(); break; } //Holdings for new Vehicle: Cache = new SecurityCache(); Holdings = new SecurityHolding(symbol, Model); Exchange = new SecurityExchange(); }
/******************************************************** * CONSTRUCTOR/DELEGATE DEFINITIONS *********************************************************/ /// <summary> /// Construct a new security vehicle based on the user options. /// </summary> public Security(string symbol, SubscriptionDataConfig config, decimal leverage, bool isDynamicallyLoadedData = false) { //Set Basics: _symbol = symbol; _config = config; _isDynamicallyLoadedData = isDynamicallyLoadedData; //Setup Transaction Model for this Asset switch (config.Security) { case SecurityType.Equity: Model = new EquityTransactionModel(); DataFilter = new EquityDataFilter(); break; case SecurityType.Forex: Model = new ForexTransactionModel(); DataFilter = new ForexDataFilter(); break; case SecurityType.Base: Model = new SecurityTransactionModel(); DataFilter = new SecurityDataFilter(); break; } //Holdings for new Vehicle: Cache = new SecurityCache(); Holdings = new SecurityHolding(symbol, _config.Security, leverage, Model); Exchange = new SecurityExchange(); }
/******************************************************** * CLASS VARIABLES *********************************************************/ /******************************************************** * CONSTRUCTOR/DELEGATE DEFINITIONS *********************************************************/ /// <summary> /// Construct the Market Vehicle /// </summary> public Equity(string symbol, Resolution resolution, bool fillDataForward, decimal leverage, bool extendedMarketHours, bool useQuantConnectData = false) : base(symbol, SecurityType.Equity, resolution, fillDataForward, leverage, extendedMarketHours, useQuantConnectData) { //Holdings for new Vehicle: Cache = new EquityCache(); Holdings = new EquityHolding(symbol, this.Model); Exchange = new EquityExchange(); //Set the Transaction Model Model = new EquityTransactionModel(); }