Skip to content

Getting Started

Install

bash
pip install --extra-index-url https://<GEMFURY_TOKEN>@pypi.fury.io/alphaquantcapital/ aqc-trading-sdk

REPLACE <GEMFURY_TOKEN> WITH ACTUAL TOKEN PASSWORD. REQUEST VIG FOR IT, AND DON'T SHARE IT WITH ANYONE.

Import and Initialize

python
from aqc_trading_sdk import TradingClient

client = TradingClient(
    strategy_id="AQC-P1A2B3C4",
    base_url="https://engine.alpha-techlab.com"
)

Strategy ID

Strategy IDs route orders and data to the correct account and tag all activity for attribution.

PrefixAccount
AQC-PxxxxxxPaper (simulated)
AQC-LxxxxxxLive
AQC-FxxxxxxFund

The SDK sends this as the X-Strategy-Id header on every request. The engine infers the account (paper/live/fund) solely from the ID prefix — no extra configuration needed in strategy code.

Local Development

python
client = TradingClient(
    strategy_id="AQC-P1A2B3C4",
    base_url="http://localhost:8000"
)

Async Client

Use AsyncTradingClient inside asyncio loops:

python
import asyncio
from aqc_trading_sdk import AsyncTradingClient

async def main():
    client = AsyncTradingClient(strategy_id="AQC-P1A2B3C4")
    quote = await client.get_quote("SPY")
    print(quote)
    await client.close()

asyncio.run(main())

Connectivity Model

You do not need connect() / disconnect() / reconnection loops in strategy code.

  • the execution engine owns IBKR gateway connectivity
  • the SDK is request-oriented
  • if you want a startup check, use:
python
status = client.get_connection_status()
if not status["broker_ready"]:
    raise RuntimeError("Broker connection is not ready")