Appearance

Personalize your experience

Mode
Accent Color
Direction
DSL Bots

DSL Bots

Reference

The 49 ready-made strategy-DSL bots: where to find them, how to load and adapt one, the file format, and what every bot is tested for.

Where they are

The bots in apps/hft/dsl/bots, one *.bot.json file each, and every bot carries the dsl tag. In the app they are listed in the Unified under DSL Bots. The search box matches name, , category, tags and symbol, and the tag chips narrow the list to bots that carry every selected tag (for example crypto + rsi).

  1. 1
    Pick a bot
    Click it in the DSL Bots list. Its goes through the same loader as the JSON editor, so the form, node and JSON editors all show it, and its tags become the tags.
  2. 2
    Backtest it
    Initial capital is taken from the bot’s quantity settings. Change the symbol or timeframe in the Symbol step to try it elsewhere.
  3. 3
    Adapt and save
    it like any . Saving stores your copy; the bot file itself is not changed.

File format

A bot file wraps one engine (the same JSON the shows and dslx_cli runs) with :

bots/rsi2-pullback.bot.json (abridged)
{
  "id": "rsi2-pullback",
  "name": "RSI(2) Pullback",
  "category": "mean-reversion",
  "tags": ["dsl", "equity", "nse", "rsi", "connors"],
  "description": "Connors RSI(2): buy a deep 2-period oversold reading above the 200 SMA; ...",
  "strategy": { "version": 2, "name": "RSI(2) Pullback", "symbol": { ... }, "entry": { ... }, "exit": { ... } }
}

The files, bots/README.md and the web copy strategy-builder/dsl/bots.generated.json are all written by node apps/hft/dsl/scripts/make-bots.mjs. Add or change a bot there, not in the JSON; make-bots.mjs --check fails if the files are out of date.

What every bot is tested for

npx tsx apps/hft/dsl/scripts/verify-bots.mts checks each bot:

  1. The engine and the browser validator accept it with no errors and no warnings, including the never-true checks.
  2. It survives all three editors: loading it into the builder and compiling back gives the same JSON, and so does pushing every signal through the node editor (per-signal graphs and the unified canvas).
  3. The JSON the builder produces backtests to the same as the bot file.
  4. It : on rising, falling, ranging and volatile synthetic markets every signal fires and every opens positions.
  5. Run on the engine server, bar by bar over a , it makes the same exits (side, time, price, reason, bars , P&L %) as the backtest of the same bars.
★
Pro tip:A bot passing these checks means it is a correct, working . It does not mean it is profitable on your market. Backtest it on your own symbol and , and read before .

Trend following

BotMarketTimeframeWhat it doesTags
9/21 Trend:BTCUSDT15mLong when 9 crosses above EMA 21 while price is above the 1h EMA 50; out on the opposite .dsl, crypto, , , mtf
Golden Swingzerodha:NIFTY1DSMA 50 / 200 golden on daily bars with a 6% trailing stop; exits on the death cross.dsl, equity, nse, sma, swing
Flip:ETHUSDT1hEnters when the direction flips up, exits when it flips down; stop and 1.5R / 3R targets.dsl, crypto, ,
ADX Trend:BTCUSDT1h+DI crosses above −DI while ADX shows a trend (> 20); out when −DI takes over or the trend fades.dsl, crypto, adx, dmi
Ichimoku Cloud Breakout:SOLUSDT4hClose breaks above both cloud spans with Tenkan above Kijun; exits when price closes back under the Kijun.dsl, crypto, ichimoku
MACD Zero-Line Momentum:BTCUSDT30mMACD crosses above zero with a positive ; exits when the MACD line drops under its signal.dsl, crypto, macd, momentum
Parabolic SAR Trend:BNBUSDT1hSAR flips below price while the 50 is rising; exits on the next flip.dsl, crypto, psar
Donchian Breakout:BTCUSDT4h : buy a close above the prior 20-bar high, exit on a close below the prior 10-bar low.dsl, crypto, donchian, breakout
Aroon Trend Start:ETHUSDT1hAroon Up crosses over Aroon Down and is strong (> 70); exits when the oscillator negative.dsl, crypto, aroon
Death Short:BTCUSDT1hShort when 20 crosses under EMA 50 with below 50; covers on the opposite .dsl, crypto, short,
Trend:ETHUSDT30mTwo green candles above the 20; exits on the first red one.dsl, crypto,

