Exemple #1
0
 public void OnNewTrade(IFIXInstrument instrument, Trade trade)
 {
     if (this.Enabled && this.Input == BarFactoryInput.Trade)
     {
         this.AddTrade(instrument, trade.DateTime, trade.Price, trade.Size);
     }
 }
Exemple #2
0
 public HistoricalDataEventArgs(string requestId, IFIXInstrument instrument, IHistoricalDataProvider provider, int dataLength) : base()
 {
     this.RequestId  = requestId;
     this.Instrument = instrument;
     this.Provider   = provider;
     this.DataLength = dataLength;
 }
Exemple #3
0
 private void EmitNewCorporateAction(IFIXInstrument instrument, CorporateAction corporateAction)
 {
     if (this.NewCorporateAction != null)
     {
         this.NewCorporateAction(this, new CorporateActionEventArgs(corporateAction, instrument, this));
     }
 }
 public void EmitNewBarOpen(Bar bar, IFIXInstrument instrument)
 {
     if (this.NewBarOpen != null)
     {
         this.NewBarOpen(null, new BarEventArgs(bar, instrument, provider));
     }
 }
 private void EmitHistoricalBar(string requestId, IFIXInstrument instrument, Bar bar)
 {
     if (this.NewHistoricalBar != null)
     {
         this.NewHistoricalBar(this, new HistoricalBarEventArgs(bar, requestId, instrument, this, -1));
     }
 }
Exemple #6
0
 private void jsgfiCe1q(IFIXInstrument instrument, long size)
 {
     if (this.NewBarSlice != null)
     {
         this.NewBarSlice(this, new BarSliceEventArgs(size, null));
     }
 }
Exemple #7
0
 private void EmitNewFundamental(IFIXInstrument instrument, Fundamental fundamental)
 {
     if (this.NewFundamental != null)
     {
         this.NewFundamental(this, new FundamentalEventArgs(fundamental, instrument, this));
     }
 }
Exemple #8
0
 private void NQyesH3ccX(IFIXInstrument instrument, CorporateAction action)
 {
     if (this.NewCorporateAction != null)
     {
         this.NewCorporateAction(this, new CorporateActionEventArgs(action, instrument, this));
     }
 }
Exemple #9
0
        private void EmitNewQuoteEvent(IFIXInstrument instrument, SmartQuant.Data.Quote quote)
        {
            if (quote == null)
            {
                return;
            }

            if (instrument == null)
            {
                throw new ArgumentException("合约不存在,请检查是否创建了合约");
            }

            // 本想把这行代码放在构造函数中的,结果发现有问题
            // 在QuoteMonitor中可以看到价差,但在策略中并不会触发相应的事件
            var NewQuoteDelegate = (MulticastDelegate)NewQuoteField.GetValue(marketDataProvider);

            foreach (Delegate dlg in NewQuoteDelegate.GetInvocationList())
            {
                dlg.Method.Invoke(dlg.Target, new object[] { marketDataProvider, new QuoteEventArgs(quote, instrument, marketDataProvider) });
            }

            if (factory != null)
            {
                factory.OnNewQuote(instrument, quote);
            }
        }
 private void EmitBar(IFIXInstrument instrument, SmartQuant.Data.Bar bar)
 {
     if (this.NewBar != null)
     {
         this.NewBar(this, new BarEventArgs(bar, instrument, this));
     }
 }
 private void EmitHistoricalDataRequestError(string requestId, IFIXInstrument instrument, string message)
 {
     if (this.HistoricalDataRequestError != null)
     {
         this.HistoricalDataRequestError(this, new HistoricalDataErrorEventArgs(requestId, instrument, this, -1, message));
     }
 }
		public HistoricalDataEventArgs(string requestId, IFIXInstrument instrument, IHistoricalDataProvider provider, int dataLength) : base()
		{
			this.RequestId = requestId;
			this.Instrument = instrument;
			this.Provider = provider;
			this.DataLength = dataLength;
		}
