Indicators & Alerts
Write custom QW Script indicators (a Pine Script subset), see what they output, and get an email or Discord alert when a condition fires.
List indicators
/indicatorsBuilt-in studies (type, params with ranges and defaults) and your QW Script library (id, type qws:<id>, visibility). The MCP tools are list_indicators, get_indicator and save_indicator.
Create or update a script
/indicators/indicators/{id}QW Script is the trading terminal's Pine Script (v4 to v6 subset) with qw.* extensions for options flow and GEX. The script is compiled first: one with errors is not saved, and the errors come back with line and column. New scripts are private. You can update your own private scripts; published marketplace scripts are edited in the terminal.
namestringrequireddescriptionstringsourcestringrequiredcurl -X POST "https://quantwheel.com/api/v1/indicators" \
-H "Authorization: Bearer qw_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "RSI oversold",
"source": "//@version=5\nindicator(\"RSI oversold\")\nr = ta.rsi(close, 14)\nplot(r, \"RSI\")\nalertcondition(ta.crossunder(r, 30), \"Oversold\")"
}'{
"id": "smgx2k1a0b3f",
"type": "qws:smgx2k1a0b3f",
"name": "RSI oversold",
"kind": "indicator",
"overlay": false,
"inputs": [],
"warnings": [],
"created": true
}Alert targets
/indicators/{id}?symbol=SPY&timeframe=1hid is a built-in type such as rsi or a script id. With symbol and timeframe the study runs on recent candles and alertTargets lists what an alert can watch: series refs (close, histogram, line:<id>), guide levels, whether it draws buy / sell signals, and its event titles.
Indicator alerts
/indicator-alerts/indicator-alerts/indicator-alerts/{id}Alerts are evaluated every minute by the same engine as the trading terminal's chart alerts and delivered by email (default) and / or Discord. The condition is checked against the study's real outputs before the alert is saved. Up to 200 chart alerts per account. MCP: list_indicator_alerts, create_indicator_alert, delete_indicator_alert.
symbolstringrequiredtimeframestringrequiredindicatorstringrequiredparamsobjectconditionobjectrequiredtriggerstringoncebooleanemail / discordbooleancurl -X POST "https://quantwheel.com/api/v1/indicator-alerts" \
-H "Authorization: Bearer qw_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"symbol": "SPY",
"timeframe": "1h",
"indicator": "rsi",
"params": { "length": 14 },
"condition": { "kind": "value", "series": "line:rsi", "op": "crossing_up", "value": 30 }
}'{
"id": "ia_mgx2m0q0abcd",
"symbol": "SPY",
"timeframe": "1h",
"indicator": "rsi",
"label": "RSI 14",
"condition": { "kind": "value", "series": "line:rsi", "op": "crossing_up", "target": { "kind": "value", "value": 30 } },
"description": "RSI crossing up 30",
"trigger": "bar_close",
"once": false,
"active": true,
"email": true,
"discord": false,
"triggeredAt": null
}Conditions
| kind | Shape | Fires when |
|---|---|---|
value | series, op and value or targetSeries | The series crosses (crossing, crossing_up, crossing_down) or is above / below (greater_than, less_than) the number or the other series. |
signal | filter any | buy | sell | The study draws a buy or sell marker or strategy entry. |
event | title | A script alertcondition / qw.alert with that title fires. |