Strategy · Pine Script v6 · On the chart

PF Probe 50 - Stop Limit Trail

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

PF Probe 50 - Stop Limit Trail is a synthetic validation strategy designed to test simultaneous exit conditions.

View on GitHub

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

41 lines of Pine Script v6 from validation/bracket-exit-stop-limit-trail-same-bar-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 50 - stop/limit/trail same-bar exit
//
// Purpose: isolate one strategy.exit carrying stop, limit, and trail_points at
// the same time. This is the exit surface used by the scalping integration
// probe family.
// 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 50 - stop limit trail", shorttitle="PF_P50_EXIT3", 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)

atr = ta.atr(14)

enterLong = hour == 8 and minute == 15 and strategy.position_size == 0
enterShort = hour == 16 and minute == 15 and strategy.position_size == 0

if enterLong
    strategy.entry("L", strategy.long, qty=1, comment="probe long")

if enterShort
    strategy.entry("S", strategy.short, qty=1, comment="probe short")

if strategy.position_size > 0
    longStop = strategy.position_avg_price - atr * 0.8
    longLimit = strategy.position_avg_price + atr * 1.6
    strategy.exit("LX", "L", stop=longStop, limit=longLimit, trail_points=atr, comment="triple exit long")

if strategy.position_size < 0
    shortStop = strategy.position_avg_price + atr * 0.8
    shortLimit = strategy.position_avg_price - atr * 1.6
    strategy.exit("SX", "S", stop=shortStop, limit=shortLimit, trail_points=atr, comment="triple exit short")

if strategy.position_size != 0 and hour == 23 and minute == 45
    strategy.close_all(comment="timeout")

Overview

PF Probe 50 - Stop Limit Trail opens long positions at 08:15 and short positions at 16:15 when flat. Position exits utilize a single bracket exit command incorporating an ATR-based stop loss set at 0.8 times ATR, a take profit limit set at 1.6 times ATR, and trailing stop points equal to ATR. An intraday timeout closes open positions at 23:45. It plots overlay signals 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

Type

Strategy, Pine Script v6

Draws

On the price chart

Category

Volatility & bands, 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

This overlay strategy offers two selectable entry modes: a Bollinger squeeze on typical price and a simple moving-average cross. It filters trades by weekday, session, date range, and an optional news window, and can restrict direction or invert the side. Risk

Strategy v5 Volatility & bandsMoving averages
Updated today · None stated GitHub repository of Boilerplate Configurable Strategy [Yosiet]

Daily Bias + FVG Strategy

by TradersPost
218 stars

This overlay strategy plots previous-day high and low, the daily open, and fair value gap zones on the price chart. It takes entries on a selectable timeframe when the FVG requirement and an optional session window allow them, then uses an ATR or fixed pip sto

Strategy v6 SMC / ICT / price actionSupport & resistance Repaints
Updated 3 months ago · None stated GitHub repository of Daily Bias + FVG Strategy
106 stars

This strategy places buy-stop and sell-stop orders around the opening-session high and low, offset by a user-defined pip gap, and only allows those orders during a separate trading session. It exits with a fixed or ATR-based stop loss and a matching take-profi

Strategy v5 Sessions & timeBreakout Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of 50 Pips A Day Strategy - Kaspricci

Turtle MACD Time-Zone Filter

by skywalker0803r
42 stars

This strategy enters long when price closes above the prior Donchian high and short when it closes below the prior Donchian low, only while flat and inside a Taipei-hour window. It exits on a MACD histogram reversal or through an ATR stop and a percentage take

Strategy v5 BreakoutOscillators & momentum
Updated 2 months ago · None stated GitHub repository of Turtle MACD Time-Zone Filter

ORION: Hybrid Strategy

by eddiebelaval
7 stars

This strategy identifies volatility breakout opportunities by constructing dynamic ATR-based price boxes and detecting volatility squeezes. Trades are filtered using an exponential moving average trend condition and designated session hours. Entries trigger up

Strategy v5 Volatility & bandsBreakout
Updated 3 months ago · None stated GitHub repository of ORION: Hybrid Strategy

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