Strategy · Pine Script v5 · On the chart

Scalper Quick Strike

by Basant1Saini· code credited to TradingTools

Scalper Quick Strike is a Pine Script strategy that trades on intraday charts using multiple EMAs and Stochastic oscillator.

View on GitHub

GitHub stars1on the repository
Pine versionv5runs as is
Lines of code79
Settings13inputs
LicenceNone statedfile: MPL-2.0
Last update8 months ago4 Mar 2026

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

79 lines of Pine Script v5 from 7_Scalper/7_Scalper.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.

7_Scalper.pine
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0
// © TradingTools

//@version=5
strategy("Scalper - Quick Strike", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100)

// ─── Inputs ───
emaFast         = input.int(5, "Fast EMA", group="EMAs")
emaMed          = input.int(13, "Medium EMA", group="EMAs")
emaSlow         = input.int(34, "Slow EMA", group="EMAs")
stochK          = input.int(14, "Stochastic K", group="Stochastic")
stochD          = input.int(3, "Stochastic D", group="Stochastic")
stochSmooth     = input.int(3, "Stochastic Smooth", group="Stochastic")
stochOB         = input.float(80, "Stoch Overbought", group="Stochastic")
stochOS         = input.float(20, "Stoch Oversold", group="Stochastic")
atrLength       = input.int(10, "ATR Length", group="Risk Management")
atrMult         = input.float(1.0, "ATR Multiplier for SL", step=0.1, group="Risk Management")
rrRatio         = input.float(1.5, "Risk:Reward Ratio", step=0.1, group="Risk Management")
maxTrades       = input.int(10, "Max Trades Per Day", group="Risk Management")
sessionFilter   = input.session("0935-1555", "Trading Session", group="Session")

// ─── Calculations ───
fast    = ta.ema(close, emaFast)
med     = ta.ema(close, emaMed)
slow    = ta.ema(close, emaSlow)
atrVal  = ta.atr(atrLength)

k       = ta.stoch(close, high, low, stochK)
d       = ta.sma(k, stochD)
kSmooth = ta.sma(k, stochSmooth)

// ─── Session ───
inSession = not na(time(timeframe.period, sessionFilter))

// ─── Trade Count (reset daily) ───
var int tradeCount = 0
if dayofweek != dayofweek[1]
    tradeCount := 0

// ─── EMA Alignment ───
bullAlign = fast > med and med > slow
bearAlign = fast < med and med < slow

// ─── Entry Conditions ───
// Long: EMA aligned bull + Stochastic crossing up from oversold
// Short: EMA aligned bear + Stochastic crossing down from overbought
longCondition  = bullAlign and ta.crossover(kSmooth, d) and kSmooth < stochOS + 30 and close > fast and inSession
shortCondition = bearAlign and ta.crossunder(kSmooth, d) and kSmooth > stochOB - 30 and close < fast and inSession

// ─── Execute Trades ───
if longCondition and strategy.position_size == 0 and tradeCount < maxTrades
    sl = close - atrVal * atrMult
    tp = close + (close - sl) * rrRatio
    strategy.entry("Scalp Long", strategy.long)
    strategy.exit("Scalp Long Exit", "Scalp Long", stop=sl, limit=tp)
    tradeCount += 1

if shortCondition and strategy.position_size == 0 and tradeCount < maxTrades
    sl = close + atrVal * atrMult
    tp = close - (sl - close) * rrRatio
    strategy.entry("Scalp Short", strategy.short)
    strategy.exit("Scalp Short Exit", "Scalp Short", stop=sl, limit=tp)
    tradeCount += 1

// ─── Time-based Exit (quick) ───
if not inSession and strategy.position_size != 0
    strategy.close_all("Session End")

// ─── Plotting ───
plot(fast, "Fast EMA", color=color.new(color.lime, 0), linewidth=1)
plot(med, "Med EMA", color=color.new(color.orange, 0), linewidth=1)
plot(slow, "Slow EMA", color=color.new(color.red, 0), linewidth=2)

plotshape(longCondition, title="Scalp Long", location=location.belowbar, style=shape.triangleup, color=color.lime, size=size.tiny)
plotshape(shortCondition, title="Scalp Short", location=location.abovebar, style=shape.triangledown, color=color.fuchsia, size=size.tiny)

// ─── Alerts ───
alertcondition(longCondition, title="Scalp Long", message="Scalper: Quick long entry")
alertcondition(shortCondition, title="Scalp Short", message="Scalper: Quick short entry")

Overview

Scalper Quick Strike calculates fast medium and slow EMAs along with a smoothed Stochastic to detect trend alignment and momentum shifts. Long entries trigger when EMAs align bullish and Stochastic crosses up from oversold levels with price above the fast EMA inside the selected session. Short entries work symmetrically on bearish alignment with Stochastic crossing down from overbought. The strategy places market orders with ATR based stop loss and risk reward ratio take profit exits. A daily trade counter limits pyramiding while a session filter exits all positions outside trading hours. EMAs appear as colored lines on the price chart with entry signals shown as small triangles.

Details

Published by

Basant1Saini on GitHub

Code credit

TradingTools, as written in the script's header

Draws

On the price chart

Markets

Any symbol

Timeframes

M1-M5

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Fast EMAint5emaFast
Medium EMAint13emaMed
Slow EMAint34emaSlow
Stochastic Kint14stochK
Stochastic Dint3stochD
Stochastic Smoothint3stochSmooth
Stoch Overboughtfloat80stochOB
Stoch Oversoldfloat20stochOS
ATR Lengthint10atrLength
ATR Multiplier for SLfloat1.0atrMult
Risk:Reward Ratiofloat1.5rrRatio
Max Trades Per Dayint10maxTrades
Show all 13 settings
SettingTypeDefaultVariable
Trading Sessionsession0935-1555sessionFilter
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

Scalping 3EMA

by rodrigo-brito
9 stars

This long-only strategy calculates three exponential moving averages with lengths of 50, 100, and 150 periods, plotting them directly on the price chart. It also calculates a 14-period RSI and MACD. The strategy opens long positions when the moving averages al

Strategy v4 TrendOscillators & momentum
Updated 5 years ago · MIT GitHub repository of Scalping 3EMA
2 stars

This strategy executes trend-following scalping setups by combining fast and slow exponential moving averages with a smoothed Stochastic oscillator. It enters long positions when the fast EMA is above the slow EMA and the Stochastic is oversold, and short posi

Strategy v5 TrendOscillators & momentum Repaints
Updated 7 months ago · None stated GitHub repository of WINNER MNQ Strategy - Optimized 2026

More Trend scripts

Related on ForexR

Trade Your Charts With a Regulated Broker

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

Compare brokers