public TransactionProcessor( IQuoteContext quoteContext, Account account, ISimulationSettings settings) { this.quoteContext = quoteContext; this.account = account; this.delay = settings.Get<TradeDelaySetting>(); this.commission = settings.Get<CommissionSetting>(); this.avgPrice = new double[quoteContext.TickerCount]; }
bool ISimulationContext.Initialize(SyncTickers syncTickers, StrategyBase strategy, ISimulationSettings settings) { this.strategy = strategy; this.settings = settings; this.syncTickers = syncTickers; this.account = new Account(settings.Get<InitialEquitySetting>().Value); this.strategy.QuoteContext = this.quoteContext = new QuoteContext(syncTickers); this.transactionProcessor = new TransactionProcessor(quoteContext, account, settings); this.strategy.WalletContext = this.walletContext = new WalletContext(quoteContext, account, transactionProcessor); this.resultQuotes = new List<SimulationResultQuote>(); return strategy.Initialize(); }