Geometer markets · Order Guard

Sits between your bot and your broker and checks every order before it leaves.

A local process on 127.0.0.1. Your bot holds a scoped local key; the guard holds your daily broker session and refuses any order that crosses your limits.

What it does, and what stays outside it

What Order Guard handles

  • Enforces global, per-account, per-strategy and per-symbol stop switches that only you at the terminal can re-arm.
  • Fails flat: any limit you have not configured refuses new risk by default.
  • Keeps order flow under the 10-orders-per-second exchange threshold per segment with a short queue and headroom.
  • Checks order size, notional cap, price collar around last traded price, allowed symbols and allowed products.
  • Enforces daily loss limits, trade caps, losing-streak pauses, margin checks and options worst-case loss budgets.
  • Previews brokerage, STT, exchange fees, SEBI fee, stamp duty and GST before sending, and halts new openings when a broker reply is unknown.

What it does not do

  • Cannot block orders placed directly in the broker's app or from another API key (it polls the order book, flags them as outside orders and counts them against your limits).
  • Cannot catch a mistake that stays inside every limit you configured.
  • Does not protect a machine where an attacker already has full root control.

In practice

Drop-in Kite Connect (change one line) or uniform order API

Keep your existing Python bot and change only the base URL, or connect any language or AI agent through the uniform order API and MCP server.

Full reference in the docs
Drop-in Kite Connect (change one line) or uniform order API
from kiteconnect import KiteConnect

# Point your existing bot at the local guard instead of Kite directly.
# The bot uses a scoped guard key; the guard holds your real broker session.
kite = KiteConnect(
    api_key="gm_live_local_bot_key",
    root="http://127.0.0.1:7878/kite",
)

order_id = kite.place_order(
    variety=kite.VARIETY_REGULAR,
    exchange=kite.EXCHANGE_NSE,
    tradingsymbol="EXAMPLE_ETF",
    transaction_type=kite.TRANSACTION_TYPE_BUY,
    quantity=100,
    product=kite.PRODUCT_MIS,
    order_type=kite.ORDER_TYPE_LIMIT,
    price=100.00,
)

Limits to know upfront

  • Outside orders are flagged, not blocked. The guard reads the broker's order book while the market is open, counts outside orders against your daily limits, and can trigger the stop switch, but it cannot intercept another program talking directly to the broker.

  • Limits protect boundaries, not ideas. A valid order inside your configured quantity, price band and daily loss cap is allowed through.

  • Daily broker login stays yours. Sessions log out after market close and require your fresh login before the next morning.

Try it with pretend orders first

Install it, answer four questions, and test your limits with pretend orders before you go near a live broker.