/********************************************************
        * 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();
        }
Exemple #2
0
        /********************************************************
         * 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();
        }
Exemple #3
0
        /********************************************************
         * 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();
        }
Exemple #4
0
        /********************************************************
         * CLASS VARIABLES
         *********************************************************/

        /********************************************************
         * CONSTRUCTOR/DELEGATE DEFINITIONS
         *********************************************************/
        /// <summary>
        /// Construct the Forex Object
        /// </summary>
        public Forex(string symbol, Resolution resolution, bool fillDataForward, decimal leverage, bool extendedMarketHours) :
            base(symbol, SecurityType.Forex, resolution, fillDataForward, leverage, extendedMarketHours)
        {
            //Holdings for new Vehicle:
            Cache    = new ForexCache();
            Holdings = new ForexHolding(symbol, this.Model);
            Exchange = new ForexExchange();
            Model    = new ForexTransactionModel();
        }
Exemple #5
0
 /********************************************************
 * CLASS VARIABLES
 *********************************************************/
 /********************************************************
 * CONSTRUCTOR/DELEGATE DEFINITIONS
 *********************************************************/
 /// <summary>
 /// Construct the Forex Object
 /// </summary>
 public Forex(string symbol, Resolution resolution, bool fillDataForward, decimal leverage, bool extendedMarketHours)
     : base(symbol, SecurityType.Forex, resolution, fillDataForward, leverage, extendedMarketHours)
 {
     //Holdings for new Vehicle:
     Cache = new ForexCache();
     Holdings = new ForexHolding(symbol, this.Model);
     Exchange = new ForexExchange();
     Model = new ForexTransactionModel();
 }