Versions
A rewrite is syntactic. Where a language rule changed between versions, compare the result with TradingView.
Declarations
A script without an
indicator() or strategy() declaration fails with an error.
What the chart draws
plot()with the stylesline,linebr,stepline,stepline_diamond,steplinebr,histogram,columns,area,areabr,circlesandcross, and the optionsoffset,show_last,trackprice,histbase,join,linestyle,format,precision,displayandforce_overlay.hline(),fill()between plots or hlines, including gradient fills,bgcolor()andbarcolor().plotshape(),plotchar(),plotarrow(),plotcandle()andplotbar().label,line,box,linefill,polylineandtabledrawings, with text, tooltips, arrows andextend.display.nonehides a plot.scale.leftandscale.noneplace the script on the left scale or on an unlabeled scale of its own.
plotchar() with an empty character, a drawing with an na coordinate or color, a polyline with fewer than two points and an empty table draw nothing. When a run passes one of the output caps, Darvas leaves the extra items out and writes a warning to the editor’s Logs.
Strategies
Astrategy() script runs, and Darvas places no orders.
- Simulated orders are arrows on the price chart, under the bar for a buy and over it for a sell. Blue marks a long entry, red a short entry and purple an exit. Each arrow shows the order id and the signed size, such as “Long +1”.
- Backtest in the chart legend shows the net profit, closed and open trades, win rate, profit factor and max drawdown of the closed trades.
- Darvas does not show the Strategy Tester’s other figures or its trade list.
- Strategy order alerts do not exist on Darvas, so
{{strategy.*}}placeholders stay as written.
Inputs
The inputs dialog has a field for each of theseinput.*() types.
Darvas applies these input options:
minvalandmaxvallimit the value.stepsets the step of the number field.groupputs inputs under a heading, and inputs that share aninlineid sit on one row.tooltipadds an info button next to the input name.confirm=trueopens the dialog when you add the indicator to a chart. Closing the dialog keeps the defaults.- The dialog lists every input whatever its
displaysays.
Logs
log.info(), log.warning() and log.error() write to Logs in the editor, with the bar each line came from. Only runs in the editor keep logs. Saved runs, alerts and community indicators keep none.
Not supported
Known differences from TradingView
x == (y == z)loses its parentheses, sobarstate.isfirst == (bar_index == 0)is false.ta.supertrendgivesnaas the direction on its warm-up bars, where TradingView gives 1.