Blockhouse
    • Home
    • Quickstart
    • Tutorial Videos
      • SDK Walkthrough
      • Algorithm Products Walkthrough
      • Connecting with Lime
      • Connecting with Interactive Brokers
  • Core Product
    • Platform Architecture Overview
    • How to Send Your Data
    • Visualizing Trade Insights: Pre & Post-Trade Dashboards
    • Analyzing Trades with TCA Reports
    • Smart Order Routing & Execution Algorithms
  • Asset Classes
    • Fixed Income
      • Data Schemas & Execution Formats
      • Standards and Conventions
      • Venues and Datasets
    • Equities
      • Data Schemas & Execution Formats
      • Standards and Conventions
      • Venues and Datasets
    • Crypto
      • Data Schemas & Execution Formats
      • Standards and Conventions
      • Venues and Datasets
  • API Reference
    • Execution API
      • Introduction & Installation
      • Managing Orders
      • Full SDK Example & Notes
  • FIX API
    • About FIX API
Powered by GitBook
On this page
  • 3.1 Scheduling a Trade
  • 3.2 Updating a Trade Order
  • 3.3 Cancelling a Trade Order
  1. API Reference
  2. Execution API

Managing Orders

The TradeClient supports three order management commands:

Scheduling a Trade Updating a Trade Cancelling a Trade


3.1 Scheduling a Trade

Method: submit_trade(payload: dict) -> dict

Schedules a trade order for future execution.

Parameters

Parameter
Type
Description

symbol

str

Trading symbol (e.g., "AAPL")

quantity

float

Number of shares

side

str

"buy" or "sell"

time_in_minutes

int

Time delay for execution (minutes)

Example Usage

from blockhouse import TradeClient
client = TradeClient("your_api_key")

payload = {
    "symbol": "AAPL",
    "quantity": 100,
    "side": "buy",
    "time_in_minutes": 30
}
response = client.submit_trade(payload)
print(response)

3.2 Updating a Trade Order

Method: update_trade(payload: dict) -> dict

Updates an existing scheduled order.

Example Usage

from blockhouse import TradeClient
client = TradeClient("your_api_key")

payload = {
    "order_id": "12345",
    "symbol": "AAPL",
    "quantity": 150,
    "side": "buy",
    "time_in_minutes": 45
}
response = client.update_trade(payload)
print(response)

3.3 Cancelling a Trade Order

Method: cancel_trade(order_id: str) -> dict

Cancels a scheduled trade order.

Example Usage

from blockhouse import TradeClient
client = TradeClient("your_api_key")

response = client.cancel_trade("12345")
print(response)
PreviousIntroduction & InstallationNextFull SDK Example & Notes

Last updated 2 months ago