Strategy · Pine Script v6 · On the chart

PF probe 97b - intraday cap isolate

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

This strategy identifies long and short positions using a dual moving average crossover on the price chart.

View on GitHub

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

45 lines of Pine Script v6 from validation/cap-max-intraday-filled-orders-isolate-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 97b — max_intraday_filled_orders cap (isolated from probe 97)
// Clean-room: written from validation goal, not from source.
//
// Purpose: isolate `strategy.risk.max_intraday_filled_orders(N)` from
// probe 97. Drops bracket, drops gap/range gate, drops pending stop
// entries. Uses a plain dual-MA crossover with market entries; the cap
// is the only non-trivial surface under test. If TV vs engine diverge
// here, the cap counter (when it increments, when it resets, what it
// counts as a "filled order") is the bug locus.
//
// Validation goal: bit-exact trade list. Pass = identical entries
// because the cap counter increments + day-rollover boundary match TV.
//
// TV setup: 15m chart, ETH-USDT-USDT (Binance USDT-M Perpetual). Full
// window matching corpus/data/ohlcv_ETH-USDT-USDT_15m.csv. Strategy
// properties: leave defaults. Export "List of trades" → tv_trades.csv.
//@version=6
strategy("PF probe 97b - intraday cap isolate", shorttitle="PF_p97b_CAP",
     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, calc_on_order_fills=false)

// ---- inputs --------------------------------------------------------
int i_fast      = input.int(5,  "Fast MA",                     minval=2)
int i_slow      = input.int(13, "Slow MA",                     minval=3)
int i_max_fills = input.int(5,  "Max intraday filled orders",  minval=1)

strategy.risk.max_intraday_filled_orders(i_max_fills)

// ---- entry signal: dual MA cross (no bracket, no gap, no cap-aware logic)
float fast = ta.sma(close, i_fast)
float slow = ta.sma(close, i_slow)
bool  go_long  = ta.crossover(fast, slow)
bool  go_short = ta.crossunder(fast, slow)

if go_long and strategy.position_size <= 0
    strategy.entry("L", strategy.long, comment="ma cross up")

if go_short and strategy.position_size >= 0
    strategy.entry("S", strategy.short, comment="ma cross dn")

Overview

The fast and slow simple moving averages generate crossover signals that trigger market entries. The script caps the number of intraday filled orders to limit position building within a single day. Inputs control the lengths of the fast and slow moving averages and the maximum number of allowed fills per day. Entries occur on crossover without additional filters or brackets. The strategy supports pyramiding but lacks an explicit stop loss.

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

Moving averages, Trend, Scalping, Sessions & time

Markets

Crypto

Timeframes

M15-H1

Risk Notes

  • The strategy can add several entries in the same direction
  • The strategy enters trades without a stop loss

Topics

algorithmic-tradingbacktestingparitypine-scriptpinescriptquantitative-financetest-corpustradingview

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Fast MAint5i_fast
Slow MAint13i_slow
Max intraday filled ordersint5i_max_fills
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

QQQ 5min Pure Runner

by yalili8521
2 stars

This strategy identifies trend continuation and accumulation setups on 5-minute charts. It enters long or short positions based on an aligned moving average stack, rising or falling price grinds within a lookback period, and a maximum bar size threshold to avo

Strategy v6 TrendMoving averages
Updated 7 days ago · None stated GitHub repository of QQQ 5min Pure Runner
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
53 stars

This strategy trades EUR/USD on the price chart using a fast and slow exponential moving average crossover filtered by RSI. It enters long when the fast EMA crosses above the slow EMA while RSI is above 50 and below the overbought level, and enters short on th

Strategy v6 TrendMoving averages
Updated 2 months ago · MPL-2.0 GitHub repository of EUR/USD EMA9-21 + RSI Scalping Strategy

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

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