Exemple #13
0
 private void EmitNewBarOpen(Bar bar, IFIXInstrument instrument)
 {
     if (this.NewBarOpen != null)
     {
         this.NewBarOpen(null, new BarEventArgs(bar, instrument, null));
     }
 }
Exemple #14
0
		public void OnNewTrade(IFIXInstrument instrument, Trade trade)
		{
			if (this.Enabled && this.Input == BarFactoryInput.Trade)
			{
				this.AddTrade(instrument, trade.DateTime, trade.Price, trade.Size);
			}
		}
 private void EmitHistoricalDataRequestCompleted(string requestId, IFIXInstrument instrument)
 {
     if (this.HistoricalDataRequestCompleted != null)
     {
         this.HistoricalDataRequestCompleted(this, new HistoricalDataEventArgs(requestId, instrument, this, -1));
     }
 }
 private void EmitNewMarketDepth(IFIXInstrument instrument, MarketDepth marketDepth)
 {
     if (NewMarketDepth != null)
     {
         NewMarketDepth(this, new MarketDepthEventArgs(marketDepth, instrument, this));
     }
 }
Exemple #17
0
        private void EmitNewBarOpenEvent(IFIXInstrument instrument, SmartQuant.Data.Bar bar)
        {
            if (bar == null)
            {
                return;
            }

            if (_NewBarOpen == null)
            {
                return;
            }

            if (instrument == null)
            {
                throw new ArgumentException("合约不存在,请检查是否创建了合约");
            }

            if (NewBarOpenField == null && _NewBarOpen != null)
            {
                throw new ArgumentException("事件没有正确识别");
            }

            var NewBarOpenDelegate = (MulticastDelegate)NewBarOpenField.GetValue(marketDataProvider);

            foreach (Delegate dlg in NewBarOpenDelegate.GetInvocationList())
            {
                dlg.Method.Invoke(dlg.Target, new object[] { marketDataProvider, new BarEventArgs(bar, instrument, marketDataProvider) });
            }
        }
 private void EmitHistoricalTrade(string requestID, IFIXInstrument instrument, Trade trade)
 {
     if (this.NewHistoricalTrade != null)
     {
         this.NewHistoricalTrade(this, new HistoricalTradeEventArgs(trade, requestID, instrument, this, -1));
     }
 }
Exemple #19
0
 private void HiaeqOcUjh(IFIXInstrument instrument, MarketDepth md)
 {
     if (this.NewMarketDepth != null)
     {
         this.NewMarketDepth(this, new MarketDepthEventArgs(md, instrument, this));
     }
 }
Exemple #20
0
 private void EmitNewBarOpenEvent(IFIXInstrument instrument, Bar bar)
 {
     if (this.NewBarOpen != null)
     {
         this.NewBarOpen(this, new BarEventArgs(bar, instrument, this));
     }
 }
Exemple #21
0
 private void EmitHistoricalQuote(string requestID, IFIXInstrument instrument, Quote quote)
 {
     if (this.NewHistoricalQuote != null)
     {
         this.NewHistoricalQuote(this, new HistoricalQuoteEventArgs(quote, requestID, instrument, this, -1));
     }
 }
