Exemplo n.º 1
0
        private void Feed_OnStreamQuote(string symbol, byte quoteCondition, byte bidExchange, byte askExchange, double bidPrice, double askPrice, int bidSize, int askSize, DateTime quoteDatetime)
        {
            string data = "Stream Quote: " + symbol + "," + quoteCondition + "," + bidExchange + "," + askExchange + "," + bidPrice + "," + askPrice + "," + bidSize + "," + askSize + "," + quoteDatetime.ToString();

            RealTimeDataUpdated?.Invoke(this, new RealTimeDataUpdatedEventArgs {
                Data = new Tuple <string, double, double, DateTime, int>(symbol, bidPrice, askPrice, quoteDatetime, bidSize)
            });
        }
Exemplo n.º 2
0
        public DataManager(IDataProvider dataProvider, IDataBase dataBase)
        {
            this.dataProvider = dataProvider;
            repository        = dataBase;

            dataProvider.SessionStatusChanged += (object sender, SessionStatusChangedEventArgs e) =>
                                                 SessionStatusChanged?.Invoke(sender, e);
            dataProvider.RealTimeDataUpdated += (object sender, RealTimeDataUpdatedEventArgs e) =>
                                                RealTimeDataUpdated?.Invoke(sender, e);
        }
Exemplo n.º 3
0
        private void offersTableUpdated(object sender, RowEventArgs e)
        {
            O2GOfferTableRow otr = (O2GOfferTableRow)e.RowData;

            if (otr != null && realTimeInstrumentsList.Count > 0)
            {
                var instrument = otr.Instrument.Contains('/') ? this.deNormalizeSymbol(otr.Instrument) : otr.Instrument;
                if (realTimeInstrumentsList.Contains(instrument))
                {
                    RealTimeDataUpdated?.Invoke(this,
                                                new RealTimeDataUpdatedEventArgs(new Instrument {
                        Name = instrument, Type = InstrumentType.Forex
                    },
                                                                                 otr.Bid, otr.Volume, otr.Time));
                }
                //instrument, otr.Bid, otr.Ask, otr.Volume, otr.Time);

                //RealTimeDataUpdated?.Invoke(this, new RealTimeDataUpdatedEventArgs { Data = new Tuple<string, double, double, int, DateTime>(instrument, otr.Bid, otr.Ask, otr.Volume, otr.Time) });
            }
        }