ChartnautDocs

Build your own indicator

By the end of this tutorial you will have your own session VWAP with bands at 1 and 2 standard deviations, checked against real data, saved in your library and drawn on a chart in Charts. The upper band is the one the opening range study in Test your first trading idea splits its breaks by.

The agent writes the script, paid for with AI credits or your own AI subscription. You describe what you want and check what it draws.

Describe the indicator

Say what it calculates, when it resets and what it should look like. This is the description used here:

Build a session VWAP that resets at the New York session open, with bands at 1 and 2 standard deviations above and below. Draw VWAP as a solid line and the bands as thinner lines.

  1. In the sidebar, open Tools → Indicators.

  2. Click New at the top right. The page asks What do you want to build?

  3. Type your description into the box and press Enter. Session VWAP with σ bands under Suggested indicators fills in a similar prompt if you would rather start from that.

Screenshot to capture · 16:10 · build-your-own-indicator-new-indicator
New indicator page with the session VWAP description typed in
Route/morpheus/indicators/new
FocusThe welcome heading "What do you want to build?", the agent input and the Suggested indicators list
StateInput contains: "Build a session VWAP that resets at the New York session open, with bands at 1 and 2 standard deviations above and below. Draw VWAP as a solid line and the bands as thinner lines." Not yet sent.
Sourceclient/src/routes/authenticated/morpheus/indicators/NewIndicator.tsx:117 NewIndicator
The new indicator page with the session VWAP description typed in.

Chartnaut creates the indicator and opens the builder: the agent's chat on the left, a preview on the right. The agent writes the script and applies each change as it goes. Each change appears in the chat as a card with a one-line summary, and opening the card shows the code.

Preview it on the chart

  1. In the preview, open the Chart tab.

  2. Check that VWAP starts fresh at the New York open and that both pairs of bands sit either side of it.

  3. Use the arrows either side of the date to step through a few trading days, including a quiet one and a busy one.

The bands should be tight on a quiet day and wide on a busy one. If they are the same width every day, the standard deviation is not being calculated per session.

Screenshot to capture · 16:9 · build-your-own-indicator-preview
Indicator builder Chart tab showing session VWAP with 1 and 2 standard deviation bands
Route/morpheus/indicator-builder/<indicator id>
FocusThe preview pane: tab strip (Chart, Code, Errors, Logs), date control, and the chart with VWAP and four bands. Include the edge of the agent chat.
StateA finished session VWAP indicator with 1 and 2 standard deviation bands. Chart tab selected on a busy BTC day.
Sourceclient/src/routes/authenticated/morpheus/indicators/IndicatorBuilderPage.tsx:719 IndicatorBuilderPage
Session VWAP with 1 and 2 standard deviation bands in the builder preview.

Fix it with the agent

When something looks wrong, tell the agent what you see and on which day. It edits the script and the chart redraws.

  • The VWAP carries on from yesterday instead of resetting at the New York open.

  • The 2 standard deviation bands are drawn in the same colour as the 1 standard deviation bands. Make them fainter.

  • Add a setting for the band multipliers so I can change them.

If the chart stays empty, the Errors tab shows what stopped the script, and the agent reads it too. The Logs tab shows anything the script prints.

Save it

Each working change the agent makes is saved to the indicator as a new version, so it is already in your library. If you edit the code yourself in the Code tab, save it when you are done.

Open Tools → Indicators and click the indicator to see it. The Versions tab lists every saved version, and Preview Settings shows the settings it exposes. To change it later, click Make a change and carry on with the agent.

Add it to a chart

  1. Open Trading → Charts.

  2. Click Indicator in the toolbar.

  3. Under Library, choose Mine.

  4. Click your session VWAP.

The indicator draws on the chart straight away. Indicators on the chart covers its settings, hiding it and removing it.

Screenshot to capture · 4:3 · build-your-own-indicator-picker
Indicator picker in Charts with Mine selected and the session VWAP listed
Route/charts
FocusThe indicator picker dialog: search box, sidebar with Native categories and Library (Mine, Community, Create your own), Mine selected, the session VWAP row visible
StateThe session VWAP indicator exists in the library.
Sourceclient/src/components/charting-app/components/IndicatorSelectDialog.tsx:946 IndicatorSelectorDialogComponent
The indicator picker in Charts with your own indicators under Mine.