public void Update() { if (Manager.Kraken.Tickers == null || Manager.Kraken.Tickers.Length <= 0) { return; } for (int i = 0; i < Manager.Kraken.Tickers.Length; i++) { Ticker _ticker = Manager.Kraken.Tickers[i]; Ticker ticker = Manager.Kraken.CalculateExchangeTicker(_ticker); //calculates ticker for income if (ticker == null) { continue; } InfoTicker infoTicker = SManager.InfoTickers(ticker.Name); infoTicker.Ask = ticker.BuyPrice(ticker.AssetBase.Value, 1); infoTicker.Bid = ticker.SellPrice(ticker.AssetBase.Value, 1); } if (Manager.Kraken == null || Manager.Kraken.ServerTime.IsDefault) { return; } SManager.ServerTime = Manager.Kraken.ServerTime; }
private void Update_LabelStartControlPrice() { try { if (SManager == null) { return; } //InfoTicker BTCUSD = SManager.InfoTickers("BTCUSD"); InfoTicker BTCEUR = SManager.InfoTickers("XXBTZEUR");// "BTCEUR"); if (BTCEUR != null) { string fontAsk = "<font color=\"Black\">"; string fontBid = "<font color=\"Black\">"; if (BTCEUR.IsAskUp) { fontAsk = "<font color=\"DarkGreen\">"; } else if (BTCEUR.IsAskDown) { fontAsk = "<font color=\"DarkRed\">"; } if (BTCEUR.IsBidUp) { fontBid = "<font color=\"DarkGreen\">"; } else if (BTCEUR.IsBidDown) { fontBid = "<font color=\"DarkRed\">"; } LblStartControlAsk.Text = string.Format("{0}<b>{1:#,##,###,0.00}</b></font>", fontAsk, BTCEUR.Ask); LblStartControlBid.Text = string.Format("{0}<b>{1:#,##,###,0.00}</b></font>", fontBid, BTCEUR.Bid); } LblStartControlTime.Text = string.Format("* Server Timestamp: <b>{0}</b>", SManager.ServerTime.ToString("yyyy/MM/dd T hh:mm:ss.fff UTC")); UpdPnlMarketPrice.Update(); } catch (Exception ex) { ex.ToOutput(); } }