Logo of algocrab

Build trading rules without Python or Pine Script

Dovee is Algocrab's English strategy language — write when rules, plots, risk, and session filters; run them on the chart. Open any chart, use the code editor, press Run, and plots appear on the candles. For TradingView-only signals, use AlgoCrab Bridge instead of coding.

This tour matches the public Dovee docs on charting.in. Algocrab-specific publishing, brokers, and live risk are under On Algocrab.

What traders write: lengths and factors belong on input lines. buy, sell, and exit already draw an arrow and fill price — do not duplicate with extra labels on the same rule. Use alert only for a custom message.

Example — EMA cross

strategy "EMA Cross"
long only
session 9:15 to 15:15

fastLen = input 9 as "Fast EMA"
slowLen = input 21 as "Slow EMA"

fast = ema(close, fastLen)
slow = ema(close, slowLen)

plot fast as "Fast" blue
plot slow as "Slow" orange
fill fast, slow blue

when fast crosses above slow and bullish
  buy
when fast crosses below slow
  exit
  alert "Trend flipped"

stop 10 points
targets 20, 40 split 50, 50

Entries

  • buy / sell / exit — long, short, flatten (exit only while in a trade)
  • long only / short only — opposite side becomes an exit
  • One trade at a time for same-side adds — opposite signals flip direction. Use re-entry or an input toggle to allow pyramiding.
  • session 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
  • RSI-style pane: put oscillator at the top of the script
  • Optional marks: arrow up "Breakout", label, paint green on the bar

Conditions

  • crosses above / crosses below
  • is above / is below
  • History: close 1 bars ago or close[1]
  • Candles: bullish, bearish, doji, hammer, engulfing, …
  • else after a when; alert "message" without an extra order
  • Expressions: rsi(14) > 70, arithmetic + - * /

Language basics

  • Comments: # or //
  • when is the usual rule word (if still works); bodies use indent, then, or { }
  • Evaluation is on each closed candle, not ticks
  • na means not enough bars yet; replaceMissing (nz shorthand)
  • Helpers: change, barssince, valuewhen, mask
  • Debug: note "fast=" + fast (or debug)

Indicators

English names — ema(9), supertrend(atrLen, factor), rsi(14), not Pine ta.*. Anything the trader should tune from the UI is an input. Color a line with mask, not paint. Full signatures: Function reference.

Example — Supertrend

strategy "Supertrend Stop Target"

atrLen = input 10 as "ATR Length"
factor = input 3 as "Factor"

st = supertrend(atrLen, factor)
stUp = mask(st, close is above st)
stDown = mask(st, close is below st)
plot stUp as "Supertrend Up" green
plot stDown as "Supertrend Down" red

when close crosses above st
  buy

when close crosses below st
  sell

stop 2 points
target 2 points

Multi-timeframe & levels

  • HTF: ema(close, 50) on 1h — last closed HTF bar only
  • Prior periods: previous day high, previous week low
  • Session: session high (needs a session line)
  • Opening range: openingRange = range 9:15 to 9:30 then openingRange high
  • timezone "Asia/Kolkata" for sessions and calendar buckets

Strategy state (simulated)

  • flat / long / short / in position
  • entry price, bars since entry, profit percent, trade count
  • Persistent: state highestSinceEntry = na, assign inside when

Risk (script)

  • stop 10 points, stop 2 percent, stop 2 atr
  • target 20 points, trail 5 points, breakeven after 10 points
  • targets 5, 10, 15 split 40, 30, 30 for partial exits
  • risk 1 percent sizes quantity from capital and stop distance

On Algocrab, live broker SL/target and publish flow are documented in On Algocrab — Risk.

Canonical words

Prefer when, plot, exit, input. Aliases if, show, close (action), ask still run with deprecation warnings where applicable.

Start with these 10

  1. ema — trend and crossovers
  2. sma — slower trend line
  3. rsi — overbought / oversold
  4. macdline — momentum
  5. supertrend — ATR trail
  6. atr — volatility; stop 2 atr
  7. bbupper / bblower — Bollinger bands
  8. vwap — session average
  9. adx — trend strength

Next

Need Help?

Feel free to contact us with any of your queries.

Email

We will get back to you within 24 hrs.

Chat

We are available during market hours.

Phone

Mon-Sat, 9 AM - 6 PM

© 2026 Algocrab. All rights reserved.

Facebook IconInstagram IconYoutube IconWhatsapp Icon