Strategy · Pine Script v6 · On the chart

PF probe 88 - 3-way exit set once

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

This strategy places long and short entries on the price chart at fixed daily times of 8:00 and 20:00.

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-exit-three-way-set-once-entry-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 88 - three-way exit set once at entry (scalping-like)
//
// Purpose: isolate the exit-side divergence in a community-style scalping
// strategy. Probe 50 already covers same-bar stop+limit+trail_points fills,
// but it RE-ISSUES strategy.exit on every bar while in position
// (`if strategy.position_size > 0`). The scalping shape instead calls
// strategy.exit ONCE next to strategy.entry — the exit's stop, limit, and
// trail_points values are captured from the entry-bar atr/close and never
// updated. This probe mirrors that shape exactly so any divergence between
// TV and the engine maps cleanly to the "exit set once + carried across
// multiple bars" path rather than the "exit reset each bar" path that
// probe 50 covers.
//
// 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 88 - 3-way exit set once", shorttitle="PF_P88_EX3SET", 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)

// Tick-sized trail (~$0.20 for ETH at mintick 0.01) matches scalping's
// trail_points=atr semantics — atr is implicitly cast to int and ends up
// as a small tick count rather than the human-readable atr in price units.
trailTicks = 20

// Long entry once a day, with the 3-way exit captured at entry close.
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 * 0.99,
         limit=close * 1.02,
         trail_points=trailTicks,
         comment="3-way set once")

// Short entry once a day, far enough from the long window to avoid bracket
// interference. Same 3-way exit captured at entry close.
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 * 1.01,
         limit=close * 0.98,
         trail_points=trailTicks,
         comment="3-way set once")

Overview

PF probe 88 - 3-way exit set once uses fixed position sizing of 1 share with pyramiding set to 1, so only one position is held. At entry it immediately sets a three-way bracket exit that includes a stop loss, a limit order, and a trailing stop of 20 points. The exit values are captured from the entry bar close and remain constant while the position is open. The strategy draws all elements directly on the price chart with overlay enabled. It runs on intraday charts such as 15-minute timeframes and carries no commission or slippage.

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