Пример #1
0
        /// <summary>
        /// Creates a new IBrokerage instance
        /// </summary>
        /// <param name="job">The job packet to create the brokerage for</param>
        /// <param name="algorithm">The algorithm instance</param>
        /// <returns>A new brokerage instance</returns>
        public override IBrokerage CreateBrokerage(LiveNodePacket job, IAlgorithm algorithm)
        {
            var errors      = new List <string>();
            var accountID   = Read <string>(job.BrokerageData, "tradestation-account-id", errors);
            var accessToken = Read <string>(job.BrokerageData, "tradestation-access-token", errors);
            var simulation  = Read <bool>(job.BrokerageData, "tradestation-simulation", errors);

            var brokerage = new TradeStationBrokerage(algorithm.Transactions, algorithm.Portfolio, accountID, accessToken, simulation);

            //Add the brokerage to the composer to ensure its accessible to the live data feed.
            Composer.Instance.AddPart <IDataQueueHandler>(brokerage);
            Composer.Instance.AddPart <IHistoryProvider>(brokerage);
            return(brokerage);
        }
Пример #2
0
 public TradeStationSymbolMapper(TradeStationBrokerage broker)
 {
     _broker = broker;
 }