public CryptoTradeForm() { InitializeComponent(); // Wire up events Crypto.UpdateOrdersEvent += Crypto_UpdateOrdersEvent; Crypto.UpdateTickerEvent += Crypto_UpdateTickerEvent; // Create Bid/Ask displays for @BTC and @XBT futures m_baBtc = new TextBidAsk(panelBtc, "@BTC:"); m_baXbt = new TextBidAsk(panelXbt, "@XBT:"); Crypto.InitializeExchanges(); LoadAlgos(); LoadStudies(); m_orderGridPanel = new TickerGridPanel(panelCrypto2, "Orders", Color.Gray, ZOrder.Columns); m_orderGridPanel.Initialize(); m_orderGridPanel.Grid.CellClick += OrderGrid_CellClick; m_gridPanels.Add(m_orderGridPanel); m_tradeGridPanel = new TickerGridPanel(panelCrypto3, "Trades", Color.Gray, ZTrade.Columns); m_tradeGridPanel.Initialize(); m_gridPanels.Add(m_tradeGridPanel); m_iq = PriceFeed.Instance; m_iq.UpdatePrices += M_iq_UpdatePrices; m_iq.SubscribePrices("@BTC#"); m_iq.SubscribePrices("@XBT#"); m_iq.SubscribePrices("XBTX.XO"); m_iq.SubscribePrices("BRTI.X"); m_iq.SubscribePrices("GXBT.XO"); Initialize(); m_updateTickerCount = 0; Task.Run(() => UpdateExchangeTickers()); Task.Run(() => UpdateBalances()); Task.Run(() => UpdateOrders()); }
public void Test() { m_priceFeed.SubscribePrices("@M6E#"); m_priceFeed.UpdatePrices += M_priceFeed_UpdatePrices; var denoms = new HashSet <string>(); foreach (var eid in m_api.ExchangeIds) { Console.WriteLine(eid); try { var symbols = m_api[eid].GetSymbols(); foreach (var s in symbols) { try { var gs = GlobalSymbol(eid, s); if (gs.EndsWith("-BTC")) { Console.WriteLine("{0,12} {1,10} {2,10}", eid, s, gs); } //Console.WriteLine("{0,12} {1,10} {2,10}", eid, s, gs); var split = gs.Split('-'); denoms.Add(split[0]); } catch (Exception ex) { Console.WriteLine("ERROR: {0}", ex.Message); } } } catch (Exception ex) { Console.WriteLine("{0} ERROR: {1}", eid, ex.Message); } Console.WriteLine(new string('-', 80)); } Console.WriteLine("\nUnique denominations:"); foreach (var d in denoms.OrderBy(x => x)) { Console.WriteLine(d); } }
static void SubscribeNikkeiYen(string mYY) { // Subscribe Nikkei/Yen m_updates.SetId("niy", "@NIY" + mYY); m_updates.SetId("nkd", "@NKD" + mYY); m_updates.SetId("jy", "@JY" + mYY); m_prices.SubscribePrices("@NIY" + mYY); m_prices.SubscribePrices("@NKD" + mYY); m_prices.SubscribePrices("@JY" + mYY); }