Exemple #22
0
        public void OnNewQuote(IFIXInstrument instrument, Quote quote)
        {
            if (!this.Enabled)
            {
                return;
            }
            Quote quote1;

            if (!this.ALv6cyCmM.TryGetValue(instrument, out quote1))
            {
                quote1 = new Quote();
                this.ALv6cyCmM.Add(instrument, quote1);
            }
            switch (this.Input)
            {
            case BarFactoryInput.Bid:
                if (quote.Bid != quote1.Bid || quote.BidSize != quote1.BidSize)
                {
                    this.AddTrade(instrument, quote.DateTime, quote.Bid, quote.BidSize);
                }
                break;

            case BarFactoryInput.Ask:
                if (quote.Ask != quote1.Ask || quote.AskSize != quote1.AskSize)
                {
                    this.AddTrade(instrument, quote.DateTime, quote.Ask, quote.AskSize);
                }
                break;

            case BarFactoryInput.BidAsk:
                if (quote.Ask != quote1.Ask || quote.AskSize != quote1.AskSize)
                {
                    this.AddTrade(instrument, quote.DateTime, quote.Ask, quote.AskSize);
                }
                if (quote.Bid != quote1.Bid || quote.BidSize != quote1.BidSize)
                {
                    this.AddTrade(instrument, quote.DateTime, quote.Bid, quote.BidSize);
                }
                break;

            case BarFactoryInput.Middle:
                if (quote.Ask != quote1.Ask || quote.AskSize != quote1.AskSize || (quote.Bid != quote1.Bid || quote.BidSize != quote1.BidSize))
                {
                    this.AddTrade(instrument, quote.DateTime, (quote.Ask + quote.Bid) / 2.0, (quote.AskSize + quote.BidSize) / 2);
                }
                break;

            case BarFactoryInput.Spread:
                if (quote.Ask != quote1.Ask || quote.AskSize != quote1.AskSize || (quote.Bid != quote1.Bid || quote.BidSize != quote1.BidSize))
                {
                    this.AddTrade(instrument, quote.DateTime, quote.Ask - quote.Bid, 0);
                }
                break;
            }
            quote1.Ask     = quote.Ask;
            quote1.Bid     = quote.Bid;
            quote1.AskSize = quote.AskSize;
            quote1.BidSize = quote.BidSize;
        }
Exemple #23
0
 public void OnNewTrade(IFIXInstrument instrument, Trade trade)
 {
     if (!this.Enabled || this.Input != BarFactoryInput.Trade)
     {
         return;
     }
     this.AddTrade(instrument, DateTime.Now, trade.Price, trade.Size);
 }
Exemple #24
0
 private void EmitNewBar(Bar bar, IFIXInstrument instrument)
 {
     bar.IsComplete = true;
     if (this.NewBar != null)
     {
         this.NewBar(null, new BarEventArgs(bar, instrument, null));
     }
 }
Exemple #25
0
 private void EmitBar(IFIXInstrument instrument, FreeQuant.Data.Bar bar)
 {
     if (this.NewBar == null)
     {
         return;
     }
     this.NewBar((object)this, new BarEventArgs(bar, instrument, (IMarketDataProvider)this));
 }
 public void EmitNewBar(Bar bar, IFIXInstrument instrument)
 {
     bar.IsComplete = true;
     if (this.NewBar != null)
     {
         this.NewBar(null, new BarEventArgs(bar, instrument, provider));
     }
 }
        private void OnReminder(ReminderEventArgs args)
        {
            Dictionary <long, Dictionary <IFIXInstrument, Bar> > barFinishedStore = new Dictionary <long, Dictionary <IFIXInstrument, Bar> >();

            Monitor.Enter(this);
            try
            {
                foreach (KeyValuePair <IFIXInstrument, Dictionary <BarType, Dictionary <long, object> > > kvp1 in barStore.ToList())
                {
                    IFIXInstrument instrument = kvp1.Key;
                    Dictionary <BarType, Dictionary <long, object> > barCabinet = barStore[instrument];

                    if (barCabinet.ContainsKey(BarType.Time))
                    {
                        Dictionary <long, object> barBox = barCabinet[BarType.Time];
                        foreach (KeyValuePair <long, object> kvp2 in barBox.ToList())
                        {
                            long    num     = kvp2.Key;
                            BarData barData = (BarData)kvp2.Value;
                            if (barData.RealyEndTime == args.SignalTime)
                            {
                                if (!barFinishedStore.ContainsKey(num))
                                {
                                    barFinishedStore.Add(num, new Dictionary <IFIXInstrument, Bar>());
                                }
                                Dictionary <IFIXInstrument, Bar> barFinishedCabinet = barFinishedStore[num];
                                barFinishedCabinet.Add(instrument, barData.Bar);
                                barBox.Remove(num);
                            }
                        }
                        if (barBox.Count == 0)
                        {
                            barCabinet.Remove(BarType.Time);
                        }
                    }
                    if (barCabinet.Count == 0)
                    {
                        barStore.Remove(instrument);
                    }
                }
            }
            finally
            {
                Monitor.Exit(this);
            }
            foreach (KeyValuePair <long, Dictionary <IFIXInstrument, Bar> > kvp3 in barFinishedStore)
            {
                long barSize = kvp3.Key;
                Dictionary <IFIXInstrument, Bar> barFinishedCabinet = kvp3.Value;
                foreach (KeyValuePair <IFIXInstrument, Bar> pair in barFinishedCabinet)
                {
                    this.EmitNewBar(pair.Value, pair.Key);
                }
                this.EmitNewBarSlice(barSize);
            }
            this.times.Remove(args.SignalTime);
        }