Mean reversion

BotMarketTimeframeWhat it doesTags
(2) zerodha:RELIANCE1DConnors RSI(2): buy a deep 2- oversold reading above the 200 SMA; sell on (2) > 70 or a close above the 5 SMA.dsl, equity, nse, , connors
Bollinger Band :BTCUSDT15mBuys a close back inside the lower ; exits at the middle band.dsl, crypto,
%B + Dip:ETHUSDT1hPrice under the lower (%B < 0) with under 35; exits once %B recovers above 0.8.dsl, crypto, ,
Stochastic Oversold :SOLUSDT15m%K crosses above %D below 25; exits when %K crosses down above 75.dsl, crypto, stochastic
Williams %R Reversal:BTCUSDT1hWilliams %R climbs out of oversold (−80); exits when it reaches overbought (−20).dsl, crypto, williams-r
Z-Score Reversion:ETHUSDT15mBuys a 2- stretch below the 20-bar mean; exits back at the mean.dsl, crypto, , zscore
CCI Reversal:BNBUSDT30mCCI crosses back above −100; exits above +100.dsl, crypto, cci
MFI Oversold zerodha:INFY15mA bullish engulfing candle while money is oversold (MFI < 30); exits when MFI is above 70.dsl, equity, nse, mfi,
Overbought Short:BTCUSDT15mShorts falling back under 70 below the 200 ; covers under 40.dsl, crypto, short,

Breakouts

BotMarketTimeframeWhat it doesTags
Opening zerodha:NIFTY5mBuys a break above the first 15 minutes high before 11:00 IST on above-average volume; squares off by 15:15.dsl, equity, nse, intraday, orb
Bollinger Squeeze Breakout:BTCUSDT1hAfter a squeeze (bandwidth under 4%) a close above the upper with volume; trailing stop.dsl, crypto, , volatility
Expansion Breakout:ETHUSDT1hA new 20-bar closing high while volatility () expands; ATR stop with 2R target.dsl, crypto, , volatility
Previous Day High Breakzerodha:HDFCBANK5mIntraday break of yesterday’s high on 1.5× relative volume; exits under the VWAP.dsl, equity, nse, intraday
Pivot R1 Breakout:BTCUSDT15mClose breaks above the daily R1 pivot; exits under the pivot point.dsl, crypto, pivots
VWAP Reclaimzerodha:SBIN5mPrice reclaims the VWAP on above-average volume after 09:30; exits on losing it.dsl, equity, nse, intraday, vwap
Keltner Volume Breakout:SOLUSDT1hClose above the upper Keltner channel on 1.5× volume; exits back inside under the middle line.dsl, crypto, keltner, volume

Market structure and candlesticks

BotMarketTimeframeWhat it doesTags
Break of Structure Continuation:BTCUSDT15mA bullish break of structure in an uptrend (close above 50); exits on a bearish change of character.dsl, crypto, smc, structure
at the Lower :ETHUSDT1hA whose low pierced the lower Bollinger band; exits at the middle .dsl, crypto, ,
Morning Star Reversalzerodha:TCS1hA morning star with under 45; exits when RSI is back above 60.dsl, equity, nse,
Three White Soldiers:BNBUSDT1hThree white soldiers above the 20 ; exits on three black crows or a close under the EMA.dsl, crypto, , momentum
With the Trend:BTCUSDT1hBullish engulfing while 50 is above EMA 200; exits on a bearish engulfing.dsl, crypto, , trend
Higher Low Trend:ETHUSDT4hA confirmed higher low above the 100 ; exits on a lower low.dsl, crypto, structure, swing

Momentum

BotMarketTimeframeWhat it doesTags
OBV Confirmed Trend:BTCUSDT30mPrice above 20 with OBV rising for 3 bars; exits when OBV falls for 3 bars.dsl, crypto, obv, volume
Volume Spike Momentum:SOLUSDT15mA 2× volume spike with a positive 12-bar rate of change on a green candle; time exit after 3 hours.dsl, crypto, volume, roc
ROC Momentum ( filtered):ETHUSDT1hROC crosses above zero; a block skips the entry when is already overbought.dsl, crypto, roc,
StochRSI Trend :BTCUSDT15mStochRSI %K crosses above 20 while 20 is above EMA 50; exits when %K crosses under 80.dsl, crypto, stochrsi, trend
Triple Confirmation:BTCUSDT1h trend, between 50 and 70 and a positive MACD — all three; exits when any two fail.dsl, crypto, , , macd

