public BfxTicker(BfOrderBook orderBook, BfTicker nativeTicker, TimeSpan serverTimeDiff) { OrderBook = orderBook; NativeTicker = nativeTicker; ServerTimeDiff = serverTimeDiff; UpdatedTime = DateTime.UtcNow + serverTimeDiff; }
public BfTradingMarketTicker(BfOrderBook orderBook, BfTicker nativeTicker, BfMarketHealth health, TimeSpan serverTimeDiff) { OrderBook = orderBook; NativeTicker = nativeTicker; Health = health; ServerTimeDiff = serverTimeDiff; UpdatedTime = DateTime.UtcNow + serverTimeDiff; }
public BfxTicker(BfOrderBook orderBook, BfTicker fxbtcTicker, BfTicker btcTicker, TimeSpan serverTimeDiff) { OrderBook = orderBook; NativeTicker = fxbtcTicker; ServerTimeDiff = serverTimeDiff; UpdatedTime = DateTime.UtcNow + serverTimeDiff; if (fxbtcTicker != null && btcTicker != null) { SFDDifference = unchecked ((double)((fxbtcTicker.LastTradedPrice - btcTicker.LastTradedPrice) / btcTicker.LastTradedPrice)); SFDRate = CalculateSfdRate(Math.Abs(SFDDifference)); } }
static void Main(string[] args) { // ログファイル出力設定 // Time / JSON LoadRunsettings(args[0]); var key = Properties["ApiKey"]; var secret = Properties["ApiSecret"]; _client = new BitFlyerClient(key, secret); _factory = new RealtimeSourceFactory(key, secret); _factory.MessageReceived += OnRealtimeMessageReceived; _factory.Error += (error) => Console.WriteLine("Error: {0} Socket Error = {1}", error.Message, error.SocketError); _factory.GetTickerSource(ProductCode).Subscribe(ticker => { _ticker = ticker; //Console.WriteLine($"Ask:{_ticker.BestAsk} Bid:{_ticker.BestBid}"); }).AddTo(_disposables); _factory.GetChildOrderEventsSource().Subscribe(OnChildOrderEvent).AddTo(_disposables); _factory.GetParentOrderEventsSource().Subscribe(OnParentOrderEvent).AddTo(_disposables); while (true) { Console.WriteLine("========================================================================"); Console.WriteLine("C)hild order >"); Console.WriteLine("P)arent order >"); Console.WriteLine(""); Console.WriteLine("Q)uit"); Console.WriteLine("========================================================================"); switch (GetCh()) { case 'C': ChildOrderMain(); break; case 'P': ParentOrderMain(); break; case 'Q': _disposables.Dispose(); return; } } }