Exemple #28
0
		private InstrumentCounter GetInstrumentCounter(IFIXInstrument instrument)
		{
			InstrumentCounter instrumentCounter;
			if (!this.instrumentCounters.TryGetValue(instrument, out instrumentCounter))
			{
				instrumentCounter = new InstrumentCounter(instrument);
				this.instrumentCounters.Add(instrument, instrumentCounter);
			}
			return instrumentCounter;
		}
 private void EmitNewTradeEvent(IFIXInstrument instrument, Trade trade)
 {
     if (NewTrade != null)
     {
         NewTrade(this, new TradeEventArgs(trade, instrument, this));
     }
     if (factory != null)
     {
         factory.OnNewTrade(instrument, trade);
     }
 }
 private void EmitNewQuoteEvent(IFIXInstrument instrument, Quote quote)
 {
     if (NewQuote != null)
     {
         NewQuote(this, new QuoteEventArgs(quote, instrument, this));
     }
     if (factory != null)
     {
         factory.OnNewQuote(instrument, quote);
     }
 }
 public void OnNewTrade(IFIXInstrument instrument, Trade trade)
 {
     if (!this.enabled)
     {
         return;
     }
     if (this.input == BarFactoryInput.Trade)
     {
         this.OnNewMarketData(instrument, trade.DateTime, trade.Price, trade.Size);
     }
 }
Exemple #32
0
        private InstrumentCounter GetInstrumentCounter(IFIXInstrument instrument)
        {
            InstrumentCounter instrumentCounter;

            if (!this.instrumentCounters.TryGetValue(instrument, out instrumentCounter))
            {
                instrumentCounter = new InstrumentCounter(instrument);
                this.instrumentCounters.Add(instrument, instrumentCounter);
            }
            return(instrumentCounter);
        }
 private void EmitNewQuoteEvent(IFIXInstrument instrument, Quote quote)
 {
     if (NewQuote != null)
     {
         NewQuote(this, new QuoteEventArgs(quote, instrument, this));
     }
     if (factory != null)
     {
         factory.OnNewQuote(instrument, quote);
     }
 }
 private void EmitNewTradeEvent(IFIXInstrument instrument, Trade trade)
 {
     if (NewTrade != null)
     {
         NewTrade(this, new TradeEventArgs(trade, instrument, this));
     }
     if (factory != null)
     {
         factory.OnNewTrade(instrument, trade);
     }
 }
