Open-source · Python · FastAPI · MIT
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.
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%)"
]
}
Call the API in a loop — no ML pipeline to build or maintain.
Surface structured signals alongside raw price data.
Get a working signal endpoint in under 5 minutes.
Clone and install
git clone https://github.com/your-username/PIaaS
cd PIaaS && pip install -r requirements.txt
Start the server
uvicorn main:app --reload
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]}'
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"]))
| Field | Type | Description |
|---|---|---|
action | BUY · SELL · HOLD | Recommended decision |
confidence | 0.0 – 1.0 | Model confidence in the prediction |
expected_value | float | P(up) − P(down) |
risk_score | 0.0 – 1.0 | Volatility-based risk estimate |
signal_strength | 0.0 – 1.0 | Distance from neutral (0 = no signal, 1 = strong) |
reasoning_signals | list[str] | Human-readable explanation of the decision |
Ready to add trading signals to your project?
No setup required beyond pip install. Works in under 60 seconds.