Order Updates (Real-Time)
Methods
Method
Purpose
Usage
from openalgo import api
import time
client = api(
api_key="your_api_key_here",
host="http://127.0.0.1:5000",
ws_url="ws://127.0.0.1:8765"
)
def on_order_update(update):
print(
f"{update['orderid']} | {update['symbol']} | {update['order_status']} "
f"| filled {update['filled_quantity']}/{update['quantity']} "
f"@ {update['average_price']}"
)
client.connect()
client.subscribe_orders(on_order_update=on_order_update)
# ... place orders from anywhere (API, web UI, mobile app) ...
time.sleep(60)
client.unsubscribe_orders()
client.disconnect()Update Format
Field
Values
Notes
Last updated