Exemple #35
0
        public void OnNewQuote(IFIXInstrument instrument, Quote quote)
        {
            if (!this.Enabled)
            {
                return;
            }
            double price;
            int    size;

            switch (this.Input)
            {
            case BarFactoryInput.Bid:
                price = quote.Bid;
                size  = quote.BidSize;
                break;

            case BarFactoryInput.Ask:
                price = quote.Ask;
                size  = quote.AskSize;
                break;

            case BarFactoryInput.BidAsk:
                this.AddTrade(instrument, DateTime.Now, quote.Bid, quote.BidSize);
                this.AddTrade(instrument, DateTime.Now, quote.Ask, quote.AskSize);
                return;

            case BarFactoryInput.Middle:
                this.AddTrade(instrument, DateTime.Now, (quote.Ask + quote.Bid) / 2.0, (quote.AskSize + quote.BidSize) / 2);
                return;

            case BarFactoryInput.Spread:
                price = quote.Ask - quote.Bid;
                size  = 0;
                break;

            default:
                return;
            }
            BarFactory.mU5OEr88NSmCpsBxeD u5Oer88NsmCpsBxeD = this.cqyLFWMOvs[instrument] as BarFactory.mU5OEr88NSmCpsBxeD;
            if (u5Oer88NsmCpsBxeD == null)
            {
                u5Oer88NsmCpsBxeD = new BarFactory.mU5OEr88NSmCpsBxeD();
                this.cqyLFWMOvs.Add(instrument, u5Oer88NsmCpsBxeD);
            }
            if (price == u5Oer88NsmCpsBxeD.price && size == u5Oer88NsmCpsBxeD.size)
            {
                return;
            }
            this.AddTrade(instrument, DateTime.Now, price, size);
            u5Oer88NsmCpsBxeD.price = price;
            u5Oer88NsmCpsBxeD.size  = size;
        }
Exemple #36
0
		public InstrumentOrderListTable this[IFIXInstrument instrument]
		{
			get
			{
				InstrumentOrderListTable table = this.orders[instrument] as InstrumentOrderListTable;
				if (table == null)
				{
					table = new InstrumentOrderListTable();
					this.orders.Add(instrument, table);
				}
				return table;
			}
		}
Exemple #37
0
		public void OnNewQuote(IFIXInstrument instrument, Quote quote)
		{
			if (!this.Enabled)
				return;
			Quote quote1;
			if (!this.ALv6cyCmM.TryGetValue(instrument, out quote1))
			{
				quote1 = new Quote();
				this.ALv6cyCmM.Add(instrument, quote1);
			}
			switch (this.Input)
			{
				case BarFactoryInput.Bid:
					if (quote.Bid != quote1.Bid || quote.BidSize != quote1.BidSize)
					{
						this.AddTrade(instrument, quote.DateTime, quote.Bid, quote.BidSize);
					}
					break;
				case BarFactoryInput.Ask:
					if (quote.Ask != quote1.Ask || quote.AskSize != quote1.AskSize)
					{
						this.AddTrade(instrument, quote.DateTime, quote.Ask, quote.AskSize);
					}
					break;
				case BarFactoryInput.BidAsk:
					if (quote.Ask != quote1.Ask || quote.AskSize != quote1.AskSize)
						this.AddTrade(instrument, quote.DateTime, quote.Ask, quote.AskSize);
					if (quote.Bid != quote1.Bid || quote.BidSize != quote1.BidSize)
					{
						this.AddTrade(instrument, quote.DateTime, quote.Bid, quote.BidSize);
					}
					break;
				case BarFactoryInput.Middle:
					if (quote.Ask != quote1.Ask || quote.AskSize != quote1.AskSize || (quote.Bid != quote1.Bid || quote.BidSize != quote1.BidSize))
					{
						this.AddTrade(instrument, quote.DateTime, (quote.Ask + quote.Bid) / 2.0, (quote.AskSize + quote.BidSize) / 2);
					}
					break;
				case BarFactoryInput.Spread:
					if (quote.Ask != quote1.Ask || quote.AskSize != quote1.AskSize || (quote.Bid != quote1.Bid || quote.BidSize != quote1.BidSize))
					{
						this.AddTrade(instrument, quote.DateTime, quote.Ask - quote.Bid, 0);
					}
					break;
			}
			quote1.Ask = quote.Ask;
			quote1.Bid = quote.Bid;
			quote1.AskSize = quote.AskSize;
			quote1.BidSize = quote.BidSize;
		}
        private void EmitNewQuoteEvent(IFIXInstrument instrument, Quote quote)
        {
            if (this.MarketDataFilter != null)
            {
                quote = this.MarketDataFilter.FilterQuote(quote, instrument.Symbol);
            }

            if (quote != null)
            {
                if (NewQuote != null)
                {
                    NewQuote(this, new QuoteEventArgs(quote, instrument, this));
                }
                if (factory != null)
                {
                    factory.OnNewQuote(instrument, quote);
                }
            }
        }
        private void EmitNewTradeEvent(IFIXInstrument instrument, Trade trade)
        {
            if (this.MarketDataFilter != null)
            {
                trade = this.MarketDataFilter.FilterTrade(trade, instrument.Symbol);
            }

            if (trade != null)
            {
                if (NewTrade != null)
                {
                    NewTrade(this, new TradeEventArgs(trade, instrument, this));
                }
                if (factory != null)
                {
                    factory.OnNewTrade(instrument, trade);
                }
            }
        }
