Strategy template · early access
EMA crossover strategy, automated
The 9 EMA closes across the 21 EMA in the direction of the 200 EMA: a buy above it, a sell below it. The bot runs it on real candles, draws each signal and posts it to your Telegram channel, built with you in early access.

What the ema crossover is
An EMA crossover compares two exponential moving averages of the close, a fast one and a slow one. When the fast line crosses above the slow one, price has been rising faster than its recent average, and many traders read that as the start of an up move; a cross below is read the other way. It is among the oldest and most copied systematic rules, and the 9 and 21 periods are a common pair for intraday charts.
The cross alone fires often and in every kind of market, so most versions add a filter. The one here takes a cross only when price is on the same side of the 200 EMA, which leaves out crosses against the longer trend. The rule is a close, two averages and a comparison, which is why it automates cleanly.
The bot's rules
- Buy when the 9 EMA closes above the 21 EMA after being at or under it, while the close is above the 200 EMA.
- Sell on the cross below, while the close is under the 200 EMA. One signal a cross.
- Stop beyond the lowest low (sell: highest high) of the last 10 candles; if that is closer than 0.5 × ATR(14), 0.5 × ATR(14) is used.
- Targets at 1, 2, 3 times the stop distance.
Which version. The 9/21 version with the 200 EMA as the trend filter, as it is usually taught for 15-minute gold: the stop beyond the last ten candles, targets at 1, 2 and 3 times the stop.
The settings
The defaults the example was found with. Each one is a setting, not a rewrite.
| Setting | Default | What you can change |
|---|---|---|
| Market | XAUUSD | Gold or any of the seven US-dollar majors; other markets need a price feed first. |
| Candles | 15 minutes | The averages are computed on these. |
| Fast EMA | EMA 9 | 5, 9 and 12 are common. |
| Slow EMA | EMA 21 | 13, 21 and 26 are common. |
| Trend filter | EMA 200 | Only crosses on the trend's side are taken. 0 turns it off. |
| Stop beyond the last | 10 candles | The lowest low for a buy, the highest high for a sell. |
| Smallest stop | 0.5 × ATR(14) | Used when the last candles' extreme is closer than this. |
| Targets | 1, 2, 3 × the stop | Or a fixed pip distance. |
The example, as the bot would post it
The signal in the chart above: found by the template's code on XAUUSD 15 min candles at . Its levels, and the message the bot would send with the chart:
- Entry4008.10
- Stop4034.43 · 26 pips
- TP13981.77 · +26 pips
- TP23955.44 · +53 pips
- TP33929.10 · +79 pips
🔴 SELL XAUUSD · EMA crossover Entry: 4008.10 (market) Stop: 4034.43 (26 pips) TP1: 3981.77 (+26 pips) TP2: 3955.44 (+53 pips) TP3: 3929.10 (+79 pips) EMA 9 crossed below EMA 21, with price under the 200 EMA. Stop beyond the last 10 candles; targets at 1, 2, 3 times the stop. Not financial advice. Trade at your own risk.
The same signal in another of the bot's chart templates, Daylight, with a space for your logo:

How often it fires
Signals the template's code found with the defaults over the last twelve months of candles. A count of signals, not of wins: we publish no results for templates.
- Gold (XAUUSD)
- 47.2signals a month: 566 from 2025-10-23 to 2026-10-23
- EURUSD
- 50.9signals a month: 611 from 2025-10-23 to 2026-10-23
Automation, not an edge. A template does the work of watching the chart, finding the setup and posting it. It does not make the strategy win. Before it goes live in your channel we run it over past candles on your markets and show you every signal it would have sent, losses included, privately.
What can be changed
- The rules: every setting above, and any filter or confirmation you can write down.
- The markets: gold and the seven US-dollar majors, one or all of them.
- The chart: your logo where the placeholder is, a chart template in your colours, and the marks your method uses.
- The channels: every signal to a paid channel and a paced share to a free one, the way our own channels run.
Or bring a strategy that is not here: every template started as rules someone wrote down.
Questions
Are 9 and 21 the right periods?
They are the pair most often taught, and we do not claim they suit any market. 5/13, 12/26 and 20/50 are all common. A test on past candles shows how a pair behaved on your market, losses included.
What does the 200 EMA filter do?
It keeps the bot to crosses that agree with the longer trend: buys only while price is above the 200 EMA, sells only while it is below. Set it to 0 to take every cross.
Why is the stop at the last ten candles?
A cross has no level of its own, so the stop goes beyond the recent swing. If that is closer than half the average candle range (ATR 14), the bot uses half the ATR so that normal noise does not hit it.
Does the bot place trades?
No. It finds the setup, draws the chart, posts the signal to your Telegram channel and follows it with a reply at each target and at the stop. It does not connect to a broker or trade any account.
Can I change the rules?
Yes. Every setting in the table above is yours to change, and so is anything else that can be written down: a filter, a session, a second confirmation, a different stop. If a step is a judgement call, we work out with you how to write it as a rule.
Will it make money?
We do not say it will, for this template or any other. A template is automation, not an edge. Before it goes live we run it over past candles on your markets and show you every signal it would have sent, losses included, privately. How a strategy behaved on past candles is not what it will do.
Is it AI?
No. It follows the written rules on this page. The same candles always give the same signals.
Which markets and timeframes?
The seven US-dollar majors and gold today, on any timeframe from 5 minutes to daily. Other markets need a price feed for them first; ask us.
What does it cost?
Templates are in early access: built with you, for your channel, and priced before launch. Early-access members hear the price first. For a broker, prop firm or educator, write to us.
Other strategy templates

Opening range breakout
The first 15 minutes after the New York open set a range; the first 5-minute close outside it is the signal.

Fair value gap
Three candles leave a gap that price skipped; the first candle to come back into it is the signal.

Liquidity sweep
Price runs through the previous day's high or low, then a 15-minute candle closes back inside the level: that close is the signal.

Order block
A strong candle breaks the last swing high; the last down candle before it is the block, and the first return into it is the signal.

Supertrend
The Supertrend line (ATR 10 × 3) flips from above price to below it, or the other way: the candle that closes through it is the signal.

London breakout
The Asian session sets a range; the first 15-minute close above its high or below its low after the London open is the signal.

Break and retest
Price closes beyond a swing high or low, comes back to the level within twelve candles and closes on the broken side: that close is the signal.

RSI divergence
Price makes a lower swing low while the RSI makes a higher one, the first in oversold territory: a buy once the second swing is confirmed. The mirror is a sell.

MACD crossover
The MACD line crosses its signal line below zero in an uptrend, or above zero in a downtrend, with price on the 200 EMA's side.

Silver bullet
A fair value gap forms in the 10:00 to 11:00 New York window; the first candle back into it before 11:00 is the signal.

Judas swing
A candle runs through the Asian range early in London, then a 15-minute candle closes back inside it: that close is the signal.