Metadata-Version: 2.4
Name: algoproven
Version: 0.2.0
Summary: The prop-firm rule runtime for futures bots — ask before every trade: can this break my prop account?
Author: AlgoProven
License: MIT
Project-URL: Homepage, https://algoproven.com
Project-URL: Documentation, https://app.algoproven.com/api/docs
Keywords: prop-firm,futures,trading,risk,topstep,apex,rule-gate,drawdown
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# algoproven

The prop-firm **rule runtime** for futures bots. Execution tools send trades — AlgoProven decides whether the next trade is **allowed under your exact prop-firm rules**. Ask before every order: *can this break my prop account?*

Pure Python stdlib, no dependencies.

## Install

```bash
pip install algoproven        # (publishing to PyPI soon)
# from source: cd sdk && pip install -e .
```

## Use

```python
from algoproven import RuleGate

gate = RuleGate()  # -> https://app.algoproven.com

v = gate.check(firm="topstep_50k", symbol="ES", qty=2, stop_ticks=12, room=1000)
print(v["decision"], "-", v["reason"])
# ALLOW - Risk $300 is within $1,000 of room - $700 left after.

# one-liner go/no-go inside your bot's order path:
if not gate.allowed(firm="topstep_50k", symbol="ES", qty=5, stop_ticks=40, room=1000):
    return  # REDUCE or BLOCK — skip the trade

gate.firms()   # -> available presets
```

## Verdicts

| decision | meaning |
|---|---|
| `ALLOW`  | risk fits the room — take it |
| `REDUCE` | too big — `max_safe_qty` tells you the largest safe size |
| `BLOCK`  | no safe size — tighten the stop or skip |

Each verdict returns `{decision, reason, max_safe_qty, proposed_risk, room, distance_to_breach}`.

## Inputs

- `firm` — preset key (`topstep_50k`, `apex_50k`, `ffn_50k`; see `gate.firms()`)
- `symbol` — `ES / MES / NQ / MNQ / MGC / MCL / M6E`
- `qty`, `stop_ticks` — the proposed trade; OR pass `open_risk` (the $ you'd lose if stopped)
- `room` — $ left before breach today (daily-loss room or live distance-to-breach). Defaults to the firm's binding line.

## Notes

v1 is **stateless** — it computes on the values you pass, holds no credentials, places no orders. Live account-state binding (real-time distance-to-breach, PayoutLock, multi-account) ships with the AlgoProven cockpit. Rules change weekly; confirm against your firm's official page.

Not affiliated with any prop firm. Not financial advice.
