Requirements
- The indicator is saved. A draft is deleted when you close Darvas, and its alert would stop with it.
- The chart timeframe is 15 minutes or longer, on a market whose candles Darvas stores.
- Your plan has room for one more. Darvas Free has 1 indicator alert, Darvas Pro 5 and Darvas Pro+ 20, and each counts toward the plan’s conditional alerts.
Set an alert
- Open the saved indicator in the editor, on the market and timeframe to watch.
- In the Darvas tab, choose Set alert. The assistant also shows this card when your request asks for alerts.
- Under What sets off the alert, choose one:
- Buy and sell marks, then BUY marks, SELL marks or All marks.
- One of the script’s
alertcondition()titles. - Any alert() function call.
- Choose Set alert.
What counts as a mark
A mark is a point ofplotshape() or plotchar() whose value is not false, na or 0, or a label from label.new(). A plotchar() with an empty character does not count. Simulated strategy orders do not count.
Darvas reads a mark’s direction in this order:
- Words in its title or text: buy, long, bull, bullish or al for a buy, and sell, short, bear, bearish or sat for a sell. A mark with words of both kinds goes on to the next rule.
- Its shape or label style: an up shape is a buy and a down shape is a sell.
- Its place: below the bar is a buy and above the bar is a sell.
alertcondition() and alert()
- The card lists each
alertcondition()whose title is a constant string. A title in a variable is not listed. - Any alert() function call fires on every bar where the script calls
alert(). - The notification carries the alert’s message, or the condition’s title when the message is empty. Darvas fills these placeholders in
alertcondition()andalert()messages:{{ticker}},{{exchange}},{{interval}},{{open}},{{high}},{{low}},{{close}},{{volume}},{{time}},{{timenow}},{{syminfo.currency}},{{syminfo.basecurrency}},{{plot_0}}to{{plot_19}}and{{plot("Title")}}. Times are in UTC.{{strategy.*}}placeholders stay as written. - Every frequency works as “once per bar close”, because Darvas checks closed candles. A condition that is true only inside a candle, and false at its close, never fires.
When Darvas checks
- Darvas runs the saved script shortly after each candle closes, on the same 1,000 candles a chart uses, and reads only closed candles.
- The first check only records the newest mark, so an alert never fires on history.
- A newer mark sends a notification in the app, as a push notification and on Telegram, if you connected it. The alert stays on after it fires.
- On Darvas Pro+, a webhook that subscribes to
alarm.custom_indicator.triggeredreceives each alert as a signed POST.
When an alert pauses
Darvas turns an alert off in these cases:- You can no longer run the indicator, for example because its author stopped sharing it.
- The script fails on 3 candle closes in a row.
- The script passes its 10 second run time or its memory on 10 candle closes in a row.