OPEN-SOURCE SCRIPT
9 & 15 EMA Strategy [Trade Room]

OVERVIEW
This indicator combines a fast/slow EMA crossover (default 9 and 15) with a
trend-slope filter and price-action candle confirmation to generate long and
short signals, along with automatically calculated take-profit and stop-loss
levels based on a user-defined risk:reward ratio.
The EMA 9/15 crossover is a long-standing, widely taught trend-following
concept in retail trading education. This script is my own original
implementation of that concept, built with additional filters to reduce
false signals in choppy conditions.
HOW IT WORKS
1. Trend filter: the script checks whether the fast EMA is above or below
the slow EMA to establish bullish or bearish bias.
2. Slope filter (optional): both EMAs must be sloping steeply enough,
measured as percentage change over a short lookback, to confirm the
move has real momentum rather than chopping sideways. This is adjustable
so it can be tuned per instrument and timeframe.
3. Price action filter (optional): a signal only fires when price pulls
back to the fast EMA and the resulting candle matches one of three
patterns — pin bar, engulfing, or an above-average range "big bar" —
in the direction of the trend.
4. TP/SL: stop-loss is placed at the signal candle's high/low, and take-
profit is calculated as a multiple of that risk distance, set by the
Risk:Reward input (default 1:2).
WHY IT'S USEFUL
Most EMA crossover scripts only plot crossovers, leaving the trader to
manually judge trend strength and risk levels. This script adds an
objective slope threshold and candle-pattern confirmation layer on top of
the crossover, and automatically plots calculated TP/SL levels so risk
is defined before entry, not after.
SETTINGS
- Fast/Slow EMA length — fully adjustable, not fixed to 9/15
- Slope filter toggle and threshold — tune sensitivity per asset/timeframe
- Candle pattern filter toggle
- Risk:Reward ratio for TP calculation
- Independent show/hide toggles for EMAs, labels, TP, and SL
- Alert conditions for both signal types
LIMITATIONS
Like any trend-following tool, this indicator will produce false signals
in ranging or low-volatility conditions. The slope filter is designed to
reduce — not eliminate — this. No indicator predicts price; this is a
decision-support tool, not financial advice, and past signal behavior is
not indicative of future results. Always backtest on your specific
instrument and timeframe and use proper risk management.
This indicator combines a fast/slow EMA crossover (default 9 and 15) with a
trend-slope filter and price-action candle confirmation to generate long and
short signals, along with automatically calculated take-profit and stop-loss
levels based on a user-defined risk:reward ratio.
The EMA 9/15 crossover is a long-standing, widely taught trend-following
concept in retail trading education. This script is my own original
implementation of that concept, built with additional filters to reduce
false signals in choppy conditions.
HOW IT WORKS
1. Trend filter: the script checks whether the fast EMA is above or below
the slow EMA to establish bullish or bearish bias.
2. Slope filter (optional): both EMAs must be sloping steeply enough,
measured as percentage change over a short lookback, to confirm the
move has real momentum rather than chopping sideways. This is adjustable
so it can be tuned per instrument and timeframe.
3. Price action filter (optional): a signal only fires when price pulls
back to the fast EMA and the resulting candle matches one of three
patterns — pin bar, engulfing, or an above-average range "big bar" —
in the direction of the trend.
4. TP/SL: stop-loss is placed at the signal candle's high/low, and take-
profit is calculated as a multiple of that risk distance, set by the
Risk:Reward input (default 1:2).
WHY IT'S USEFUL
Most EMA crossover scripts only plot crossovers, leaving the trader to
manually judge trend strength and risk levels. This script adds an
objective slope threshold and candle-pattern confirmation layer on top of
the crossover, and automatically plots calculated TP/SL levels so risk
is defined before entry, not after.
SETTINGS
- Fast/Slow EMA length — fully adjustable, not fixed to 9/15
- Slope filter toggle and threshold — tune sensitivity per asset/timeframe
- Candle pattern filter toggle
- Risk:Reward ratio for TP calculation
- Independent show/hide toggles for EMAs, labels, TP, and SL
- Alert conditions for both signal types
LIMITATIONS
Like any trend-following tool, this indicator will produce false signals
in ranging or low-volatility conditions. The slope filter is designed to
reduce — not eliminate — this. No indicator predicts price; this is a
decision-support tool, not financial advice, and past signal behavior is
not indicative of future results. Always backtest on your specific
instrument and timeframe and use proper risk management.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。