# Trading analysis workspace

> Current status reviewed September 29, 2026. See [the release index](README.md) for shipped versus planned features, network, wallet signing and deployment boundaries. Older dated experiments below are retained as history.

Markets and community trading channels show OHLCV candles for 5m, 15m, 1h, 4h and 1d from `/api/orb/trade/market`, which reads Perpl's perpetual candle endpoint through a short server cache. Charts refresh according to their configured cadence and can be refreshed manually; they are not a tick stream. A token with no listed perpetual has no chart — that is a normal outcome, not an error. Alongside the candles the chart shows the venue's mark, oracle and funding figures for that market, so the price on the screen is the same number the desk quotes.

Tools: candlestick/line toggle, zoom and pan, SMA 20, EMA 50 (SMA seed), volume in the market's collateral, Wilder RSI 14 with 30/70 guides, horizontal price levels, two-point trend lines, undo and chart expansion. Indicators warm up only when enough candles exist. Drawings are limited to 50 and saved locally by token symbol and interval; they are not shared or synced between devices.

The position planner calculates quantity, position value and reward/risk from user-entered entry, stop, target and dollar risk for long or short scenarios. It is a calculator: it never submits an order. Execution, leverage and native stop-loss / take-profit triggers live in the perpetual desk. Fees, slippage and gaps are excluded.

Verification: `scripts/test-chart-analysis.ts` covers candle validation, indicator reference values, insufficient history, long/short arithmetic and invalid inputs. `work/test-chart-ui.cjs` exercises drawings, persistence, intervals, indicators, expansion, the five locales (en, pt-BR, es, fr, zh) and mobile width. `scripts/test-trade-rpc.mjs` checks native RPC through the built Next API.

Charts use TradingView Lightweight Charts under Apache-2.0, with its attribution logo and a visible TradingView link. Market data comes from Perpl's public testnet API. This workspace is part of the published Orb Web3 testnet; this documentation does not authorize a Git push.
