Strategy · Pine Script v6 · On the chart

PF probe scalping-probe-02-fast-ma-trigger

by pineforge-4pass· code credited to PineForge contributors 2026

This strategy plots a fast and a slow exponential moving average on the price chart and flips position when they cross.

View on GitHub

GitHub stars1on the repository
Pine versionv6current
Lines of code46
Settings2inputs
LicenceApache-2.0
Last update5 days ago23 Oct 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

46 lines of Pine Script v6 from validation/composite-scalping-fast-ma-cross-trigger-01/strategy.pine, published under Apache-2.0. Keep the author's credit and licence lines when you reuse it.

strategy.pine
// This Pine Script® code is licensed under Apache-2.0
// SPDX-License-Identifier: Apache-2.0
// © PineForge contributors 2026
//
// PF probe scalping-probe-02-fast-ma-trigger — short-period EMA cross flip-on-cross
// Clean-room: written from validation goal, not from source.
//
// Purpose: isolates the short-period EMA cross trigger surface that drives
// most scalp strategies' direction signal. Two EMAs (5 and 13) generate
// flat-flip entries on `ta.crossover` / `ta.crossunder` with no bracket,
// no filters — pure cross-on-cross. The engine surface under test is the
// EMA recursion warmup precision and the `ta.crossover`/`ta.crossunder`
// strict-inequality semantics: TV uses `now > prev_other and prev <=
// prev_other` so the engine's edge detector must follow exactly the same
// rule, especially around equal-EMA touches.
//
// Validation goal: bit-exact trade list against TradingView's broker emulator
// on the reference 15-minute ETH-USDT-USDT feed.
//
// TV setup: 15m chart, ETH-USDT-USDT (Binance USDT-M Perpetual). Full window
// matching corpus/data/ohlcv_ETH-USDT-USDT_15m.csv. Strategy properties:
// leave defaults from script header. Export "List of trades" → tv_trades.csv.
//@version=6
strategy("PF probe scalping-probe-02-fast-ma-trigger", shorttitle="PF_SC02_MA",
     overlay=true, initial_capital=1000000,
     commission_type=strategy.commission.percent, commission_value=0,
     slippage=0, default_qty_type=strategy.fixed, default_qty_value=1,
     pyramiding=1, process_orders_on_close=false)

// ---- inputs --------------------------------------------------------
int i_fast = input.int(5,  "Fast EMA", minval=2, maxval=50)
int i_slow = input.int(13, "Slow EMA", minval=3, maxval=100)

// ---- EMA pair + cross ---------------------------------------------
float ema_fast = ta.ema(close, i_fast)
float ema_slow = ta.ema(close, i_slow)

bool long_signal  = ta.crossover(ema_fast,  ema_slow)
bool short_signal = ta.crossunder(ema_fast, ema_slow)

// ---- flip-on-cross entries ----------------------------------------
if long_signal
    strategy.entry("L", strategy.long, qty=1, comment="ma flip long")

if short_signal
    strategy.entry("S", strategy.short, qty=1, comment="ma flip short")

Overview

A crossover of the fast EMA above the slow EMA enters one unit long, and a crossunder enters one unit short. There is no stop loss, take profit, or extra filter, so the opposite cross is the only exit. The two inputs set the EMA lengths. Orders are not processed on the close of the signal bar. It is a clean-room probe aimed at a 15-minute crypto feed.

Details

Published by

pineforge-4pass on GitHub

Code credit

PineForge contributors 2026, as written in the script's header

Type

Strategy, Pine Script v6

Draws

On the price chart

Category

Moving averages, Scalping

Markets

Crypto

Timeframes

M15-H1

Risk Notes

  • The strategy enters trades without a stop loss

Topics

algorithmic-tradingbacktestingparitypine-scriptpinescriptquantitative-financetest-corpustradingview

Settings

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

SettingTypeDefaultVariable
Fast EMAint5i_fast
Slow EMAint13i_slow
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

257 stars

This strategy is designed for 1-minute S&P 500 futures trading using multi-timeframe data and Fibonacci-weighted standard deviation bands around volume-weighted moving averages. It requests data from multiple higher timeframes without lookahead to prevent repa

Strategy v5 Volatility & bandsMoving averages
Updated 6 weeks ago · None stated GitHub repository of ES - Futures 1M No Repaint Fixed

5 Minute Scalp

by hasnocool
106 stars

This strategy overlays three exponential moving averages on the price chart, with periods of 9, 50, and 200. It calculates a MACD histogram from a 1-minute timeframe, applies Bollinger Bands to the histogram, and tracks two RSI oscillators of different lengths

Strategy v5 ScalpingMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of 5 Minute Scalp
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
43 stars

This strategy trades SOL perpetual candles on the price chart. It tracks confirmed pivot highs and lows as support and resistance circles, then compares close with a smoothed filter and a three-period EMA to mark long and short conditions after the bar closes.

Strategy v5 Moving averagesSupport & resistance Repaints
Updated 2 years ago · None stated GitHub repository of SOL 1m Strategy Candle Bar
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

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