private void client_RealTimeBar(object sender, RealTimeBarEventArgs e)
 {
     if (debug)
     {
         log.Debug("Received Real Time Bar: " + e.Close);
     }
 }
Beispiel #2
0
        //This event is raised when real time data arrives
        //We convert them and pass them on downstream
        private void _client_RealTimeBar(object sender, RealTimeBarEventArgs e)
        {
            RealTimeDataEventArgs args = TWSUtils.RealTimeDataEventArgsConverter(e);
            var originalRequest        = _realTimeDataRequests[e.RequestId];

            args.InstrumentID = originalRequest.Instrument.ID.Value;
            args.RequestID    = _requestIDMap[e.RequestId];
            RaiseEvent(DataReceived, this, args);
        }
Beispiel #3
0
        //This event is raised when real time data arrives
        //We convert them and pass them on downstream
        private void _client_RealTimeBar(object sender, RealTimeBarEventArgs e)
        {
            var args            = TwsUtils.RealTimeDataEventArgsConverter(e);
            var originalRequest = realTimeDataRequests[e.RequestId];

            if (originalRequest?.Instrument != null)
            {
                args.InstrumentID = originalRequest.Instrument.ID;
            }
            args.RequestID = requestIDMap[e.RequestId];
            RaiseEvent(DataReceived, this, args);
        }
 /// <summary>
 ///     Returns RealTimeDataEventArgs derived from IB's  RealTimeBarEventArgs, but not including the symbol
 /// </summary>
 /// <param name="e">RealTimeBarEventArgs</param>
 /// <returns>RealTimeDataEventArgs </returns>
 public static RealTimeDataEventArgs RealTimeDataEventArgsConverter(RealTimeBarEventArgs e)
 {
     return(new RealTimeDataEventArgs(
                0,
                e.Time,
                e.Open,
                e.High,
                e.Low,
                e.Close,
                e.Volume,
                e.Wap,
                e.Count,
                0));
 }
Beispiel #5
0
 /// <summary>
 /// Returns RealTimeDataEventArgs derived from IB's  RealTimeBarEventArgs, but not including the symbol
 /// </summary>
 /// <param name="e">RealTimeBarEventArgs</param>
 /// <returns>RealTimeDataEventArgs </returns>
 public static RealTimeDataEventArgs RealTimeDataEventArgsConverter(RealTimeBarEventArgs e, QDMS.BarSize frequency)
 {
     return(new RealTimeDataEventArgs(
                0,
                frequency,
                e.Time,
                (decimal)e.Open,
                (decimal)e.High,
                (decimal)e.Low,
                (decimal)e.Close,
                e.Volume,
                e.Wap,
                e.Count,
                0));
 }
Beispiel #6
0
 static void client_RealTimeBar(object sender, RealTimeBarEventArgs e)
 {
     Console.WriteLine("Received Real Time Bar: " + e.Close);
 }