Exemple #40
0
		public void OnNewQuote(IFIXInstrument instrument, Quote quote)
		{
			if (!this.Enabled)
				return;
			double price;
			int size;
			switch (this.Input)
			{
				case BarFactoryInput.Bid:
					price = quote.Bid;
					size = quote.BidSize;
					break;
				case BarFactoryInput.Ask:
					price = quote.Ask;
					size = quote.AskSize;
					break;
				case BarFactoryInput.BidAsk:
					this.AddTrade(instrument, DateTime.Now, quote.Bid, quote.BidSize);
					this.AddTrade(instrument, DateTime.Now, quote.Ask, quote.AskSize);
					return;
				case BarFactoryInput.Middle:
					this.AddTrade(instrument, DateTime.Now, (quote.Ask + quote.Bid) / 2.0, (quote.AskSize + quote.BidSize) / 2);
					return;
				case BarFactoryInput.Spread:
					price = quote.Ask - quote.Bid;
					size = 0;
					break;
				default:
					return;
			}
			BarFactory.mU5OEr88NSmCpsBxeD u5Oer88NsmCpsBxeD = this.cqyLFWMOvs[instrument] as BarFactory.mU5OEr88NSmCpsBxeD;
			if (u5Oer88NsmCpsBxeD == null)
			{
				u5Oer88NsmCpsBxeD = new BarFactory.mU5OEr88NSmCpsBxeD();
				this.cqyLFWMOvs.Add(instrument, u5Oer88NsmCpsBxeD);
			}
			if (price == u5Oer88NsmCpsBxeD.price && size == u5Oer88NsmCpsBxeD.size)
				return;
			this.AddTrade(instrument, DateTime.Now, price, size);
			u5Oer88NsmCpsBxeD.price = price;
			u5Oer88NsmCpsBxeD.size = size;
		}
Exemple #41
0
		public MarketDepthEventArgs(MarketDepth marketDepth, IFIXInstrument instrument, IMarketDataProvider provider) : base(instrument, provider)
		{
			this.MarketDepth = marketDepth;
		}
 private void EmitNewMarketDepth(IFIXInstrument instrument, MarketDepth marketDepth)
 {
     if (NewMarketDepth != null)
     {
         NewMarketDepth(this, new MarketDepthEventArgs(marketDepth, instrument, this));
     }
 }
		public HistoricalQuoteEventArgs(Quote quote, string requestId, IFIXInstrument instrument, IHistoricalDataProvider provider, int dataLength)
			: base(requestId, instrument, provider, dataLength)
		{
			this.Quote = quote; 
		}
Exemple #44
0
		public FundamentalEventArgs(Fundamental fundamental, IFIXInstrument instrument, IMarketDataProvider provider) 
			: base(instrument, provider)
		{
			this.Fundamental = fundamental; 
		}
        private void EmitNewBarOpenEvent(IFIXInstrument instrument, SmartQuant.Data.Bar bar)
        {
            if (bar == null)
                return;

            if (_NewBarOpen == null)
                return;

            if (instrument == null)
                throw new ArgumentException("合约不存在,请检查是否创建了合约");

            if (NewBarOpenField == null && _NewBarOpen != null)
                throw new ArgumentException("事件没有正确识别");

            var NewBarOpenDelegate = (MulticastDelegate)NewBarOpenField.GetValue(marketDataProvider);

            foreach (Delegate dlg in NewBarOpenDelegate.GetInvocationList())
            {
                dlg.Method.Invoke(dlg.Target, new object[] { marketDataProvider, new BarEventArgs(bar, instrument, marketDataProvider) });
            }
        }
