I want to get live prices of instruments (every 1-second tick) and clearly, using WebSocket streaming is the way to go. I am using Java and downloaded the JAR and got the IDE setup and am able to connect to Kite programmatically, execute orders and such but when I come to using WebSockets, am stumped. Here is what is happening, or rather not happening -
In Test.java, this is the code in line#128-130: ArrayList tokens = new ArrayList<>(); tokens.add(Long.parseLong("256265")); examples.tickerUsage(kiteConnect, tokens);
The output am seeing after a lot of debug is: [true]
I have gone through the code in Examples.java and the "true" is being printed out because of code in line#472 and line#473: boolean isConnected = tickerProvider.isConnectionOpen(); System.out.println(isConnected);
It seems that connection is established but am not able to see the output am expecting to see via tickerProvider.setOnTickerArrivalListener() which should print the last price, open interest, day high OI etc.
Am I missing something? Am I doing something wrong?