Пример #1
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) });
            }
        }
Пример #2
0
 private void EmitBar(IFIXInstrument instrument, SmartQuant.Data.Bar bar)
 {
     if (this.NewBar != null)
     {
         this.NewBar(this, new BarEventArgs(bar, instrument, this));
     }
 }
        public SmartQuant.Data.Bar FilterBarOpen(SmartQuant.Data.Bar bar, string symbol)
        {
            Bar bar2 = this.oqFilter.FilterBarOpen(new Bar(bar), symbol);

            if (bar2 != null)
            {
                return(bar2.bar);
            }
            return(null);
        }
Пример #4
0
 public Bar this[DateTime dateTime]
 {
     get
     {
         SmartQuant.Data.Bar bar = this.series[dateTime];
         if (bar == null)
         {
             return(null);
         }
         return(new Bar(bar));
     }
 }
Пример #5
0
        public void EmitBar(string instrument, DateTime time, byte providerId, double open, double high, double low, double close, long volume, long openInt, long size)
        {
            SmartQuant.Data.Bar bar = new SmartQuant.Data.Bar(SmartQuant.Data.BarType.Time, size, time, time.AddSeconds(size), open, high, low, close, volume, openInt)
            {
                ProviderId = providerId,
                IsComplete = true,
            };

            SmartQuant.Instruments.Instrument inst = SmartQuant.Instruments.InstrumentManager.Instruments[instrument];

            EmitNewBarEvent(inst, bar);
        }
Пример #6
0
        public void EmitBarOpen(string instrument, DateTime time, byte providerId, double open, double high, double low, double close, long volume, long openInt, long size)
        {
            SmartQuant.Data.Bar bar = new SmartQuant.Data.Bar(time, open, high, low, close, volume, size)
            {
                ProviderId = providerId,
                OpenInt    = openInt,
            };

            SmartQuant.Instruments.Instrument inst = SmartQuant.Instruments.InstrumentManager.Instruments[instrument];

            EmitNewBarOpenEvent(inst, bar);
        }
Пример #7
0
 public void EmitBar(global::OpenQuant.API.Instrument instrument, global::OpenQuant.API.BarType barType, long barSize, DateTime beginDateTime, DateTime endDateTime, double open, double high, double low, double close, long volume)
 {
     SmartQuant.Data.Bar bar = new SmartQuant.Data.Bar(global::OpenQuant.API.EnumConverter.Convert(barType), barSize, beginDateTime, endDateTime, open, high, low, close, volume, 0L);
     if (this.MarketDataFilter != null)
     {
         bar = this.MarketDataFilter.FilterBar(bar, instrument.Symbol);
     }
     if (bar != null)
     {
         this.EmitBar(instrument.instrument, bar);
     }
 }
Пример #8
0
 public void EmitHistoricalBar(global::OpenQuant.API.HistoricalDataRequest request, DateTime datetime, double open, double high, double low, double close, long volume)
 {
     if (this.NewHistoricalBar != null)
     {
         SmartQuant.Data.Bar bar;
         if (request.request.DataType == HistoricalDataType.Daily)
         {
             bar = new Daily(datetime, open, high, low, close, volume, 0L);
         }
         else
         {
             bar = new SmartQuant.Data.Bar(datetime, open, high, low, close, volume, request.request.BarSize);
         }
         HistoricalBarEventArgs args = new HistoricalBarEventArgs(bar, request.request.RequestId, request.request.Instrument, this, 0);
         this.NewHistoricalBar(this, args);
     }
 }
Пример #9
0
		internal Bar(SmartQuant.Data.Bar bar)
		{
			this.bar = bar;
		}
Пример #10
0
		public Bar(DateTime dateTime, double open, double high, double low, double close, long volume, long openInt, long size)
		{
			this.bar = new SmartQuant.Data.Bar(SmartQuant.Data.BarType.Time, size, dateTime, dateTime.AddSeconds((double)size), open, high, low, close, volume, openInt);
		}
Пример #11
0
		public Bar(DateTime dateTime, double open, double high, double low, double close, long volume, long size)
		{
			this.bar = new SmartQuant.Data.Bar(dateTime, open, high, low, close, volume, size);
		}
Пример #12
0
 public Bar(DateTime dateTime, double open, double high, double low, double close, long volume, long openInt, long size)
 {
     this.bar = new SmartQuant.Data.Bar(SmartQuant.Data.BarType.Time, size, dateTime, dateTime.AddSeconds((double)size), open, high, low, close, volume, openInt);
 }
Пример #13
0
 public Bar(DateTime dateTime, double open, double high, double low, double close, long volume, long size)
 {
     this.bar = new SmartQuant.Data.Bar(dateTime, open, high, low, close, volume, size);
 }
        public void EmitBar(string instrument,DateTime time, byte providerId, double open, double high, double low, double close, long volume,long openInt, long size)
        {
            SmartQuant.Data.Bar bar = new SmartQuant.Data.Bar(SmartQuant.Data.BarType.Time,size,time,time.AddSeconds(size), open, high, low, close, volume,openInt)
            {
                ProviderId = providerId,
                IsComplete = true,
            };

            SmartQuant.Instruments.Instrument inst = SmartQuant.Instruments.InstrumentManager.Instruments[instrument];

            EmitNewBarEvent(inst, bar);
        }
Пример #15
0
 internal Bar(SmartQuant.Data.Bar bar)
 {
     this.bar = bar;
 }
Пример #16
0
		public void EmitHistoricalBar(global::OpenQuant.API.HistoricalDataRequest request, DateTime datetime, double open, double high, double low, double close, long volume)
		{
			if (this.NewHistoricalBar != null)
			{
				SmartQuant.Data.Bar bar;
				if (request.request.DataType == HistoricalDataType.Daily)
				{
					bar = new Daily(datetime, open, high, low, close, volume, 0L);
				}
				else
				{
					bar = new SmartQuant.Data.Bar(datetime, open, high, low, close, volume, request.request.BarSize);
				}
				HistoricalBarEventArgs args = new HistoricalBarEventArgs(bar, request.request.RequestId, request.request.Instrument, this, 0);
				this.NewHistoricalBar(this, args);
			}
		}
Пример #17
0
		public void EmitBar(global::OpenQuant.API.Instrument instrument, global::OpenQuant.API.BarType barType, long barSize, DateTime beginDateTime, DateTime endDateTime, double open, double high, double low, double close, long volume)
		{
			SmartQuant.Data.Bar bar = new SmartQuant.Data.Bar(global::OpenQuant.API.EnumConverter.Convert(barType), barSize, beginDateTime, endDateTime, open, high, low, close, volume, 0L);
			if (this.MarketDataFilter != null)
			{
				bar = this.MarketDataFilter.FilterBar(bar, instrument.Symbol);
			}
			if (bar != null)
			{
				this.EmitBar(instrument.instrument, bar);
			}
		}
        public void EmitBarOpen(string instrument, DateTime time, byte providerId, double open, double high, double low, double close, long volume, long openInt, long size)
        {
            SmartQuant.Data.Bar bar = new SmartQuant.Data.Bar(time, open, high, low, close, volume, size)
            {
                ProviderId = providerId,
                OpenInt = openInt,
            };

            SmartQuant.Instruments.Instrument inst = SmartQuant.Instruments.InstrumentManager.Instruments[instrument];

            EmitNewBarOpenEvent(inst, bar);
        }
Пример #19
0
 public object Convert(SmartQuant.Data.Bar bar)
 {
     return(new Bar(bar));
 }