Esempio n. 1
0
 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);
        }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
 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);
     }
 }
Esempio n. 6
0
        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);
            }
        }
Esempio n. 7
0
		internal Trade(SmartQuant.Data.Trade trade)
		{
			this.trade = trade;
		}
Esempio n. 8
0
		public Trade(DateTime dateTime, double price, int size)
		{
			this.trade = new SmartQuant.Data.Trade(dateTime, price, size);
		}
Esempio n. 9
0
 internal Trade(SmartQuant.Data.Trade trade)
 {
     this.trade = trade;
 }
Esempio n. 10
0
 public Trade(DateTime dateTime, double price, int size)
 {
     this.trade = new SmartQuant.Data.Trade(dateTime, price, size);
 }
Esempio n. 11
0
		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);
			}
		}
Esempio n. 12
0
		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);
			}
		}
Esempio n. 13
0
 public object Convert(SmartQuant.Data.Trade trade)
 {
     return(new Trade(trade));
 }