This long-only strategy calculates three exponential moving averages with lengths of 50, 100, and 150 periods, plotting them directly on the price chart.
1Copy the scriptPress Copy script above, or the copy button on the code below.
2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
3Paste over the templateCreate a new strategy, select all of the template text and paste. Press Save and give it a name.
4Add it to the chartPress Add to chart. The trades and results appear in the Strategy Tester tab; adjust the settings with the gear icon.
Source Code
28 lines of Pine Script v4 from strategies/scalping_ema9.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.
scalping_ema9.pine
//@version=4
strategy("Scalping 3EMA - brito.com.br", overlay=true)
var INF = 99999999
var entry_price = INF
ema1 = ema(close, 50)
ema2 = ema(close, 100)
ema3 = ema(close, 150)
rsi = rsi(close, 14)
[macdLine, signalLine, histLine] = macd(close, 12, 26, 9)
// plot EMAs
plot(ema1, color=color.red)
plot(ema2, color=color.orange)
plot(ema3, color=color.yellow)
macd_trending = macdLine > signalLine
ema_trending = ema1 > ema2 and ema2 > ema3
macd_rising = rising(macdLine-signalLine, 5)
ema_rising = rising(ema1, 5)
if (ema_trending and macd_rising and ema_rising and macdLine > signalLine)
strategy.entry("long", strategy.long)
if (crossunder(ema1, ema2))
strategy.close("long")
Overview
Scalping 3EMA also calculates a 14-period RSI and MACD. The strategy opens long positions when the moving averages align in an upward sequence with the fastest EMA rising, while the MACD line is above the signal line and expanding. It closes trades when the 50-period EMA crosses below the 100-period EMA. Parameters are hardcoded without user inputs, and the strategy operates without stop-loss orders or take-profit targets.
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.
This strategy generates trading signals on the 5-minute price chart using Williams Fractals for trend reversals, combined with EMA fast and slow trend filters and optional RSI confirmation. Long entries trigger on bullish fractals aligned with rising EMA and R
This strategy trades EUR/USD on the price chart using a fast and slow exponential moving average crossover filtered by RSI. It enters long when the fast EMA crosses above the slow EMA while RSI is above 50 and below the overbought level, and enters short on th
This strategy plots on the price chart and enters from a moving-average filter, ADX and Gann colours. Price above a 200-period EMA allows only longs; price below allows only shorts. A Gann aqua colour with ADX above a key level opens a long, and a Gann brown c
2 EMA/SMA + RSI Strategy [Alorse] combines three configurable moving averages with a short-period Relative Strength Index filter. It plots fast, slow, and trend moving averages on the price chart. Long entries trigger when the fast moving average is above the
This strategy plots on the price chart and opens long or short positions when a weighted score from MACD, Stochastic RSI, RSI, Supertrend and a moving-average crossover exceeds a user-set trigger. Each component has its own weight and candle delay. Entries can
This strategy combines Arnaud Legoux Moving Average percentage price change calculations with an adaptive Gaussian Moving Average to generate trend-following signals. Long and short entries are triggered when the ALMA change calculation crosses above or below