{"openapi":"3.1.0","info":{"title":"Trade Stats API","version":"1.0.0","description":"Live trading-performance analytics that traders run on a list of realised trade results, computed on demand from the profit-and-loss series you pass in — no key, no cache, nothing stored. The analyze endpoint returns the full performance scorecard: number of wins and losses, win rate, gross profit and loss, profit factor, expectancy, average win and loss, payoff ratio, and the largest win and loss — the numbers a trader pulls from a trade journal to judge a strategy. The equity endpoint builds the equity curve from a starting balance and returns the running balance after every trade, the peak, the maximum drawdown in money and percent, and the total return. The streaks endpoint returns the longest winning and losing runs and the current streak. This is a backward-looking trade-journal analyzer — it scores actual results, which is fundamentally different from forward Monte-Carlo simulators and position sizers that work from assumptions. Each value you pass is one closed trade's profit (positive) or loss (negative). Works for any market or strategy — stocks, forex, crypto or futures. Computed locally and deterministically, so it is instant and private. Ideal for trade journals, strategy dashboards, back-test scorecards and broker reports. Live, nothing stored. 3 compute endpoints. For forward simulation of an edge use a strategy-simulator API; for position sizing use a trading-risk API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/tradestats-api","description":"oanor gateway"}],"tags":[{"name":"Trades"},{"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/analyze":{"get":{"operationId":"get_v1_analyze","tags":["Trades"],"summary":"Full performance scorecard","description":"","parameters":[{"name":"trades","in":"query","required":true,"description":"Closed-trade P&L, comma-separated (profit +, loss -)","schema":{"type":"string"},"example":"120,-50,80,-30,200,-90,45,-60,150"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Profit factor = gross profit / gross loss. Expectancy = average P&L per trade. Payoff ratio = average win / average loss.","wins":5,"losses":4,"source":"TRADE-STATS","trades":9,"breakeven":0,"total_pnl":365,"expectancy":40.55555556,"gross_loss":-230,"average_win":119,"largest_win":200,"average_loss":-57.5,"gross_profit":595,"largest_loss":-90,"payoff_ratio":2.069565,"win_rate_pct":55.5556,"average_trade":40.55555556,"loss_rate_pct":44.4444,"profit_factor":2.586957},"meta":{"timestamp":"2026-06-11T07:49:17.252Z","request_id":"2fc8aa87-a091-487b-95dc-2ecf1576215e"},"status":"ok","message":"Trades analyzed","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/equity":{"get":{"operationId":"get_v1_equity","tags":["Trades"],"summary":"Equity curve + drawdown","description":"","parameters":[{"name":"trades","in":"query","required":true,"description":"Closed-trade P&L, comma-separated","schema":{"type":"string"},"example":"120,-50,80,-30,200,-90,45,-60,150"},{"name":"starting_balance","in":"query","required":false,"description":"Starting balance (default 10000)","schema":{"type":"string"},"example":"10000"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"Equity curve includes the starting balance as the first point. Max drawdown is the largest peak-to-trough decline.","source":"TRADE-STATS","trades":9,"total_pnl":365,"return_pct":3.65,"equity_curve":[10000,10120,10070,10150,10120,10320,10230,10275,10215,10365],"max_drawdown":105,"peak_balance":10365,"final_balance":10365,"max_drawdown_pct":1.017442,"starting_balance":10000},"meta":{"timestamp":"2026-06-11T07:49:17.362Z","request_id":"8e9a8ca2-6b49-4bf5-a733-6dd7381cac52"},"status":"ok","message":"Equity curve 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/streaks":{"get":{"operationId":"get_v1_streaks","tags":["Trades"],"summary":"Longest winning/losing runs + current streak","description":"","parameters":[{"name":"trades","in":"query","required":true,"description":"Closed-trade P&L, comma-separated","schema":{"type":"string"},"example":"120,-50,80,-30,200,-90,45,-60,150"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"note":"A streak is a run of consecutive wins or losses; a breakeven trade (0) resets the streak.","source":"TRADE-STATS","trades":9,"losing_runs":4,"winning_runs":5,"current_streak":{"type":"winning","length":1},"longest_win_streak":1,"longest_loss_streak":1},"meta":{"timestamp":"2026-06-11T07:49:17.473Z","request_id":"5f55e9a9-c8bf-46f1-b5b1-eb530d697076"},"status":"ok","message":"Streaks 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":"trades = the P&L of each closed trade, comma-separated; profit positive, loss negative (trades=120,-50,80,-30,...). starting_balance optional for the equity endpoint.","source":"Computed in-process from caller-supplied trade P&L results (no upstream)","service":"tradestats-api","endpoints":{"GET /v1/meta":"This document.","GET /v1/equity":"Equity curve + drawdown (trades=...&starting_balance=10000).","GET /v1/analyze":"Full performance scorecard (trades=120,-50,80,-30,200,-90,45,-60,150).","GET /v1/streaks":"Longest winning/losing runs and current streak (trades=...)."},"description":"Live trading-performance analytics computed on demand from a list of realised trade results. The analyze endpoint returns the full scorecard (win rate, profit factor, expectancy, average win/loss, payoff ratio, largest win/loss); the equity endpoint builds the equity curve from a starting balance with running balance, drawdown series, max drawdown and total return; the streaks endpoint returns the longest winning and losing runs and the current streak. A backward-looking trade-journal analyzer that scores actual results, distinct from forward Monte-Carlo simulators and position sizers. Computed locally, nothing stored.","upstream_status":"ok"},"meta":{"timestamp":"2026-06-11T07:49:17.549Z","request_id":"a455431c-2c8d-495d-ad8d-55bef4a8aad2"},"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":4400,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":680,"monthly_call_quota":89000,"rps_limit":6,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":1940,"monthly_call_quota":460000,"rps_limit":18,"hard_limit":true},{"slug":"business","name":"Business","price_cents_month":4400,"monthly_call_quota":2840000,"rps_limit":45,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/tradestats-api"}