Strategy · Pine Script v6 · On the chart

PF Probe Scalping-Probe-Integration

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

This strategy evaluates fast and slow Exponential Moving Average (EMA) crossovers to generate trade signals.

View on GitHub

GitHub stars3on the repository
Pine versionv6current
Lines of code61
Settings4inputs
LicenceApache-2.0
Last update4 days ago20 Nov 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

61 lines of Pine Script v6 from validation/composite-scalping-integration-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-integration — fast EMA cross entries with tight TP/SL bracket
// Clean-room: written from validation goal, not from source.
//
// Purpose: composes the two surfaces isolated by `scalping-probe-01..02` into
// a single end-to-end scalp strategy. The engine surface under test is the
// cross-surface composition: fast EMA cross fires the entry, then the tight
// bracket TP (+15 ticks) / SL (-7 ticks) governs the exit. Bracket arithmetic
// must be computed off the entry fill, and intra-bar TP-vs-SL resolution must
// match TV's open→high/low/close traversal rule. A new opposite cross can
// arrive while the bracket is still active — the engine must handle the
// `strategy.entry` reverse-position semantics correctly in that case.
//
// 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-integration", shorttitle="PF_SCINT",
     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)
int i_tp_tk = input.int(15, "Take profit (ticks)", minval=1)
int i_sl_tk = input.int(7,  "Stop loss (ticks)",   minval=1)

// ---- EMA pair + cross trigger -------------------------------------
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)

// ---- entries -------------------------------------------------------
if long_signal
    strategy.entry("L", strategy.long, qty=1, comment="integ scalp long")

if short_signal
    strategy.entry("S", strategy.short, qty=1, comment="integ scalp short")

// ---- bracket exits anchored on entry fill --------------------------
float entry_px = strategy.position_avg_price

if strategy.position_size > 0
    float tp_px = entry_px + i_tp_tk * syminfo.mintick
    float sl_px = entry_px - i_sl_tk * syminfo.mintick
    strategy.exit("Brk", from_entry="L", stop=sl_px, limit=tp_px)

if strategy.position_size < 0
    float tp_px = entry_px - i_tp_tk * syminfo.mintick
    float sl_px = entry_px + i_sl_tk * syminfo.mintick
    strategy.exit("Brk", from_entry="S", stop=sl_px, limit=tp_px)

Overview

PF Probe Scalping-Probe-Integration enters a long position when the fast EMA crosses above the slow EMA, and enters a short position when it crosses below. Upon position fill, it sets tight take-profit and stop-loss bracket exits based on a user-defined number of price ticks relative to the entry price. Settings allow users to customize both EMA periods as well as tick distances for targets and stops. The strategy overlay plots directly on the main price chart.

Details

Published by

pineforge-4pass on GitHub

Code credit

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

Draws

On the price chart

Markets

Crypto

Timeframes

M1-M5, M15-H1

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.

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
Take profit (ticks)int15i_tp_tk
Stop loss (ticks)int7i_sl_tk
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 overlay strategy marks short-term turning points on the price chart and enters SPY option-style trades from them. It plots simple moving averages of highs and lows, draws up and down reversal arrows, and colors bars when a short-term extreme coincides wit

Strategy v5 TrendMoving averages Repaints
Updated 2 months ago · None stated GitHub repository of SPY Options Trading - Alert

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 3 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

More Moving averages 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