{"openapi":"3.1.0","info":{"title":"Trade Setup & R:R Planner API","version":"1.0.0","description":"Live trade-planning analytics built on the geometry of a setup, the numbers a trader checks before pulling the trigger, computed on demand from the entry, stop and target you pass in — no key, no cache, nothing stored. The plan endpoint turns an entry, stop-loss and target into the risk and reward per unit, the reward-to-risk ratio and the break-even win rate — the minimum win rate that makes the trade profitable — and, if you supply an account size and a risk percent, the position size, risk amount and reward amount. The targets endpoint projects target prices at chosen R-multiples of the stop distance, so you can ladder out at 1R, 2R and 3R. The expectancy endpoint turns a reward-to-risk ratio and a win rate into the expected value per trade in R and the profit factor, telling you whether an edge is positive. This is a trade-geometry planner, fundamentally different from account-based position sizers, forward Monte-Carlo simulators and backward trade-journal analyzers: it reasons from the entry, stop and target. Works for any market — forex, stocks, crypto or futures — and for long or short. Computed locally and deterministically, so it is instant and private. Ideal for trade journals, risk checklists, broker tools and trading dashboards. Live, nothing stored. 3 compute endpoints. For Kelly position sizing use a trading-risk API; for a full outcome distribution use a strategy simulator.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/tradesetup-api","description":"oanor gateway"}],"tags":[{"name":"Setup"},{"name":"Meta"}],"components":{"securitySchemes":{"oanorKey":{"type":"apiKey","in":"header","name":"x-oanor-key","description":"Get your key at https://www.oanor.com/developer/keys"}}},"security":[{"oanorKey":[]}],"paths":{"/v1/expectancy":{"get":{"operationId":"get_v1_expectancy","tags":["Setup"],"summary":"Expected value & profit factor","description":"","parameters":[{"name":"reward_risk_ratio","in":"query","required":false,"description":"Reward-to-risk ratio","schema":{"type":"string"},"example":"3"},{"name":"win_rate","in":"query","required":true,"description":"Win rate (fraction or percent)","schema":{"type":"string"},"example":"40"},{"name":"entry","in":"query","required":false,"description":"Entry (alternative to RR)","schema":{"type":"string"},"example":"100"},{"name":"stop","in":"query","required":false,"description":"Stop (alternative to RR)","schema":{"type":"string"},"example":"98"},{"name":"target","in":"query","required":false,"description":"Target (alternative to RR)","schema":{"type":"string"},"example":"106"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"edge":"positive","note":"Expectancy in R = win_rate x RR - (1 - win_rate). Above the break-even win rate the edge is positive.","source":"TRADE-SETUP","expectancy_r":0.6,"win_rate_pct":40,"profit_factor":2,"reward_risk_ratio":3,"breakeven_win_rate_pct":25,"expectancy_pct_of_risk":60},"meta":{"timestamp":"2026-06-11T07:49:06.925Z","request_id":"9f89b72f-f43f-44f9-84bd-af91da181e48"},"status":"ok","message":"Expectancy computed","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/plan":{"get":{"operationId":"get_v1_plan","tags":["Setup"],"summary":"Risk/reward, RR ratio, break-even + position size","description":"","parameters":[{"name":"entry","in":"query","required":true,"description":"Entry price","schema":{"type":"string"},"example":"100"},{"name":"stop","in":"query","required":true,"description":"Stop-loss price","schema":{"type":"string"},"example":"98"},{"name":"target","in":"query","required":true,"description":"Target price","schema":{"type":"string"},"example":"106"},{"name":"side","in":"query","required":false,"description":"long or short (default long)","schema":{"type":"string"},"example":"long"},{"name":"account","in":"query","required":false,"description":"Account size for position sizing","schema":{"type":"string"},"example":"10000"},{"name":"risk_pct","in":"query","required":false,"description":"Risk percent of account (e.g. 1 = 1%)","schema":{"type":"string"},"example":"1"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"reward_risk_ratio = reward / risk; break-even win rate = 1 / (1 + RR). Give account & risk_pct for position sizing.","side":"long","stop":98,"entry":100,"source":"TRADE-SETUP","target":106,"account":10000,"risk_pct":1,"risk_amount":100,"position_size":50,"reward_amount":300,"risk_per_unit":2,"reward_per_unit":6,"reward_risk_ratio":3,"risk_pct_from_entry":2,"reward_pct_from_entry":6,"breakeven_win_rate_pct":25},"meta":{"timestamp":"2026-06-11T07:49:07.024Z","request_id":"c46c324d-4a64-48c9-a955-f3d7527b3fd2"},"status":"ok","message":"Trade plan computed","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/targets":{"get":{"operationId":"get_v1_targets","tags":["Setup"],"summary":"Target prices at R-multiples of the stop","description":"","parameters":[{"name":"entry","in":"query","required":true,"description":"Entry price","schema":{"type":"string"},"example":"100"},{"name":"stop","in":"query","required":true,"description":"Stop-loss price","schema":{"type":"string"},"example":"98"},{"name":"side","in":"query","required":false,"description":"long or short (default long)","schema":{"type":"string"},"example":"long"},{"name":"r_multiples","in":"query","required":false,"description":"R-multiples, comma-separated","schema":{"type":"string"},"example":"1,2,3"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Target at R = entry +/- R x risk (per side). Each R-multiple is one unit of the stop distance.","side":"long","stop":98,"entry":100,"source":"TRADE-SETUP","targets":[{"r_multiple":1,"target_price":102,"reward_per_unit":2,"gain_pct_from_entry":2},{"r_multiple":2,"target_price":104,"reward_per_unit":4,"gain_pct_from_entry":4},{"r_multiple":3,"target_price":106,"reward_per_unit":6,"gain_pct_from_entry":6}],"risk_per_unit":2},"meta":{"timestamp":"2026-06-11T07:49:07.099Z","request_id":"f3a9cd32-54c8-41f5-b851-c8957585cbba"},"status":"ok","message":"Targets computed","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/meta":{"get":{"operationId":"get_v1_meta","tags":["Meta"],"summary":"Spec","description":"","parameters":[],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"entry, stop and target are prices; side is long or short. account & risk_pct optional for sizing; win_rate accepts a fraction or percent.","source":"Computed in-process from caller-supplied entry/stop/target prices (no upstream)","service":"tradesetup-api","endpoints":{"GET /v1/meta":"This document.","GET /v1/plan":"Risk/reward, RR ratio, break-even win rate + position size (entry=100&stop=98&target=106&side=long&account=10000&risk_pct=1).","GET /v1/targets":"Target prices at R-multiples of the stop (entry=100&stop=98&side=long&r_multiples=1,2,3).","GET /v1/expectancy":"Expected value & profit factor (reward_risk_ratio=3&win_rate=40, or entry/stop/target+win_rate)."},"description":"Live trade-planning analytics built on the geometry of a setup. The plan endpoint turns an entry, stop and target into risk/reward per unit, the reward-to-risk ratio and the break-even win rate, plus position sizing from an account and risk percent; the targets endpoint projects target prices at chosen R-multiples; the expectancy endpoint turns a reward-to-risk ratio and win rate into expected value per trade and profit factor. A trade-geometry planner, distinct from account-based position sizers, forward simulators and backward trade analyzers. Computed locally, nothing stored.","upstream_status":"ok"},"meta":{"timestamp":"2026-06-11T07:49:07.180Z","request_id":"2ded5979-7621-4be3-9885-ffdb03451c7a"},"status":"ok","message":"Meta","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}}},"x-oanor-pricing":[{"slug":"free","name":"Free","price_cents_month":0,"monthly_call_quota":4450,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":740,"monthly_call_quota":89500,"rps_limit":6,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":2130,"monthly_call_quota":462000,"rps_limit":18,"hard_limit":true},{"slug":"business","name":"Business","price_cents_month":4750,"monthly_call_quota":2860000,"rps_limit":45,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/tradesetup-api"}