KirillBelov/WebSocketLink
(1.0.1)
current version: 1.0.2 »
Examples
Basic Examples (7)
Import the package:
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 (15)
Custom serializer (5)
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 (4)
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 (6)
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
External Links
Version History
-
1.0.2
– 20 March 2024
-
1.0.1
– 14 January 2023
-
1.0.0
– 13 January 2023
MIT License
Paclet Source
See Also