Strategy · Pine Script v4 · On the chart

Scalping 3EMA

by rodrigo-brito

This long-only strategy calculates three exponential moving averages with lengths of 50, 100, and 150 periods, plotting them directly on the price chart.

View on GitHub

GitHub stars9on the repository
Pine versionv4older, still runs
Lines of code28
Settings0inputs
LicenceMIT
Last update5 years ago28 Apr 2021

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new strategy, select all of the template text and paste. Press Save and give it a name.
  4. 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.

Details

Published by

rodrigo-brito on GitHub

Type

Strategy, Pine Script v4

Draws

On the price chart

Category

Trend, Oscillators & momentum, Moving averages, Scalping

Markets

Crypto

Timeframes

M15-H1, M1-M5

Risk Notes

  • The strategy enters trades without a stop loss
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.

Similar Pine Scripts

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

Strategy v5 TrendOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of 5min Williams Fractals Scalping (3commas)
53 stars

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

Strategy v6 TrendMoving averages
Updated 2 months ago · MPL-2.0 GitHub repository of EUR/USD EMA9-21 + RSI Scalping Strategy
13 stars

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

Strategy v5 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of Ruckard TradingZone ADX Gann
330 stars

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

Strategy v4 TrendOscillators & momentum
Updated 2 months ago · None stated GitHub repository of 2 EMA/SMA + RSI Strategy [Alorse]

Acrypto - Weighted Strategy

by AlbertoCuadra
318 stars

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

Strategy v5 TrendOscillators & momentum
Updated 3 years ago · Custom licence GitHub repository of Acrypto - Weighted Strategy

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

Strategy v5 Moving averagesOscillators & momentum
Updated 6 weeks ago · None stated GitHub repository of ESM2024 - ALMA Smoothed Gaussian Moving Average

More strategys

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers