Esempio n. 1
0
 public BitmexSymbolOrderBook(string symbol, bool isTest = false) : this(symbol, defaultOrderBookOptions)
 {
     isTestnet           = isTest;
     _bitmexSocketClient = new BitmexSocketClient(new BitmexSocketClientOptions(isTest));
     InstrumentIndex     = _bitmexSocketClient.GetIndexAndTickForInstrument(symbol).Index;
     InstrumentTickSize  = _bitmexSocketClient.GetIndexAndTickForInstrument(symbol).TickSize;
     if (symbol == "XBTUSD")
     {
         InstrumentTickSize = 0.01m;
     }
 }
Esempio n. 2
0
 /// <summary>
 /// AttentioN! For price calculation at order book update you should use level id and and instrument index <see href=""/></see>
 /// example, XBTUSD has 88 index and tick size returned by api =0.5, but to calculate price at orderbookL2 update you should use 0.01. this value is hardcoded
 /// </summary>
 /// <param name="symbol"></param>
 /// <param name="options"></param>
 /// <param name="bitmexSocketClient"></param>
 public BitmexSymbolOrderBook(string symbol, BitmexSocketOrderBookOptions options, BitmexSocketClient bitmexSocketClient = null) : base(symbol, options)
 {
     isTestnet           = options.IsTestnet;
     _bitmexSocketClient = bitmexSocketClient ?? new BitmexSocketClient(new BitmexSocketClientOptions(options.IsTestnet));
     InstrumentIndex     = options.InstrumentIndex ?? _bitmexSocketClient.GetIndexAndTickForInstrument(symbol).Index;
     InstrumentTickSize  = options.TickSize.HasValue ? options.TickSize.Value : _bitmexSocketClient.GetIndexAndTickForInstrument(symbol).TickSize;
     if (symbol == "XBTUSD")
     {
         InstrumentTickSize = 0.01m;
     }
 }