Skip to main content

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:

  1. Minted an anonymous trial API key (50 credits, no signup)
  2. Asked Claude to write a Python strategy from your prompt (streamed tokens)
  3. Trained an ML model on 28 days of real EURUSD 15-min OHLC data
  4. Deployed the trained model for live signal delivery
  5. 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 (default https://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

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

quantifyme-0.1.0.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

quantifyme-0.1.0-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file quantifyme-0.1.0.tar.gz.

File metadata

  • Download URL: quantifyme-0.1.0.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for quantifyme-0.1.0.tar.gz
Algorithm Hash digest
SHA256 70aa367d2f956fdbc125a6a5b82525c5dce6e420fbdce8a184eb2d3fbbdb90dd
MD5 d65cb34d369219fda82509e5520d3339
BLAKE2b-256 6562ceb4fba1dedde795512329dc7e5642e04798c8a015a240eaae9aeb304786

See more details on using hashes here.

File details

Details for the file quantifyme-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: quantifyme-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for quantifyme-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6394f7157d6810650a58604c5a523de2e63d3da71be75dcd7f953f9842d0864b
MD5 b5ded03703487b1015132888957e1667
BLAKE2b-256 fc3a23020b35bc9c4152960a7fa8cfb792f5db8eecc579c3dbaeab0ed63fec0a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page