예제 #1
0
        public Streamer(string connectionId, QuoteProvider quoteProvider)
        {
            this._quoteProvider = quoteProvider;
            this._instruments = Config.GetInstruments(this._quoteProvider);
            this._connectionId = connectionId;

            SubscribeOnInstrumetsEvents();

            _hubContext = GlobalHost.ConnectionManager.GetHubContext<ChartHub>();

            _log.Info(String.Format("Streamer created. ConnectionId: {0}", _connectionId));
        }
예제 #2
0
        public static List<Instrument> GetInstruments(QuoteProvider quoteProvider)
        {
            List<Instrument> instruments = new List<Instrument>();
            Config.Instruments.ForEach((i) => instruments.Add(new Instrument(i.Name, i.Symbol, i.PipCost)));

            foreach (Instrument instrument in instruments)
            {
                instrument.Range = 10; //Settings.Default.InstrumentRange;
                instrument.TimeFrame = Models.Enums.TimeFrame.M1;// Instrument.ParseTimeFrame(Settings.Default.InstrumentTimeFrame);
                instrument.SetQuoteProvider(quoteProvider);
            }
            return instruments;
        }