This strategy detects gap-up price zones where the current low is higher than the high from two bars prior, creating visual box objects on the price chart.
//@version=6
strategy("drawing-box-zone-reentry", overlay=true, pyramiding=0, default_qty_type=strategy.fixed, default_qty_value=1)
var box[] zones = array.new<box>()
gapUp = low > high[2]
if gapUp
array.push(zones, box.new(bar_index - 2, low, bar_index, high[2], bgcolor=color.new(color.green, 80)))
n = array.size(zones)
if n > 0
z = array.get(zones, n - 1)
top = box.get_top(z)
bot = box.get_bottom(z)
if strategy.position_size == 0 and close <= top and close >= bot
strategy.entry("L", strategy.long)
if strategy.position_size > 0 and close > top
strategy.close("L")
array.get(zones, n - 1).delete()
array.pop(zones)
if array.size(zones) > 20
array.get(zones, 0).delete()
array.shift(zones)
Overview
When price re-enters the boundaries of the most recent gap zone while flat, the strategy opens a long position. The trade exits when the closing price rises above the top boundary of the zone, at which point the corresponding box drawing is removed. There are no built-in stop loss levels or configurable input settings.
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.
This trend-following strategy executes a classic Donchian channel breakout system designed to cross-validate backtest results against external framework benchmarks. It triggers a long entry when the closing price breaks above the highest high of the prior entr
This strategy plots running pivot highs as red R circles and pivot lows as blue S circles directly on the price chart. It computes an EMA 3 and a Cto trend line from close prices, then generates long signals on upward EMA-Cto crossovers combined with price pos
The Chained Linear Regression Reversal Strategy plots linear regression channels with upper and lower standard deviation bands directly on the price chart across a user-defined time window. When price breaks out of the static channel for a confirmed number of
STRG-HOLP is a trading strategy that identifies High of Low Period (HOLP) and Low of High Period (LOHP) breakout setups. It tracks the lowest low or highest high over a user-defined lookback window. A long trade opens when the close breaks above the high of th
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
This trend breakout strategy plots Donchian Channels consisting of upper, lower, and middle bands directly on the main price chart. Long positions enter when price touches the upper channel and pulls back to or below the middle band, placing a stop loss at the