changed samples
This commit is contained in:
1 parent
317f17d7da
commit
ce9880a9b1
15 files changed
+272
-39
No files matched your search
@@ -1,7 +1,13 @@
|
||||
import json
|
||||
import websocket
|
||||
json_payload = {'jsonrpc': 2, 'method': 'delete_order', 'params': {'order_id': 541002}, 'id': 1}
|
||||
json_string = json.dumps(json_payload)
|
||||
json_string = {
|
||||
"jsonrpc": 2,
|
||||
"method": "delete_order",
|
||||
"params": {
|
||||
"order_id": 541002
|
||||
},
|
||||
"id": 1
|
||||
}
|
||||
ws_url = "ws://localhost:8080"
|
||||
# Define a callback function to handle received messages
|
||||
def on_message(ws, message):
|
||||
|
||||
@@ -1,7 +1,26 @@
|
||||
import json
|
||||
import websocket
|
||||
json_payload = {'price': 1646.8, 'quantity': 1, 'order_type': 'cover', 'side': 'buy', 'account': 'main', 'user': 'bts', 'exchange_securty_name': 'ETH-31MAR23', 'venue': 'deribit', 'custom': {'hedge_ticks': 2, 'cancel_on_external_hedge_cancel': True, 'cancel_hedges_on_cancel': True, 'detach_hedges': False}}
|
||||
json_string = json.dumps(json_payload)
|
||||
json_string = {
|
||||
"jsonrpc": 2,
|
||||
"method": "enter_order",
|
||||
"params": {
|
||||
"price": 1646.8,
|
||||
"quantity": 1,
|
||||
"order_type": "cover",
|
||||
"side": "buy",
|
||||
"account": "main",
|
||||
"user": "bts",
|
||||
"exchange_securty_name": "ETH-31MAR23",
|
||||
"venue": "deribit",
|
||||
"custom": {
|
||||
"hedge_ticks": 2,
|
||||
"cancel_on_external_hedge_cancel": true,
|
||||
"cancel_hedges_on_cancel": true,
|
||||
"detach_hedges": false
|
||||
}
|
||||
},
|
||||
"id": 1
|
||||
}
|
||||
ws_url = "ws://localhost:8080"
|
||||
# Define a callback function to handle received messages
|
||||
def on_message(ws, message):
|
||||
|
||||
@@ -1,7 +1,23 @@
|
||||
import json
|
||||
import websocket
|
||||
json_payload = {'price': 1646.8, 'quantity': 1, 'order_type': 'iceberg', 'side': 'buy', 'account': 'main', 'user': 'bts', 'exchange_securty_name': 'ETH-31MAR23', 'venue': 'deribit', 'custom': {'showquanity': 5}}
|
||||
json_string = json.dumps(json_payload)
|
||||
json_string = {
|
||||
"jsonrpc": 2,
|
||||
"method": "enter_order",
|
||||
"params": {
|
||||
"price": 1646.8,
|
||||
"quantity": 1,
|
||||
"order_type": "iceberg",
|
||||
"side": "buy",
|
||||
"account": "main",
|
||||
"user": "bts",
|
||||
"exchange_securty_name": "ETH-31MAR23",
|
||||
"venue": "deribit",
|
||||
"custom": {
|
||||
"showquanity": 5
|
||||
}
|
||||
},
|
||||
"id": 1
|
||||
}
|
||||
ws_url = "ws://localhost:8080"
|
||||
# Define a callback function to handle received messages
|
||||
def on_message(ws, message):
|
||||
|
||||
@@ -1,7 +1,21 @@
|
||||
import json
|
||||
import websocket
|
||||
json_payload = {'price': 1646.8, 'quantity': 1, 'order_type': 'limit', 'side': 'buy', 'account': 'main', 'user': 'bts', 'exchange_securty_name': 'ETH-31MAR23', 'venue': 'deribit', 'custom': {}}
|
||||
json_string = json.dumps(json_payload)
|
||||
json_string = {
|
||||
"jsonrpc": 2,
|
||||
"method": "enter_order",
|
||||
"params": {
|
||||
"price": 1646.8,
|
||||
"quantity": 1,
|
||||
"order_type": "limit",
|
||||
"side": "buy",
|
||||
"account": "main",
|
||||
"user": "bts",
|
||||
"exchange_securty_name": "ETH-31MAR23",
|
||||
"venue": "deribit",
|
||||
"custom": {}
|
||||
},
|
||||
"id": 1
|
||||
}
|
||||
ws_url = "ws://localhost:8080"
|
||||
# Define a callback function to handle received messages
|
||||
def on_message(ws, message):
|
||||
|
||||
@@ -10,9 +10,24 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 1,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"Defaulting to user installation because normal site-packages is not writeable\n",
|
||||
"Requirement already satisfied: websocket in /home/arham/.local/lib/python3.10/site-packages (0.2.1)\n",
|
||||
"Requirement already satisfied: greenlet in /home/arham/.local/lib/python3.10/site-packages (from websocket) (2.0.2)\n",
|
||||
"Requirement already satisfied: gevent in /home/arham/.local/lib/python3.10/site-packages (from websocket) (22.10.2)\n",
|
||||
"Requirement already satisfied: zope.event in /home/arham/.local/lib/python3.10/site-packages (from gevent->websocket) (4.6)\n",
|
||||
"Requirement already satisfied: setuptools in /usr/lib/python3/dist-packages (from gevent->websocket) (59.6.0)\n",
|
||||
"Requirement already satisfied: zope.interface in /home/arham/.local/lib/python3.10/site-packages (from gevent->websocket) (6.0)\n",
|
||||
"Note: you may need to restart the kernel to use updated packages.\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"%pip install websocket"
|
||||
]
|
||||
@@ -27,7 +42,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 2,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@@ -53,7 +68,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 16,
|
||||
"execution_count": 3,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@@ -107,7 +122,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 17,
|
||||
"execution_count": 4,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@@ -138,7 +153,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 18,
|
||||
"execution_count": 5,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@@ -181,7 +196,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 19,
|
||||
"execution_count": 6,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@@ -200,7 +215,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 20,
|
||||
"execution_count": 7,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@@ -220,7 +235,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 21,
|
||||
"execution_count": 8,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@@ -239,7 +254,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 22,
|
||||
"execution_count": 9,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
@@ -258,7 +273,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 24,
|
||||
"execution_count": 10,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
||||
@@ -1,7 +1,25 @@
|
||||
import json
|
||||
import websocket
|
||||
json_payload = {'jsonrpc': 2, 'method': 'subscribe', 'params': {'subscription_id': 1, 'type': 'books', 'filter': {'symbol': ['ETH'], 'expiration': ['2023/04/28'], 'venue': ['deribit']}}, 'id': 1}
|
||||
json_string = json.dumps(json_payload)
|
||||
json_string = {
|
||||
"jsonrpc": 2,
|
||||
"method": "subscribe",
|
||||
"params": {
|
||||
"subscription_id": 1,
|
||||
"type": "books",
|
||||
"filter": {
|
||||
"symbol": [
|
||||
"ETH"
|
||||
],
|
||||
"expiration": [
|
||||
"2023/04/28"
|
||||
],
|
||||
"venue": [
|
||||
"deribit"
|
||||
]
|
||||
}
|
||||
},
|
||||
"id": 1
|
||||
}
|
||||
ws_url = "ws://localhost:8080"
|
||||
message_count = [0]
|
||||
# Define a callback function to handle received messages
|
||||
|
||||
@@ -1,7 +1,25 @@
|
||||
import json
|
||||
import websocket
|
||||
json_payload = {'jsonrpc': 2, 'method': 'subscribe', 'params': {'subscription_id': 1, 'type': 'fills', 'filter': {'symbol': ['ETH'], 'expiration': ['2023/04/28'], 'venue': ['deribit']}}, 'id': 1}
|
||||
json_string = json.dumps(json_payload)
|
||||
json_string = {
|
||||
"jsonrpc": 2,
|
||||
"method": "subscribe",
|
||||
"params": {
|
||||
"subscription_id": 1,
|
||||
"type": "fills",
|
||||
"filter": {
|
||||
"symbol": [
|
||||
"ETH"
|
||||
],
|
||||
"expiration": [
|
||||
"2023/04/28"
|
||||
],
|
||||
"venue": [
|
||||
"deribit"
|
||||
]
|
||||
}
|
||||
},
|
||||
"id": 1
|
||||
}
|
||||
ws_url = "ws://localhost:8080"
|
||||
message_count = [0]
|
||||
# Define a callback function to handle received messages
|
||||
|
||||
@@ -1,7 +1,25 @@
|
||||
import json
|
||||
import websocket
|
||||
json_payload = {'jsonrpc': 2, 'method': 'subscribe', 'params': {'subscription_id': 1, 'type': 'orders', 'filter': {'symbol': ['ETH'], 'expiration': ['2023/04/28'], 'venue': ['deribit']}}, 'id': 1}
|
||||
json_string = json.dumps(json_payload)
|
||||
json_string = {
|
||||
"jsonrpc": 2,
|
||||
"method": "subscribe",
|
||||
"params": {
|
||||
"subscription_id": 1,
|
||||
"type": "orders",
|
||||
"filter": {
|
||||
"symbol": [
|
||||
"ETH"
|
||||
],
|
||||
"expiration": [
|
||||
"2023/04/28"
|
||||
],
|
||||
"venue": [
|
||||
"deribit"
|
||||
]
|
||||
}
|
||||
},
|
||||
"id": 1
|
||||
}
|
||||
ws_url = "ws://localhost:8080"
|
||||
message_count = [0]
|
||||
# Define a callback function to handle received messages
|
||||
|
||||
@@ -1,7 +1,25 @@
|
||||
import json
|
||||
import websocket
|
||||
json_payload = {'jsonrpc': 2, 'method': 'subscribe', 'params': {'subscription_id': 1, 'type': 'price_stats', 'filter': {'symbol': ['ETH'], 'expiration': ['2023/04/28'], 'venue': ['deribit']}}, 'id': 1}
|
||||
json_string = json.dumps(json_payload)
|
||||
json_string = {
|
||||
"jsonrpc": 2,
|
||||
"method": "subscribe",
|
||||
"params": {
|
||||
"subscription_id": 1,
|
||||
"type": "price_stats",
|
||||
"filter": {
|
||||
"symbol": [
|
||||
"ETH"
|
||||
],
|
||||
"expiration": [
|
||||
"2023/04/28"
|
||||
],
|
||||
"venue": [
|
||||
"deribit"
|
||||
]
|
||||
}
|
||||
},
|
||||
"id": 1
|
||||
}
|
||||
ws_url = "ws://localhost:8080"
|
||||
message_count = [0]
|
||||
# Define a callback function to handle received messages
|
||||
|
||||
@@ -1,7 +1,25 @@
|
||||
import json
|
||||
import websocket
|
||||
json_payload = {'jsonrpc': 2, 'method': 'subscribe', 'params': {'subscription_id': 1, 'type': 'price_tickets', 'filter': {'symbol': ['ETH'], 'expiration': ['2023/04/28'], 'venue': ['deribit']}}, 'id': 1}
|
||||
json_string = json.dumps(json_payload)
|
||||
json_string = {
|
||||
"jsonrpc": 2,
|
||||
"method": "subscribe",
|
||||
"params": {
|
||||
"subscription_id": 1,
|
||||
"type": "price_tickets",
|
||||
"filter": {
|
||||
"symbol": [
|
||||
"ETH"
|
||||
],
|
||||
"expiration": [
|
||||
"2023/04/28"
|
||||
],
|
||||
"venue": [
|
||||
"deribit"
|
||||
]
|
||||
}
|
||||
},
|
||||
"id": 1
|
||||
}
|
||||
ws_url = "ws://localhost:8080"
|
||||
message_count = [0]
|
||||
# Define a callback function to handle received messages
|
||||
|
||||
@@ -1,7 +1,25 @@
|
||||
import json
|
||||
import websocket
|
||||
json_payload = {'jsonrpc': 2, 'method': 'subscribe', 'params': {'subscription_id': 1, 'type': 'securities', 'filter': {'symbol': ['ETH'], 'expiration': ['2023/04/28'], 'venue': ['deribit']}}, 'id': 1}
|
||||
json_string = json.dumps(json_payload)
|
||||
json_string = {
|
||||
"jsonrpc": 2,
|
||||
"method": "subscribe",
|
||||
"params": {
|
||||
"subscription_id": 1,
|
||||
"type": "securities",
|
||||
"filter": {
|
||||
"symbol": [
|
||||
"ETH"
|
||||
],
|
||||
"expiration": [
|
||||
"2023/04/28"
|
||||
],
|
||||
"venue": [
|
||||
"deribit"
|
||||
]
|
||||
}
|
||||
},
|
||||
"id": 1
|
||||
}
|
||||
ws_url = "ws://localhost:8080"
|
||||
message_count = [0]
|
||||
# Define a callback function to handle received messages
|
||||
|
||||
@@ -1,7 +1,25 @@
|
||||
import json
|
||||
import websocket
|
||||
json_payload = {'jsonrpc': 2, 'method': 'subscribe', 'params': {'subscription_id': 1, 'type': 'trades', 'filter': {'symbol': ['ETH'], 'expiration': ['2023/04/28'], 'venue': ['deribit']}}, 'id': 1}
|
||||
json_string = json.dumps(json_payload)
|
||||
json_string = {
|
||||
"jsonrpc": 2,
|
||||
"method": "subscribe",
|
||||
"params": {
|
||||
"subscription_id": 1,
|
||||
"type": "trades",
|
||||
"filter": {
|
||||
"symbol": [
|
||||
"ETH"
|
||||
],
|
||||
"expiration": [
|
||||
"2023/04/28"
|
||||
],
|
||||
"venue": [
|
||||
"deribit"
|
||||
]
|
||||
}
|
||||
},
|
||||
"id": 1
|
||||
}
|
||||
ws_url = "ws://localhost:8080"
|
||||
message_count = [0]
|
||||
# Define a callback function to handle received messages
|
||||
|
||||
@@ -1,7 +1,22 @@
|
||||
import json
|
||||
import websocket
|
||||
json_payload = {'jsonrpc': 2, 'method': 'update_order', 'params': {'order_id': 538001, 'price': 1641.8, 'quantity': 2, 'order_type': {'hedge_ticks': 2, 'cancel_on_external_hedge_cancel': True, 'cancel_hedges_on_cancel': True, 'detach_hedges': False}, 'custom': 'cover'}, 'id': 1}
|
||||
json_string = json.dumps(json_payload)
|
||||
json_string = {
|
||||
"jsonrpc": 2,
|
||||
"method": "update_order",
|
||||
"params": {
|
||||
"order_id": 538001,
|
||||
"price": 1641.8,
|
||||
"quantity": 2,
|
||||
"order_type": {
|
||||
"hedge_ticks": 2,
|
||||
"cancel_on_external_hedge_cancel": true,
|
||||
"cancel_hedges_on_cancel": true,
|
||||
"detach_hedges": false
|
||||
},
|
||||
"custom": "cover"
|
||||
},
|
||||
"id": 1
|
||||
}
|
||||
ws_url = "ws://localhost:8080"
|
||||
# Define a callback function to handle received messages
|
||||
def on_message(ws, message):
|
||||
|
||||
@@ -1,7 +1,19 @@
|
||||
import json
|
||||
import websocket
|
||||
json_payload = {'jsonrpc': 2, 'method': 'update_order', 'params': {'order_id': 538001, 'price': 1641.8, 'quantity': 2, 'order_type': {'showquanity': 5}, 'custom': 'iceberg'}, 'id': 1}
|
||||
json_string = json.dumps(json_payload)
|
||||
json_string = {
|
||||
"jsonrpc": 2,
|
||||
"method": "update_order",
|
||||
"params": {
|
||||
"order_id": 538001,
|
||||
"price": 1641.8,
|
||||
"quantity": 2,
|
||||
"order_type": {
|
||||
"showquanity": 5
|
||||
},
|
||||
"custom": "iceberg"
|
||||
},
|
||||
"id": 1
|
||||
}
|
||||
ws_url = "ws://localhost:8080"
|
||||
# Define a callback function to handle received messages
|
||||
def on_message(ws, message):
|
||||
|
||||
@@ -1,7 +1,17 @@
|
||||
import json
|
||||
import websocket
|
||||
json_payload = {'jsonrpc': 2, 'method': 'update_order', 'params': {'order_id': 538001, 'price': 1641.8, 'quantity': 2, 'order_type': {}, 'custom': 'limit'}, 'id': 1}
|
||||
json_string = json.dumps(json_payload)
|
||||
json_string = {
|
||||
"jsonrpc": 2,
|
||||
"method": "update_order",
|
||||
"params": {
|
||||
"order_id": 538001,
|
||||
"price": 1641.8,
|
||||
"quantity": 2,
|
||||
"order_type": {},
|
||||
"custom": "limit"
|
||||
},
|
||||
"id": 1
|
||||
}
|
||||
ws_url = "ws://localhost:8080"
|
||||
# Define a callback function to handle received messages
|
||||
def on_message(ws, message):
|
||||
|
||||
Reference in new issue
Block a user