Skip to main content
In this quickstart you add a moving average crossover indicator to a chart, save it and change one of its inputs.

1. Open the indicator editor

  • Desktop: in /terminal, choose Indicators in the rail on the right of the chart. If your account has Darvas V3, open the V3 panel and switch it to Custom indicator.
  • Mobile: open the indicator menu, choose the Custom category and tap New custom indicator.
The editor opens with two tabs, Darvas and Code.

2. Paste the script

Open the Code tab, replace the template with this script, and choose Add to chart.
The chart shows two moving averages on the price, a green triangle under each bar where the fast one crosses above the slow one, and a red triangle above each bar where it crosses below. The button now reads Update chart. If the script has an error, the editor marks the line and shows the message. Messages from log.info() and runner warnings are in Logs under the editor.

3. Save the indicator

Choose Save and give the indicator a name. An indicator you do not save is removed when you close Darvas. A saved indicator is in the Custom category of the indicator menu, and you can add it to any chart and timeframe. Each change to its code is a new version that you can go back to.

4. Change an input

Open the menu in the editor header and choose Inputs, or use the settings button of the indicator in the chart legend. Set Fast length to 5 and save. The fast average and the triangles move.

Next steps

Write it with Darvas

Describe the indicator in your own words.

Set an alert

Get a notification on each new buy or sell triangle.

Pine Script support

What Darvas draws and what it does not run.

The indicator editor

Every part of the editor.