Documentation/AlgoCode/Language
Dovee
Dovee is Laabh’s English strategy language — not Pine. Write when-rules, marks, risk, and session filters; we run them live on the same pipeline.
Chart Script → Dovee tab. The Pine tab stays for TradingView scripts. Add to Chart and Deploy work the same for both.
This page is the language tour. Every word and indicator — signature, parameters, return value, example — is in the function reference.
What a trader can write
strategy "EMA Cross" long only once session 9:15 to 15:15 fastLen = input 9 as "Fast EMA" fast = ema(close, fastLen) slow = ema(close, 21) plot fast as "Fast" blue plot slow as "Slow" orange fill fast, slow blue when fast crosses above slow and bullish buy arrow up "Buy" label "Buy" paint green when fast crosses below slow exit arrow down "Exit" alert "Trend flipped" stop 10 points targets 20, 40 split 50, 50
Entries
buy/sell/exit— long, short, flatten (exitonly while in a trade)long only/short only— opposite side becomes an exitonce— no second entry while already in a tradesession 9:15 to 15:15— signals only in that clock window
Chart
- Lines:
plot fast as "Fast" blue - Band:
fill fast, slow green - Level:
level 70 as "Overbought" red - Marks:
arrow up "Buy",label "Buy" - Tint:
paint greeninsidewhen - RSI-style pane: put
oscillatorat the top
Conditions
crosses above/crosses belowis above/is belowclose 1 bars agoprevious bar (shorthand:close[1]);close rising- Candles:
bullish,bearish,doji,hammer,engulfing,shootingstar,insidebar,pinbar - Clock:
monday…sunday,hour,minute(chart timezone) elseafter awhenalert "message"— notify without an extra order- Symbols work too:
rsi(14) > 70,+-*/
Language basics
- Comments:
#or// whenis the usual word for a rule (ifstill works);plotis the usual word for a line (showstill works); bodies can use indent,then, or{ }- Math:
roundfloorceilsqrtlogpowsignabs - Price also has
time(bar unix seconds),hour,minute. Evaluation is on each closed candle, not ticks. - Also:
change,replaceMissing(shorthandnz),barssince.nameans not available — not enough bars yet (for exampleema(50)on the first 49 bars). - Colors:
greenredblueorangepurplegraygreywhiteblackyellowlime - Debug without trading:
note "fast=" + fast(ordebug)
Indicators
English names, not Pine ta.*. Same library as the chart indicators — HMA, Keltner, Donchian, Williams %R, AO, Ichimoku lines, and the rest. ema(9) means close. Supertrend is supertrend(10, 3) (ATR length, then factor). Multi-line tools: keltnerupper, macdsignal, tenkan. Full list with arguments: Dovee reference.
Knobs for the UI: fastLen = input 9 as "Fast EMA". The old word ask still runs (you will see a deprecation warning).
Inputs can also control stop, target, and trailing settings: stopPoints = input 10 as "Stop Loss", then stop stopPoints points; use target targetPoints points the same way. For a stepped trailing stop, use trailAmount = input 10 as "Trailing Steps" and trailBy = input 5 as "Trail By", then trailsteps trailAmount points and trail trailBy points. Multi-target targets 10, 20, 30 split 40, 30, 30 shows Target 1/2/3 and Split 1/2/3 in Inputs. You can also name them: tp1 = input 10 as "Target 1" then targets tp1, tp2, tp3 split 40, 30, 30.
Risk
stop 10 pointsorstop stopPoints points,stop 2 percent, orstop 2 atr(2 × ATR of 14)target 20 points; for stepped trailing,trailsteps 10 pointsmeans the price must move 10 points, andtrail 5 pointsmoves the stop by 5 points each time. Withouttrailsteps, trail keeps following price at that distance.- Multi-target:
targets 100, 200, 300 split 50, 30, 20(those numbers are editable in Inputs as Target 1/2/3 and Split 1/2/3)
Live size and exchange still come from Deploy — not from the script. qty on the script is only a hint: if Deploy has a size set, that size is the one that is used.
Start with these 10
The reference lists every indicator. New traders can begin here:
ema— Follow the trend; fast vs slow EMA crossovers.sma— A slower trend line — support and resistance.rsi— Spot overbought / oversold turns.macdline— Momentum and trend change.supertrend— Stay with the trend; trail with ATR.atr— Measure volatility; size stops as stop 2 atr.bbupper— Upper Bollinger — stretch and mean reversion.bblower— Lower Bollinger — stretch and mean reversion.vwap— Intraday fair value vs the session average.adx— Trend strength (not direction). High ADX = a real trend.
Other projects
Copy lib/dovee. Each indicator lives in ta/ (ema, rsi, Supertrend, MACD, Bollinger, and the rest). Call evaluateDovee(source, candles)— no Pine runtime required. On Laabh charts we still compile to Pine so live orders stay on the existing pipeline.
Templates in the Dovee tab: EMA Cross, RSI, Supertrend. Next: Function reference · Deploy · Pine examples