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
  1. API Reference
  2. Execution API

Full SDK Example & Notes

from blockhouse import TradeClient

client = TradeClient("your_api_key")

# Schedule a Trade
trade_payload = {
    "symbol": "AAPL",
    "quantity": 100,
    "side": "buy",
    "time_in_minutes": 30
}
trade_response = client.submit_trade(trade_payload)
print(trade_response)

# Update the Trade
update_payload = {
    "order_id": trade_response["order_id"],
    "symbol": "AAPL",
    "quantity": 150,
    "side": "buy",
    "time_in_minutes": 45
}
update_response = client.update_trade(update_payload)
print(update_response)

# Cancel the Trade
cancel_response = client.cancel_trade(trade_response["order_id"])
print(cancel_response)

Notes

  • The SDK automatically validates inputs.

  • Orders are executed via SOR for optimized execution across venues.

  • Metrics include fill rate, slippage, spread fees, and venue allocations.

PreviousManaging OrdersNextAbout FIX API

Last updated 2 months ago