Every discussion about bots hits the same question: "what strategy does it run?" The honest answer is that there's no magic strategy — there's the right strategy for the right market regime. A trend bot crushes it in a directional market and bleeds in a range; a reversion bot does the opposite. Below are the five base strategies behind most bots, with logic clear enough for you to code and adapt.
First of all — the concept of regime: a market can be in a trend (rising or falling in a sustained way) or ranging (oscillating in a range). No strategy works in both. The first decision of any bot should be: what regime am I in? Some strategies below are trend strategies, others are range strategies — note the regime tag on each.
Moving-average crossover
The most classic strategy and the best starting point for automating. You use two moving averages — a fast one (e.g. 9 periods) and a slow one (e.g. 21). When the fast crosses above the slow, it's a buy signal; below, a sell signal. The logic: the fast average reacts more quickly to price, so the crossover signals a change in momentum.
Pros
- Simple to code and understand
- Robust (few parameters)
- Excellent in strong trends
Cons
- Suffers in a ranging market (false signals)
- Enters late (averages lag)
- "Whipsaw" in consolidation
How to improve it: add a trend filter (only buy if price is above a long 200 average) or a strength filter (RSI, ADX) to avoid trading in a range.
Breakout
The idea: price tends to get "stuck" in a range, and when it breaks an important high or low, it tends to continue in the breakout's direction. The bot identifies the high/low of a period (e.g. the last 20 bars) and buys when price breaks the high, sells when it breaks the low.
Pros
- Catches the start of strong moves
- Clear entry logic
- Works across many assets
Cons
- False breakouts are common
- A "stop hunt" can catch you
- Needs a volume/strength filter
How to improve it: require confirmation (above-average volume on the break, or a close beyond the level, not just the touch). Combine it with the liquidity concept from Smart Money Concepts to avoid the fakes.
Trend pullback
Instead of entering on the breakout, you wait for price to "breathe." In an uptrend, price rises and pulls back before continuing. The strategy enters the buy during the pullback, near a support (e.g. the 20 average or an order block), betting on the trend resuming. It's the application of the saying "buy the dip, within the uptrend."
Pros
- Better risk/reward (enters cheaper)
- Short stop (near the support)
- Trades with the trend
Cons
- Hard to tell a pullback from a reversal
- Can miss the move if the dip doesn't come
- Requires good trend identification
How to improve it: use Fibonacci or moving averages as the pullback zone, and only trade if the larger trend (higher timeframe) confirms the direction.
Want to learn to code these strategies?
See the Pine Script and Python-with-Binance tutorials — ready-made code to adapt.
Mean reversion
The opposite of the previous ones. The premise: price tends to return to its "mean" after stretching too far to one side. When price moves far from the mean (e.g. it touches the lower Bollinger band or RSI below 30), the bot buys betting on the return; when it stretches up, it sells. It works well in markets with no clear trend, oscillating in a range.
Pros
- Many signals in a ranging market
- Good hit rate in a range
- Entries at "stretched" prices
Cons
- Catastrophic in a strong trend
- "Catches a falling knife" if unfiltered
- Requires detecting the ranging regime
The danger of mean reversion: when the market enters a strong trend, this strategy keeps buying against the move and accumulating loss. Without a filter that turns it off in a trend (e.g. high ADX), it blows up the account. Never run mean reversion without a regime detector.
Grid trading
The grid sets up a "grid" of orders at spaced price levels, buying as price falls and selling as it rises, profiting from the oscillation. It's popular in crypto and ranging markets. The logic is mechanical: you define a range, a spacing and a number of levels, and the bot trades the oscillation automatically.
Pros
- Profits in a ranging market without predicting direction
- Fully mechanical/automatable
- Many small realizations
Cons
- Dangerous in a trend against the grid
- Accumulates position (and risk) without limit if misconfigured
- Requires capital and strict drawdown management
Extra caution: a grid with no risk limit is one of the fastest ways to blow up an account. If price trends strongly against the grid, the bot keeps adding losing positions. Always set a global stop (a maximum loss that closes everything) and never run a leveraged grid without understanding the worst-case scenario.
06Which to use? A decision table
| Strategy | Ideal regime | Difficulty | Main risk |
|---|---|---|---|
| Moving-average crossover | Trend | Low | Whipsaw in a range |
| Breakout | Start of a trend | Medium | False breakout |
| Pullback | Established trend | Medium | Confusing it with a reversal |
| Mean reversion | Range | Medium | Strong trend |
| Grid | Volatile range | High | Unlimited accumulation |
073 principles worth more than the strategy
I'll be honest about something most bot sellers hide: the strategy is the least important part. What actually determines whether you survive is:
- Risk management > strategy. A mediocre strategy with strict risk management beats a brilliant strategy without it. Set risk per trade (1-2%), always a stop, a daily loss limit.
- An honest backtest. Test across several years and regimes, validate out-of-sample, and be suspicious of results that are too good. See how in our MT5 backtest tutorial.
- Simplicity. A strategy with 3 parameters is more robust than one with 15. Each extra parameter is a chance for overfitting — to work in the past and fail in the future.
08Frequently asked questions
What's the best strategy to automate?
There's no universal "best." Trend strategies (crossover, breakout, pullback) shine in directional markets; mean reversion and grid work in ranges. The best is the one that matches the asset and the current regime — and you find that out by backtest, not by opinion.
A simple or complex strategy?
Usually the simple one is more robust. Strategies with many parameters tend to overfit: they work beautifully in the past and fail in the future. Fewer parameters generalize better.
Is grid trading safe?
It's one of the riskiest. In a strong trend against the grid, it accumulates losing positions. It requires a global stop and strict drawdown management. It's not for a beginner without understanding the worst-case scenario.
Can I combine strategies?
Yes, and it's common. E.g. using a regime detector (ADX) to run a moving-average crossover in a trend and mean reversion in a range. But be careful not to overcomplicate — each extra layer is another point of failure and overfitting.
Where do I find the code for these strategies?
Our Pine Script and Python with Binance tutorials include the commented code for several of them. The moving-average crossover is implemented in both.