> ## Documentation Index
> Fetch the complete documentation index at: https://docs.darvas.app/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> These docs cover the Darvas financial data API, its MCP server, data API and Darvas Pro+ webhooks, and Pine Script custom indicators for Darvas charts.
> https://docs.darvas.app/llms.txt lists every indexed page with a summary, and https://docs.darvas.app/llms-full.txt holds them in one file. Add .md to any page URL to read that page as Markdown. The lookup lists of tickers, types and series are named at https://docs.darvas.app/ai-agents.
> The docs MCP server https://docs.darvas.app/mcp searches and reads these docs. It needs no key.
> Call the REST API at https://api.darvas.app/v1. Send the API key, which starts with dvk_, in the X-API-KEY header or as Authorization: Bearer. The OpenAPI 3.1 spec of all 168 operations is https://docs.darvas.app/openapi.yaml.
> Name a company by ticker or cik. A share class takes a dot or a dash, so BRK.B and BRK-B name the same shares. Dates are YYYY-MM-DD.
> A list answer holds one page. Request its next_page_url as it is until the answer has none. limit counts rows across all pages.
> Errors are JSON with a stable error code and a message: 400 VALIDATION_ERROR, 401 UNAUTHORIZED, 403 PLAN_REQUIRED, 404 NOT_FOUND, 429 RATE_LIMITED or QUOTA_EXCEEDED, 500 INTERNAL_ERROR and 503 UNAVAILABLE. On a 429, wait the seconds in Retry-After. 1 credit = 1 successful call: a 2xx answer with data costs one credit however many rows it holds (at most 1,000 a page), and empty answers, errors and FINRA /short-volume cost 0 credits.
> The Financial Data MCP server is https://api.darvas.app/mcp (Streamable HTTP, protocol 2025-11-25, the same API key in X-API-KEY or as a Bearer token). tools/list answers 8 flagship tools plus search_data_tools and call_data_tool by default; ?mode=full lists all 164 tools and ?toolsets=sec,crypto,macro lists domains. Every tool is callable by name, takes response_format (json, compact or tsv) and fields, and a list answer's cursor value goes in the cursor argument. The darvas://catalog/* resources cost 0 credits. Setup for each client is at https://docs.darvas.app/mcp-server.
> The data API covers SEC filers and their filings, statements, XBRL facts, debt maturities, ownership and earnings, US stock prices, technicals and FINRA short volume, macro series and a global economic calendar.
> Its crypto data covers prices, indices, order books, order flow, volume profiles, derivatives, options, liquidations, spot ETF flows and a screener across 9 exchanges. It also covers DeFi protocols, stablecoins, yields and DEX pairs, and Polymarket, Kalshi and OKX prediction markets. https://docs.darvas.app/market-coverage gives the history and update time of each dataset.
> https://docs.darvas.app/ai-agents names the endpoint and the MCP tool that answer each kind of question about these datasets.
> Custom indicators for Darvas charts are Pine Script v5 or v6 indicator() or strategy() scripts. Darvas rewrites Pine v1 to v4 to v5 and runs no other indicator language. Start at https://docs.darvas.app/pine-script/introduction.
> https://docs.darvas.app/pine-script/support lists the Pine Script that Darvas runs. https://docs.darvas.app/pine-script/request-security covers request.security() and request.financial(), and https://docs.darvas.app/pine-script/limits lists the run limits.
> Darvas Pro+ webhooks send a signed POST for alarm fires and pauses, scheduled answers, economic calendar alerts, ETF flow updates, ended connections and the data API events. https://docs.darvas.app/pro/webhooks lists every event, its object and how to verify the Darvas-Signature header.

# Pine Script Code Editor, Logs & Versions

> Explore the Darvas Pine Script editor: AI assistant and Code tabs, runtime logs, input dialogs, version history, drafts and script management.

## Open the editor

* **Desktop:** in `/terminal`, choose **Indicators** in the rail on the right of the chart. With Darvas V3, switch the V3 panel to **Custom indicator**.
* **Mobile:** open the indicator menu, choose **Custom** and tap **New custom indicator**. The editor opens as a sheet.
* **An indicator you saved:** choose its edit button in the **Custom** category of the indicator menu.

## Header

| Part | What it does |
| - | - |
| Indicator switcher | Opens one of your saved indicators, or starts a **New indicator**. |
| Status | **New draft**, **Not saved**, **Saved**, or the current version, such as **v3**. |
| **Save** | Saves the script. The first save asks for a name. Each name can be used once per account. |
| **Share** | Opens the sharing settings. See [Share an indicator](https://docs.darvas.app/pine-script/sharing.md). |
| Menu | **New**, **Edit indicator details**, **Inputs**, **Share** and **Community indicators**. |

**Edit indicator details** changes the name (up to 64 characters) and the description (up to 280 characters). Choose **Save** to keep the change.

## Darvas tab

The **Darvas** tab is the assistant. Describe an indicator, or paste a TradingView script, and Darvas writes or fixes the Pine Script, tests it on the chart and adds it. See [Write indicators with Darvas](https://docs.darvas.app/pine-script/ai-assistant.md).

The tab also lists the versions of the indicator. Every change to the code is a version, whether Darvas or you made it. Choose **Restore** on an earlier version to make its code current again. Darvas saves the restore as a new version. Darvas keeps the newest 50 versions.

On a saved indicator, **Set alert** creates an alert on its marks. See [Alerts on indicator marks](https://docs.darvas.app/pine-script/alerts.md).

## Code tab

The **Code** tab holds the Pine source.

* **Add to chart** runs the script on the chart's newest 1,000 candles and draws it. After the first run the button reads **Update chart**.
* When the script fails, the editor marks the line and shows the error message.
* **Logs** lists the lines from `log.info()`, `log.warning()` and `log.error()` with the bar each line came from, plus warnings from the runner, such as drawings left out over a cap. It keeps the newest 1,000 lines. Logs come only from runs in the editor.
* A script written for Pine v1 to v4 runs after an automatic rewrite to v5. The editor then shows "Converted from Pine v4 automatically. Compare the result with TradingView."

## Inputs

**Inputs** in the menu, or the settings button of the indicator in the chart legend, opens a dialog with one field for each `input.*()` of the script. **Save** keeps your values and **Defaults** puts back the script's own. [Pine Script support](https://docs.darvas.app/pine-script/support.md#inputs) lists the input types and options the dialog shows.

## Drafts

A script you add to the chart without saving is a draft. It stays in your browser until you close Darvas, and then it is removed. Save it to keep it, to use it on other charts and devices, and to set alerts or share it.

## Rename or delete an indicator

* **Rename:** open the indicator, choose **Edit indicator details**, change the name and choose **Save**.
* **Delete:** in the **Custom** category of the indicator menu, choose the delete button of the indicator and confirm. Deleting removes the saved source. If you shared the indicator, everyone who added it loses it too.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.