Open-source · Python · FastAPI · MIT

Trading Signal API
for Python Developers

Send a price series, get a structured BUY / SELL / HOLD signal — with confidence score, risk score, and explainable reasoning. No ML expertise required.

Works with any price series — crypto, stocks, commodities, synthetic data.

View on GitHub Run locally ↓
Deterministic — same input, same output Zero network calls at inference No external data dependency Runs fully local

Input → Output

Request

curl -X POST http://localhost:8000/v1/predict \
  -H "X-API-Key: dev-key-1234" \
  -H "Content-Type: application/json" \
  -d '{"prices": [100, 101.5, 99.8,
                  102.3, 103.1, 101.9]}'

Response

{
  "action": "HOLD",
  "confidence": 0.51,
  "expected_value": -0.01,
  "risk_score": 0.18,
  "signal_strength": 0.01,
  "reasoning_signals": [
    "positive momentum (+1.90%)",
    "price above MA5 (+0.55%)"
  ]
}

How it works

prices[ ] feature extraction logistic regression signal + reasoning

Why developers use this

Algorithmic trading bots

Call the API in a loop — no ML pipeline to build or maintain.

Financial dashboards

Surface structured signals alongside raw price data.

Strategy prototyping

Get a working signal endpoint in under 5 minutes.

Run locally in 60 seconds

1

Clone and install

git clone https://github.com/your-username/PIaaS
cd PIaaS && pip install -r requirements.txt
2

Start the server

uvicorn main:app --reload
3

Call the API — default key works immediately, no config needed

curl -X POST http://localhost:8000/v1/predict \
  -H "X-API-Key: dev-key-1234" \
  -H "Content-Type: application/json" \
  -d '{"prices": [100, 101.5, 99.8, 102.3, 103.1, 101.9]}'
4

Or use the Python SDK

from sdk.client import PIaaSClient

client = PIaaSClient("http://localhost:8000", api_key="dev-key-1234")
signal = client.predict([100, 101.5, 99.8, 102.3, 103.1, 101.9])

if signal["action"] == "BUY" and signal["confidence"] > 0.65:
    place_order(size=compute_position(signal["risk_score"]))

Response fields

FieldTypeDescription
actionBUY · SELL · HOLDRecommended decision
confidence0.0 – 1.0Model confidence in the prediction
expected_valuefloatP(up) − P(down)
risk_score0.0 – 1.0Volatility-based risk estimate
signal_strength0.0 – 1.0Distance from neutral (0 = no signal, 1 = strong)
reasoning_signalslist[str]Human-readable explanation of the decision

Why this is different

deterministic Identical inputs always produce identical outputs — no stochastic inference
local-first Zero network calls at inference time — runs entirely in your process
transparent Logistic regression, not a black box — every signal is traceable to a feature
self-contained No data broker, no API key, no rate limit from a third party

What this is not

Ready to add trading signals to your project?

No setup required beyond pip install. Works in under 60 seconds.

View on GitHub Run locally ↑