Python SDK for QuantifyMe — describe a trading strategy in English, deploy it live in one call.
Project description
quantifyme
Python SDK for QuantifyMe — describe a trading strategy in plain English, deploy it live in one call. Powered by Claude and an ML backtest engine.
pip install quantifyme
60 seconds, zero to live signal
from quantifyme import QuantifyMe
qm = QuantifyMe() # anonymous trial key auto-minted on first call
result = qm.one_shot(
"Buy EURUSD when RSI drops below 30, sell when RSI rises above 70",
on_progress=lambda e: print(f"[{e.pct:>3}%] {e.stage}: {e.msg}"),
)
print("Live signals →", result.live_url)
That's it. The SDK just did:
- Minted an anonymous trial API key (50 credits, no signup)
- Asked Claude to write a Python strategy from your prompt (streamed tokens)
- Trained an ML model on 28 days of real EURUSD 15-min OHLC data
- Deployed the trained model for live signal delivery
- Returned a dashboard URL you can open to see live predictions
Before / after
Raw HTTP (what you'd have written without the SDK):
import requests, json
resp = requests.post(
"https://api.quantifyme.ai/api/v1/one_shot",
headers={"X-API-Key": "qm_..."},
json={"prompt": "Buy EURUSD when RSI < 30", "deliver_to": {"webhook": True}},
stream=True, timeout=600,
)
event = None
for line in resp.iter_lines(decode_unicode=True):
if not line: continue
if line.startswith("event:"):
event = line.split(":", 1)[1].strip()
elif line.startswith("data:"):
data = json.loads(line.split(":", 1)[1])
if event == "step":
print(f"[{data['pct']:>3}%] {data['stage']}: {data.get('msg', '')}")
elif event == "done":
print("LIVE:", data["live_url"])
break
elif event == "error":
raise RuntimeError(data["error"])
Same thing, with the SDK:
from quantifyme import QuantifyMe
qm = QuantifyMe()
print(qm.one_shot("Buy EURUSD when RSI < 30", on_progress=print).live_url)
Authentication
Three options, checked in order:
qm = QuantifyMe(api_key="qm_...") # explicit
qm = QuantifyMe.from_env() # reads QUANTIFYME_API_KEY
qm = QuantifyMe() # auto-mints anonymous trial key
Environment variables:
QUANTIFYME_API_KEY— your personal key (get one at https://quantifyme.ai)QUANTIFYME_BASE_URL— override API base (defaulthttps://api.quantifyme.ai)
Granular control
The SDK exposes the full REST API, not just one_shot:
# Generate code only (no training / no deploy)
code = qm.generate(
features="RSI 14, Bollinger Bands",
signals="Buy on oversold bounce",
model="Random Forest",
risk="0.5% stop loss",
).code
# Train + wait for completion
job = qm.train(code=code, model_name="RSI Scalp")
stats = job.wait() # blocks until done
print(f"Test profit factor: {stats.test_stats.profit_factor:.2f}")
print(f"Test win rate: {stats.test_stats.win_rate:.1%}")
# List + deploy
for m in qm.models.list():
print(f"{m.name}: {m.test_stats.total_return:+.2%} on {m.test_stats.n} trades")
qm.deploy("Model 1", channels=["webhook"], webhook_url="https://yours.example.com/hook")
# Live signals
for live in qm.deployed.list():
print(f"Live: {live.model} → {live.channels}")
Discovery (no auth required)
qm.indicators.schema() # all built-in indicators + parameters
qm.presets.list() # curated strategy templates + chip presets
Error handling
from quantifyme import (
AuthError, RateLimitError, InsufficientCreditsError,
StreamError, TrainingError,
)
try:
qm.one_shot("...")
except InsufficientCreditsError:
print("Out of credits — top up at https://quantifyme.ai/billing")
except RateLimitError:
print("Slow down")
except AuthError:
print("Bad API key")
except TrainingError as e:
print(f"Training failed: {e}")
Context manager
with QuantifyMe() as qm:
qm.one_shot("Buy on MACD bullish crossover")
# connection cleaned up
What's behind this
QuantifyMe runs 24/7 prediction daemons on your behalf:
- Every 15 minutes, each deployed model receives a fresh EURUSD candle
- Runs
model.predict_proba()against the latest bar - Fires signals via webhook POST / Telegram DM when confidence clears your threshold
- All models, credits, and live slots are isolated per-API-key (trial or paid)
Free tier: 1 live model (auto-swap on new deploy), 50 credits. Pro tier ($3.30/mo): unlimited models + signals + 30K API tokens/month.
Related packages
quantifyme-mcp— Claude MCP server exposing the same API to Claude Code / Desktop as callable tools. Install:pipx install quantifyme-mcp && claude mcp add quantifyme quantifyme-mcp.
Links
- Website: https://quantifyme.ai
- OpenAPI spec: https://api.quantifyme.ai/openapi.json
- Source: https://github.com/malcolm1232/HFTAgent
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file quantifyme-0.2.0.tar.gz.
File metadata
- Download URL: quantifyme-0.2.0.tar.gz
- Upload date:
- Size: 10.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a2c23771a6f6dcc12bbb1a6a86f309ae3d2bfb7aabfd21988bbb7205798a7c1c
|
|
| MD5 |
9c9ee2e6c6bc1024d88a965758143bdf
|
|
| BLAKE2b-256 |
14d3c89538ff9f210091118cef1dae36c8869a5eaef87823c45bff9e9e796fbb
|
File details
Details for the file quantifyme-0.2.0-py3-none-any.whl.
File metadata
- Download URL: quantifyme-0.2.0-py3-none-any.whl
- Upload date:
- Size: 13.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
99a937fc45d17477a44d050beaa95bdd71e15cf691b77a760d93c5a4269d83b3
|
|
| MD5 |
418a0f66d70771dae6b8a83a01da7110
|
|
| BLAKE2b-256 |
21f5e5e91892898862339009744143e998c46247532408c5e4a22af42d5675fc
|