Beispiel #1
0
 /// <summary>
 /// Cloner Constructor - Clone the original tick into this new tick:
 /// </summary>
 /// <param name="original">Original tick we're cloning</param>
 public Tick(Tick original) {
     base.Symbol = original.Symbol;
     base.Time = new DateTime(original.Time.Ticks);
     this.BidPrice = original.BidPrice;
     this.AskPrice = original.AskPrice;
     this.Exchange = original.Exchange;
     this.SaleCondition = original.SaleCondition;
     this.Quantity = original.Quantity;
     this.Suspicious = original.Suspicious;
 }
        /********************************************************
        * CLASS METHODS
        *********************************************************/
        /// <summary>
        /// Tick Implementation of Reader Method: read a line and convert it to a tick.
        /// </summary>
        /// <param name="datafeed">Source of the datafeed</param>
        /// <param name="config">Configuration object for algorith</param>
        /// <param name="line">Line of the datafeed</param>
        /// <param name="date">Date of this reader request</param>
        /// <returns>New Initialized tick</returns>
        public override BaseData Reader(SubscriptionDataConfig config, string line, DateTime date, DataFeedEndpoint datafeed)
        {
            Tick _tick = new Tick();

            //Select the URL source of the data depending on where the system is trading.
            switch (datafeed)
            {
                //Local File System Storage and Backtesting QC Data Store Feed use same files:
                case DataFeedEndpoint.FileSystem:
                case DataFeedEndpoint.Backtesting:
                    //Create a new instance of our tradebar:
                    _tick = new Tick(config, line, date, datafeed);
                    break;
                case DataFeedEndpoint.LiveTrading:
                    break;
                case DataFeedEndpoint.Tradier:
                    break;
            }

            return _tick;
        }