public void EmitHistoricalTrade(global::OpenQuant.API.HistoricalDataRequest request, DateTime datetime, double price, int size) { if (this.NewHistoricalTrade != null) { SmartQuant.Data.Trade trade = new SmartQuant.Data.Trade(datetime, price, size); HistoricalTradeEventArgs args = new HistoricalTradeEventArgs(trade, request.request.RequestId, request.request.Instrument, this, 0); this.NewHistoricalTrade(this, args); } }
public void EmitTrade(string instrument, DateTime time, byte providerId, double price, int size) { SmartQuant.Data.Trade trade = new SmartQuant.Data.Trade(time, price, size) { ProviderId = providerId }; SmartQuant.Instruments.Instrument inst = SmartQuant.Instruments.InstrumentManager.Instruments[instrument]; EmitNewTradeEvent(inst, trade); }
public SmartQuant.Data.Trade FilterTrade(SmartQuant.Data.Trade trade, string symbol) { Trade trade2 = this.oqFilter.FilterTrade(new Trade(trade), symbol); if (trade2 == null) { return(null); } return(trade2.trade); }
public void EmitTrade(global::OpenQuant.API.Instrument instrument, DateTime time, byte providerId, double price, int size) { SmartQuant.Data.Trade trade = new SmartQuant.Data.Trade(time, price, size); trade.ProviderId = providerId; if (this.MarketDataFilter != null) { trade = this.MarketDataFilter.FilterTrade(trade, instrument.Symbol); } if (trade == null) { return; } if (this.NewTrade != null) { this.NewTrade(this, new TradeEventArgs(trade, instrument.instrument, this)); } if (this.barFactory != null) { this.barFactory.OnNewTrade(instrument.instrument, trade); } }
private void EmitNewTradeEvent(IFIXInstrument instrument, SmartQuant.Data.Trade trade) { if (trade == null) { return; } if (instrument == null) { throw new ArgumentException("合约不存在,请检查是否创建了合约"); } var NewTradeDelegate = (MulticastDelegate)NewTradeField.GetValue(marketDataProvider); foreach (Delegate dlg in NewTradeDelegate.GetInvocationList()) { dlg.Method.Invoke(dlg.Target, new object[] { marketDataProvider, new TradeEventArgs(trade, instrument, marketDataProvider) }); } if (factory != null) { factory.OnNewTrade(instrument, trade); } }
internal Trade(SmartQuant.Data.Trade trade) { this.trade = trade; }
public Trade(DateTime dateTime, double price, int size) { this.trade = new SmartQuant.Data.Trade(dateTime, price, size); }
public object Convert(SmartQuant.Data.Trade trade) { return(new Trade(trade)); }