API · Trading
Trading API
The Trading API powers external-signal strategies: a strategy you drive with your own signals instead of a node graph. You create the strategy, then open and manage positions on your paper account via the API. Trades resolve through Trigr's paper engine (with the same slippage, funding, and fee frictions as a normal backtest), building a live track record you can list and monetize in the marketplace. All trading calls are free.
Create a strategy
POST/api/v1/strategies
Creates an API-driven, non-backtestable strategy owned by you. It starts running immediately (its paper track is live).
curl -X POST https://trigr.xyz/api/v1/strategies \
-H "Authorization: Bearer $TRIGR_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "My MACD bot",
"primaryAsset": "BTC",
"description": "Discretionary MACD crossovers"
}'{ "strategy": { "id": "strat_…", "type": "EXTERNAL_SIGNAL", "isApiDriven": true, "canBacktest": false, … } }Open a position
POST/api/v1/positions
Opens a position on one of your external-signal strategies. size is USD margin; tp / sl are optional. Stacking is allowed: you can hold multiple positions on the same asset.
curl -X POST https://trigr.xyz/api/v1/positions \
-H "Authorization: Bearer $TRIGR_KEY" \
-H "Content-Type: application/json" \
-d '{
"strategyId": "strat_…",
"market": "BTC",
"side": "long",
"size": 250,
"tp": 72000,
"sl": 66000
}'{ "position": { "id": "pos_…", "status": "open", "side": "long", … } }Modify TP / SL
PATCH/api/v1/positions/{id}
Adjust the take-profit or stop-loss of an open position. Pass a number to set a level, or null to clear it. Omitting a field leaves it unchanged.
curl -X PATCH https://trigr.xyz/api/v1/positions/pos_… \
-H "Authorization: Bearer $TRIGR_KEY" \
-H "Content-Type: application/json" \
-d '{ "sl": 67000, "tp": null }'Close a position
POST/api/v1/positions/{id}/close
Manually closes an open position at the live reference price, using the same exit frictions (slippage, round-trip fees, funding) as an automatic TP/SL close, so manual and automatic closes are consistent.
curl -X POST https://trigr.xyz/api/v1/positions/pos_…/close \
-H "Authorization: Bearer $TRIGR_KEY"List positions
GET/api/v1/positions
Lists your positions. Filter with ?status=open|closed and/or ?strategyId=….
curl "https://trigr.xyz/api/v1/positions?status=open" \
-H "Authorization: Bearer $TRIGR_KEY"Strategy live performance
GET/api/v1/strategies/{id}/perf
Returns the live paper track (equity curve + summary) for one of your external-signal strategies: the same live-perf surface the marketplace shows. 404 if the strategy isn't yours.
Notes
- All trading calls are free: they cost no credits.
- External-signal strategies cannot be backtested (
canBacktest=falseis enforced); they show live performance only. - Everything is siloed to your account; you can only act on your own strategies and positions.