Strategy · Pine Script v6 · On the chart

PF IES Probe 04 - Pressure Gauge

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

This strategy calculates candle-position buying pressure derived from the close relative to the high-low range, smoothed through a double exponential moving average chain with a momentum overlay.

View on GitHub

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

79 lines of Pine Script v6 from validation/composite-ies-pressure-gauge-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
//
// IES probe 04 — candle-position pressure with double-EMA smoothing
//
// Purpose: isolate the IES integration probe family's "pressure gauge" — a
// flow proxy built from the candle's close-position-in-range, then
// double-smoothed:
//
//   raw_buy = (high - low) > 0 ? (close - low) / (high - low) : 0.5
//   pressure_ratio  = ta.ema(raw_buy, 14)
//   pressure_smooth = ta.ema(pressure_ratio, 5)
//   pressure_momentum = pressure_smooth - pressure_smooth[10]
//
// Two failure modes can drift here. (1) Zero-range bars in the OHLCV CSV:
// the ternary returns 0.5, but a tiny float-rounding gap (e.g. high == low
// in the CSV but high > low post-magnifier) will quietly switch branches.
// (2) The ema-of-ema chain seeds differently: the inner ta.ema(raw_buy,14)
// has its own warmup, and the outer ta.ema(...,5) re-smoothes its output
// — that compounds early-bar disagreement between TV and the engine.
//
// IES's pressure_state ladder fires `pressure_bull` when state >= 1 OR
// momentum > 0.05. This probe replicates that exactly and enters long on
// the rising edge of pressure_bull, exits on rising edge of pressure_bear.
//
// TV setup: 15m chart, ETH-USDT-USDT, same window as
// data/ohlcv_ETH-USDT-USDT_15m.csv. Export "List of trades" → trades.csv.
//@version=6
strategy("PF IES probe 04 - pressure gauge", shorttitle="IES_p04_PRESS", 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)

// ---- inputs (mirrored from IES) ------------------------------------
int   i_pressure_len    = input.int(14,    "Pressure Period",    minval=5,  maxval=50)
int   i_pressure_smooth = input.int(5,     "Pressure Smoothing", minval=1,  maxval=20)
int   i_pressure_mom    = input.int(10,    "Pressure Momentum",  minval=3,  maxval=30)
float i_pressure_high   = input.float(0.7, "Extreme Buy Level",  minval=0.5,maxval=0.9, step=0.05)
float i_pressure_low    = input.float(0.3, "Extreme Sell Level", minval=0.1,maxval=0.5, step=0.05)
float i_pressure_thresh = input.float(0.05,"Momentum Threshold", minval=0.01,maxval=0.2, step=0.01)

// ---- candle-position pressure with zero-range fallback -------------
float range_val = high - low
float raw_buy   = range_val > 0 ? (close - low) / range_val : 0.5

// ---- double-EMA smoothing chain ------------------------------------
float pressure_ratio    = ta.ema(raw_buy,        i_pressure_len)
float pressure_smooth   = ta.ema(pressure_ratio, i_pressure_smooth)
float pressure_momentum = pressure_smooth - pressure_smooth[i_pressure_mom]

// ---- IES's exact pressure_state ladder -----------------------------
int pressure_state = 0
if pressure_smooth >= i_pressure_high
    pressure_state := 2
else if pressure_smooth > 0.5 + i_pressure_thresh
    pressure_state := 1
else if pressure_smooth <= i_pressure_low
    pressure_state := -2
else if pressure_smooth < 0.5 - i_pressure_thresh
    pressure_state := -1

bool pressure_bull = pressure_state >=  1 or pressure_momentum >  i_pressure_thresh
bool pressure_bear = pressure_state <= -1 or pressure_momentum < -i_pressure_thresh

// ---- enter on rising edge of bull/bear pressure --------------------
bool long_entry  = pressure_bull and not pressure_bull[1] and strategy.position_size <= 0
bool short_entry = pressure_bear and not pressure_bear[1] and strategy.position_size >= 0

if long_entry
    if strategy.position_size < 0
        strategy.close("S", comment="flip")
    strategy.entry("L", strategy.long, qty=1, comment="pressure bull")

if short_entry
    if strategy.position_size > 0
        strategy.close("L", comment="flip")
    strategy.entry("S", strategy.short, qty=1, comment="pressure bear")

Overview

PF IES Probe 04 - Pressure Gauge evaluates a multi-step pressure ladder to identify bullish and bearish states. Long positions are entered on the rising edge of bullish pressure and closed when bearish pressure emerges. Configurable inputs include EMA smoothing lengths, momentum lookback, and extreme state thresholds. It operates directly on the price chart without a stop-loss mechanism.

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

Oscillators & momentum, Trend

Markets

Crypto

Timeframes

M15-H1

Risk Notes

  • 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
Pressure Periodint14i_pressure_len
Pressure Smoothingint5i_pressure_smooth
Pressure Momentumint10i_pressure_mom
Extreme Buy Levelfloat0.7i_pressure_high
Extreme Sell Levelfloat0.3i_pressure_low
Momentum Thresholdfloat0.05i_pressure_thresh
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

330 stars

2 EMA/SMA + RSI Strategy [Alorse] combines three configurable moving averages with a short-period Relative Strength Index filter. It plots fast, slow, and trend moving averages on the price chart. Long entries trigger when the fast moving average is above the

Strategy v4 TrendOscillators & momentum
Updated 2 months ago · None stated GitHub repository of 2 EMA/SMA + RSI Strategy [Alorse]

Acrypto - Weighted Strategy

by AlbertoCuadra
318 stars

This strategy plots on the price chart and opens long or short positions when a weighted score from MACD, Stochastic RSI, RSI, Supertrend and a moving-average crossover exceeds a user-set trigger. Each component has its own weight and candle delay. Entries can

Strategy v5 TrendOscillators & momentum
Updated 3 years ago · Custom licence GitHub repository of Acrypto - Weighted Strategy
285 stars

Mean Reversion Strategy is an overlay strategy that identifies pullbacks using a long-term EMA, RSI, and candlestick patterns. It generates long signals when a bullish engulfing candle forms below the EMA while RSI is oversold, and short signals when a bearish

Strategy v4 Mean reversionCandlestick patterns
Updated 3 years ago · None stated GitHub repository of Mean Reversion Strategy
218 stars

This strategy generates trading signals based on a selectable momentum engine, supporting MACD, RSI, Stochastic, or Rate of Change. Entries trigger on signal crosses, zero-line crosses, or threshold crosses, with an optional moving average trend filter. Risk m

Strategy v6 Oscillators & momentumTrend
Updated 3 months ago · None stated GitHub repository of Momentum Strategy Template

255 EMA Strategy

by hasnocool
106 stars

255 EMA Strategy combines an exponential moving average with Average True Range bands and standard MACD crossovers to generate entry signals. Drawn directly on the price chart, it plots the central 255 EMA along with upper and lower volatility envelopes. Trade

Strategy v4 Moving averagesOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of 255 EMA 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