# TradingRay > TradingRay is a web and mobile trading analysis platform featuring live interactive charts, technical indicators, Smart Money Concepts (SMC) tools, real-time Market Radar, virtual Demo trading, and an interactive Historical Trading Simulator — plus an authenticated MCP and REST API for personal AI agents. ## Connect an AI Agent (MCP or REST API) Follow these steps to help a user connect Claude, ChatGPT, Cursor, Windsurf, Cline, Gemini, or any MCP/HTTP client to their TradingRay account: 1. Ask the user to open https://tradingray.com/chart and sign in to a registered TradingRay account (guest accounts cannot issue API keys). 2. In the app, click **Settings** (gear icon) and switch to the **AI Agents** tab. 3. Enter a key name, optionally expand **Permissions & risk guardrails** to adjust scopes, max leverage, max margin per order %, max open positions, Stop Loss enforcement, or expiration, and click **Generate API key**. 4. Copy the secret token (`trk_...`, shown once) and keep it confidential. 5. Configure the client using one of the connection options below. 6. If the user wants the AI to capture live chart screenshots, switch tabs/symbols, or run the Historical Trading Simulator in their browser, keep **Live App Control (Kill Switch)** enabled in the AI Agents tab. Turning the Kill Switch off immediately pauses live UI control across all open tabs and devices. ### Connection Endpoints - **Remote MCP (Streamable HTTP):** `https://tradingray.com/node-api/mcp` (`POST`, JSON-RPC 2.0, MCP protocol `2025-03-26`) - **MCP Discovery Metadata:** `https://tradingray.com/.well-known/mcp.json` - **OpenAPI 3.1 Specification:** `https://tradingray.com/node-api/agent/openapi.json` - **REST Tool Base:** `https://tradingray.com/node-api/agent/v1/{tool_name}` (`POST`, JSON body) - **List Permitted Tools:** `https://tradingray.com/node-api/agent/v1/tools` (`GET`) - **Raw Chart PNG:** `https://tradingray.com/node-api/agent/v1/chart/image?symbol=BTCUSDT&tf=1h&source=auto` (`GET`, returns `image/png`) ### Authentication Send the personal API key in one of these headers (never as URL query parameters or cookies): - `Authorization: Bearer trk_<64-hex>` - `X-API-Key: trk_<64-hex>` ### Ready-to-Use MCP Configuration ```json { "mcpServers": { "tradingray": { "url": "https://tradingray.com/node-api/mcp", "headers": { "Authorization": "Bearer trk_YOUR_API_KEY" } } } } ``` ### Permission Scopes - `market:read` — Read market catalog, OHLCV + server-calculated indicators (`RSI14`, `EMA9/20/50/200`, `SMA20/50`, `MACD`, `Bollinger Bands`, `ATR14`, `VWAP`, swings, `BOS`, unfilled `FVG`s, Volume Profile `POC/VAH/VAL`), Radar screener, and server-rendered PNG charts. - `alerts:read` — List saved chart drawings/alerts and trading/TA alert notifications. - `alerts:write` — Create and delete technical chart drawings (`hlinemax`, `hline`, `line`, `reqt`, `paralel`, `fibo`, `arrow`) synced to open charts. - `demo:read` — Read virtual Demo account balance, equity, available margin, open positions, pending orders, and history. - `demo:trade` — Place and manage virtual Demo futures orders subject to API key risk guardrails (`client_order_id` supported for idempotency). - `app:control` — Read open app window state, switch sections/symbols/timeframes, add/configure/remove chart indicators, capture live browser chart screenshots, and run/play/trade/draw inside the Historical Trading Simulator. ### Live Top Ticker & Autonomous Agent Workflow - **You are in full control of pacing, symbols, timeframes, indicators, account settings, and full trade lifecycle:** - **Pause & inspect freely:** You decide when to pause (`simulator_control(action="pause")`) to study `chart_image`, draw levels, and calculate Entry/TP/SL without the price running away, and when to resume (`play`, or `simulator_trade` with `auto_play: true`) and adjust playback speed (`1x..4x`). - **Symbols & Timeframes:** On live charts and Demo, freely switch symbols, exchanges, timeframes, chart layouts, and sidebar tabs via `app_navigate`. Inside the Simulator, change timeframe or deal a fresh random setup via `simulator_start(tf=...)` or `simulator_control(action="next_round", tf=...)`, or return to live charts via `simulator_control(action="exit")`. - **Chart Indicators:** Use `chart_indicators` (`catalog`, `list`, `add`, `update`, `remove`, `clear`) to add and customize MA/EMA/BB/RSI/MACD/ATR/VWAP/SuperTrend/Stochastic/SMC/Wyckoff/AutoPatterns/Volume Profile/Order Book and configure periods, colors (`#RRGGBB`), widths, panel heights, thresholds (`ob`/`os`), and module toggles on both live charts and the Simulator. - **Trading Settings & Disciplined Execution:** Never fire one blind trade at random. Before entering, configure account settings via `action="order_settings"` (`margin_mode`: `'isolated'` or `'cross'`, `position_mode`: `'separate'` for independent positions or `'average'` for DCA/averaging into one position, `leverage`, `auto_tp_roi`: `0/50/100/200/300`). Plan entries using structure/indicators/levels (`chart_image`, `chart_draw`/`simulator_draw`), combine `market`/`limit`/`trigger` orders with justified SL/TP & R:R, and actively manage open trades with breakeven protection (`be_at_roi`/`be_at_price`, `be_offset`, `protect(breakeven: true)`, `move_protection(level="be")`), trailing stops (`trail_at`/`trail_gap`), partial closes (`close` + `percent`), `move_order`, scaling in (`average`), `close_all`, and `cancel`. - **Real-Time Events (`agent_events` & `new_events`):** Use `agent_events(since_seq, wait_seconds)` (or inspect `event_cursor` / `new_events` on state responses) to immediately receive limit/trigger fills, TP/SL/breakeven/trailing triggers, liquidations, simulator round win/loss outcomes (`simulator_round_outcome`), end-of-history / game finished results (`simulator_candles_finished`, `simulator_game_finished`), and triggered price alerts (`alert_triggered`). - **Live top ticker (`thought`):** Pass an optional `thought` parameter (short 1-sentence reasoning, max 240 chars) on any tool call so the user sees what you are doing and why in TradingRay's compact live top status bar. - **Blind Historical Simulator:** Assets are intentionally randomized and anonymized (`SIM-1`, `SIM-2`, ...) with relative timestamps and masked PNG X-axis dates to prevent ticker/date lookahead bias. Do not ask to pick a specific simulator symbol; stepping/rewinding candles is disabled (`1x`–`4x` human playback). - **Native Visual Style:** Trades automatically render Entry, TP, SL, and trailing levels natively on the chart — never draw duplicate manual trade lines. Drawings (`chart_draw`, `simulator_draw`) automatically inherit native CrypSpy defaults unless styling is explicitly needed. ### Available Tools (19) - **Market & Visual Analysis (`market:read`):** `market_catalogue`, `chart_analysis`, `chart_image`, `radar_get` - **Drawings & Alerts (`alerts:read` / `alerts:write`):** `alerts_list`, `chart_draw`, `chart_drawing_delete` - **Virtual Demo Trading (`demo:read` / `demo:trade`):** `demo_state`, `demo_order`, `demo_position_manage` - **Live App, Indicators & Historical Simulator (`app:control`):** `app_state`, `app_navigate`, `chart_indicators`, `simulator_start`, `simulator_state`, `simulator_control`, `simulator_trade`, `simulator_draw` - **Real-Time Events:** `agent_events` (scoped per category: `simulator`, `demo`, `alerts`) ### Safety Model - All API trading executes exclusively on virtual **Demo** or **Historical Simulator** balances — never on real exchange funds. - Risk guardrails (max leverage, max margin % per order, max open positions + pending orders, optional required Stop Loss) are enforced atomically on the server. - Historical Simulator tools expose only revealed candles up to the current replay cursor (zero future-candle lookahead). - Protected position alerts, published-idea drawings, and active demo line orders cannot be overwritten or deleted via API. ## Platform Pages - [Charts & App](https://tradingray.com/chart): Interactive charts, Smart Money tools, AI Agent Settings - [Demo Trading](https://tradingray.com/demo-trading): Live-price virtual futures practice - [Trading Simulator](https://tradingray.com/trading-simulator): Historical candle replay practice - [Market Radar](https://tradingray.com/radar): Real-time crypto screener, liquidations, pumps, funding - [Community Forecasts](https://tradingray.com/forecasts): Trader ideas and verified results - [Crypto News](https://tradingray.com/news): Market news and economic calendar