static IDisposable SubscribeExecutionSource(RealtimeSourceFactory factory, BfProductCode productCode) { var source = factory.GetExecutionSource(productCode); return(source.Subscribe(exec => { Console.WriteLine($"{exec.ExecutedTime} P:{exec.Price} A:{exec.Side} B:{exec.Size}"); })); }
static void RealtimeExecutionSample(RealtimeSourceFactory factory) { factory.GetExecutionSource(BfProductCode.FXBTCJPY).Subscribe(tick => { Console.WriteLine("{0} {1} {2} {3} {4} {5}", tick.ExecutionId, tick.Side, tick.Price, tick.Size, tick.ExecutedTime.ToLocalTime(), tick.ChildOrderAcceptanceId); }).AddTo(_disposables); }
public IObservable <RealtimeOhlc> GetRealtimeOhlcSource(BfProductCode productCode, TimeSpan frameSpan) { return(new RealtimeOhlcSource(_historicalFactory, productCode, frameSpan, _realtimeFactory.GetExecutionSource(productCode, true))); }