Skip to main content

AlgoGTT SDK

Official Python SDK and CLI for the AlgoGTT Algorithmic Trading Platform.

Provides direct programmatic access to:

  • Broker Connection & Management: Check live connection status, available cash margin, and connect AngelOne (SmartAPI TOTP), Dhan (Personal Access Token), or OpenAlgo bridges headlessly.
  • Trading Engine Lifecycle: Start / stop live or paper trading sessions, configure session duration (market_close, 1_hour, 1_trade), and stream live engine logs.
  • Real-Time Chart Overlays: Access the exact same live signals, markers, SL/TSL, targets, and Smart Money Concept (SMC) Fair Value Gaps displayed on the web terminal.
  • Position & Order Management: Query open broker positions, live orders, dynamic order shifting, and emergency square-offs.
  • Option Strips & Greeks: Retrieve option chains, PCR, and implied volatilities.
  • Daily EOD Reports: Generate and export end-of-day trading summaries in JSON or HTML.

Installation

pip install --upgrade algogtt

Authentication

1. Get Your API Key

  1. Log in to your AlgoGTT account at https://www.algogtt.in.
  2. Go to Profile / Settings (https://www.algogtt.in/profile).
  3. Under AlgoGTT / STS API Key, click Copy (starts with STS_...).

2. Configure CLI (Run Once)

Use the built-in login command to save your credentials persistently:

algogtt login --api-key STS_YOUR_API_KEY_HERE

Stores credentials securely in ~/.algogtt/credentials. Once logged in, you can run any algogtt CLI command directly without typing --api-key.

Alternatively, set an environment variable:

export ALGOGTT_API_KEY="STS_YOUR_API_KEY_HERE"

Don't Know Python? Use Excel or AmiBroker (No Code Required)

If you don't use Python and want to integrate with your existing charting and spreadsheet tools:


CLI Usage

The algogtt command-line utility provides instant control over the engine directly from your terminal:

# Unpack complete example scripts into an ./algogtt-examples/ folder:
algogtt init

# 1. Start an automated trading session
algogtt session start --symbol CRUDEOIL --strategy swing_breakout --scope market_close
# Add --live to route real orders to your connected broker:
algogtt session start --symbol CRUDEOIL --strategy swing_breakout --live

# 2. Check engine status & running PID
algogtt session status

# 3. Stream real-time execution logs
algogtt session logs

# 4. Stop the active session
algogtt session stop

# 5. Fetch real-time chart overlays & trade markers
algogtt overlays --symbol CRUDEOIL --strategy swing_breakout --timeframe 1m

# 6. List active broker positions & P&L
algogtt positions

# 7. List live orders
algogtt orders

# 8. Fetch daily EOD summary
algogtt eod --date 2026-09-11

# 9. Inspect contract specs, daily circuit limits (DPL) & technical health meter
algogtt symbol CRUDEOIL
algogtt symbol NATGASMINI --circuit
algogtt symbol NIFTY --health

# 10. List Delta Exchange India perpetual futures & RWAs
algogtt crypto symbols
algogtt crypto symbols --category RWA

Python SDK Reference

from algogtt import AlgoGTTClient

# Automatically reads ALGOGTT_API_KEY from environment, or pass api_key="..."
client = AlgoGTTClient()

# ----------------------------------------------------
# 1. Trading Engine Lifecycle
# ----------------------------------------------------
# Start session (Paper Mode)
client.engine.start(
    symbol="CRUDEOIL",
    strategy="swing_breakout",
    session_duration="market_close",  # 'market_close' | '1_hour' | '1_trade'
    dry_run=True,                     # Set False for real live broker orders
)

# Inspect status & PID
status = client.engine.status(symbol="CRUDEOIL")
print("Engine Status:", status.get("is_running"), "PID:", status.get("pid"))

# Stream latest logs
for line in client.engine.logs():
    print(line)

# Stop session
client.engine.stop()

# ----------------------------------------------------
# 2. Real-Time Chart Overlays & SMC Signals
# ----------------------------------------------------
overlays = client.live.get_overlays(
    symbol="CRUDEOIL",
    strategy="swing_breakout",
    timeframe="1m"
)
print("Total Net P&L:", overlays.get("total_pnl"))

# Parsed trades
trades = client.live.get_trades(symbol="CRUDEOIL")
for t in trades:
    print(t["option_symbol"], "Entry:", t.get("entry_price"), "SL:", t.get("current_sl"))

# ----------------------------------------------------
# 3. Positions & Orders
# ----------------------------------------------------
positions = client.trading.get_positions()
orders = client.trading.get_orders()

# Dynamic Trailing Stop Loss / Order Shift
# client.trading.shift_order(order_id="12345", symbol="CRUDEOIL", stop_loss=315.0)

# Square Off
# client.trading.square_off()

# ----------------------------------------------------
# 4. Broker Connection & Management
# ----------------------------------------------------
# Check broker status & cash balance
broker_st = client.broker.status()
print(f"Connected: {broker_st.get('connected')} | Broker: {broker_st.get('broker')} | Funds: ₹{broker_st.get('funds')}")

# Programmatic connect (AngelOne TOTP / Dhan / OpenAlgo)
# client.broker.connect_angelone(api_key="...", client_id="...", password="...", totp_secret="...")
# client.broker.connect_dhan(client_id="...", access_token="...")
# client.broker.connect_openalgo(host="http://127.0.0.1:5000", api_key="...")

# ----------------------------------------------------
# 5. Symbol Intelligence, Circuit Limits & Health Meter
# ----------------------------------------------------
# Fetch complete contract specifications, DPL circuit limits, and technical health meter
sym_info = client.symbols.get_details("CRUDEOIL")
specs = client.symbols.get_specs("CRUDEOIL")
print(f"Lot Size: {specs.get('lot_size')} | Tick: ₹{specs.get('tick_size')} | Margin: ₹{specs.get('approx_margin'):,.2f}")

# Daily Circuit Limits (DPL)
circuits = client.symbols.get_circuit_limits("CRUDEOIL")
print(f"Upper Circuit: ₹{circuits.get('initial_upper')} | Lower: ₹{circuits.get('initial_lower')}")

# Multi-Indicator Technical Health Meter (EMA 21, MACD, Stoch, ROC, RSI, Bollinger Bands)
health = client.symbols.get_health_meter("NIFTY")
print(f"Health Rating: {health.get('rating')} ({health.get('bullish_percentage')}% Bullish)")

# ----------------------------------------------------
# 6. Delta Exchange Crypto & RWA Perpetuals
# ----------------------------------------------------
# List 230+ perpetual contracts from Delta Exchange India
all_cryptos = client.crypto.get_symbols()
rwas = client.crypto.get_symbols(category="RWA")
print(f"Total Perpetuals: {len(all_cryptos)} | RWAs: {len(rwas)}")

# ----------------------------------------------------
# 7. Partner & Affiliate Program Automation
# ----------------------------------------------------
# Fetch overview: referral code, conversions, commissions, pending balance
stats = client.partner.get_stats()
print(f"Code: {stats.get('referral_code')} | Pending Payout: ₹{stats.get('pending_payout')}")

# List referred signups & subscription statuses
refs = client.partner.get_referrals(page=1, page_size=20)
for r in refs.get("referrals", []):
    print(r.get("username"), "Status:", r.get("plan_status"), "Commission: ₹", r.get("commission_earned"))

# List historical disbursements & debit note adjustments
payouts = client.partner.get_payouts(page=1)
for p in payouts.get("payouts", []):
    print(p.get("created_at"), p.get("payout_type"), f"₹{p.get('amount')}", p.get("status"))

# Generate tracked campaign deep-link & HTML embed button
link_info = client.partner.generate_link(
    target_path="/strategies/marketplace",
    campaign="youtube_promo"
)
print("Tracking URL:", link_info.get("referral_url"))
print("Embed Button HTML:", link_info.get("embed_button_html"))

# Update banking / UPI settlement destination
client.partner.update_payout_settings(
    payout_method="upi",
    upi_id="partner@oksbi",
    beneficiary_name="Partner Trade Desk",
    pan_number="ABCDE1234F"
)

Examples & Client Integrations

See the examples/ directory (or run algogtt init to unpack locally):

  • options_buyer_watchdog.py: Real-time options terminal HUD monitoring open positions, theta decay (>35m), post-brokerage net PnL, and daily drawdown kill-switch.
  • traders_diary_template.py: Automated daily trader's diary for option buyers with R:R, win rate, and drawdown analysis.
  • algogtt_option_buyer.afl: AmiBroker AFL with VWAP + ATR expansion breakout, dynamic ATM/ITM strike selector, anti-theta filter, and watchlist exploration.
  • login_and_auth.py: Authentication test, credential verification, and connectivity troubleshooting.
  • broker_connection.py: Check broker status, margin funds, connect AngelOne (TOTP), Dhan (PAT), OpenAlgo, or disconnect sessions.
  • partner_automation.py: Manage affiliate referrals, track 30-day cooling payouts, generate campaign deep-links, and update UPI/bank details.
  • live_engine_control.py: Start, monitor, and stop live engine sessions programmatically.
  • fetch_live_overlays.py: Fetch real-time chart overlays, dynamic SL/TSL, profit targets, and audit logs.
  • parse_signals.py: Load candlestick data with strategy indicators into Pandas DataFrames.
  • parse_trades.js: Native Node.js & React Native / Mobile fetch integration.
  • algogtt_trades.vba: Microsoft Excel 1-click VBA macro for importing trades and logs.
  • algogtt_signals.afl: AmiBroker AFL formula for chart plotting and automated broker order execution.

Mobile & Multi-Platform Support

AlgoGTT uses an API-First Architecture. The Web Terminal (/terminal), Android App, iOS React Native App, CLI, and external bots all consume the same authenticated REST & SSE endpoints. Any backend enhancements immediately reflect across all interfaces.

Metadata

Release files for algogtt 1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for algogtt 1.3.0
File Size Uploaded Provenance Actions
algogtt-1.3.0.tar.gz 66.4 kB Without provenance Details for algogtt-1.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for algogtt 1.3.0
File Interpreter ABI Platform Actions
algogtt-1.3.0-py3-none-any.whl Python 3 none any Details for algogtt-1.3.0-py3-none-any.whl

Total release size: 131.3 kB

Release files / algogtt-1.3.0.tar.gz

Download URL algogtt-1.3.0.tar.gz
Size 66.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9b01ca5d7160429819a0525aade33efd274e762fad00b676dbd7bee383821093
BLAKE2b-256 checksum
How to use checksums
a293ff1ecf122bfc3b88bdef2bcad143faf9be52b35bfd3cb880915afd0f73b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Release files / algogtt-1.3.0-py3-none-any.whl

Download URL algogtt-1.3.0-py3-none-any.whl
Size 64.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
685b0bb9c60000d4aeb4d2dba31ff76ed0a0cdbd25ff430ffb008616f74d4883
BLAKE2b-256 checksum
How to use checksums
27989873f36d1d508e3c3bd9559d4924d054ab4618f940e5b185ebff0bc8808f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Security for algogtt 1.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.3.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page