Websockets and AutoIt
-
Recently Browsing 0 members
No registered users viewing this page.
-
Similar Content
-
By adityaparakh
Hello ,
I am trying to use Websockets in AutoIt.
It is to fetch live stock market prices , API is provided and documentation available for python language.
The link for the code snippet is :
https://symphonyfintech.com/xts-market-data-front-end-api-v2/#tag/Introduction
https://symphonyfintech.com/xts-market-data-front-end-api-v2/#tag/Instruments/paths/~1instruments~1subscription/post
https://github.com/symphonyfintech/xts-pythonclient-api-sdk
Second Link is to subscribe to a list of ExchangeInstruments.
Now I would like to get live stock ltp (LastTradedPrice) for a few stocks whose "ExchangeInstrumentID" I know.
I am able to use the WinHttp object to perform actions using simple codes like below :
I have the secretKey and appkey and can generate the needed token. And get the unique ExchangeInstrumentID.
Below code is just for example of how I am using WinHttp. Unrelated to socket part.
Global $InteractiveAPItoken = IniRead(@ScriptDir & "\Config.ini", "token", "InteractiveAPItoken", "NA") $baseurl = "https://brokerlink.com/interactive/" $functionurl = "orders" $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") $oHTTP.Open("POST", $baseurl & $functionurl, False) $oHTTP.SetRequestHeader("Content-Type", "application/json;charset=UTF-8") $oHTTP.SetRequestHeader("authorization", $InteractiveAPItoken) $pD = '{ "exchangeSegment": "NSEFO", "exchangeInstrumentID": ' & $exchangeInstrumentID & ', "productType": "' & $producttype & '", "orderType": "MARKET", "orderSide": "' & $orderside & '", "timeInForce": "DAY", "disclosedQuantity": 0, "orderQuantity": ' & $qty & ', "limitPrice": 0, "stopPrice": 0, "orderUniqueIdentifier": "' & $orderidentifier & '"}' $oHTTP.Send($pD) $oReceived = $oHTTP.ResponseText $oStatusCode = $oHTTP.Status
But am struggling to understand and use socket.
Would be of great help if you can have a look at the link mentioned above and help with the code sample for AutoIt.
To connect and listen to a socket.
Thanks a lot
-
By Glyph
Has anyone already worked on a WSS UDF yet? I'm interested in making a project involving WSS with the ASYNC autoit library like ratchetphp / Pawl in PHP. (using reactphp)
ASYNC is a must, and obviously WSS. the problem with some libraries i've worked with in PHP are mainly issues with handshakes like improper peer name validation (for multi level certs)
relevant links: https://tools.ietf.org/rfc/rfc6455.txt
https://github.com/ratchetphp/Pawl
/e i should note i'm not looking for hybrid workarounds, i want to do this in autoit alone. (no javascript)
-
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now