Esempio n. 1
0
        public TickSeries GetHistoricalTicks(IHistoricalDataProvider provider, TickType type, Instrument instrument, DateTime dateTime1, DateTime dateTime2)
        {
            if (provider.IsDisconnected)
            {
                provider.Connect();
            }

            DataNotifier @class = new DataNotifier();
            string       text   = Guid.NewGuid().ToString();

            lock (this.dictionary_0)
            {
                this.dictionary_0.Add(text, @class);
            }
            HistoricalDataRequest request = null;

            switch (type)
            {
            case TickType.Bid:
                request = new HistoricalDataRequest(instrument, dateTime1, dateTime2, DataObjectType.Bid);
                break;

            case TickType.Ask:
                request = new HistoricalDataRequest(instrument, dateTime1, dateTime2, DataObjectType.Ask);
                break;

            case TickType.Trade:
                request = new HistoricalDataRequest(instrument, dateTime1, dateTime2, DataObjectType.Trade);
                break;
            }
            request.RequestId = text;
            provider.Send(request);
            @class.ReadyEvent.WaitOne();
            lock (this.dictionary_0)
            {
                this.dictionary_0.Remove(text);
            }
            var ts = new TickSeries("", "");

            foreach (var data in @class.Data)
            {
                var objs = data.Objects;
                foreach (var tick in objs)
                {
                    ts.Add((Tick)tick);
                }
            }
            return(ts);
        }
Esempio n. 2
0
 public virtual void Send(HistoricalDataRequest request)
 {
     // noop
 }
Esempio n. 3
0
 public virtual void RequestHistoricalData(HistoricalDataRequest request)
 {
     // noop
 }
Esempio n. 4
0
        public TickSeries GetHistoricalTicks(IHistoricalDataProvider provider, TickType type, Instrument instrument, DateTime dateTime1, DateTime dateTime2)
        {
            if (provider.IsDisconnected)
                provider.Connect();

            DataNotifier @class = new DataNotifier();
            string text = Guid.NewGuid().ToString();
            lock (this.dictionary_0)
            {
                this.dictionary_0.Add(text, @class);
            }
            HistoricalDataRequest request = null;
            switch (type)
            {
                case TickType.Bid:
                    request = new HistoricalDataRequest(instrument, dateTime1, dateTime2, DataObjectType.Bid);
                    break;
                case TickType.Ask:
                    request = new HistoricalDataRequest(instrument, dateTime1, dateTime2, DataObjectType.Ask);
                    break;
                case TickType.Trade:
                    request = new HistoricalDataRequest(instrument, dateTime1, dateTime2, DataObjectType.Trade);
                    break;
            }
            request.RequestId = text;
            provider.Send(request);
            @class.ReadyEvent.WaitOne();
            lock (this.dictionary_0)
            {
                this.dictionary_0.Remove(text);
            }
            var ts = new TickSeries("", "");
            foreach (var data in @class.Data)
            {
                var objs = data.Objects;
                foreach (var tick in objs)
                    ts.Add((Tick)tick);
            }
            return ts;
        }
Esempio n. 5
0
 public virtual void Send(HistoricalDataRequest request)
 {
     // noop
 }
Esempio n. 6
0
 public virtual void RequestHistoricalData(HistoricalDataRequest request)
 {
     // noop
 }