public void StartTicks(string instrumentToken) { _ticker.Connect(); uint[] tokens = new uint[] { 260105 }; _ticker.Subscribe(tokens); _ticker.SetMode(tokens, "full"); }
private void InitTicker() { ticker.OnTick += OnTick; ticker.OnReconnect += OnReconnect; ticker.OnNoReconnect += OnNoReconnect; ticker.OnError += OnError; ticker.OnClose += OnClose; ticker.OnConnect += OnConnect; ticker.OnOrderUpdate += OnOrderUpdate; ticker.EnableReconnect(Interval: 5, Retries: 50); ticker.Connect(); SubscribeToInstruments(); }
private static void initTicker() { ticker = new Ticker(MyAPIKey, MyUserId, MyPublicToken); ticker.OnTick += onTick; ticker.OnReconnect += onReconnect; ticker.OnNoReconnect += oNoReconnect; ticker.OnError += onError; ticker.OnClose += onClose; ticker.OnConnect += onConnect; ticker.EnableReconnect(Interval: 5, Retries: 50); ticker.Connect(); // Subscribing to NIFTY50 and setting mode to LTP ticker.Subscribe(Tokens: new string[] { "256265" }); ticker.SetMode(Tokens: new string[] { "256265" }, Mode: "ltp"); }
private static void initTicker() { ticker = new Ticker(MyAPIKey, MyAccessToken); ticker.OnTick += OnTick; ticker.OnReconnect += OnReconnect; ticker.OnNoReconnect += OnNoReconnect; ticker.OnError += OnError; ticker.OnClose += OnClose; ticker.OnConnect += OnConnect; ticker.OnOrderUpdate += OnOrderUpdate; ticker.EnableReconnect(Interval: 5, Retries: 50); ticker.Connect(); // Subscribing to Banknifty and setting mode to full ticker.Subscribe(Tokens: new UInt32[] { 260105 }); ticker.SetMode(Tokens: new UInt32[] { 260105 }, Mode: Constants.MODE_FULL); }
public Ticker InitializeTicker(string accessToken) { var ticker = new Ticker(_apiKey, accessToken); Message = _logger.WriteMessage(ConnectConstants.TICKER_INITIALIZED); ticker.OnTick += OnTick; ticker.OnConnect += OnConnect; ticker.OnReconnect += OnReconnect; ticker.OnNoReconnect += OnNoReconnect; ticker.OnError += OnError; ticker.OnClose += OnClose; ticker.OnOrderUpdate += OnOrderUpdate; ticker.EnableReconnect(Interval: 5, Retries: 50); ticker.Connect(); // Subscribing to NIFTY50 and setting mode to LTP ticker.Subscribe(Tokens: new UInt32[] { 256265 }); ticker.SetMode(Tokens: new UInt32[] { 256265 }, Mode: Constants.MODE_LTP); return(ticker); }
public void WebSocket() { try { ticker = new Ticker(tradeUser.ApiKey, tradeUser.AccessToken); // Add handlers to events ticker.OnTick += onTicker; // Engage reconnection mechanism and connect to ticker ticker.EnableReconnect(Interval: 5, Retries: 50); ticker.Connect(); // Subscribing to NIFTY50 and setting mode to LTP ticker.Subscribe(Tokens: new UInt32[] { 2113328 }); ticker.SetMode(Tokens: new UInt32[] { 2113328 }, Mode: Constants.MODE_LTP); //var ws = new WebSocket(''); //("wss://ws.kite.trade?api_key=xxx&access_token=xxxx"); } catch (Exception ex) { throw ex; } }