# Chartnaut Docs > Chartnaut is a trading terminal: charts, scripting, replay and backtesting. These are its docs. Generated 2026-11-22T22:30:08Z. ## For coding agents: the Terminal SDK The Terminal SDK puts Chartnaut's terminal inside another app. Two npm packages: - `@chartnaut/charts`: the page side. `` and hooks from `@chartnaut/charts/react`, `createTerminal()` without React, `createMockTerminal()` from `@chartnaut/charts/testing` for tests. - `@chartnaut/node`: the server side. `frameRoute({ getUser })` answers the terminal's `/api/chartnaut/frame`; `new Chartnaut()` calls the partner API with `CHARTNAUT_SECRET_KEY`; `verifyRequest` checks webhooks. Start a project with `npm create @chartnaut/app my-app`, or `chartnaut init --project` in an existing one: both write a Test key to `.env.local` (never print or commit it). The secret key stays on the server. - [Overview](https://docs.chartnaut.com/sdk/overview/): what the SDK is and a two-file example - [Errors](https://docs.chartnaut.com/sdk/errors/): every error code (each error's `docs` link points here) and what to do - [llms-full.txt](https://docs.chartnaut.com/llms-full.txt): every page below in one file, with code - [partner-api.yaml](https://docs.chartnaut.com/openapi/partner-api.yaml): OpenAPI 3.1, Partner API (your server, @chartnaut/node) - [public-api.yaml](https://docs.chartnaut.com/openapi/public-api.yaml): OpenAPI 3.1, Public API (the CLI, the MCP server, developer apps) ## API reference Every operation of both HTTP APIs, generated from their OpenAPI files. ### Partner API - [Chartnaut Partner API](https://docs.chartnaut.com/api/partner/): base URL `https://api.chartnaut.com/partner/v1`, OpenAPI at https://docs.chartnaut.com/openapi/partner-api.yaml - [GET /users](https://docs.chartnaut.com/api/partner/list-users/): List your linked users - [POST /users](https://docs.chartnaut.com/api/partner/create-managed-user/): Create a managed user - [GET /users/{user}](https://docs.chartnaut.com/api/partner/get-user/): Read a linked user - [DELETE /users/{user}](https://docs.chartnaut.com/api/partner/delete-managed-user/): Delete a managed user - [PATCH /users/{user}](https://docs.chartnaut.com/api/partner/update-managed-user/): Change a managed user's level or features - [POST /users/{user}/export](https://docs.chartnaut.com/api/partner/export-managed-user/): Export a managed user's data - [GET /exports/{export}](https://docs.chartnaut.com/api/partner/get-export/): Read an export - [DELETE /users/{user}/connection](https://docs.chartnaut.com/api/partner/disconnect-user/): Unlink a user - [POST /users/{user}/frame-token](https://docs.chartnaut.com/api/partner/create-frame-token/): Get a frame URL for a user - [GET /users/{user}/alert-fires](https://docs.chartnaut.com/api/partner/list-alert-fires/): List a user's alert fires - [POST /links](https://docs.chartnaut.com/api/partner/create-link/): Make a link for one of your users - [GET /scripts](https://docs.chartnaut.com/api/partner/list-scripts/): The scripts published to an app - [POST /scripts](https://docs.chartnaut.com/api/partner/publish-script/): Publish one of your scripts to your app - [DELETE /scripts/{script}](https://docs.chartnaut.com/api/partner/unpublish-script/): Take a script off your app - [GET /sessions](https://docs.chartnaut.com/api/partner/list-sessions/): List your sessions, by user, label or status - [POST /sessions](https://docs.chartnaut.com/api/partner/create-session/): Create a backtest session for a user - [POST /sessions/batch](https://docs.chartnaut.com/api/partner/create-sessions/): Create up to 500 sessions in one call - [POST /sessions/actions](https://docs.chartnaut.com/api/partner/session-actions/): End, lock or unlock many sessions - [GET /sessions/{session}](https://docs.chartnaut.com/api/partner/get-session/): Read a session - [PATCH /sessions/{session}](https://docs.chartnaut.com/api/partner/update-session/): Change a session's labels or page control - [GET /sessions/{session}/trades](https://docs.chartnaut.com/api/partner/list-session-trades/): A session's closed trades - [GET /sessions/{session}/breaches](https://docs.chartnaut.com/api/partner/list-session-breaches/): A session's rule breaches - [GET /accounts](https://docs.chartnaut.com/api/partner/list-accounts/): List demo accounts you created, or a user's own accounts - [POST /accounts](https://docs.chartnaut.com/api/partner/create-account/): Create a demo account for a user - [POST /accounts/batch](https://docs.chartnaut.com/api/partner/create-accounts/): Create up to 500 demo accounts in one call - [POST /accounts/actions](https://docs.chartnaut.com/api/partner/account-actions/): Lock, unlock or close everything on many demo accounts - [GET /accounts/{account}](https://docs.chartnaut.com/api/partner/get-account/): Read an account - [PATCH /accounts/{account}](https://docs.chartnaut.com/api/partner/update-account/): Change a demo account's labels - [GET /accounts/{account}/trades](https://docs.chartnaut.com/api/partner/list-account-trades/): An account's closed trades - [GET /accounts/{account}/positions](https://docs.chartnaut.com/api/partner/list-account-positions/): A user's own account's open positions - [GET /accounts/{account}/breaches](https://docs.chartnaut.com/api/partner/list-account-breaches/): A demo account's rule breaches - [GET /webhooks/test](https://docs.chartnaut.com/api/partner/send-test-webhook/): Send a test.ping ### Public API - [Chartnaut API](https://docs.chartnaut.com/api/public/): base URL `https://api.chartnaut.com/v1`, OpenAPI at https://docs.chartnaut.com/openapi/public-api.yaml - [POST /auth/device](https://docs.chartnaut.com/api/public/start-device-login/): Start a browser sign-in - [POST /auth/token](https://docs.chartnaut.com/api/public/poll-device-login/): Finish a browser sign-in - [POST /auth/revoke](https://docs.chartnaut.com/api/public/revoke-current-key/): Revoke the key making this request (sign out) - [GET /scripts](https://docs.chartnaut.com/api/public/list-scripts/): List your scripts - [POST /scripts](https://docs.chartnaut.com/api/public/create-script/): Create a script and its first version - [POST /scripts/validate](https://docs.chartnaut.com/api/public/validate-script/): Lint and resolve a script without saving or running it - [GET /scripts/{slug}](https://docs.chartnaut.com/api/public/get-script/): Get a script (latest version, or slug@N) - [PUT /scripts/{slug}](https://docs.chartnaut.com/api/public/update-script/): Save a new version - [DELETE /scripts/{slug}](https://docs.chartnaut.com/api/public/delete-script/): Delete a script - [PATCH /scripts/{slug}](https://docs.chartnaut.com/api/public/update-script-metadata/): Rename or describe a script - [GET /scripts/{slug}/versions](https://docs.chartnaut.com/api/public/list-script-versions/): List versions, newest first - [GET /scripts/{slug}/events](https://docs.chartnaut.com/api/public/list-definition-events/): List a definition's events - [GET /scripts/{slug}/events/summary](https://docs.chartnaut.com/api/public/definition-events-summary/): Summarise a definition's events - [POST /scripts/{slug}/collect](https://docs.chartnaut.com/api/public/collect-definition/): Run a definition over history - [GET /runs](https://docs.chartnaut.com/api/public/list-runs/): List your runs, newest first - [POST /runs](https://docs.chartnaut.com/api/public/create-run/): Run a script on one instrument and window - [GET /runs/{run_id}](https://docs.chartnaut.com/api/public/get-run/): Get a run's status, progress and summary - [POST /runs/{run_id}/cancel](https://docs.chartnaut.com/api/public/cancel-run/): Cancel a queued or running run - [GET /runs/{run_id}/results](https://docs.chartnaut.com/api/public/get-run-results/): Get what the run produced - [GET /insights](https://docs.chartnaut.com/api/public/list-insights/): List your Forward Insights, newest change first - [POST /insights](https://docs.chartnaut.com/api/public/create-insight/): Put a study run on the chart as a Forward Insight - [GET /insights/{insight_id}](https://docs.chartnaut.com/api/public/get-insight/): Get one Forward Insight - [DELETE /insights/{insight_id}](https://docs.chartnaut.com/api/public/delete-insight/): Take an insight off your charts. The study and its runs are kept - [PATCH /insights/{insight_id}](https://docs.chartnaut.com/api/public/update-insight/): Rename an insight, change its description, or choose what a click on its events opens - [POST /insights/{insight_id}/activate](https://docs.chartnaut.com/api/public/activate-insight/): Make an insight active, so it shows on your charts of its definition, instrument and timeframe - [POST /insights/{insight_id}/deactivate](https://docs.chartnaut.com/api/public/deactivate-insight/): Stop an insight showing on your charts. It stays in your library - [GET /library](https://docs.chartnaut.com/api/public/search-library/): Search the scripts the caller can use. No source - [GET /library/{author}/{slug}](https://docs.chartnaut.com/api/public/get-library-script/): Describe one library script, with its interface and dependencies. No source - [POST /library/{author}/{slug}](https://docs.chartnaut.com/api/public/add-to-library/): Add another author's script to your library, with the scripts it needs - [DELETE /library/{author}/{slug}](https://docs.chartnaut.com/api/public/remove-from-library/): Remove a script you added from your library - [GET /library/{author}/{slug}/requirements](https://docs.chartnaut.com/api/public/get-library-requirements/): What adding a script to your library would add, and anything that stops it - [GET /instruments](https://docs.chartnaut.com/api/public/search-instruments/): Search instruments you can run on - [GET /datasets](https://docs.chartnaut.com/api/public/list-datasets/): List the reference datasets scripts can read - [GET /datasets/econ.calendar/codes](https://docs.chartnaut.com/api/public/search-calendar-codes/): Search economic calendar indicator codes - [GET /instruments/{symbol}](https://docs.chartnaut.com/api/public/get-instrument/): Get one instrument, including the coverage your plan can reach - [GET /timeframes](https://docs.chartnaut.com/api/public/list-timeframes/): List supported timeframes - [GET /me](https://docs.chartnaut.com/api/public/whoami/): Who this token belongs to, its scopes and the plan - [GET /usage](https://docs.chartnaut.com/api/public/get-usage/): Compute used this period, and every plan cap with its current count - [GET /webhooks](https://docs.chartnaut.com/api/public/list-webhooks/): List webhooks (not available yet, 501) - [POST /webhooks](https://docs.chartnaut.com/api/public/create-webhook/): Register a webhook (not available yet, 501) - [DELETE /webhooks/{webhook_id}](https://docs.chartnaut.com/api/public/delete-webhook/): Delete a webhook (not available yet, 501) - [GET /docs](https://docs.chartnaut.com/api/public/list-docs/): List scripting reference topics - [GET /docs/{topic}](https://docs.chartnaut.com/api/public/get-doc/): Get one reference topic as markdown - [GET /projects](https://docs.chartnaut.com/api/public/list-projects/): List your developer projects - [POST /projects](https://docs.chartnaut.com/api/public/create-project/): Create a developer project and its first Test key (the secret is shown once) - [GET /projects/{slug}](https://docs.chartnaut.com/api/public/get-project/): Get one project - [POST /projects/{slug}/keys](https://docs.chartnaut.com/api/public/create-project-key/): Mint a Test key (Live keys are only made in the browser: env "live" is 403 live_keys_browser_only) - [GET /projects/{slug}/sites](https://docs.chartnaut.com/api/public/list-project-sites/): List Test sites - [POST /projects/{slug}/sites](https://docs.chartnaut.com/api/public/add-project-site/): Add a Test site (Live sites are only added in the browser: 403 test_only) - [GET /projects/{slug}/quickstart](https://docs.chartnaut.com/api/public/get-project-quickstart/): What Test and Live still need, and the one CLI command - [GET /apps](https://docs.chartnaut.com/api/public/list-apps/): Old path of listProjects (deprecated) - [POST /apps](https://docs.chartnaut.com/api/public/create-app/): Old path of createProject (deprecated) - [GET /apps/{slug}](https://docs.chartnaut.com/api/public/get-app/): Old path of getProject (deprecated) - [POST /apps/{slug}/keys](https://docs.chartnaut.com/api/public/create-app-key/): Old path of createProjectKey (deprecated) - [GET /apps/{slug}/sites](https://docs.chartnaut.com/api/public/list-app-sites/): Old path of listProjectSites (deprecated) - [POST /apps/{slug}/sites](https://docs.chartnaut.com/api/public/add-app-site/): Old path of addProjectSite (deprecated) - [GET /apps/{slug}/quickstart](https://docs.chartnaut.com/api/public/get-app-quickstart/): Old path of getProjectQuickstart (deprecated) ## Terminal SDK Put Chartnaut's trading terminal inside your own app and drive it from your code. - [Overview](https://docs.chartnaut.com/sdk/overview/): Put Chartnaut's trading terminal inside your own app with @chartnaut/charts, and drive it from your code: charts, scripts, drawings, replay and orders. - [Getting started](https://docs.chartnaut.com/sdk/getting-started/): A working terminal on localhost in a few minutes: npm create @chartnaut/app, chartnaut init --project in an existing project folder, or by hand. - [React](https://docs.chartnaut.com/sdk/react/): The component, its props and events, and the hooks that turn the terminal's charts, scripts, replay and account into React state. - [The terminal object](https://docs.chartnaut.com/sdk/terminal/): createTerminal and the terminal it returns: ready and status, events with on, once and off, raw commands with send, can, apply, and dev mode. - [Layout and charts](https://docs.chartnaut.com/sdk/layout-and-charts/): Lay out up to 8 charts and panels, drive each chart by its id, link them, switch our interface off and match your colours. - [Scripts](https://docs.chartnaut.com/sdk/scripts/): Add indicators, definitions, insights and Pine scripts to a chart, read their values, react to their events and hold the replay on them. - [Drawings and overlays](https://docs.chartnaut.com/sdk/drawings-and-overlays/): Draw lines, zones, fibs, text and markers with the chart's own tools, hear the drawings your users make, and show your own data as overlays. - [Symbols and data](https://docs.chartnaut.com/sdk/symbols-and-data/): Search markets, read what a user may open, order sizes in lots, contracts or units, closed bars, live quotes, screenshots and watchlists. - [Replay, orders and the account](https://docs.chartnaut.com/sdk/replay-orders-account/): Drive a backtest from your code: play and step the replay, place orders by size or risk, move stops, close half, lock trading and read the account. - [Workspace and persist](https://docs.chartnaut.com/sdk/workspace-and-persist/): Where each user's layout, charts, scripts and drawings are kept: their browser, their Chartnaut account, your own database, or nowhere. - [Testing](https://docs.chartnaut.com/sdk/testing/): Test your app's terminal code without a terminal: createMockTerminal records every command, answers them, and emits events when your test says. - [Users](https://docs.chartnaut.com/sdk/users/): Who signs in to your terminal: linked users with their own Chartnaut account, or managed users you create on Business. frameRoute, cn.links, cn.users and cn.frames. - [Accounts](https://docs.chartnaut.com/sdk/accounts/): Demo accounts you create for challenges and live competitions, and the user's own broker accounts you can read: balances, open positions and closed trades. cn.accounts. - [Webhooks](https://docs.chartnaut.com/sdk/webhooks/): Hear on your server when a user links, a session ends or a rule breaks, and check each delivery's signature in one line with verifyRequest. - [Projects](https://docs.chartnaut.com/sdk/projects/): A project is what you set up on Chartnaut for something you build: Test and Live keys, the sites a terminal may open on, localhost in Test, View as, and what it takes to go live. - [Plans and limits](https://docs.chartnaut.com/sdk/plans-and-limits/): What Free, Pro and Business developer plans include, whose limit a refusal is (the user's or yours), and what happens at the cap. - [Errors](https://docs.chartnaut.com/sdk/errors/): Every error code the terminal and the partner API send, what each means and what to do about it. - [API reference and OpenAPI](https://docs.chartnaut.com/sdk/api-and-openapi/): The partner API behind @chartnaut/node and the public API behind the CLI, as OpenAPI 3.1 files you can download, generate clients from or hand to a coding agent. - [Changelog](https://docs.chartnaut.com/sdk/changelog/): What changed in each version of @chartnaut/charts and @chartnaut/node, and how the terminal tells you when your SDK is out of date. ## Get started What Chartnaut is, how the pieces fit, plans and the glossary. - [What Chartnaut is](https://docs.chartnaut.com/start/what-chartnaut-is/): Chartnaut is a trading terminal you can build into whatever you need: building blocks and agents that shape the charts and everything around them to how you trade. - [Ways to use Chartnaut](https://docs.chartnaut.com/start/ways-to-use-chartnaut/): Chartnaut Desktop, a web browser, the CLI and API, or an AI app over MCP: what each is for, what it needs, and why Desktop is the one to install. - [Chartnaut Desktop](https://docs.chartnaut.com/start/chartnaut-desktop/): Why Chartnaut recommends the desktop app, and how to install, sign in, update and remove it on Windows. - [Chartnaut in your browser](https://docs.chartnaut.com/start/chartnaut-in-your-browser/): Use Chartnaut at terminal.chartnaut.com with nothing to install, and what needs Chartnaut Desktop instead. - [For developers](https://docs.chartnaut.com/start/for-developers/): The Chartnaut CLI, the API and coding agents: where to start with each. - [How the pieces fit](https://docs.chartnaut.com/start/how-the-pieces-fit/): How Chartnaut turns a trading hunch into an answer: indicators and definitions find the setup, a study measures it, a Forward Insight brings it to your chart, and your own trades complete the picture. - [How to get the most out of Chartnaut](https://docs.chartnaut.com/start/get-the-most-out-of-chartnaut/): Six workflows that make Chartnaut worth using, and where to start each one. - [Plans](https://docs.chartnaut.com/start/plans/): Compare Free and Pro: price, live accounts and the 14-day live trial, history, options data, research limits, add-ons and the CLI, MCP and API. - [Glossary](https://docs.chartnaut.com/start/glossary/): Every Chartnaut term in one line, grouped by where you meet it. - [Keyboard shortcuts](https://docs.chartnaut.com/start/keyboard-shortcuts/): Search with ⌘K and move around Chartnaut with single keys. ## Using Chartnaut Every part of the app, in the order of the app's sidebar. - [Set up Charts for how you trade](https://docs.chartnaut.com/guides/set-up-charts/): Build your own chartbook: charts and panels side by side, your indicators on them and a theme you like. - [Connect a broker and place your first trade](https://docs.chartnaut.com/guides/connect-and-place-a-trade/): Connect MetaTrader, cTrader, TradeLocker or Chartnaut Demo, map your symbols, place a trade from the chart and find it in Trades and the Journal. - [Test your first trading idea](https://docs.chartnaut.com/guides/test-your-first-trading-idea/): Hand one trading idea to the agent: it finds every time it happened in two years of history, measures what came next, and puts the answer on your chart. - [Turn your trades into a playbook](https://docs.chartnaut.com/guides/turn-your-trades-into-a-playbook/): Create a BTC opening range playbook, set its R-levels and tags, file your trades into it, read its reports and see what Historical Intelligence needs. - [Backtest on random days](https://docs.chartnaut.com/guides/backtest-on-random-days/): Trade a week of BTC from a random Monday in Replay, log each trade into your playbook as you take it, and file the rest afterwards. - [Add your first view](https://docs.chartnaut.com/guides/add-your-first-view/): Build a view with the agent that shows how far price ran after you exited, in R, then publish it to every trade, change it and take it off. - [Build your own indicator](https://docs.chartnaut.com/guides/build-your-own-indicator/): Describe a session VWAP with standard deviation bands to the agent, check it on the chart, save it and add it to Charts. - [Build your first app](https://docs.chartnaut.com/guides/build-your-first-app/): Build a pre-market briefing with the agent, test it against the chart, publish it and open it from Tools → Apps. - [How Charts works](https://docs.chartnaut.com/guides/how-charts-works/): Real-time and replay, panels side by side, chartbooks, what a chart shows, trading from the chart and what your plan allows. - [Chartbooks](https://docs.chartnaut.com/guides/chartbooks/): Save a Charts layout as a chartbook, keep variations with Duplicate, and switch between them from one menu. - [Panels](https://docs.chartnaut.com/guides/panels/): Add charts and tools to your layout, split them where you want, and move, resize or remove them. - [Chart types](https://docs.chartnaut.com/guides/chart-types/): Every chart type, how to pair a profile with price, and where each type's settings live. - [Indicators on the chart](https://docs.chartnaut.com/guides/indicators-on-the-chart/): Add an indicator to one chart or several, change its settings, and hide or remove it from the legend. - [Definitions on the chart](https://docs.chartnaut.com/guides/definitions-on-the-chart/): Add a definition to a chart, choose its profile and events, and read the marks it draws. - [Forward Insights on the chart](https://docs.chartnaut.com/guides/forward-insights-on-the-chart/): Make a Forward Insight active on a definition and the latest setup shows its answer by itself. Choosing one, the limit per plan, replays, and what each message means. - [Drawing tools](https://docs.chartnaut.com/guides/drawing-tools/): Every drawing tool on the rail, how to edit, lock and clear drawings, and where they are saved. - [Replay](https://docs.chartnaut.com/guides/replay/): Open a backtest session in Charts, control playback from the replay bar, and trade history bar by bar. - [Trading from the chart](https://docs.chartnaut.com/guides/trading-from-the-chart/): Pick an account, place a draft from the trade bar or the Position Manager, confirm it on the chart, and manage it. - [Chart Settings and themes](https://docs.chartnaut.com/guides/chart-settings-and-themes/): Pick a theme and set colours, grid, crosshair, numbers and trade drawing for a chartbook, then save them as a template. - [Market data](https://docs.chartnaut.com/guides/market-data/): Find an instrument, read the Live, Slow and Offline status, and what to do when data stalls or a source goes down. - [Options levels on the chart](https://docs.chartnaut.com/guides/options-levels-on-the-chart/): Add the Options levels indicator to SP500: the call wall, put wall, gamma flip, absolute gamma strike, expected move and gamma profile, and what each setting does. - [Options calendar](https://docs.chartnaut.com/guides/options-calendar/): Mark monthly options expiration, quad witching, VIX expiration and quarter-end on any chart, with the next 45 days ahead. - [How options levels are calculated](https://docs.chartnaut.com/guides/how-options-levels-are-calculated/): The data behind Chartnaut's options levels, when they change, how each level is worked out, the dealer sign assumption and why another vendor's levels can differ. - [Research with options levels](https://docs.chartnaut.com/guides/research-with-options-levels/): Use the call wall, put wall and gamma flip in your own indicators, definitions, studies and backtests, with scripts you can paste. - [How accounts work](https://docs.chartnaut.com/guides/how-accounts-work/): MetaTrader, cTrader, TradeLocker and Chartnaut Demo accounts, live slots per plan, pausing, symbol mapping, history import and what each status means. - [14-day live trial](https://docs.chartnaut.com/guides/live-trial/): Trade one cTrader or TradeLocker account live on Free for 14 days, once. What happens on day 14, and how to keep the account with Pro. - [Connect MetaTrader](https://docs.chartnaut.com/guides/connect-metatrader/): Connect an MT4 or MT5 login with its server, import your past trades and fix a failed connection. - [Connect cTrader](https://docs.chartnaut.com/guides/connect-ctrader/): Sign in with your cTrader ID, pick which accounts to trade, import your past trades and re-authorize when access expires. - [Connect TradeLocker](https://docs.chartnaut.com/guides/connect-tradelocker/): Log in with your TradeLocker email, password and server, pick which accounts to trade, and fix a login that stopped working. - [Connect Chartnaut Demo](https://docs.chartnaut.com/guides/connect-chartnaut-demo/): Open a virtual-money account that trades live prices, with the label, leverage and starting balance you choose. - [Symbol mapping](https://docs.chartnaut.com/guides/symbol-mapping/): Link your broker's symbols to Chartnaut instruments during an import, from the trade bar, or on an unmapped trade. - [History import](https://docs.chartnaut.com/guides/history-import/): Bring a MetaTrader, cTrader or TradeLocker account's closed trades, open positions and pending orders into Chartnaut, and re-sync later. - [Manage an account](https://docs.chartnaut.com/guides/manage-an-account/): An account's own tabs and reports, and how to rename, pause, reconnect or delete it. - [How your trades are recorded](https://docs.chartnaut.com/guides/how-your-trades-are-recorded/): Where trades come from, what Chartnaut saves with each one, and how the dashboard, journal and trades library fit together. - [Dashboard](https://docs.chartnaut.com/guides/dashboard/): The page Chartnaut opens on: your stats for a period, a calendar per account, and dashboards of your own apps. - [Trades library](https://docs.chartnaut.com/guides/trades-library/): Find any trade by asking for it or by filtering, and choose how trades are shown and sorted. - [Trade detail](https://docs.chartnaut.com/guides/trade-detail/): Everything on one trade: details, P&L path, playbook, tags, properties, notes, snapshots and fills. - [Snapshots and replay](https://docs.chartnaut.com/guides/snapshots-and-replay/): See your charts at entry and exit, step back into the trade on its chart, and export it as a video. - [Daily journal](https://docs.chartnaut.com/guides/daily-journal/): One page per trading day with its P&L, trades and orders beside what you wrote about it. - [Notes, tags and templates](https://docs.chartnaut.com/guides/notes-tags-and-templates/): Write notes on a trade, reuse note templates, tag trades from their playbook and add your own properties. - [AI trade search](https://docs.chartnaut.com/guides/ai-trade-search/): Ask about your trades in plain words, get the matching trades back and apply them to Trades. - [Pinned collections](https://docs.chartnaut.com/guides/pinned-collections/): Sets of trades kept from trade studies, to open in Trades or study again. - [Sharing a trade](https://docs.chartnaut.com/guides/sharing-a-trade/): Save a trade as a styled image card or an MP4 video of it playing out on its chart. - [How playbooks work](https://docs.chartnaut.com/guides/how-playbooks-work/): What a playbook holds, how R-levels and tags work, how trades get into it, its reports, and what Historical Intelligence needs to train. - [Create a playbook](https://docs.chartnaut.com/guides/create-a-playbook/): Create a playbook with its name, colour and three R-level targets, then write its entry rule. - [Tags and criteria](https://docs.chartnaut.com/guides/tags-and-criteria/): Add checkbox and group tags to a playbook, tick them on trades from the chart or afterwards, and see which ones matter. - [Playbook reports](https://docs.chartnaut.com/guides/playbook-reports/): What each playbook report shows, how to run a Monte Carlo simulation and how to add your own report. - [Historical Intelligence](https://docs.chartnaut.com/guides/historical-intelligence/): Train a model on a playbook's tagged trades for one instrument, read its performance and see the odds of each R-level as you trade. - [How backtesting works](https://docs.chartnaut.com/guides/how-backtesting-works/): Trade past market data bar by bar: how sessions differ from Chartnaut Demo, how to set one up, random dates, reports and where the trades go. - [Start a session](https://docs.chartnaut.com/guides/start-a-session/): Set up a backtest in Quickstart, add margin, costs, slippage and risk rules in Advanced, and fix a session that will not start. - [Session reports](https://docs.chartnaut.com/guides/session-reports/): What a backtest session's five tabs and ten reports show, and how to add your own report. - [How research works](https://docs.chartnaut.com/guides/how-research-works/): How definitions, events, versions, studies and Forward Insights fit together, from a trading idea to an answer on your chart. - [Build a definition](https://docs.chartnaut.com/guides/build-a-definition/): Ask the Agent to build a definition or use the definition builder, then check its marks on real days before you measure anything. - [Versions and profiles](https://docs.chartnaut.com/guides/versions-and-profiles/): How a definition's versions keep your answers fixed, and how profiles let you study different settings side by side. - [Run a definition over history](https://docs.chartnaut.com/guides/run-over-history/): Run a definition over the instrument, interval and dates you choose to find every time its setup happened. - [Browse events](https://docs.chartnaut.com/guides/browse-events/): Open a dataset's events, filter them by anything the definition recorded, and check each one on a chart. - [Build and run a study](https://docs.chartnaut.com/guides/build-and-run-a-study/): Ask the Agent a question about a definition's events, approve the study it writes and run it over your datasets. - [Read the results](https://docs.chartnaut.com/guides/read-the-results/): Where a study's results appear, what each kind shows, and how to judge a number by the sample behind it. - [Forward Insights](https://docs.chartnaut.com/guides/forward-insights/): Put a study's answer on the chart as a Forward Insight, choose how it splits and manage it on the definition. - [Forward Insights on live events](https://docs.chartnaut.com/guides/forward-insights-on-live-events/): Why a Forward Insight can show the wrong reading on a live event, and how Update fixes the study behind it. - [In sample and out of sample](https://docs.chartnaut.com/guides/in-sample-and-out-of-sample/): What in sample and out of sample mean, explained for beginners, why it matters more than the percentage, and why a replay hides an insight until you pass the date its data ends. - [Definition alerts](https://docs.chartnaut.com/guides/definition-alerts/): Get a notification when a definition fires on a market. A Pro feature: 12 alerts at once, deep and 1-minute alerts included, more with an add-on. - [How indicators work](https://docs.chartnaut.com/guides/how-indicators-work/): Built-in and custom indicators, where they appear, how definitions use them, and the limits on each plan. - [Build a custom indicator](https://docs.chartnaut.com/guides/build-a-custom-indicator/): Build an indicator with the Agent or the indicator builder, or write it yourself, and manage its versions, sharing and limits. - [Indicators inside definitions](https://docs.chartnaut.com/guides/indicators-inside-definitions/): How a definition reads indicator values, how to approve the ones the agent adds, and why the version it reads stays fixed. - [Build your own pages](https://docs.chartnaut.com/guides/build-your-own-pages/): Describe a view once and the agent builds it onto every trade, journal day, backtest session, playbook, account or instrument, each showing that page's own data. - [Add a view](https://docs.chartnaut.com/guides/add-a-view/): Start a view from + View or Create custom report, build it with the agent, and change or remove it later. - [Views on trades](https://docs.chartnaut.com/guides/views-on-trades/): What a view on a closed trade can read, and six views worth building on your trades. - [Views on journal days](https://docs.chartnaut.com/guides/views-on-journal-days/): What a view on a journal day can read, and six views worth building on your trading days. - [Views on backtest sessions](https://docs.chartnaut.com/guides/views-on-backtest-sessions/): What a view on a backtest session can read, and six reports worth building on your sessions. - [Views on playbooks](https://docs.chartnaut.com/guides/views-on-playbooks/): What a view on a playbook can read, and six reports worth building on your setups. - [Views on accounts](https://docs.chartnaut.com/guides/views-on-accounts/): What a view on an account can read, and six reports worth building on your accounts. - [Views on instruments](https://docs.chartnaut.com/guides/views-on-instruments/): What a view on an instrument can read, and six views worth building for the markets you trade. - [Build an app](https://docs.chartnaut.com/guides/build-an-app/): Build a page of your own with the agent or from Tools → Apps, publish it, open it and share it. - [What views and apps can see and change](https://docs.chartnaut.com/guides/app-permissions/): What views and apps can read and change, the data they ask to collect, and where to check before adding one. - [Community views](https://docs.chartnaut.com/guides/community-views/): Find public views for a page, try them on your own data, add them, and share your own. - [How the agent works](https://docs.chartnaut.com/guides/how-the-agent-works/): What the agent builds, Supervised and Autonomous modes, the approval cards, the builders' own agents, and running it on credits or your own subscription. - [Work with your data](https://docs.chartnaut.com/guides/work-with-your-data/): Ask the agent questions about your study results: it runs a program over your data, keeps what it works out as files, and builds on them. - [Approvals](https://docs.chartnaut.com/guides/approvals/): Every card the agent stops on, the button that answers it, and how to ask for a change instead. - [The builders' agents](https://docs.chartnaut.com/guides/builder-agents/): The agents in the indicator, definition and app builders, what each asks before changing, and the preview's agent buttons. - [AI credits](https://docs.chartnaut.com/guides/ai-credits/): What AI credits pay for, what a message costs, and how to check and top up your balance. - [Use your own AI subscription](https://docs.chartnaut.com/guides/use-your-own-ai-subscription/): Run Chartnaut's AI on your own Claude or ChatGPT subscription in Chartnaut Desktop, without spending credits. - [Community library](https://docs.chartnaut.com/guides/community-library/): Browse Discover, add indicators, definitions and apps to your library, clone them to make them yours, and choose who sees your own work. ## Scripting Write and debug indicators, definitions and studies. - [Overview](https://docs.chartnaut.com/scripting/overview/): This section is the code reference for indicator, definition and study scripts: every declaration, hook and ctx call, with examples you can paste into a builder's Code tab. - [Overview](https://docs.chartnaut.com/scripting/choose-your-dsl-overview/): This page tells you which kind of script to write before you open a builder's Code tab. - [Script anatomy](https://docs.chartnaut.com/scripting/script-anatomy/): Every Chartnaut script has two parts: top-level declarations that say what exists (settings, outputs, events, results, dependencies), then hooks that run over bars or events. - [First indicator guide](https://docs.chartnaut.com/scripting/first-indicator-guide/): This walkthrough builds an overlay indicator by hand: an EMA with a length and a colour setting, and an arrow on every bar that closes up through it. - [First definition guide](https://docs.chartnaut.com/scripting/first-definition-guide/): This walkthrough builds a small definition by hand: it marks every bar that closes above its open, with a label on each mark, ready to run over history and measure with a study. - [First study guide](https://docs.chartnaut.com/scripting/first-study-guide/): This walkthrough builds a small study by hand: it reads the events of the Bull bar definition from the first definition guide, counts them, and publishes a count, a table and a ... - [What Chartnaut guarantees](https://docs.chartnaut.com/scripting/what-chartnaut-guarantees/): One answer per bar: the same value in the browser and on the server, on every chart timeframe, live, in replay and over history, with no look-ahead and no repainting. - [Bars and clocks](https://docs.chartnaut.com/scripting/bars-and-clocks/): Confirmed and forming bars, when onBar runs, what a higher or lower timeframe can know at a bar, the UTC time grids, and sessions. - [Warmup and memory](https://docs.chartnaut.com/scripting/warmup-and-memory/): What warmup guarantees, how to declare it with warmup(...) and retain(...), how it resolves on each timeframe, memory limits per plan, and how to spot a warmup that is too short. - [Seams and anchors](https://docs.chartnaut.com/scripting/seams-and-anchors/): Where computed history joins, why every value starts its memory from a fixed point on a time grid, what is guaranteed at the straddling bucket, and what your script must do to keep it. - [Limits and errors](https://docs.chartnaut.com/scripting/limits-and-errors/): Every limit a script or run can reach, per plan where it varies, what you see when you reach it, and the errors and warnings script authors meet with what to do about each. - [Nuances worth knowing](https://docs.chartnaut.com/scripting/nuances/): Subtle behaviours that surprise script authors: forming-bar re-runs, barIndex, UTC days, Monday weeks, "max" per plan, oncePer across runs, errors on the chart and the server. - [Overview](https://docs.chartnaut.com/scripting/runtime-overview/): Most of the scripting API is the same whether you write an indicator or a definition: reading price, declaring settings, drawing on the chart, reading other indicators, other ti... - [Price and bar data](https://docs.chartnaut.com/scripting/bar-fields/): Every call to onBar(ctx) hands you the current bar and the context around it: prices, volume, time, whether the bar has closed, the instrument and the chart. Indicators and defi... - [Remembering values across bars](https://docs.chartnaut.com/scripting/accum-state/): Anything your script remembers from one bar to the next, such as an EMA, a session open or a "closed above yesterday" flag, lives in ctx.accum. Never in a module-level let or var. - [Settings inputs and dialog](https://docs.chartnaut.com/scripting/inputs-dialog-layout/): Settings a trader can change without editing code, such as a length, a colour or a higher timeframe, are declared at the top of the script with input.*, arranged with dialog and... - [Declaring indicator dependencies](https://docs.chartnaut.com/scripting/indicators-declare/): A script can build on another indicator, such as ATR or VWAP, by declaring it once at the top of the file and reading its values on ctx.indicators. Indicators, definitions and s... - [Dependency outputs](https://docs.chartnaut.com/scripting/dependency-outputs/): A correct indicators.declare does not put a number on every bar. The dependency's warmup, bars it chose not to emit, and gaps in the data all read as undefined. Guard every read... - [Drawing on the chart](https://docs.chartnaut.com/scripting/drawings-and-paint/): Everything a script draws, whether a line, a marker, a level or a zone, follows one pattern: declare the output at the top of the file, then draw it from onBar with the matching... - [Layers & rows](https://docs.chartnaut.com/scripting/layers-and-rows/): output.layer is the fourth output family, after series, markers and the hline / range / trendline lane. Its output is rows: keyed, schema-typed records written from onBar / onRu... - [Timeframe handles and runOn](https://docs.chartnaut.com/scripting/mtf-and-runon/): To read another timeframe, such as a daily EMA on a 5-minute chart, declare a timeframe(...) handle at module scope. To limit which chart timeframes a script runs on, set runOn ... - [Summaries and long windows](https://docs.chartnaut.com/scripting/summary-and-long-windows/): ctx.summary answers "what was the highest high, lowest low, first open, last close or total volume over this span" without loading the span's bars. Use it for all-time highs, 52... - [Sessions](https://docs.chartnaut.com/scripting/session-api/): ctx.session tells a script when a session opens and closes, so you key logic off session boundaries instead of clock arithmetic. Indicators and definitions share one API; studie... - [Reference data](https://docs.chartnaut.com/scripting/datasets/): dataset(...) gives a script reference data that is not market prices: the economic calendar, daily rates and yields, options levels and the options chain. You declare a handle o... - [Economic calendar](https://docs.chartnaut.com/scripting/economic-calendar/): econ.calendar is one row per scheduled economic release, covering the G10 and more than 100 economies. It carries the schedule, the consensus forecast and the previous figure. T... - [Rates and yields](https://docs.chartnaut.com/scripting/rates-and-yields/): rates.daily is one row per series per day. The series are government bond yields, US Treasury curves, overnight reference rates (SOFR, ESTR, SONIA, EFFR) and central-bank policy... - [Options levels](https://docs.chartnaut.com/scripting/options-levels/): Read call wall, put wall, gamma flip, gamma exposure, expected move and the gamma profile with options.eod.levels. On Pro. - [Options contracts](https://docs.chartnaut.com/scripting/options-contracts/): Read the end-of-day US options chain, one row per contract, with options.eod.contracts: quotes, open interest, implied volatility and greeks. Pro and up. - [Budgets and limits](https://docs.chartnaut.com/scripting/budgets/): Chartnaut caps how much work a script can do, so a heavy loop cannot freeze Charts or stall a study run. A soft limit shows a warning and the script keeps running. A hard limit ... - [Lint and error codes](https://docs.chartnaut.com/scripting/lint-and-error-codes/): Every lint rule id and runtime error code Chartnaut reports for scripts, with its severity and the fix. Look up the id shown in the builder's Problems list or in an agent's tool... - [Overview](https://docs.chartnaut.com/scripting/indicator-api/): An indicator is a script that draws on Charts: moving averages, oscillators, bands, markers, custom overlays. This section covers what indicators add on top of the shared runtim... - [Overlay vs pane](https://docs.chartnaut.com/scripting/indicator-meta/): meta({...}) is the first call in every indicator. It names the indicator, decides where it draws and what data it reads. Call it exactly once: a second call is an error, and an ... - [Series types](https://docs.chartnaut.com/scripting/series-outputs/): Every series an indicator draws is declared with an output. call at the top of the script and fed from onBar with the matching ctx. verb. This page lists every kind, its verb an... - [Panes & scales](https://docs.chartnaut.com/scripting/panes-and-scales/): Panes decide where an output draws. Price scales decide which axis it is measured against. They are separate choices, and most indicators only need the first. - [onBar](https://docs.chartnaut.com/scripting/onbar-indicator/): onBar(ctx) is the function Chartnaut calls once per bar: read price and settings, update state, emit to your outputs. This page covers what is particular to an indicator's onBar... - [Layers](https://docs.chartnaut.com/scripting/layers/): A layer is a chart primitive you script yourself: keyed rows computed in onBar, drawn by your own paint (Canvas 2D) or paintGL (WebGL). Profiles, footprints, heatmaps, drawing t... - [Painting a layer](https://docs.chartnaut.com/scripting/layer-render/): The render half of a layer runs on the main thread inside one host primitive per pane. You register functions on the layer handle; the host owns scheduling, culling, memoisation... - [Examples](https://docs.chartnaut.com/scripting/indicator-examples/): Ten Chartnaut public library indicators, simple to complex, with the decisions in each script explained. - [Volume](https://docs.chartnaut.com/scripting/example-volume/): Public library Volume indicator — what it plots, key script decisions, full source. - [Moving Average](https://docs.chartnaut.com/scripting/example-moving-average/): Public library Moving Average indicator — what it plots, key script decisions, full source. - [Donchian Channels](https://docs.chartnaut.com/scripting/example-donchian-channels/): Public library Donchian Channels indicator — what it plots, key script decisions, full source. - [ATR](https://docs.chartnaut.com/scripting/example-atr/): Public library ATR indicator — what it plots, key script decisions, full source. - [RSI](https://docs.chartnaut.com/scripting/example-rsi/): Public library RSI indicator — what it plots, key script decisions, full source. - [Bollinger Bands](https://docs.chartnaut.com/scripting/example-bollinger-bands/): Public library Bollinger Bands indicator — what it plots, key script decisions, full source. - [Stochastic](https://docs.chartnaut.com/scripting/example-stochastic/): Public library Stochastic indicator — what it plots, key script decisions, full source. - [MACD](https://docs.chartnaut.com/scripting/example-macd/): Public library MACD indicator — what it plots, key script decisions, full source. - [Supertrend](https://docs.chartnaut.com/scripting/example-supertrend/): Public library Supertrend indicator — what it plots, key script decisions, full source. - [VWAP](https://docs.chartnaut.com/scripting/example-vwap/): Public library VWAP indicator — what it plots, key script decisions, full source. - [Overview](https://docs.chartnaut.com/scripting/definition-api/): A definition is a script that marks every bar where a setup appears. Run it over history and each mark becomes an event you can browse and study. - [Meta](https://docs.chartnaut.com/scripting/definition-meta/): meta({...}) names the definition, gives it a stable slug, and sets kind: "flow" so it can emit events. Call it once, at the top of the entry file. - [Events and snapshots](https://docs.chartnaut.com/scripting/events-and-snapshots/): Every event a definition emits needs an events.declare first. The declaration names the event, describes its payload, and sets how it paints on the chart. The payload schema is ... - [Emit and labels](https://docs.chartnaut.com/scripting/emit-and-labels/): ctx.emit records that the setup happened on this bar. On the chart it draws the event's paint. When the definition runs over history, each accepted emit becomes a stored event t... - [onBar](https://docs.chartnaut.com/scripting/onbar-flow-runtime/): A definition's onBar(ctx) runs once per bar, oldest first, exactly as an indicator's does. The difference is the goal: a definition calls ctx.emit when its condition is true, an... - [Multi-file packages and imports](https://docs.chartnaut.com/scripting/imports-and-modules/): A definition can be one file or several. Split it with relative ES module imports (./helpers.js) when a piece of logic is reusable or easier to read alone. Small definitions sta... - [Examples](https://docs.chartnaut.com/scripting/definition-examples/): Three runnable definition scripts, simple to complex: bull bar, EMA cross, session OR break. - [Bull bar](https://docs.chartnaut.com/scripting/example-bull-bar/): Definition example: events.declare, the required emit label, a one-line bull-bar condition. - [EMA cross](https://docs.chartnaut.com/scripting/example-ema-cross/): Definition example: indicator dependencies and cross detection with the previous value. - [Session OR break](https://docs.chartnaut.com/scripting/example-or-break/): Definition example: clock-based sessions, opening-range state in accum with warmup, oncePer per session. - [Overview](https://docs.chartnaut.com/scripting/study-api/): A study script reads the events a definition recorded over history and turns them into results you can read: counts, hit rates, forward returns, tables. This section is the code... - [Declarations](https://docs.chartnaut.com/scripting/declarations/): The top of a study declares everything it reads and publishes: its settings, the definitions whose events it measures, any indicators, the dimensions that split events into grou... - [scope](https://docs.chartnaut.com/scripting/study-scope/): scope(ctx) decides each event's group from what was known when it fired: the tuple it returns, what it can read, ctx.previous, report dimensions and pin cells. - [onEvent and onFinish](https://docs.chartnaut.com/scripting/onevent-and-onfinish/): A study has three handlers. scope runs first for each event, in time order, and decides which group the event belongs to. onEvent runs next for every event scope includes and me... - [Collect and publish](https://docs.chartnaut.com/scripting/collect-and-publish/): In onEvent you store each measurement with ctx.collect. In onFinish you read the rows back with ctx.collected and turn them into declared results with ctx.publish. Most measurem... - [Results and stats](https://docs.chartnaut.com/scripting/results-and-stats/): Each result has a kind, set in results.declare, and the kind fixes the payload shape ctx.publish accepts. This page lists those shapes and the helpers for computing them: ctx.st... - [Dependencies](https://docs.chartnaut.com/scripting/study-dependencies/): A study measures around its events using what its dependencies already produced: other events from declared definitions, the lines and boxes they drew, and indicator values at a... - [Forward Insights](https://docs.chartnaut.com/scripting/chart-pins-overview/): A Forward Insight puts a study's answer on the chart: click a definition's mark and a popover shows what happened next after events like it, with the sample behind each number. ... - [Outlooks](https://docs.chartnaut.com/scripting/outlooks/): An outlook draws a Forward Insight on the chart for the event you clicked: Keep or Reject it, manage kept outlooks in Insights, and write outlook.js beside a study. - [Show studies on charts](https://docs.chartnaut.com/scripting/show-studies-on-charts/): To see a study's numbers while you trade or replay, put the study on the chart as a Forward Insight. You do not edit the study code yourself: Put on chart has an agent update it... - [Examples](https://docs.chartnaut.com/scripting/study-examples/): Three runnable study scripts, simple to complex: event count, forward return, stop and target first hit. - [Event count](https://docs.chartnaut.com/scripting/example-event-count/): Study example: flows.declare, collect and publish, a weekday table and a written answer. - [Forward return](https://docs.chartnaut.com/scripting/example-forward-return/): Study example: a horizon setting, candles.forward and a distribution of forward returns. - [Stop / target first hit](https://docs.chartnaut.com/scripting/example-stop-target-first-hit/): Study example: a stop and target scan with firstHit, split by a direction dimension. - [Overview](https://docs.chartnaut.com/scripting/agents-overview/): Chartnaut's agents write the same scripts this section documents, and check them with lint, typecheck and a dry run before you see the result. This page shows which agent writes... - [Indicator authoring agent](https://docs.chartnaut.com/scripting/indicator-authoring-agent/): The indicator builder's agent writes and edits one indicator script: inputs, outputs, dependencies, layers and onBar. Its edits apply straight to the code, and the chart beside ... - [Definition authoring agent](https://docs.chartnaut.com/scripting/flow-authoring-agent/): The definition builder's agent writes and edits one definition: its events, the emits with their labels, what it draws, and every file of a multi-file package. Its edits apply s... - [Study authoring agent](https://docs.chartnaut.com/scripting/study-authoring-agent/): The study builder's agent writes one study: which definitions it reads, what it collects per event, and what it publishes. Unlike the indicator and definition agents, it never a... - [Forward insight agent](https://docs.chartnaut.com/scripting/pin-orchestrator/): The Forward Insight agent works inside the Put on chart sheet. It adds a pin_cell result to a finished study so that the study's answer shows on Charts, on the bar where the set... - [Agent lint and dry-run](https://docs.chartnaut.com/scripting/agent-lint-and-dry-run/): Every agent checks its code before you see the result: lint for shape, typecheck for the values passed to the DSL, then a dry run that executes the saved script on real market d... - [Overview](https://docs.chartnaut.com/scripting/troubleshooting-overview/): Find what you see in the left column. The cause and the fix are in the same row; the link is only for more depth. - [FAQ](https://docs.chartnaut.com/scripting/faq/): Answers to the questions people ask most about scripting in Chartnaut. Each answer is complete here; links go to the full reference. - [Budget exceeded](https://docs.chartnaut.com/scripting/budget-exceeded/): A budget error means the script did more work than Chartnaut allows for one run, so it was stopped to keep the chart or the study responsive. The message names the budget and gi... - [Dependency unavailable](https://docs.chartnaut.com/scripting/dependency-unavailable/): Your script declares another indicator or definition and reads its output, but the value is empty. The plot is blank, study rows are skipped, or the chart legend shows dependenc... - [Emit not collected](https://docs.chartnaut.com/scripting/emit-not-collected/): Your definition calls ctx.emit, but no events appear on the chart, after running the definition over history, or in a study. Every emit that does not become an event was either ... - [Forward Insight errors](https://docs.chartnaut.com/scripting/pin-validation-errors/): This page covers what goes wrong when you put a study on the chart as a Forward Insight, and what goes wrong when you click an event afterwards. Each message is quoted as the ap... ## CLI, MCP & APIs Run your scripts from a terminal, a coding agent, an AI app like Claude or ChatGPT, or your own code. - [Overview](https://docs.chartnaut.com/cli/overview/): Run your indicators, definitions and studies on Chartnaut's servers from a terminal, a coding agent, an AI app over MCP, or your own code. - [Install](https://docs.chartnaut.com/cli/install/): Install the Chartnaut CLI on macOS, Linux or Windows with one command, then update or remove it. - [Sign in](https://docs.chartnaut.com/cli/sign-in/): Connect the CLI to your account by approving a code in the browser, or with an API key for CI. - [Your first run](https://docs.chartnaut.com/cli/your-first-run/): Set up a folder, write an EMA, validate it, run it on 30 days of BTC and save it. - [Working with Claude Code and Codex](https://docs.chartnaut.com/cli/claude-code-and-codex/): What chartnaut init gives Claude Code and Codex, the loop they follow, and how they read full results. - [Command reference](https://docs.chartnaut.com/cli/command-reference/): Every chartnaut command and flag, with defaults and limits. - [Saving and versions](https://docs.chartnaut.com/cli/saving-and-versions/): Push and pull scripts, resolve version conflicts, and go back to an older version. - [Runs and results](https://docs.chartnaut.com/cli/runs-and-results/): List runs, compare instruments, and fetch full results, study blocks and CSV, including study runs made in the app. - [Definition events](https://docs.chartnaut.com/cli/events-and-collect/): Read, filter and export a definition's stored events from the CLI, and run it over more history. - [Connect Chartnaut to an AI app](https://docs.chartnaut.com/cli/mcp-overview/): Let Claude, ChatGPT, Cursor or Codex read the docs, write scripts and run them on your account over MCP. - [MCP, the Agent or the CLI](https://docs.chartnaut.com/cli/mcp-vs-agent-vs-cli/): Three ways to have an AI build and run your scripts: an AI app over MCP, Chartnaut's own Agent, or the CLI with a coding agent. When to use which. - [Claude](https://docs.chartnaut.com/cli/mcp-claude/): Add Chartnaut as a custom connector in claude.ai and Claude Desktop, or as an MCP server in Claude Code. - [ChatGPT](https://docs.chartnaut.com/cli/mcp-chatgpt/): Add Chartnaut to ChatGPT as a custom MCP connector and sign in with your Chartnaut account. - [Cursor and Codex](https://docs.chartnaut.com/cli/mcp-cursor-and-codex/): Add Chartnaut's MCP server to Cursor's mcp.json or Codex's config.toml, with a browser sign-in or an API key. - [What you can ask](https://docs.chartnaut.com/cli/mcp-what-you-can-ask/): Requests that work well in Claude, ChatGPT or Cursor once Chartnaut is connected, with the tools each one uses, and the three built-in prompts. - [Permissions and connected apps](https://docs.chartnaut.com/cli/mcp-permissions/): What an AI app can do once you click Allow, how long it stays signed in, and how to disconnect it. - [Security and privacy](https://docs.chartnaut.com/cli/mcp-security-and-privacy/): What a connected AI app sees and never sees, how the sign-in and its tokens are protected, and how to cut an app off. - [Limits and cost](https://docs.chartnaut.com/cli/mcp-limits-and-cost/): What a connected AI app costs against your plan: what each plan allows, API requests per tool, heavy calls, long polls, runs at once and compute. - [MCP tools reference](https://docs.chartnaut.com/cli/mcp-tools/): Every tool, prompt and resource Chartnaut's MCP server offers, with inputs, outputs, limits and errors. - [Troubleshooting MCP](https://docs.chartnaut.com/cli/mcp-troubleshooting/): Fix an AI app that will not connect, keeps asking you to sign in, or gets plan_limit, forbidden_scope, rate_limited, busy or cut-off results from Chartnaut. - [How the MCP server works](https://docs.chartnaut.com/cli/mcp-how-it-works/): The transport, what happens on each tool call, the OAuth sign-in step by step, and what Chartnaut stores for a connection. - [API keys](https://docs.chartnaut.com/cli/api-keys/): Create, scope and revoke the keys the CLI and your own code use to act as you. - [API overview](https://docs.chartnaut.com/cli/api-overview/): What the Chartnaut API is for, how to authenticate, and a first call to check your key and start a run. - [Getting started](https://docs.chartnaut.com/cli/api-reference/): Base URL, keys, scopes, heavy calls, paging, errors and idempotency, with an index of every endpoint. - [Get the current key](https://docs.chartnaut.com/cli/api-get-current-key/): The username, plan and scopes of the key making the call. - [Get usage](https://docs.chartnaut.com/cli/api-get-usage/): Compute used this month, every plan cap with its count, and your API limits. - [List timeframes](https://docs.chartnaut.com/cli/api-list-timeframes/): The nine timeframes a run or a definition run over history can use. - [Search instruments](https://docs.chartnaut.com/cli/api-search-instruments/): Find instruments you can run on by text and category, with your coverage on each. - [Get an instrument](https://docs.chartnaut.com/cli/api-get-instrument/): One instrument by canonical or short symbol, with the coverage your plan can reach. - [The Instrument object](https://docs.chartnaut.com/cli/api-object-instrument/): The fields of an instrument: symbols, category, order flow, coverage and sessions. - [List doc topics](https://docs.chartnaut.com/cli/api-list-doc-topics/): Every page of the scripting reference, in sidebar order. - [Get a doc topic](https://docs.chartnaut.com/cli/api-get-doc-topic/): One scripting reference page as markdown. - [List scripts](https://docs.chartnaut.com/cli/api-list-scripts/): Your indicators, definitions and studies, most recently changed first. - [Get a script](https://docs.chartnaut.com/cli/api-get-script/): One of your scripts at its latest or a given version, optionally with source. - [List versions](https://docs.chartnaut.com/cli/api-list-script-versions/): A script's versions, newest first, with who saved each and what changed. - [Validate a script](https://docs.chartnaut.com/cli/api-validate-script/): Check code without saving or running it: diagnostics, interface and dependencies. - [Create a script](https://docs.chartnaut.com/cli/api-create-script/): Create an indicator, definition or study and save its first version. - [Save a script version](https://docs.chartnaut.com/cli/api-save-script-version/): Save new files as the next version, refused if someone saved first. - [Update script details](https://docs.chartnaut.com/cli/api-update-script-metadata/): Change a script's name, description or visibility without adding a version. - [Delete a script](https://docs.chartnaut.com/cli/api-delete-script/): Delete one of your scripts. - [The Script object](https://docs.chartnaut.com/cli/api-object-script/): The fields of a script, in its list form and its full form. - [The File object](https://docs.chartnaut.com/cli/api-object-file/): One source file of a script: path, code and entry flag. - [The Interface object](https://docs.chartnaut.com/cli/api-object-interface/): What Chartnaut read from a script: settings, outputs, events, results and timeframes. - [The Dependency object](https://docs.chartnaut.com/cli/api-object-dependency/): Another script a script's version reads, with its alias and pinned version. - [The Version object](https://docs.chartnaut.com/cli/api-object-version/): One saved version of a script: number, summary, author and time. - [The Diagnostic object](https://docs.chartnaut.com/cli/api-object-diagnostic/): One finding from checking a script's code. - [List events](https://docs.chartnaut.com/cli/api-list-events/): A definition's stored events, filtered by instrument, timeframe, time, version and payload. - [Summarise events](https://docs.chartnaut.com/cli/api-summarise-events/): A definition's event totals per instrument and timeframe, and runs over history still going. - [Run a definition over history](https://docs.chartnaut.com/cli/api-run-definition-over-history/): Run a definition over a window and store its events for studies to read. - [The Event object](https://docs.chartnaut.com/cli/api-object-event/): One event a definition found: id, instrument, times and payload. - [Create a run](https://docs.chartnaut.com/cli/api-create-run/): Start an indicator, definition or study run on an instrument and window. - [List runs](https://docs.chartnaut.com/cli/api-list-runs/): Your runs, newest first, from the API, the app or both. - [Get a run](https://docs.chartnaut.com/cli/api-get-run/): One run's status, progress and summary, optionally waiting for it to finish. - [Get run results](https://docs.chartnaut.com/cli/api-get-run-results/): What a succeeded run produced: points, events or study result blocks. - [Cancel a run](https://docs.chartnaut.com/cli/api-cancel-run/): Cancel a queued or running run. - [The Run object](https://docs.chartnaut.com/cli/api-object-run/): The fields of a run: what ran, its status, progress, summary and usage. - [The Failure object](https://docs.chartnaut.com/cli/api-object-failure/): Why a run failed or was cancelled, and whether to retry. - [The Summary object](https://docs.chartnaut.com/cli/api-object-summary/): The counts from a succeeded run, by kind. - [Create a Forward Insight](https://docs.chartnaut.com/cli/api-create-insight/): Save a study run's pin_cell answer to your library as a Forward Insight, or dry-run it to see the card first. - [List Forward Insights](https://docs.chartnaut.com/cli/api-list-insights/): Your Forward Insights, newest change first, filtered by definition, study, instrument or timeframe. - [Get a Forward Insight](https://docs.chartnaut.com/cli/api-get-insight/): One of your Forward Insights by its id. - [Update a Forward Insight](https://docs.chartnaut.com/cli/api-update-insight/): Rename a Forward Insight or change its description. - [Activate a Forward Insight](https://docs.chartnaut.com/cli/api-activate-insight/): Make a Forward Insight active, so the latest setup of its definition shows it on your charts. - [Deactivate a Forward Insight](https://docs.chartnaut.com/cli/api-deactivate-insight/): Stop a Forward Insight showing on your charts. It stays in your library. - [Remove a Forward Insight](https://docs.chartnaut.com/cli/api-delete-insight/): Archive a Forward Insight from your library. The study and its runs are kept. - [The Forward Insight object](https://docs.chartnaut.com/cli/api-object-insight/): The fields of a Forward Insight: its definition, study, instrument, timeframe, breakdown and window. - [Search the library](https://docs.chartnaut.com/cli/api-search-library/): Find indicators, definitions and studies you can run: yours, Chartnaut's built-ins and the community's. - [Get a library script](https://docs.chartnaut.com/cli/api-get-library-script/): One library script's description, interface and dependencies, by author and slug. Never its source. - [Check what a script needs](https://docs.chartnaut.com/cli/api-get-library-requirements/): What adding another author's script to your library would add with it, and anything that stops it. Changes nothing. - [Add to your library](https://docs.chartnaut.com/cli/api-add-to-library/): Add another author's indicator or definition to your library, with the scripts it needs, once the person has agreed to them. - [Remove from your library](https://docs.chartnaut.com/cli/api-remove-from-library/): Take another author's script out of your library. The scripts it brought along stay. - [The Library script object](https://docs.chartnaut.com/cli/api-object-library-script/): The fields of a script as the library describes it, in its list form and its full form. - [Start a sign-in](https://docs.chartnaut.com/cli/api-start-sign-in/): Start the browser sign-in behind chartnaut login and get the codes to show and poll with. - [Poll a sign-in](https://docs.chartnaut.com/cli/api-poll-sign-in/): Check whether a sign-in was approved and receive the new API key. - [Revoke the current key](https://docs.chartnaut.com/cli/api-revoke-key/): Revoke the key making the call. - [Call the MCP server](https://docs.chartnaut.com/cli/api-call-mcp-server/): Send MCP JSON-RPC requests to Chartnaut's remote MCP server over Streamable HTTP. - [Get protected resource metadata](https://docs.chartnaut.com/cli/api-get-protected-resource-metadata/): Discover which authorization server issues tokens for the MCP server, and its scopes. - [Get authorization server metadata](https://docs.chartnaut.com/cli/api-get-authorization-server-metadata/): Discover Chartnaut's OAuth endpoints, grant types and PKCE method. - [Register a client](https://docs.chartnaut.com/cli/api-register-client/): Register an MCP client dynamically and get its client_id. - [Start an authorization](https://docs.chartnaut.com/cli/api-start-authorization/): Send the person to Chartnaut's consent page and get an authorization code back. - [Get a token](https://docs.chartnaut.com/cli/api-get-token/): Exchange an authorization code, or a refresh token, for an access token and a new refresh token. - [Revoke a token](https://docs.chartnaut.com/cli/api-revoke-token/): Revoke an access token, or end a connection with its refresh token. - [Webhooks](https://docs.chartnaut.com/cli/api-webhooks/): Notices when a run finishes: not built yet, answers 501. - [Limits](https://docs.chartnaut.com/cli/limits/): How request, heavy-call, long-poll and runs-at-once limits behave, and how to retry. - [Errors and exit codes](https://docs.chartnaut.com/cli/errors-and-exit-codes/): Every API error code, run failure kind and CLI exit code, and which to retry. - [Partner API overview](https://docs.chartnaut.com/cli/partner-overview/): Link your users' Chartnaut accounts, run backtests and demo accounts for them, and embed Chartnaut in your site. - [Partner keys](https://docs.chartnaut.com/cli/partner-keys/): Make, rotate and revoke the secret keys your server uses for the partner API. - [Linking users](https://docs.chartnaut.com/cli/partner-linking/): Link a user's Chartnaut account to their account on your site, with the scopes they approve. - [The frame and embed.js](https://docs.chartnaut.com/cli/partner-frame/): Put Chartnaut's backtest screen on your page with one script or the @chartnaut/charts package, sign users in once, receive its events and send it commands. - [Backtest sessions](https://docs.chartnaut.com/cli/partner-sessions/): Create backtests for your users, read their results, list them by label and lock or end many at once. - [Demo accounts](https://docs.chartnaut.com/cli/partner-demo-accounts/): Create simulated-money accounts on live prices for your users, lock and unlock them, and close them all at once. - [Rules](https://docs.chartnaut.com/cli/partner-rules/): Daily loss, drawdown, position limits, profit targets and slippage on sessions and demo accounts, and what happens on a breach. - [Webhooks](https://docs.chartnaut.com/cli/partner-webhooks/): The events Chartnaut sends your server, how to verify their signature and how retries work. - [Alerts](https://docs.chartnaut.com/cli/partner-alerts/): Read when a linked user's own Chartnaut alerts fire. - [Limits and errors](https://docs.chartnaut.com/cli/partner-limits-and-errors/): The partner API's rate limits and caps, the rate-limit headers, and every error code. ## Account Profile, billing, plans and limits, and support. - [Profile](https://docs.chartnaut.com/account/profile/): Set your avatar, username, bio and links, and see what you have published. - [Subscription and billing](https://docs.chartnaut.com/account/subscription-and-billing/): Upgrade to Pro, buy add-ons, cancel or reactivate, and find invoices and usage. - [Preferences](https://docs.chartnaut.com/account/preferences/): Set the timezone your charts, trades and journal use, and pick a theme. - [Support](https://docs.chartnaut.com/account/support/): Ask the help chat, email support, send feedback and check system status. - [Plans and limits](https://docs.chartnaut.com/account/plans-and-limits/): What Free and Pro include and every limit on each in one table, with what happens when Pro ends. - [Add-ons](https://docs.chartnaut.com/account/add-ons/): Nine monthly add-ons that raise a Pro limit: MetaTrader, cTrader and TradeLocker accounts, events, studies, definitions, runs at once, alerts, multistream hours and private stream seats. - [Library limits](https://docs.chartnaut.com/account/library-limits/): How many definitions, studies, custom indicators, apps, dashboards and stored trades each plan keeps, and what happens at the cap. - [Definition events](https://docs.chartnaut.com/account/definition-events-limit/): How many events your definitions can collect on each plan, what uses the allowance and why events are kept. - [Historical data](https://docs.chartnaut.com/account/historical-data/): Three years of history on Free and all of it on Pro, where backtest sessions can start, and what that means for charts, definitions and indicators. - [Datasets by plan](https://docs.chartnaut.com/account/datasets-by-plan/): Which reference data your scripts can read on each plan: the economic calendar, rates and yields, options levels and options contracts, and how many datasets one script may read. - [Chart limits](https://docs.chartnaut.com/account/chart-limits/): Panels open, indicators per chart and timeframes per indicator on each plan, and what Charts does at each limit. - [Indicator memory](https://docs.chartnaut.com/account/indicator-memory/): How many bars an indicator can remember on each plan, and what you see when it asks for more. - [Runs at once](https://docs.chartnaut.com/account/runs-at-once/): How many script runs your account can have going at once, shared by the app, the Agent and the API. - [Agent workspace](https://docs.chartnaut.com/account/agent-workspace/): How much space the agent has for the files it works out, how long they are kept, and what each program it runs may use. - [Live accounts](https://docs.chartnaut.com/account/live-accounts/): How many live broker accounts Free's trial and Pro allow at once, MetaTrader's own allowance, add-ons for more, and what happens when Pro ends. - [Historical Intelligence limits](https://docs.chartnaut.com/account/historical-intelligence-limits/): How many playbooks Historical Intelligence learns from on each plan, and how many markets in each. - [API limits](https://docs.chartnaut.com/account/api-limits/): Requests a minute, heavy calls and long polls for the CLI, MCP and API on each plan. - [AI credits](https://docs.chartnaut.com/account/ai-credits-billing/): AI credits are pay as you go: pricing, bonuses and what spends them. - [Hitting a limit](https://docs.chartnaut.com/account/hitting-a-limit/): Every plan limit message with what to do, and what happens to your work when Pro ends.