Documentation
Building blocks
A stratester bot is made of rules, and rules are made of blocks: 33 conditions and 4 actions. Each page below explains exactly how the simulation engine evaluates the block, its settings, how traders use it and the mistakes to avoid.
How rules work
A rule reads WHEN conditions THEN action. Conditions combine with and (all true), or (any true) or xor (exactly one true), and not inverts a single condition.
On every candle close the engine checks the rules from top to bottom. A rule that fires trades at that close, or places a limit or stop order that waits for its price, and the portfolio is updated before the next rule is checked. Conditions only see candles that have already closed.
Price, indicator and pattern conditions can also read bigger candles than the run uses, by ending with a timeframe such as on 4h. Every fill pays the fee and slippage set on the bot.
when rsi(14) < 30 and cooldown 24
then buy 50%
when pnl up 6% or pnl down 3%
then sell 100%
Price
Conditions on the price itself: moves, levels, breakouts and candle shapes.
- Price movePrice moved up or down by X% over the last N candles.
price down 3% in 24 - Price levelPrice crosses, or is above or below, a fixed price.
price crosses above $100000 - BreakoutClose beyond the highest high or lowest low of the last N candles.
breakout high 48 - Big candleA candle whose body is at least X% of its open.
candle green 2% - Candle streakN green or red candles in a row.
streak red 3
Indicators
Classic technical indicators, computed with the formulas traders know.
- SMA crossPrice crosses its N-candle simple moving average.
price crosses above sma(50) - EMA crossPrice crosses its N-candle exponential moving average.
price crosses above ema(21) - Golden crossFast SMA crosses the slow SMA (golden or death cross).
sma(50) crosses above sma(200) - RSIRSI above or below a level: overbought and oversold.
rsi(14) < 30 - MACDMACD crosses its signal line, or is above or below zero.
macd(12,26,9) crosses above signal - Bollinger BandsClose outside the upper or lower Bollinger Band.
price below bb_lower(20,2) - StochasticSmoothed stochastic %K above or below a level.
stoch(14,3) < 20 - ATRATR as a percentage of price, above or below a threshold.
atr(14) > 1.5% - VolatilityAverage candle range over N candles above or below X%.
volatility(24) > 1.5% - SupertrendATR trailing trend line flips (or is) bullish or bearish.
supertrend(10,3) flips bullish - ADX / DMIADX trend strength above or below a level, or +DI/−DI crosses.
adx(14) > 25 - Keltner ChannelClose outside the ATR-based Keltner Channel.
price below kc_lower(20,10,1.5) - CCICommodity Channel Index beyond ±100, or any level.
cci(20) < -100 - Williams %RFast overbought/oversold gauge (−20 / −80).
willr(14) < -80 - Chandelier exitTrailing stop line: N-candle high minus k × ATR.
price below chandelier(22,3)
Patterns
Candlestick patterns and price-action structures such as fair value gaps and sweeps.
Timing
When a rule may fire: hours, weekdays, cooldowns between trades and a cap on buys per day or week.
Portfolio
Conditions on the bot's own position and balance: take profit, stop loss, trailing stops, time stops and drawdown.
- Holding / flatTrue when you are (or are not) in a trade.
holding - Take profit / stop lossTake profit or stop loss: up or down X% or $X from entry, on the close or the wick.
pnl up 5% - Trailing stopPrice fell X% from its peak since entry: a stop that follows the trade up.
trailing 5% - Trade ageThe open trade is at least (or under) N candles old: time stops.
held >= 48 - Equity levelYour total balance is above or below $X.
equity > $12000 - DrawdownEquity is down X% from its peak this run: circuit breaker.
drawdown 15%
Actions
What a rule does when its conditions are met: buy or sell, by percentage or dollar amount, at market or with a limit or stop order.
- Buy %Invest X% of your cash, at market or with a limit or stop order.
buy 50% - Buy $Buy a fixed dollar amount, at market or with a limit or stop order.
buy $1000 - Sell %Sell X% of your position, at market or with a limit or stop order.
sell 100% - Sell $Sell a fixed dollar amount worth, at market or with a limit or stop order.
sell $500
Simulated results are hypothetical. They include only the fee and slippage you set on the bot, not every real-world cost or market condition, and past performance does not guarantee future results. Nothing here is financial advice.