Strategy · Pine Script v6 · On the chart

PF probe 91 - atr trail fixed entry

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

This strategy is a validation probe that opens one long at 08:00 and one short at 20:00 when the position is flat.

View on GitHub

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

57 lines of Pine Script v6 from validation/bracket-atr-trail-series-int-points-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 91 - atr-based trail_points with fixed-time entries
//
// Purpose: isolate whether the residual ~80 drifts from a community-style
// scalping strategy (after the trail_points-ceil fix in commit 9e838c0)
// come from the atr-based variable trail_points, or from that strategy's
// specific momentum-based entry pattern.
//
// Probes 88/89/90 all passed 100% with CONSTANT trail_points (8 or 20).
// This probe keeps everything else the same as probe 90 but switches
// trail_points to `atr` (series, varies per entry) — exactly like the
// scalping shape. Stop and limit also become atr-based (atrMult=1.2 short
// stop, *2 limit) to fully mirror the scalping shape.
//
// If probe 91 matches TV: the atr-based trail is fine, and trade-23-style
// drifts are tied to the scalping shape's entry timing
// (post-strong-bull-candle).
// If probe 91 diverges: there's a bug in how engine handles a series-int
// trail_points compared to a constant — most likely the timing of the
// atr capture inside strategy.exit.
//
// 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 91 - atr trail fixed entry",
     shorttitle="PF_P91_ATRTRAIL", 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)

atrLen = 14
atrMult = 1.2
atr = ta.atr(atrLen)

if hour == 8 and minute == 0 and strategy.position_size == 0
    longStop  = close - atr * atrMult
    longLimit = close + (close - longStop) * 2
    strategy.entry("L", strategy.long, qty=1, comment="entry long")
    strategy.exit("LX", "L",
         stop=longStop,
         limit=longLimit,
         trail_points=atr,
         comment="atr trail long")

if hour == 20 and minute == 0 and strategy.position_size == 0
    shortStop  = close + atr * atrMult
    shortLimit = close - (shortStop - close) * 2
    strategy.entry("S", strategy.short, qty=1, comment="entry short")
    strategy.exit("SX", "S",
         stop=shortStop,
         limit=shortLimit,
         trail_points=atr,
         comment="atr trail short")

Overview

Each entry sets an ATR-based stop, a limit at twice that stop distance, and a trailing stop whose trail points equal the current ATR. ATR length is 14 and the stop multiplier is 1.2, both fixed in the code. It trades a quantity of one on the price chart and has no separate oscillator pane or extra inputs.

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