Skip to content

Commit 554b4ad

Browse files
docs
1 parent d2ec909 commit 554b4ad

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ ubwa.create_stream(channels=['trade', 'kline_1m'], markets=['btcusdt', 'bnbbtc',
5757
```
5858

5959
### And 4 more lines to print out the data:
60+
6061
```
6162
while True:
6263
oldest_data_from_stream_buffer = ubwa.pop_stream_data_from_stream_buffer()
@@ -65,6 +66,7 @@ while True:
6566
```
6667

6768
### Or with a [callback function](https://unicorn-binance-websocket-api.docs.lucit.tech/unicorn_binance_websocket_api.html?highlight=process_stream_data#unicorn_binance_websocket_api.manager.BinanceWebSocketApiManager.create_stream) just do:
69+
6870
```
6971
from unicorn_binance_websocket_api import BinanceWebSocketApiManager
7072
@@ -80,6 +82,7 @@ ubwa.create_stream(channels=['trade', 'kline_1m'],
8082
```
8183

8284
### Or await the webstream data in an asyncio task:
85+
8386
This is the recommended method for processing data from web streams.
8487

8588
```
@@ -113,6 +116,7 @@ with BinanceWebSocketApiManager(exchange='binance.com') as ubwa:
113116
Basically that's it, but there are more options.
114117

115118
### Convert received raw webstream data into well-formed Python dictionaries with [UnicornFy](https://www.lucit.tech/unicorn-fy.html):
119+
116120
```
117121
unicorn_fied_stream_data = UnicornFy.binance_com_websocket(oldest_data_from_stream_buffer)
118122
```
@@ -124,6 +128,7 @@ ubwa.create_stream(['trade'], ['btcusdt'], output="UnicornFy")
124128
```
125129

126130
### [Subscribe](https://unicorn-binance-websocket-api.docs.lucit.tech/unicorn_binance_websocket_api.html#unicorn_binance_websocket_api.manager.BinanceWebSocketApiManager.subscribe_to_stream) / [unsubscribe](https://unicorn-binance-websocket-api.docs.lucit.tech/unicorn_binance_websocket_api.html#unicorn_binance_websocket_api.manager.BinanceWebSocketApiManager.unsubscribe_from_stream) new markets and channels:
131+
127132
```
128133
markets = ['engbtc', 'zileth']
129134
channels = ['kline_5m', 'kline_15m', 'kline_30m', 'kline_1h', 'kline_12h', 'depth5']
@@ -137,6 +142,7 @@ ubwa.unsubscribe_from_stream(stream_id=stream_id, channels=channels)
137142

138143
## Send Requests to Binance WebSocket API
139144
### [Place orders](https://unicorn-binance-websocket-api.docs.lucit.tech/unicorn_binance_websocket_api.html#unicorn_binance_websocket_api.api.BinanceWebSocketApiApi.create_order), [cancel orders](https://unicorn-binance-websocket-api.docs.lucit.tech/unicorn_binance_websocket_api.html#unicorn_binance_websocket_api.api.BinanceWebSocketApiApi.cancel_order) or [send other requests](https://unicorn-binance-websocket-api.docs.lucit.tech/unicorn_binance_websocket_api.html#module-unicorn_binance_websocket_api.api) via WebSocket:
145+
140146
```
141147
from unicorn_binance_websocket_api import BinanceWebSocketApiManager
142148

0 commit comments

Comments
 (0)