Session and time of day

BotMarketTimeframeWhat it doesTags
Weekday Switch Trend:BTCUSDT1h 20 / 50 entries, skipped on weekends by a DayOfWeek switch block.dsl, crypto, , switch, calendar
Lunch-Filtered Scalperzerodha:NIFTY3m(7) from 30 above VWAP, but NOT during the 11:30–13:30 lull; quick 0.5% target.dsl, equity, nse, intraday, scalp, not
Power Hour Momentumzerodha:BANKNIFTY5mOnly after 14:00 IST: a new 12-bar high on rising volume; the square-off closes it.dsl, equity, nse, intraday, time
First-Bar Gap Fadezerodha:RELIANCE15mShorts the first 15-minute bar when the open is 0.5% above yesterday’s close and the bar closes red.dsl, equity, nse, intraday, gap, short

Multi-timeframe

BotMarketTimeframeWhat it doesTags
MTF :BTCUSDT5m5m crosses up from 35 while the 1h trend is up (1h close above 1h 50) and 1h RSI is above 50.dsl, crypto, mtf,

Several entry signals

BotMarketTimeframeWhat it doesTags
Trend or Dip (two signals):ETHUSDT1hTwo independent entry signals — a trend breakout and an oversold dip — sharing one exit set.dsl, crypto, multi-signal

Position building (re-entry, DCA, pyramid)

BotMarketTimeframeWhat it doesTags
Layered DCA on Dips:BTCUSDT1hStarts on < 30 and adds two layers 2% and 4% lower (adverse ); one exit at RSI 60.dsl, crypto, dca, layers
Pyramid Into Trends:SOLUSDT4hStarts on an and adds a layer every 3% in profit (favourable ) while ADX > 25.dsl, crypto, pyramid, layers, trend
Trend Re-entry With Cooldown:BTCUSDT30mPrice above 50 and over 55; re-enters up to 2 more times, 5 bars apart, 1% from the last entry.dsl, crypto, re-entry

Formulas and QuaScript

BotMarketTimeframeWhat it doesTags
Stretch (custom formula):ETHUSDT15mA custom formula measures how far price is below its 20 SMA in ATRs; buys a 2- stretch, exits back at the mean.dsl, crypto, formula,
QuaScript Fast :BTCUSDT15mUses a QuaScript indicator: enters on the script’s “Oversold exit” above the 100 , exits when its line is above 75.dsl, crypto, quascript

See also

Related articles

  • Condition Evaluator

    Automation / Strategy Builder / Reference

    How a condition becomes true on a bar: series computed up front, no value during warm-up, the exact cross and rising rules, and the order of work on each…

  • Indicator Reference

    Automation / Strategy Builder / Reference

    All 94 indicators the strategy engine computes, grouped as in the builder's picker, with their parameters, outputs and the range of values each output can take.

  • Pitfalls & Anti-Patterns

    Automation / Strategy Builder / Reference

    The failure modes that show up repeatedly, what each one looks like from inside the builder, and the change that actually fixes it.

  • Strategy Builder FAQ

    Automation / Strategy Builder / Reference

    The questions that come up most often, answered with what the engine actually does rather than what would be convenient.

  • Strategy DSL Format

    Automation / Strategy Builder / Reference

    The engine JSON a strategy saves as. The form, node and JSON editors all edit this one document, and the C++ engine runs it unchanged in backtests and live.

  • Variables Reference

    Automation / Strategy Builder / Reference

    What can appear on either side of a condition — bar fields, earlier bars, higher timeframes, statistics, clock and calendar values, and formulas — and how…

  • Step 0 — Particulars

    Automation / Strategy Builder / Wizard Steps

    Identity and metadata: the name, description, tags and visibility that make a strategy findable a year from now. Also where the immutable Strategy ID is minted.

  • Step 1 — Settings

    Automation / Strategy Builder / Wizard Steps

    Global behaviour that decides how entries and exits interact: whether the strategy builds a position in stages, which multi-entry model it follows, and how…

  • Step 2 — Tagging

    Automation / Strategy Builder / Wizard Steps

    Optional. Client order ID templates, signal-level metadata and order linking — the machinery that makes live orders reconcilable against broker statements.

Browse all knowledge base articles →