this is a strategy based on the close and every tick:
//@version=6
strategy("GAMABOOM Reversal - Hermes v169 (ADX FIXED)", overlay=true, pyramiding=0, initial_capital=10000)
//=============================================================================
// TICK SETTINGS
//=============================================================================
stopTicks = input.int(20, "Stop Loss (Ticks)", minval=1)
targetTicks = input.int(40, "Take Profit (Ticks)", minval=1)
tickSize = syminfo.mintick
sl = stopTicks * tickSize
tp = targetTicks * tickSize
//=============================================================================
// TIME FILTER
//=============================================================================
useTimeFilter = input.bool(true, "Enable Session Filter")
startHour = input.int(9, "Start Hour", minval=0, maxval=23)
startMinute = input.int(30, "Start Minute", minval=0, maxval=59)
endHour = input.int(16, "End Hour", minval=0, maxval=23)
endMinute = input.int(0, "End Minute", minval=0, maxval=59)
currentMinutes = hour * 60 + minute
startMinutes = startHour * 60 + startMinute
endMinutes = endHour * 60 + endMinute
inSession = not useTimeFilter or (currentMinutes >= startMinutes and currentMinutes <= endMinutes)
//=============================================================================
// CORE SIGNALS
//=============================================================================
src = close
pchange = ta.change(src, 1) / src * 100
avpchange = ta.alma(pchange, 28, 0.85, 7)
rsi = ta.rsi(close, 10)
rsiL = rsi > rsi[1]
rsiS = rsi < rsi[1]
// Chande Momentum
length11 = 17
momm = ta.change(close)
f1(m) => m >= 0.0 ? m : 0.0
f2(m) => m >= 0.0 ? 0.0 : -m
sm1 = math.sum(f1(momm), length11)
sm2 = math.sum(f2(momm), length11)
percent(nom, div) => 100 * nom / div
chandeMO = percent(sm1 - sm2, sm1 + sm2)
cL = chandeMO > chandeMO[1]
cS = chandeMO < chandeMO[1]
// GMA
length_gama = 19
sigma_gama = ta.stdev(close, 20)
gma = 0.0
sumW = 0.0
for i = 0 to length_gama - 1
w = math.exp(-math.pow(((i - (length_gama - 1)) / (2 * sigma_gama)), 2) / 2)
v = ta.highest(avpchange, i + 1) + ta.lowest(avpchange, i + 1)
gma += v * w
sumW += w
gma := (gma / sumW) / 2
gma := ta.ema(gma, 7)
//=============================================================================
// FLOOR PRESSURE FILTER
//=============================================================================
threshold = input.int(45, "Floor Pressure Threshold")
tr1 = high - low
tr2 = math.abs(high - nz(close[1]))
tr3 = math.abs(low - nz(close[1]))
r7c = math.max(tr1, math.max(tr2, tr3))
p5y = high - nz(high[1]) > nz(low[1]) - low ? math.max(high - nz(high[1]), 0) : 0
d4h = nz(low[1]) - low > high - nz(high[1]) ? math.max(nz(low[1]) - low, 0) : 0
var float v5g = 0.0
v5g := nz(v5g[1]) - (nz(v5g[1]) / 1) + r7c
var float p1b = 0.0
p1b := nz(p1b[1]) - (nz(p1b[1]) / 1) + p5y
var float b6t = 0.0
b6t := nz(b6t[1]) - (nz(b6t[1]) / 1) + d4h
bullPressure = v5g != 0 ? p1b / v5g * 100 : 0
bearPressure = v5g != 0 ? b6t / v5g * 100 : 0
bullFloor = math.floor(bullPressure)
bearFloor = math.floor(bearPressure)
bullFloorOK = bullFloor > bearFloor and bullFloor >= threshold
bearFloorOK = bearFloor > bullFloor and bearFloor >= threshold
//=============================================================================
// ADX FILTER (FIXED USING DMI)
//=============================================================================
adxLen = input.int(14, "ADX Length")
adxMin = input.float(18, "ADX Min Threshold")
[dmiPlus, dmiMinus, adx] = ta.dmi(adxLen, adxLen)
adxOk = adx > adxMin
//=============================================================================
// SIGNALS
//=============================================================================
asgma_buy = ta.crossover(avpchange, gma) and rsiL and cL
asgma_sell = ta.crossunder(avpchange, gma) and rsiS and cS
bom_buy = ta.crossover(avpchange, gma)
bom_sell = ta.crossunder(avpchange, gma)
bomVolSma = ta.sma(volume, 14)
bomVolumeOk = volume > bomVolSma * 0.5
confirmed_buy = asgma_buy and bom_buy and bomVolumeOk and inSession
confirmed_sell = asgma_sell and bom_sell and bomVolumeOk and inSession
//=============================================================================
// FINAL ENTRY FILTER (FLOOR + ADX)
//=============================================================================
longCondition = confirmed_buy and bullFloorOK and adxOk
shortCondition = confirmed_sell and bearFloorOK and adxOk
if longCondition
strategy.entry("LONG", strategy.long)
if shortCondition
strategy.entry("SHORT", strategy.short)
//=============================================================================
// EXITS
//=============================================================================
strategy.exit("LONG EXIT", from_entry="LONG",
stop=close - sl,
limit=close + tp)
strategy.exit("SHORT EXIT", from_entry="SHORT",
stop=close + sl,
limit=close - tp)
//=============================================================================
// VISUALS
//=============================================================================
plotshape(longCondition, title="LONG", style=shape.labelup, location=location.belowbar, color=color.green, text="BUY")
plotshape(shortCondition, title="SHORT", style=shape.labeldown, location=location.abovebar, color=color.red, text="SELL")