Strategy · Pine Script v6 · On the chart

PF Probe 95 Multi-Cycle Open Fill Stops

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

A test strategy from a reference corpus that checks order flipping with stop entries set so far from price that they always fill at the next bar open.

View on GitHub

GitHub stars1on the repository
Pine versionv6current
Lines of code63
Settings0inputs
LicenceApache-2.0
Last update6 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

63 lines of Pine Script v6 from validation/order-deferred-flip-guaranteed-gap-stops-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 95 - multi-cycle deferred-flip growth, sub-bar-precision-free
//
// Purpose: isolate whether the residual probes 52/63 PnL divergence is
// the deferred-flip growth rule itself or sub-bar fill precision.
//
// Probe 52 exercises the same mechanic but its SE/LE stops are placed at
// ``high[1] + tick`` / ``low[1] - tick``, which makes the fire price
// depend on TradingView's intra-bar 1m magnifier path. This probe replaces
// those stops with EXTREME levels (``high * 10`` for the short stop,
// ``low * 0.1`` for the long stop) that are GUARANTEED to gap through at
// the next bar's open — the fill price is always ``open``, regardless of
// any sub-bar path. Cross events are also time-based (deterministic),
// not EMA-derived, eliminating EMA precision drift.
//
// Each UTC day fires two cycles (down at 8:00, up at 14:00). The growth
// chain steps up by 1 every cycle (long N -> short N+1 -> long N+2 ...).
// A weekly forced-flat at Monday 00:00 caps the chain length at 14
// cycles per week so the position notional stays well below
// initial_capital — without this, an unbounded chain on a 365-day
// window grows past TV's broker capital cap (~qty 288 with 1M capital)
// and TV starts splitting positions in ways unrelated to the
// deferred-flip rule we're testing.
//
// 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 95 - multi-cycle open-guaranteed stops", shorttitle="PF_P95_OG",
     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)

isDown = hour == 8 and minute == 0
isUp = hour == 14 and minute == 0

// Stop levels engineered so the fill price is always ``open`` of the next
// bar. SE short fires when ``low <= stop`` -> stop = ``high * 10`` is
// always >= low, fill = min(open, stop) = open.
// LE long fires when ``high >= stop``  -> stop = ``low * 0.1`` is always
// <= high, fill = max(open, stop) = open.
shortStop = high * 10.0
longStop = low * 0.1

if isDown
    strategy.entry("SE", strategy.short, qty=1, stop=shortStop, comment="open-guaranteed short")
    strategy.cancel("LE")

if isUp
    strategy.entry("LE", strategy.long, qty=1, stop=longStop, comment="open-guaranteed long")
    strategy.cancel("SE")

if isDown and strategy.position_size > 0
    strategy.close("LE", comment="flip flat long")

if isUp and strategy.position_size < 0
    strategy.close("SE", comment="flip flat short")

if dayofweek == 2 and hour == 0 and minute == 0 and strategy.position_size != 0
    strategy.close_all(comment="weekly reset")

Overview

At 08:00 it places a short stop entry and at 14:00 a long one, closing the opposite position each time, so each daily cycle reverses the side. A weekly reset closes everything on Tuesday midnight in the chart time zone. Timing comes from the clock, not indicators. Commission and slippage are zero.

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

Sessions & time

Markets

Any symbol

Timeframes

M15-H1

Risk Notes

  • The strategy enters trades without a stop loss

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

361 stars

Forven S01512 — Monday Drift is a calendar-based long trading strategy designed to exploit time-based recurring market patterns. It tracks UTC calendar days and hours to enter a long position at a specified day and hour, holding it for a fixed duration until a

Strategy v6 Sessions & time
Updated yesterday · AGPL-3.0 GitHub repository of Forven S01512 - Monday Drift

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 yesterday · None stated GitHub repository of Boilerplate Configurable Strategy [Yosiet]
257 stars

Donald - Test Logic Futures is an overlay strategy designed for intraday futures trading. It combines kernel regression functions with exponential moving averages to evaluate price retracements and entry timing. Trades are filtered by session execution windows

Strategy v5 TrendMoving averages Repaints
Updated 6 weeks ago · None stated GitHub repository of Donald - Test Logic Futures

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 script monitors opening gap conditions and breakout behavior relative to the first candle's range across up to twenty configurable stock tickers. It detects whether following bars remain inside the opening range before breaking out, displaying the status

Strategy v4 Screeners & dashboardsBreakout Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of 1St Bar GAP+BkOut Screener v2 by RM
53 stars

This strategy enters long or short on the price chart when price is on the correct side of a 200-period EMA, MACD agrees, RSI is not at the opposing extreme, ADX exceeds a threshold, volume beats a 20-bar average, and close breaks the recent high or low. A tim

Strategy v6 TrendOscillators & momentum
Updated 2 months ago · MPL-2.0 GitHub repository of BTCUSD 5M Optimized 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