KirillBelov/
WebSocketJLink
Installation Instructions
To install this paclet in your Wolfram Language environment,
evaluate this code:
PacletInstall["KirillBelov/WebSocketJLink"]
To load the code after installation, evaluate this code:
Needs["KirillBelov`WebSocketJLink`"]
Examples
Basic Examples (5)
Let's create a connection:
Let's see what came after a few seconds:
You can retrieve the latest received data:
Let's send a message and subscribe to another stream:
After that we will be able to receive data of another type:
Let's close the connection
Scope (10)
Custom serializer (3)
By default you can send to the server frames as a string, but you can use custom serialiser for frames:
Use this serializer
Extract data for ETHUSDT
And plot the price of the coin:
Close the connection:
Custom deserializer (2)
Also you can use custom deserializer:
Now the saved data is immediately in the form of an expression and not a string
Plot it:
Close connection
Event handler (5)
You can add custom event handler that will be process all received messages
First define a deserializer:
Let's create a separate variable to store the results of processing:
And the handler itself, which will not save unnecessary data on candles. After all, candles are completed once in a certain period, and the last candle is updated every few seconds:
Create a connection:
After several minutes you can plot the graphic with BTCUSDT candlestick:
Close connection
Publisher
Kirill Belov
Disclosures
Compatibility
Wolfram Language Version 13.0
External Links
Version History
- 1.0.1
– 06 November 2022
- 1.0.0
– 02 November 2022
MIT License
Paclet Source