Strategy · Pine Script v6 · On the chart

PF probe 90 - narrow stop/limit + trail8

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

This strategy is a validation probe that places one long at 08:00 and one short at 20:00 when flat, using a fixed quantity of one.

View on GitHub

GitHub stars1on the repository
Pine versionv6current
Lines of code49
Settings0inputs
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

49 lines of Pine Script v6 from validation/bracket-narrow-stop-limit-with-trail8-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 90 - narrow stop+limit alongside trail (scalping-distances)
//
// Purpose: investigate the 80 trades from a community-style scalping
// strategy that still drift by $0.50+ even after the trail_points-ceil fix
// (e.g. trade 23 at 2025-04-26 00:15 UTC, where engine fires trail at
// activation 1791.12 and TV fires at 1792.00 — Δ=$0.88).
//
// Probe 88 (trailTicks=20, far stop/limit at ±1-2%) and probe 89
// (trailTicks=8, far stop/limit at ±5%) both match TV 100%. That scalping
// shape's stop and limit are MUCH narrower — atr-based, so roughly
// entry±$5..$15. This probe pins trailTicks=8 (matching probe 89) but
// moves the stop and limit close to entry like that scalping shape
// (±$10/$20) to see whether the path-priority resolution on the entry bar
// changes when stop/limit are reachable on the same bar's path even though
// only the trail's activation level is actually crossed.
//
// TV setup: 15m chart, same symbol/window as data/ohlcv_ETH-USDT-USDT_15m.csv.
// Export TradingView "List of trades" to trades.csv in this folder.
//@version=6
strategy("PF probe 90 - narrow stop/limit + trail8",
     shorttitle="PF_P90_NARROW", 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)

trailTicks = 8
stopDist = 10.0
limitDist = 20.0

if hour == 8 and minute == 0 and strategy.position_size == 0
    strategy.entry("L", strategy.long, qty=1, comment="entry long")
    strategy.exit("LX", "L",
         stop=close - stopDist,
         limit=close + limitDist,
         trail_points=trailTicks,
         comment="narrow stop/limit + trail8")

if hour == 20 and minute == 0 and strategy.position_size == 0
    strategy.entry("S", strategy.short, qty=1, comment="entry short")
    strategy.exit("SX", "S",
         stop=close + stopDist,
         limit=close - limitDist,
         trail_points=trailTicks,
         comment="narrow stop/limit + trail8")

Overview

Each entry is paired with a stop 10 price units away, a limit 20 units away, and a trailing stop of 8 points. Orders process on bar ticks rather than only at the close, and the script draws on the price chart. Distances are hardcoded, with no user inputs. It is intended for a 15-minute crypto feed and does not add extra same-direction entries.

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

Scalping, Sessions & time

Markets

Crypto

Timeframes

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

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

Andean Scalping

by hasnocool
106 stars

Andean Scalping is a Pine Script v5 strategy template designed for backtesting trading signals. It features session and date-range filtering, directional trade toggles for long and short entries, and optional trend filtering tools including higher-timeframe EM

Strategy v5 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of Andean Scalping

ATOM 1m scalp HK

by dearvn
43 stars

This overlay strategy targets one-minute ATOM scalps. It tracks pivot highs and lows as resistance and support, compares a three-period EMA with a multi-stage smoothed close, and flags long or short when price crosses that curve in the matching direction. Dail

Strategy v5 ScalpingSupport & resistance Repaints
Updated 2 years ago · None stated GitHub repository of ATOM 1m scalp HK

Morning Scalp

by benso87
24 stars

This strategy tracks an opening session time range to establish directional bias and triggers pullback trades using Stochastic RSI. Once price breaks out of the initial range, it establishes a directional bias and enters when the Stochastic RSI crosses over in

Strategy v5 Sessions & timeBreakout
Updated 4 years ago · MPL-2.0 GitHub repository of Morning Scalp

Lazarus3 Backtest

by ysdede
12 stars

This strategy executes a fixed sequence of buy and sell orders on the BTC-USD pair at predetermined timestamps on the 2-hour chart. It uses an initial capital of 10000 with 0.2 percent commission to calculate position sizes. Orders are placed with specific qua

Strategy v4 ScalpingSessions & time
Updated 5 years ago · None stated GitHub repository of Lazarus3 Backtest
10 stars

The Reverse RSI Strategy is a scalping system designed for forex pairs during specific trading sessions. It combines a smoothed RSI indicator with five Exponential Moving Averages to identify mean-reversion trade opportunities. Position sizing dynamically adju

Strategy v4 Oscillators & momentumMoving averages
Updated 3 years ago · GPL-3.0 GitHub repository of Strategy - Reverse RSI

1-Min Gold Taylor Technique

by eddiebelaval
7 stars

This intraday strategy implements session-based trading rules tailored for gold on short timeframes. It tracks the Asian session price range, VWAP, 20-period EMA, and previous day high and low levels to identify liquidity sweeps during London and New York trad

Strategy v6 Sessions & timeSupport & resistance
Updated 3 months ago · None stated GitHub repository of 1-Min Gold Taylor Technique

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