@admin Any update on this issue?
B
baluslife
@baluslife
0
Reputation
2
Posts
2
Profile views
0
Followers
0
Following
Best posts made by baluslife
This user hasn't posted anything yet.
Latest posts made by baluslife
-
WebSocket Not returning any Tick
1)Created new app from "Market Feeds APIs FREE"
2)Used the following code fro gitHub (Socket Sample Code to get stock quotes Starts Here)
3) used (script = "nse_cm|2885", TASK = "mw"; )
Result: _WS.MessageReceived is always nullhelp me fix the code.
public static void test() { string Client_code = "xxxxx";// YOUR CLIENT CODE string Password = "xxxxx";// YOUR PAS SWORD string api_key = "xxxxx";// string JWTToken = ""; //optional string RefreshToken = ""; //optional SmartApi connect = new SmartApi(api_key, JWTToken, RefreshToken); OutputBaseClass obj = new OutputBaseClass(); //Login by client code and password obj = connect.GenerateSession(Client_code, Password); AngelToken sagr = obj.TokenResponse; //Get Token obj = connect.GenerateToken(); sagr = obj.TokenResponse; WebSocket _WS = new WebSocket(); var exitEvent = new ManualResetEvent(false); _WS.ConnectforStockQuote(sagr.feedToken, Client_code); if (_WS.IsConnected()) { string script = "nse_cm|2885", TASK = "mw"; // SCRIPT: nse_cm|2885, mcx_fo|222900 TASK: mw|sfi|dp _WS.RunScript(sagr.feedToken, Client_code, script, TASK); _WS.MessageReceived += WriteResult; // _WS.Close(true);// to stop and close socket connection } exitEvent.WaitOne(); } static void WriteResult(object sender, MessageEventArgs e) { Console.WriteLine("Tick Received"); Console.WriteLine("Tick Received : " + e.Message); }