Exemple #46
0
		public void OnNewTrade(IFIXInstrument instrument, Trade trade)
		{
			if (!this.Enabled || this.Input != BarFactoryInput.Trade)
				return;
			this.AddTrade(instrument, DateTime.Now, trade.Price, trade.Size);
		}
Exemple #47
0
		public QuoteEventArgs(Quote quote, IFIXInstrument instrument, IMarketDataProvider provider)
			: base(instrument, provider)
		{
			this.Quote = quote;
		}
Exemple #48
0
		public SimpleDataObject(IFIXInstrument instrument, Trade trade)
		{
			this.DateTime = trade.DateTime;
			this.Instrument = instrument;
			this.DataType = 0;
		}
Exemple #49
0
 extern Quote[] IHistoryProvider.GetQuoteHistory(IFIXInstrument instrument, DateTime datetime1, DateTime datetime2);
Exemple #50
0
 extern MarketDepth[] IHistoryProvider.GetMarketDepthHistory(IFIXInstrument instrument, DateTime datetime1, DateTime datetime2);
Exemple #51
0
 extern Daily[] IHistoryProvider.GetDailyHistory(IFIXInstrument instrument, DateTime datetime1, DateTime datetime2, bool dividendAndSplitAdjusted);
Exemple #52
0
 extern Bar[] IHistoryProvider.GetBarHistory(IFIXInstrument instrument, DateTime datetime1, DateTime datetime2, int barSize);
Exemple #53
0
		public SimpleDataObject(IFIXInstrument instrument, Quote quote)
		{
			this.DateTime = quote.DateTime;
			this.Instrument = instrument;
			this.DataType = 1;
		}
		public HistoricalDataErrorEventArgs(string requestId, IFIXInstrument instrument, IHistoricalDataProvider provider, int dataLength, string message)
			: base(requestId, instrument, provider, dataLength)
		{
			this.Message = message; 
		}
        private void EmitNewQuoteEvent(IFIXInstrument instrument, SmartQuant.Data.Quote quote)
        {
            if (quote == null)
                return;

            if (instrument == null)
                throw new ArgumentException("合约不存在,请检查是否创建了合约");

            // 本想把这行代码放在构造函数中的,结果发现有问题
            // 在QuoteMonitor中可以看到价差,但在策略中并不会触发相应的事件
            var NewQuoteDelegate = (MulticastDelegate)NewQuoteField.GetValue(marketDataProvider);

            foreach (Delegate dlg in NewQuoteDelegate.GetInvocationList())
            {
                dlg.Method.Invoke(dlg.Target, new object[] { marketDataProvider, new QuoteEventArgs(quote, instrument, marketDataProvider) });
            }

            if (factory != null)
            {
                factory.OnNewQuote(instrument, quote);
            }
        }
        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);
            }
        }
Exemple #57
0
 extern Trade[] IHistoryProvider.GetTradeHistory(IFIXInstrument instrument, DateTime datetime1, DateTime datetime2);
Exemple #58
0
		private void EmitNewBarOpen(Bar bar, IFIXInstrument instrument)
		{
			if (this.NewBarOpen != null)
			{
				this.NewBarOpen(null, new BarEventArgs(bar, instrument, null));
			}
		}
		public HistoricalMarketDepthEventArgs(MarketDepth marketDepth, string requestId, IFIXInstrument instrument, IHistoricalDataProvider provider, int dataLength)
			: base(requestId, instrument, provider, dataLength)
		{
			this.MarketDepth = marketDepth;
		}
		public HistoricalBarEventArgs(Bar bar, string requestId, IFIXInstrument instrument, IHistoricalDataProvider provider, int dataLength) : base(requestId, instrument, provider, dataLength)
		{
			this.Bar = bar; 
		}