SMC_Momentum_Signal## SMC Structure & Momentum Strategy
This indicator is a comprehensive trading tool built on Pine Script v5, utilizing Smart Money Concepts (SMC) combined with trend momentum filters.
### Key Features:
* **Primary Signal (Structure Break):** Identifies potential points of interest based on structural changes (pivots), often associated with Order Blocks or Breaker Blocks.
* **Momentum & Trend Filter:** Uses an 8/21 EMA crossover to define the current trend direction and momentum strength, helping filter out low-probability signals.
* **Dynamic Support/Resistance Zones:** Automatically plots and updates accumulation/distribution zones (Support/Resistance) based on configurable volume lookback periods.
* **Automated Risk Management:** Calculates and plots fixed Take Profit (TP) and Stop Loss (SL) lines automatically upon entry, based on a user-defined **Risk:Reward Ratio** and volatility (ATR multiplier).
---
**DISCLAIMER:** This tool is intended for educational purposes only. It is not financial advice, and the user should always practice proper risk management. Past performance is not indicative of future results.
Candlestick analysis
Volume-Weighted FVG (Fixed)1. The Core Concept: Identifying "Institutional Footprints"
FVG (Fair Value Gap): These are "gaps" or "voids" in price created by rapid movement. The market has a natural tendency to return and "fill" these gaps.
The Volume Filter: Unlike standard FVGs, this tool highlights zones created with high trading volume (Strong FVG). These represent the "footprints" of institutional traders—the "Big Money" that truly moves the market.
2. Trading the "Wall": Rejection and Reversal
The Rejection (Bounce): A Strong FVG acts as a powerful "wall." When price returns to this zone, unfilled orders often trigger, causing the price to bounce back (reject).
The Reversal (Breakout): If this "wall" is completely breached, it triggers a cascade of stop-losses from those who bet on the bounce. This results in a violent move in the opposite direction, known as a reversal.
The Retest: Once a "wall" is broken, its role flips (e.g., support becomes resistance). Trading the first retest of a broken Strong FVG is one of the highest-probability setups in scalping.
3. The Execution: High-Precision Entry
To achieve a Profit Factor (PF) of 5.0+, we combine three elements:
Structure: Confirm the trend using Multi-Timeframe (MTF) HH/HL (Higher Highs/Higher Lows).
The Zone: Price enters a Strong FVG (Darker color).
The Trigger: Enter when an Engulfing Candle breaks through the BB20 Middle Line, confirmed by an RCI 9 reversal.
Big Move Predictor ProThis indicator uses support, resistance and EMA lines to predict accurately which way the market will go and will give you buy or sell signals. With backtest results of 67.5% this indicator is one the best free indicators you can use right now.
BUZARA// © Buzzara
// =================================
// PLEASE SUPPORT THE TEAM
// =================================
//
// Telegram: t.me
// =================================
//@version=5
VERSION = ' Buzzara2.0'
strategy('ALGOX V6_1_24', shorttitle = '🚀〄 Buzzara2.0 〄🚀'+ VERSION, overlay = true, explicit_plot_zorder = true, pyramiding = 0, default_qty_type = strategy.percent_of_equity, initial_capital = 1000, default_qty_value = 1, calc_on_every_tick = false, process_orders_on_close = true)
G_SCRIPT01 = '■ ' + 'SAIYAN OCC'
//#region ———— <↓↓↓ G_SCRIPT01 ↓↓↓> {
// === INPUTS ===
res = input.timeframe('15', 'TIMEFRAME', group ="NON REPAINT")
useRes = input(true, 'Use Alternate Signals')
intRes = input(10, 'Multiplier for Alernate Signals')
basisType = input.string('ALMA', 'MA Type: ', options= )
basisLen = input.int(50, 'MA Period', minval=1)
offsetSigma = input.int(5, 'Offset for LSMA / Sigma for ALMA', minval=0)
offsetALMA = input.float(2, 'Offset for ALMA', minval=0, step=0.01)
scolor = input(false, 'Show coloured Bars to indicate Trend?')
delayOffset = input.int(0, 'Delay Open/Close MA', minval=0, step=1,
tooltip = 'Forces Non-Repainting')
tradeType = input.string('BOTH', 'What trades should be taken : ',
options = )
//=== /INPUTS ===
h = input(false, 'Signals for Heikin Ashi Candles')
//INDICATOR SETTINGS
swing_length = input.int(10, 'Swing High/Low Length', group = 'Settings', minval = 1, maxval = 50)
history_of_demand_to_keep = input.int(20, 'History To Keep', minval = 5, maxval = 50)
box_width = input.float(2.5, 'Supply/Demand Box Width', group = 'Settings', minval = 1, maxval = 10, step = 0.5)
//INDICATOR VISUAL SETTINGS
show_zigzag = input.bool(false, 'Show Zig Zag', group = 'Visual Settings', inline = '1')
show_price_action_labels = input.bool(false, 'Show Price Action Labels', group = 'Visual Settings', inline = '2')
supply_color = input.color(#00000000, 'Supply', group = 'Visual Settings', inline = '3')
supply_outline_color = input.color(#00000000, 'Outline', group = 'Visual Settings', inline = '3')
demand_color = input.color(#00000000, 'Demand', group = 'Visual Settings', inline = '4')
demand_outline_color = input.color(#00000000, 'Outline', group = 'Visual Settings', inline = '4')
bos_label_color = input.color(#00000000, 'BOS Label', group = 'Visual Settings', inline = '5')
poi_label_color = input.color(#00000000, 'POI Label', group = 'Visual Settings', inline = '7')
poi_border_color = input.color(#00000000, 'POI border', group = 'Visual Settings', inline = '7')
swing_type_color = input.color(#00000000, 'Price Action Label', group = 'Visual Settings', inline = '8')
zigzag_color = input.color(#00000000, 'Zig Zag', group = 'Visual Settings', inline = '9')
//END SETTINGS
// FUNCTION TO ADD NEW AND REMOVE LAST IN ARRAY
f_array_add_pop(array, new_value_to_add) =>
array.unshift(array, new_value_to_add)
array.pop(array)
// FUNCTION SWING H & L LABELS
f_sh_sl_labels(array, swing_type) =>
var string label_text = na
if swing_type == 1
if array.get(array, 0) >= array.get(array, 1)
label_text := 'HH'
else
label_text := 'LH'
label.new(
bar_index - swing_length,
array.get(array,0),
text = label_text,
style = label.style_label_down,
textcolor = swing_type_color,
color = swing_type_color,
size = size.tiny)
else if swing_type == -1
if array.get(array, 0) >= array.get(array, 1)
label_text := 'HL'
else
label_text := 'LL'
label.new(
bar_index - swing_length,
array.get(array,0),
text = label_text,
style = label.style_label_up,
textcolor = swing_type_color,
color = swing_type_color,
size = size.tiny)
// FUNCTION MAKE SURE SUPPLY ISNT OVERLAPPING
f_check_overlapping(new_poi, box_array, atrValue) =>
atr_threshold = atrValue * 2
okay_to_draw = true
for i = 0 to array.size(box_array) - 1
top = box.get_top(array.get(box_array, i))
bottom = box.get_bottom(array.get(box_array, i))
poi = (top + bottom) / 2
upper_boundary = poi + atr_threshold
lower_boundary = poi - atr_threshold
if new_poi >= lower_boundary and new_poi <= upper_boundary
okay_to_draw := false
break
else
okay_to_draw := true
okay_to_draw
// FUNCTION TO DRAW SUPPLY OR DEMAND ZONE
f_supply_demand(value_array, bn_array, box_array, label_array, box_type, atrValue) =>
atr_buffer = atrValue * (box_width / 10)
box_left = array.get(bn_array, 0)
box_right = bar_index
var float box_top = 0.00
var float box_bottom = 0.00
var float poi = 0.00
if box_type == 1
box_top := array.get(value_array, 0)
box_bottom := box_top - atr_buffer
poi := (box_top + box_bottom) / 2
else if box_type == -1
box_bottom := array.get(value_array, 0)
box_top := box_bottom + atr_buffer
poi := (box_top + box_bottom) / 2
okay_to_draw = f_check_overlapping(poi, box_array, atrValue)
// okay_to_draw = true
//delete oldest box, and then create a new box and add it to the array
if box_type == 1 and okay_to_draw
box.delete( array.get(box_array, array.size(box_array) - 1) )
f_array_add_pop(box_array, box.new( left = box_left, top = box_top, right = box_right, bottom = box_bottom, border_color = supply_outline_color,
bgcolor = supply_color, extend = extend.right, text = 'SUPPLY', text_halign = text.align_center, text_valign = text.align_center, text_color = poi_label_color, text_size = size.small, xloc = xloc.bar_index))
box.delete( array.get(label_array, array.size(label_array) - 1) )
f_array_add_pop(label_array, box.new( left = box_left, top = poi, right = box_right, bottom = poi, border_color = poi_border_color,
bgcolor = poi_border_color, extend = extend.right, text = 'POI', text_halign = text.align_left, text_valign = text.align_center, text_color = poi_label_color, text_size = size.small, xloc = xloc.bar_index))
else if box_type == -1 and okay_to_draw
box.delete( array.get(box_array, array.size(box_array) - 1) )
f_array_add_pop(box_array, box.new( left = box_left, top = box_top, right = box_right, bottom = box_bottom, border_color = demand_outline_color,
bgcolor = demand_color, extend = extend.right, text = 'DEMAND', text_halign = text.align_center, text_valign = text.align_center, text_color = poi_label_color, text_size = size.small, xloc = xloc.bar_index))
box.delete( array.get(label_array, array.size(label_array) - 1) )
f_array_add_pop(label_array, box.new( left = box_left, top = poi, right = box_right, bottom = poi, border_color = poi_border_color,
bgcolor = poi_border_color, extend = extend.right, text = 'POI', text_halign = text.align_left, text_valign = text.align_center, text_color = poi_label_color, text_size = size.small, xloc = xloc.bar_index))
// FUNCTION TO CHANGE SUPPLY/DEMAND TO A BOS IF BROKEN
f_sd_to_bos(box_array, bos_array, label_array, zone_type) =>
if zone_type == 1
for i = 0 to array.size(box_array) - 1
level_to_break = box.get_top(array.get(box_array,i))
// if ta.crossover(close, level_to_break)
if close >= level_to_break
copied_box = box.copy(array.get(box_array,i))
f_array_add_pop(bos_array, copied_box)
mid = (box.get_top(array.get(box_array,i)) + box.get_bottom(array.get(box_array,i))) / 2
box.set_top(array.get(bos_array,0), mid)
box.set_bottom(array.get(bos_array,0), mid)
box.set_extend( array.get(bos_array,0), extend.none)
box.set_right( array.get(bos_array,0), bar_index)
box.set_text( array.get(bos_array,0), 'BOS' )
box.set_text_color( array.get(bos_array,0), bos_label_color)
box.set_text_size( array.get(bos_array,0), size.small)
box.set_text_halign( array.get(bos_array,0), text.align_center)
box.set_text_valign( array.get(bos_array,0), text.align_center)
box.delete(array.get(box_array, i))
box.delete(array.get(label_array, i))
if zone_type == -1
for i = 0 to array.size(box_array) - 1
level_to_break = box.get_bottom(array.get(box_array,i))
// if ta.crossunder(close, level_to_break)
if close <= level_to_break
copied_box = box.copy(array.get(box_array,i))
f_array_add_pop(bos_array, copied_box)
mid = (box.get_top(array.get(box_array,i)) + box.get_bottom(array.get(box_array,i))) / 2
box.set_top(array.get(bos_array,0), mid)
box.set_bottom(array.get(bos_array,0), mid)
box.set_extend( array.get(bos_array,0), extend.none)
box.set_right( array.get(bos_array,0), bar_index)
box.set_text( array.get(bos_array,0), 'BOS' )
box.set_text_color( array.get(bos_array,0), bos_label_color)
box.set_text_size( array.get(bos_array,0), size.small)
box.set_text_halign( array.get(bos_array,0), text.align_center)
box.set_text_valign( array.get(bos_array,0), text.align_center)
box.delete(array.get(box_array, i))
box.delete(array.get(label_array, i))
// FUNCTION MANAGE CURRENT BOXES BY CHANGING ENDPOINT
f_extend_box_endpoint(box_array) =>
for i = 0 to array.size(box_array) - 1
box.set_right(array.get(box_array, i), bar_index + 100)
//
stratRes = timeframe.ismonthly ? str.tostring(timeframe.multiplier * intRes, '###M') :
timeframe.isweekly ? str.tostring(timeframe.multiplier * intRes, '###W') :
timeframe.isdaily ? str.tostring(timeframe.multiplier * intRes, '###D') :
timeframe.isintraday ? str.tostring(timeframe.multiplier * intRes, '####') :
'60'
src = h ? request.security(ticker.heikinashi(syminfo.tickerid),
timeframe.period, close, lookahead = barmerge.lookahead_off) : close
// CALCULATE ATR
atrValue = ta.atr(50)
// CALCULATE SWING HIGHS & SWING LOWS
swing_high = ta.pivothigh(high, swing_length, swing_length)
swing_low = ta.pivotlow(low, swing_length, swing_length)
// ARRAYS FOR SWING H/L & BN
var swing_high_values = array.new_float(5,0.00)
var swing_low_values = array.new_float(5,0.00)
var swing_high_bns = array.new_int(5,0)
var swing_low_bns = array.new_int(5,0)
// ARRAYS FOR SUPPLY / DEMAND
var current_supply_box = array.new_box(history_of_demand_to_keep, na)
var current_demand_box = array.new_box(history_of_demand_to_keep, na)
// ARRAYS FOR SUPPLY / DEMAND POI LABELS
var current_supply_poi = array.new_box(history_of_demand_to_keep, na)
var current_demand_poi = array.new_box(history_of_demand_to_keep, na)
// ARRAYS FOR BOS
var supply_bos = array.new_box(5, na)
var demand_bos = array.new_box(5, na)
//END CALCULATIONS
// NEW SWING HIGH
if not na(swing_high)
//MANAGE SWING HIGH VALUES
f_array_add_pop(swing_high_values, swing_high)
f_array_add_pop(swing_high_bns, bar_index )
if show_price_action_labels
f_sh_sl_labels(swing_high_values, 1)
f_supply_demand(swing_high_values, swing_high_bns, current_supply_box, current_supply_poi, 1, atrValue)
// NEW SWING LOW
else if not na(swing_low)
//MANAGE SWING LOW VALUES
f_array_add_pop(swing_low_values, swing_low)
f_array_add_pop(swing_low_bns, bar_index )
if show_price_action_labels
f_sh_sl_labels(swing_low_values, -1)
f_supply_demand(swing_low_values, swing_low_bns, current_demand_box, current_demand_poi, -1, atrValue)
f_sd_to_bos(current_supply_box, supply_bos, current_supply_poi, 1)
f_sd_to_bos(current_demand_box, demand_bos, current_demand_poi, -1)
f_extend_box_endpoint(current_supply_box)
f_extend_box_endpoint(current_demand_box)
channelBal = input.bool(false, "Channel Balance", group = "CHART")
lr_slope(_src, _len) =>
x = 0.0, y = 0.0, x2 = 0.0, xy = 0.0
for i = 0 to _len - 1
val = _src
per = i + 1
x += per
y += val
x2 += per * per
xy += val * per
_slp = (_len * xy - x * y) / (_len * x2 - x * x)
_avg = y / _len
_int = _avg - _slp * x / _len + _slp
lr_dev(_src, _len, _slp, _avg, _int) =>
upDev = 0.0, dnDev = 0.0
val = _int
for j = 0 to _len - 1
price = high - val
if price > upDev
upDev := price
price := val - low
if price > dnDev
dnDev := price
price := _src
val += _slp
//
= ta.kc(close, 80, 10.5)
= ta.kc(close, 80, 9.5)
= ta.kc(close, 80, 8)
= ta.kc(close, 80, 3)
barsL = 10
barsR = 10
pivotHigh = fixnan(ta.pivothigh(barsL, barsR) )
pivotLow = fixnan(ta.pivotlow(barsL, barsR) )
source = close, period = 150
= lr_slope(source, period)
= lr_dev(source, period, s, a, i)
y1 = low - (ta.atr(30) * 2), y1B = low - ta.atr(30)
y2 = high + (ta.atr(30) * 2), y2B = high + ta.atr(30)
x1 = bar_index - period + 1, _y1 = i + s * (period - 1), x2 = bar_index, _y2 = i
//Functions
//Line Style function
get_line_style(style) =>
out = switch style
'???' => line.style_solid
'----' => line.style_dashed
' ' => line.style_dotted
//Function to get order block coordinates
get_coordinates(condition, top, btm, ob_val)=>
var ob_top = array.new_float(0)
var ob_btm = array.new_float(0)
var ob_avg = array.new_float(0)
var ob_left = array.new_int(0)
float ob = na
//Append coordinates to arrays
if condition
avg = math.avg(top, btm)
array.unshift(ob_top, top)
array.unshift(ob_btm, btm)
array.unshift(ob_avg, avg)
ob := ob_val
//Function to remove mitigated order blocks from coordinate arrays
remove_mitigated(ob_top, ob_btm, ob_left, ob_avg, target, bull)=>
mitigated = false
target_array = bull ? ob_btm : ob_top
for element in target_array
idx = array.indexof(target_array, element)
if (bull ? target < element : target > element)
mitigated := true
array.remove(ob_top, idx)
array.remove(ob_btm, idx)
array.remove(ob_avg, idx)
array.remove(ob_left, idx)
mitigated
//Function to set order blocks
set_order_blocks(ob_top, ob_btm, ob_left, ob_avg, ext_last, bg_css, border_css, lvl_css)=>
var ob_box = array.new_box(0)
var ob_lvl = array.new_line(0)
//Global elements
var os = 0
var target_bull = 0.
var target_bear = 0.
// Create non-repainting security function
rp_security(_symbol, _res, _src) =>
request.security(_symbol, _res, _src )
htfHigh = rp_security(syminfo.tickerid, res, high)
htfLow = rp_security(syminfo.tickerid, res, low)
// Main Indicator
// Functions
smoothrng(x, t, m) =>
wper = t * 2 - 1
avrng = ta.ema(math.abs(x - x ), t)
smoothrng = ta.ema(avrng, wper) * m
rngfilt(x, r) =>
rngfilt = x
rngfilt := x > nz(rngfilt ) ? x - r < nz(rngfilt ) ? nz(rngfilt ) : x - r : x + r > nz(rngfilt ) ? nz(rngfilt ) : x + r
percWidth(len, perc) => (ta.highest(len) - ta.lowest(len)) * perc / 100
securityNoRep(sym, res, src) => request.security(sym, res, src, barmerge.gaps_off, barmerge.lookahead_on)
swingPoints(prd) =>
pivHi = ta.pivothigh(prd, prd)
pivLo = ta.pivotlow (prd, prd)
last_pivHi = ta.valuewhen(pivHi, pivHi, 1)
last_pivLo = ta.valuewhen(pivLo, pivLo, 1)
hh = pivHi and pivHi > last_pivHi ? pivHi : na
lh = pivHi and pivHi < last_pivHi ? pivHi : na
hl = pivLo and pivLo > last_pivLo ? pivLo : na
ll = pivLo and pivLo < last_pivLo ? pivLo : na
f_chartTfInMinutes() =>
float _resInMinutes = timeframe.multiplier * (
timeframe.isseconds ? 1 :
timeframe.isminutes ? 1. :
timeframe.isdaily ? 60. * 24 :
timeframe.isweekly ? 60. * 24 * 7 :
timeframe.ismonthly ? 60. * 24 * 30.4375 : na)
f_kc(src, len, sensitivity) =>
basis = ta.sma(src, len)
span = ta.atr(len)
wavetrend(src, chlLen, avgLen) =>
esa = ta.ema(src, chlLen)
d = ta.ema(math.abs(src - esa), chlLen)
ci = (src - esa) / (0.015 * d)
wt1 = ta.ema(ci, avgLen)
wt2 = ta.sma(wt1, 3)
f_top_fractal(_src) => _src < _src and _src < _src and _src > _src and _src > _src
f_bot_fractal(_src) => _src > _src and _src > _src and _src < _src and _src < _src
top_fractal = f_top_fractal(src)
bot_fractal = f_bot_fractal(src)
f_fractalize (_src) => top_fractal ? 1 : bot_fractal ? -1 : 0
f_findDivs(src, topLimit, botLimit) =>
fractalTop = f_fractalize(src) > 0 and src >= topLimit ? src : na
fractalBot = f_fractalize(src) < 0 and src <= botLimit ? src : na
highPrev = ta.valuewhen(fractalTop, src , 0)
highPrice = ta.valuewhen(fractalTop, high , 0)
lowPrev = ta.valuewhen(fractalBot, src , 0)
lowPrice = ta.valuewhen(fractalBot, low , 0)
bearSignal = fractalTop and high > highPrice and src < highPrev
bullSignal = fractalBot and low < lowPrice and src > lowPrev
// Get user input
enableSR = input(false , "SR On/Off", group="SR")
colorSup = input(#00000000 , "Support Color", group="SR")
colorRes = input(#00000000 , "Resistance Color", group="SR")
strengthSR = input.int(2 , "S/R Strength", 1, group="SR")
lineStyle = input.string("Dotted", "Line Style", , group="SR")
lineWidth = input.int(2 , "S/R Line Width", 1, group="SR")
useZones = input(true , "Zones On/Off", group="SR")
useHLZones = input(true , "High Low Zones On/Off", group="SR")
zoneWidth = input.int(2 , "Zone Width %", 0,
tooltip = "it's calculated using % of the distance between highest/lowest in last 300 bars", group="SR")
expandSR = input(true , "Expand SR")
// Get components
rb = 10
prd = 284
ChannelW = 10
label_loc = 55
style = lineStyle == "Solid" ? line.style_solid :
lineStyle == "Dotted" ? line.style_dotted : line.style_dashed
ph = ta.pivothigh(rb, rb)
pl = ta.pivotlow (rb, rb)
sr_levels = array.new_float(21, na)
prdhighest = ta.highest(prd)
prdlowest = ta.lowest(prd)
cwidth = percWidth(prd, ChannelW)
zonePerc = percWidth(300, zoneWidth)
aas = array.new_bool(41, true)
u1 = 0.0, u1 := nz(u1 )
d1 = 0.0, d1 := nz(d1 )
highestph = 0.0, highestph := highestph
lowestpl = 0.0, lowestpl := lowestpl
var sr_levs = array.new_float(21, na)
label hlabel = na, label.delete(hlabel )
label llabel = na, label.delete(llabel )
var sr_lines = array.new_line(21, na)
var sr_linesH = array.new_line(21, na)
var sr_linesL = array.new_line(21, na)
var sr_linesF = array.new_linefill(21, na)
var sr_labels = array.new_label(21, na)
if (not na(ph) or not na(pl))
for x = 0 to array.size(sr_levels) - 1
array.set(sr_levels, x, na)
highestph := prdlowest
lowestpl := prdhighest
countpp = 0
for x = 0 to prd
if na(close )
break
if not na(ph ) or not na(pl )
highestph := math.max(highestph, nz(ph , prdlowest), nz(pl , prdlowest))
lowestpl := math.min(lowestpl, nz(ph , prdhighest), nz(pl , prdhighest))
countpp += 1
if countpp > 40
break
if array.get(aas, countpp)
upl = (not na(ph ) and (ph != 0) ? high : low ) + cwidth
dnl = (not na(ph ) and (ph != 0) ? high : low ) - cwidth
u1 := countpp == 1 ? upl : u1
d1 := countpp == 1 ? dnl : d1
tmp = array.new_bool(41, true)
cnt = 0
tpoint = 0
for xx = 0 to prd
if na(close )
break
if not na(ph ) or not na(pl )
chg = false
cnt += 1
if cnt > 40
break
if array.get(aas, cnt)
if not na(ph )
if high <= upl and high >= dnl
tpoint += 1
chg := true
if not na(pl )
if low <= upl and low >= dnl
tpoint += 1
chg := true
if chg and cnt < 41
array.set(tmp, cnt, false)
if tpoint >= strengthSR
for g = 0 to 40 by 1
if not array.get(tmp, g)
array.set(aas, g, false)
if (not na(ph ) and countpp < 21)
array.set(sr_levels, countpp, high )
if (not na(pl ) and countpp < 21)
array.set(sr_levels, countpp, low )
// Plot
var line highest_ = na, line.delete(highest_)
var line lowest_ = na, line.delete(lowest_)
var line highest_fill1 = na, line.delete(highest_fill1)
var line highest_fill2 = na, line.delete(highest_fill2)
var line lowest_fill1 = na, line.delete(lowest_fill1)
var line lowest_fill2 = na, line.delete(lowest_fill2)
hi_col = close >= highestph ? colorSup : colorRes
lo_col = close >= lowestpl ? colorSup : colorRes
if enableSR
highest_ := line.new(bar_index - 311, highestph, bar_index, highestph, xloc.bar_index, expandSR ? extend.both : extend.right, hi_col, style, lineWidth)
lowest_ := line.new(bar_index - 311, lowestpl , bar_index, lowestpl , xloc.bar_index, expandSR ? extend.both : extend.right, lo_col, style, lineWidth)
if useHLZones
highest_fill1 := line.new(bar_index - 311, highestph + zonePerc, bar_index, highestph + zonePerc, xloc.bar_index, expandSR ? extend.both : extend.right, na)
highest_fill2 := line.new(bar_index - 311, highestph - zonePerc, bar_index, highestph - zonePerc, xloc.bar_index, expandSR ? extend.both : extend.right, na)
lowest_fill1 := line.new(bar_index - 311, lowestpl + zonePerc , bar_index, lowestpl + zonePerc , xloc.bar_index, expandSR ? extend.both : extend.right, na)
lowest_fill2 := line.new(bar_index - 311, lowestpl - zonePerc , bar_index, lowestpl - zonePerc , xloc.bar_index, expandSR ? extend.both : extend.right, na)
linefill.new(highest_fill1, highest_fill2, hi_col)
linefill.new(lowest_fill1 , lowest_fill2 , lo_col)
if (not na(ph) or not na(pl))
for x = 0 to array.size(sr_lines) - 1
array.set(sr_levs, x, array.get(sr_levels, x))
for x = 0 to array.size(sr_lines) - 1
line.delete(array.get(sr_lines, x))
line.delete(array.get(sr_linesH, x))
line.delete(array.get(sr_linesL, x))
linefill.delete(array.get(sr_linesF, x))
if (not na(array.get(sr_levs, x)) and enableSR)
line_col = close >= array.get(sr_levs, x) ? colorSup : colorRes
array.set(sr_lines, x, line.new(bar_index - 355, array.get(sr_levs, x), bar_index, array.get(sr_levs, x), xloc.bar_index, expandSR ? extend.both : extend.right, line_col, style, lineWidth))
if useZones
array.set(sr_linesH, x, line.new(bar_index - 355, array.get(sr_levs, x) + zonePerc, bar_index, array.get(sr_levs, x) + zonePerc, xloc.bar_index, expandSR ? extend.both : extend.right, na))
array.set(sr_linesL, x, line.new(bar_index - 355, array.get(sr_levs, x) - zonePerc, bar_index, array.get(sr_levs, x) - zonePerc, xloc.bar_index, expandSR ? extend.both : extend.right, na))
array.set(sr_linesF, x, linefill.new(array.get(sr_linesH, x), array.get(sr_linesL, x), line_col))
for x = 0 to array.size(sr_labels) - 1
label.delete(array.get(sr_labels, x))
if (not na(array.get(sr_levs, x)) and enableSR)
lab_loc = close >= array.get(sr_levs, x) ? label.style_label_up : label.style_label_down
lab_col = close >= array.get(sr_levs, x) ? colorSup : colorRes
array.set(sr_labels, x, label.new(bar_index + label_loc, array.get(sr_levs, x), str.tostring(math.round_to_mintick(array.get(sr_levs, x))), color=lab_col , textcolor=#000000, style=lab_loc))
hlabel := enableSR ? label.new(bar_index + label_loc + math.round(math.sign(label_loc)) * 20, highestph, "High Level : " + str.tostring(highestph), color=hi_col, textcolor=#000000, style=label.style_label_down) : na
llabel := enableSR ? label.new(bar_index + label_loc + math.round(math.sign(label_loc)) * 20, lowestpl , "Low Level : " + str.tostring(lowestpl) , color=lo_col, textcolor=#000000, style=label.style_label_up ) : na
// Get components
rsi = ta.rsi(close, 28)
//rsiOb = rsi > 78 and rsi > ta.ema(rsi, 10)
//rsiOs = rsi < 27 and rsi < ta.ema(rsi, 10)
rsiOb = rsi > 65 and rsi > ta.ema(rsi, 10)
rsiOs = rsi < 35 and rsi < ta.ema(rsi, 10)
dHigh = securityNoRep(syminfo.tickerid, "D", high )
dLow = securityNoRep(syminfo.tickerid, "D", low )
dClose = securityNoRep(syminfo.tickerid, "D", close )
ema = ta.ema(close, 144)
emaBull = close > ema
equal_tf(res) => str.tonumber(res) == f_chartTfInMinutes() and not timeframe.isseconds
higher_tf(res) => str.tonumber(res) > f_chartTfInMinutes() or timeframe.isseconds
too_small_tf(res) => (timeframe.isweekly and res=="1") or (timeframe.ismonthly and str.tonumber(res) < 10)
securityNoRep1(sym, res, src) =>
bool bull_ = na
bull_ := equal_tf(res) ? src : bull_
bull_ := higher_tf(res) ? request.security(sym, res, src, barmerge.gaps_off, barmerge.lookahead_on) : bull_
bull_array = request.security_lower_tf(syminfo.tickerid, higher_tf(res) ? str.tostring(f_chartTfInMinutes()) + (timeframe.isseconds ? "S" : "") : too_small_tf(res) ? (timeframe.isweekly ? "3" : "10") : res, src)
if array.size(bull_array) > 1 and not equal_tf(res) and not higher_tf(res)
bull_ := array.pop(bull_array)
array.clear(bull_array)
bull_
// === BASE FUNCTIONS ===
// Returns MA input selection variant, default to SMA if blank or typo.
variant(type, src, len, offSig, offALMA) =>
v1 = ta.sma(src, len) // Simple
v2 = ta.ema(src, len) // Exponential
v3 = 2 * v2 - ta.ema(v2, len) // Double Exponential
v4 = 3 * (v2 - ta.ema(v2, len)) + ta.ema(ta.ema(v2, len), len) // Triple Exponential
v5 = ta.wma(src, len) // Weighted
v6 = ta.vwma(src, len) // Volume Weighted
v7 = 0.0
sma_1 = ta.sma(src, len) // Smoothed
v7 := na(v7 ) ? sma_1 : (v7 * (len - 1) + src) / len
v8 = ta.wma(2 * ta.wma(src, len / 2) - ta.wma(src, len), math.round(math.sqrt(len))) // Hull
v9 = ta.linreg(src, len, offSig) // Least Squares
v10 = ta.alma(src, len, offALMA, offSig) // Arnaud Legoux
v11 = ta.sma(v1, len) // Triangular (extreme smooth)
// SuperSmoother filter
// 2013 John F. Ehlers
a1 = math.exp(-1.414 * 3.14159 / len)
b1 = 2 * a1 * math.cos(1.414 * 3.14159 / len)
c2 = b1
c3 = -a1 * a1
c1 = 1 - c2 - c3
v12 = 0.0
v12 := c1 * (src + nz(src )) / 2 + c2 * nz(v12 ) + c3 * nz(v12 )
type == 'EMA' ? v2 : type == 'DEMA' ? v3 : type == 'TEMA' ? v4 : type == 'WMA' ? v5 : type == 'VWMA' ? v6 : type == 'SMMA' ? v7 : type == 'HullMA' ? v8 : type == 'LSMA' ? v9 : type == 'ALMA' ? v10 : type == 'TMA' ? v11 : type == 'SSMA' ? v12 : v1
// security wrapper for repeat calls
reso(exp, use, res) =>
security_1 = request.security(syminfo.tickerid, res, exp, gaps = barmerge.gaps_off, lookahead = barmerge.lookahead_on)
use ? security_1 : exp
// === /BASE FUNCTIONS ===
// === SERIES SETUP ===
closeSeries = variant(basisType, close , basisLen, offsetSigma, offsetALMA)
openSeries = variant(basisType, open , basisLen, offsetSigma, offsetALMA)
// === /SERIES ===
// Get Alternate resolution Series if selected.
closeSeriesAlt = reso(closeSeries, useRes, stratRes)
openSeriesAlt = reso(openSeries, useRes, stratRes)
//
lxTrigger = false
sxTrigger = false
leTrigger = ta.crossover (closeSeriesAlt, openSeriesAlt)
seTrigger = ta.crossunder(closeSeriesAlt, openSeriesAlt)
G_RISK = '■ ' + 'Risk Management'
//#region ———— <↓↓↓ G_RISK ↓↓↓> {
// ———————————
//Tooltip
T_LVL = '(%) Exit Level'
T_QTY = '(%) Adjust trade exit volume'
T_MSG = 'Paste JSON message for your bot'
//Webhook Message
O_LEMSG = 'Long Entry'
O_LXMSGSL = 'Long SL'
O_LXMSGTP1 = 'Long TP1'
O_LXMSGTP2 = 'Long TP2'
O_LXMSGTP3 = 'Long TP3'
O_LXMSG = 'Long Exit'
O_SEMSG = 'Short Entry'
O_SXMSGSL = 'Short SL'
O_SXMSGA = 'Short TP1'
O_SXMSGB = 'Short TP2'
O_SXMSGC = 'Short TP3'
O_SXMSGX = 'Short Exit'
// ——————————— | | | Line length guide |
i_lxLvlTP1 = input.float (0.2, 'Level TP1' , group = G_RISK,
tooltip = T_LVL)
i_lxQtyTP1 = input.float (80.0, 'Qty TP1' , group = G_RISK,
tooltip = T_QTY)
i_lxLvlTP2 = input.float (0.5, 'Level TP2' , group = G_RISK,
tooltip = T_LVL)
i_lxQtyTP2 = input.float (10.0, 'Qty TP2' , group = G_RISK,
tooltip = T_QTY)
i_lxLvlTP3 = input.float (7.0, 'Level TP3' , group = G_RISK,
tooltip = T_LVL)
i_lxQtyTP3 = input.float (2, 'Qty TP3' , group = G_RISK,
tooltip = T_QTY)
i_lxLvlSL = input.float (0.5, 'Stop Loss' , group = G_RISK,
tooltip = T_LVL)
i_sxLvlTP1 = i_lxLvlTP1
i_sxQtyTP1 = i_lxQtyTP1
i_sxLvlTP2 = i_lxLvlTP2
i_sxQtyTP2 = i_lxQtyTP2
i_sxLvlTP3 = i_lxLvlTP3
i_sxQtyTP3 = i_lxQtyTP3
i_sxLvlSL = i_lxLvlSL
G_MSG = '■ ' + 'Webhook Message'
i_leMsg = input.string (O_LEMSG ,'Long Entry' , group = G_MSG, tooltip = T_MSG)
i_lxMsgSL = input.string (O_LXMSGSL ,'Long SL' , group = G_MSG, tooltip = T_MSG)
i_lxMsgTP1 = input.string (O_LXMSGTP1,'Long TP1' , group = G_MSG, tooltip = T_MSG)
i_lxMsgTP2 = input.string (O_LXMSGTP2,'Long TP2' , group = G_MSG, tooltip = T_MSG)
i_lxMsgTP3 = input.string (O_LXMSGTP3,'Long TP3' , group = G_MSG, tooltip = T_MSG)
i_lxMsg = input.string (O_LXMSG ,'Long Exit' , group = G_MSG, tooltip = T_MSG)
i_seMsg = input.string (O_SEMSG ,'Short Entry' , group = G_MSG, tooltip = T_MSG)
i_sxMsgSL = input.string (O_SXMSGSL ,'Short SL' , group = G_MSG, tooltip = T_MSG)
i_sxMsgTP1 = input.string (O_SXMSGA ,'Short TP1' , group = G_MSG, tooltip = T_MSG)
i_sxMsgTP2 = input.string (O_SXMSGB ,'Short TP2' , group = G_MSG, tooltip = T_MSG)
i_sxMsgTP3 = input.string (O_SXMSGC ,'Short TP3' , group = G_MSG, tooltip = T_MSG)
i_sxMsg = input.string (O_SXMSGX ,'Short Exit' , group = G_MSG, tooltip = T_MSG)
i_src = close
G_DISPLAY = 'Display'
//
i_alertOn = input.bool (true, 'Alert Labels On/Off' , group = G_DISPLAY)
i_barColOn = input.bool (true, 'Bar Color On/Off' , group = G_DISPLAY)
// ———————————
// @function Calculate the Take Profit line, and the crossover or crossunder
f_tp(_condition, _conditionValue, _leTrigger, _seTrigger, _src, _lxLvlTP, _sxLvlTP)=>
var float _tpLine = 0.0
_topLvl = _src + (_src * (_lxLvlTP / 100))
_botLvl = _src - (_src * (_sxLvlTP / 100))
_tpLine := _condition != _conditionValue and _leTrigger ? _topLvl :
_condition != -_conditionValue and _seTrigger ? _botLvl :
nz(_tpLine )
// @function Similar to "ta.crossover" or "ta.crossunder"
f_cross(_scr1, _scr2, _over)=>
_cross = _over ? _scr1 > _scr2 and _scr1 < _scr2 :
_scr1 < _scr2 and _scr1 > _scr2
// ———————————
//
var float condition = 0.0
var float slLine = 0.0
var float entryLine = 0.0
//
entryLine := leTrigger and condition <= 0.0 ? close :
seTrigger and condition >= 0.0 ? close : nz(entryLine )
//
slTopLvl = i_src + (i_src * (i_lxLvlSL / 100))
slBotLvl = i_src - (i_src * (i_sxLvlSL / 100))
slLine := condition <= 0.0 and leTrigger ? slBotLvl :
condition >= 0.0 and seTrigger ? slTopLvl : nz(slLine )
slLong = f_cross(low, slLine, false)
slShort = f_cross(high, slLine, true )
//
= f_tp(condition, 1.2,leTrigger, seTrigger, i_src, i_lxLvlTP3, i_sxLvlTP3)
= f_tp(condition, 1.1,leTrigger, seTrigger, i_src, i_lxLvlTP2, i_sxLvlTP2)
= f_tp(condition, 1.0,leTrigger, seTrigger, i_src, i_lxLvlTP1, i_sxLvlTP1)
tp3Long = f_cross(high, tp3Line, true )
tp3Short = f_cross(low, tp3Line, false)
tp2Long = f_cross(high, tp2Line, true )
tp2Short = f_cross(low, tp2Line, false)
tp1Long = f_cross(high, tp1Line, true )
tp1Short = f_cross(low, tp1Line, false)
switch
leTrigger and condition <= 0.0 => condition := 1.0
seTrigger and condition >= 0.0 => condition := -1.0
tp3Long and condition == 1.2 => condition := 1.3
tp3Short and condition == -1.2 => condition := -1.3
tp2Long and condition == 1.1 => condition := 1.2
tp2Short and condition == -1.1 => condition := -1.2
tp1Long and condition == 1.0 => condition := 1.1
tp1Short and condition == -1.0 => condition := -1.1
slLong and condition >= 1.0 => condition := 0.0
slShort and condition <= -1.0 => condition := 0.0
lxTrigger and condition >= 1.0 => condition := 0.0
sxTrigger and condition <= -1.0 => condition := 0.0
longE = leTrigger and condition <= 0.0 and condition == 1.0
shortE = seTrigger and condition >= 0.0 and condition == -1.0
longX = lxTrigger and condition >= 1.0 and condition == 0.0
shortX = sxTrigger and condition <= -1.0 and condition == 0.0
longSL = slLong and condition >= 1.0 and condition == 0.0
shortSL = slShort and condition <= -1.0 and condition == 0.0
longTP3 = tp3Long and condition == 1.2 and condition == 1.3
shortTP3 = tp3Short and condition == -1.2 and condition == -1.3
longTP2 = tp2Long and condition == 1.1 and condition == 1.2
shortTP2 = tp2Short and condition == -1.1 and condition == -1.2
longTP1 = tp1Long and condition == 1.0 and condition == 1.1
shortTP1 = tp1Short and condition == -1.0 and condition == -1.1
// ——————————— {
//
if strategy.position_size <= 0 and longE and barstate.isconfirmed
strategy.entry(
'Long',
strategy.long,
alert_message = i_leMsg,
comment = 'LE')
if strategy.position_size > 0 and condition == 1.0
strategy.exit(
id = 'LXTP1',
from_entry = 'Long',
qty_percent = i_lxQtyTP1,
limit = tp1Line,
stop = slLine,
comment_profit = 'LXTP1',
comment_loss = 'SL',
alert_profit = i_lxMsgTP1,
alert_loss = i_lxMsgSL)
if strategy.position_size > 0 and condition == 1.1
strategy.exit(
id = 'LXTP2',
from_entry = 'Long',
qty_percent = i_lxQtyTP2,
limit = tp2Line,
stop = slLine,
comment_profit = 'LXTP2',
comment_loss = 'SL',
alert_profit = i_lxMsgTP2,
alert_loss = i_lxMsgSL)
if strategy.position_size > 0 and condition == 1.2
strategy.exit(
id = 'LXTP3',
from_entry = 'Long',
qty_percent = i_lxQtyTP3,
limit = tp3Line,
stop = slLine,
comment_profit = 'LXTP3',
comment_loss = 'SL',
alert_profit = i_lxMsgTP3,
alert_loss = i_lxMsgSL)
if longX
strategy.close(
'Long',
alert_message = i_lxMsg,
comment = 'LX')
//
if strategy.position_size >= 0 and shortE and barstate.isconfirmed
strategy.entry(
'Short',
strategy.short,
alert_message = i_leMsg,
comment = 'SE')
if strategy.position_size < 0 and condition == -1.0
strategy.exit(
id = 'SXTP1',
from_entry = 'Short',
qty_percent = i_sxQtyTP1,
limit = tp1Line,
stop = slLine,
comment_profit = 'SXTP1',
comment_loss = 'SL',
alert_profit = i_sxMsgTP1,
alert_loss = i_sxMsgSL)
if strategy.position_size < 0 and condition == -1.1
strategy.exit(
id = 'SXTP2',
from_entry = 'Short',
qty_percent = i_sxQtyTP2,
limit = tp2Line,
stop = slLine,
comment_profit = 'SXTP2',
comment_loss = 'SL',
alert_profit = i_sxMsgTP2,
alert_loss = i_sxMsgSL)
if strategy.position_size < 0 and condition == -1.2
strategy.exit(
id = 'SXTP3',
from_entry = 'Short',
qty_percent = i_sxQtyTP3,
limit = tp3Line,
stop = slLine,
comment_profit = 'SXTP3',
comment_loss = 'SL',
alert_profit = i_sxMsgTP3,
alert_loss = i_sxMsgSL)
if shortX
strategy.close(
'Short',
alert_message = i_sxMsg,
comment = 'SX')
// ———————————
c_tp = leTrigger or seTrigger ? na :
condition == 0.0 ? na : color.green
c_entry = leTrigger or seTrigger ? na :
condition == 0.0 ? na : color.blue
c_sl = leTrigger or seTrigger ? na :
condition == 0.0 ? na : color.red
p_tp1Line = plot (
condition == 1.0 or
condition == -1.0 ? tp1Line : na,
title = "TP Line 1",
color = c_tp,
linewidth = 1,
style = plot.style_linebr)
p_tp2Line = plot (
condition == 1.0 or
condition == -1.0 or
condition == 1.1 or
condition == -1.1 ? tp2Line : na,
title = "TP Line 2",
color = c_tp,
linewidth = 1,
style = plot.style_linebr)
p_tp3Line = plot (
condition == 1.0 or
condition == -1.0 or
condition == 1.1 or
condition == -1.1 or
condition == 1.2 or
condition == -1.2 ? tp3Line : na,
title = "TP Line 3",
color = c_tp,
linewidth = 1,
style = plot.style_linebr)
p_entryLine = plot (
condition >= 1.0 or
condition <= -1.0 ? entryLine : na,
title = "Entry Line",
color = c_entry,
linewidth = 1,
style = plot.style_linebr)
p_slLine = plot (
condition == 1.0 or
condition == -1.0 or
condition == 1.1 or
condition == -1.1 or
condition == 1.2 or
condition == -1.2 ? slLine : na,
title = "SL Line",
color = c_sl,
linewidth = 1,
style = plot.style_linebr)
fill(
p_tp3Line, p_entryLine,
color = leTrigger or seTrigger ? na :color.new(color.green, 90))
fill(
p_entryLine, p_slLine,
color = leTrigger or seTrigger ? na :color.new(color.red, 90))
//
plotshape(
i_alertOn and longE,
title = 'Long',
text = 'Long',
textcolor = color.white,
color = color.green,
style = shape.labelup,
size = size.tiny,
location = location.belowbar)
plotshape(
i_alertOn and shortE,
title = 'Short',
text = 'Short',
textcolor = color.white,
color = color.red,
style = shape.labeldown,
size = size.tiny,
location = location.abovebar)
plotshape(
i_alertOn and (longX or shortX) ? close : na,
title = 'Close',
text = 'Close',
textcolor = color.white,
color = color.gray,
style = shape.labelup,
size = size.tiny,
location = location.absolute)
l_tp = i_alertOn and (longTP1 or shortTP1) ? close : na
plotshape(
l_tp,
title = "TP1 Cross",
text = "TP1",
textcolor = color.white,
color = color.olive,
style = shape.labelup,
size = size.tiny,
location = location.absolute)
plotshape(
i_alertOn and (longTP2 or shortTP2) ? close : na,
title = "TP2 Cross",
text = "TP2",
textcolor = color.white,
color = color.olive,
style = shape.labelup,
size = size.tiny,
location = location.absolute)
plotshape(
i_alertOn and (longTP3 or shortTP3) ? close : na,
title = "TP3 Cross",
text = "TP3",
textcolor = color.white,
color = color.olive,
style = shape.labelup,
size = size.tiny,
location = location.absolute)
plotshape(
i_alertOn and (longSL or shortSL) ? close : na,
title = "SL Cross",
text = "SL",
textcolor = color.white,
color = color.maroon,
style = shape.labelup,
size = size.tiny,
location = location.absolute)
//
plot(
na,
title = "─── ───",
editable = false,
display = display.data_window)
plot(
condition,
title = "condition",
editable = false,
display = display.data_window)
plot(
strategy.position_size * 100,
title = ".position_size",
editable = false,
display = display.data_window)
//#endregion }
// ——————————— <↑↑↑ G_RISK ↑↑↑>
//#region ———— <↓↓↓ G_SCRIPT02 ↓↓↓> {
// @function Queues a new element in an array and de-queues its first element.
f_qDq(_array, _val) =>
array.push(_array, _val)
_return = array.shift(_array)
_return
var line a_slLine = array.new_line(1)
var line a_entryLine = array.new_line(1)
var line a_tp3Line = array.new_line(1)
var line a_tp2Line = array.new_line(1)
var line a_tp1Line = array.new_line(1)
var label a_slLabel = array.new_label(1)
var label a_tp3label = array.new_label(1)
var label a_tp2label = array.new_label(1)
var label a_tp1label = array.new_label(1)
var label a_entryLabel = array.new_label(1)
newEntry = longE or shortE
entryIndex = 1
entryIndex := newEntry ? bar_index : nz(entryIndex )
lasTrade = bar_index >= entryIndex
l_right = 10
line.delete(
f_qDq(a_slLine,
line.new(
entryIndex,
slLine,
last_bar_index + l_right,
slLine,
style = line.style_solid,
color = c_sl)))
line.delete(
f_qDq(a_entryLine,
line.new(
entryIndex,
entryLine,
last_bar_index + l_right,
entryLine,
style = line.style_solid,
color = color.blue)))
line.delete(
f_qDq(a_tp3Line,
line.new(
entryIndex,
tp3Line,
last_bar_index + l_right,
tp3Line,
style = line.style_solid,
color = c_tp)))
line.delete(
f_qDq(a_tp2Line,
line.new(
entryIndex,
tp2Line,
last_bar_index + l_right,
tp2Line,
style = line.style_solid,
color = c_tp)))
line.delete(
f_qDq(a_tp1Line,
line.new(
entryIndex,
tp1Line,
last_bar_index + l_right,
tp1Line,
style = line.style_solid,
color = c_tp)))
label.delete(
f_qDq(a_slLabel,
label.new(
last_bar_index + l_right,
slLine,
'SL: ' + str.tostring(slLine, '##.###'),
style = label.style_label_left,
textcolor = color.white,
color = c_sl)))
label.delete(
f_qDq(a_entryLabel,
label.new(
last_bar_index + l_right,
entryLine,
'Entry: ' + str.tostring(entryLine, '##.###'),
style = label.style_label_left,
textcolor = color.white,
color = color.blue)))
label.delete(
f_qDq(a_tp3label,
label.new(
last_bar_index + l_right,
tp3Line,
'TP3: ' + str.tostring(tp3Line, '##.###'),
style = label.style_label_left,
textcolor = color.white,
color = c_tp)))
label.delete(
f_qDq(a_tp2label,
label.new(
last_bar_index + l_right,
tp2Line,
'TP2: ' + str.tostring(tp2Line, '##.###'),
style = label.style_label_left,
textcolor = color.white,
color = c_tp)))
label.delete(
f_qDq(a_tp1label,
label.new(
last_bar_index + l_right,
tp1Line,
'TP1: ' + str.tostring(tp1Line, '##.###'),
style = label.style_label_left,
textcolor = color.white,
color = c_tp)))
// ———————————
//
if longE or shortE or longX or shortX
alert(message = 'Any Alert', freq = alert.freq_once_per_bar_close)
if longE
alert(message = 'Long Entry', freq = alert.freq_once_per_bar_close)
if shortE
alert(message = 'Short Entry', freq = alert.freq_once_per_bar_close)
if longX
alert(message = 'Long Exit', freq = alert.freq_once_per_bar_close)
if shortX
alert(message = 'Short Exit', freq = alert.freq_once_per_bar_close)
//#endregion }
// ——————————— <↑↑↑ G_SCRIPT03 ↑↑↑>
ALMA v1 ATR Bands With Trend BarsALMA v1 ATR Bands With Trend Bars is a trend-context overlay indicator designed to visualize price structure, momentum direction, and volatility expansion directly on the chart.
It combines the Arnaud Legoux Moving Average (ALMA) with ATR-based dynamic bands and a dual-momentum bar-coloring model, providing a clear visual framework for interpreting trend conditions without compressing market behavior into a single decision output.
Conceptual Architecture
The indicator is built around three complementary layers, each serving a distinct analytical role:
1. ALMA Trend Curve
The core trend line is computed using the Arnaud Legoux Moving Average, which emphasizes responsiveness while maintaining smoothness through controlled offset and sigma parameters.
An optional adaptive filter suppresses minor fluctuations, allowing the curve to focus on structural price movement rather than short-term noise.
Color changes in the ALMA line reflect directional slope state, not trading actions.
2. ATR Volatility Bands
ATR-based bands are calculated around the filtered ALMA curve:
The bands expand and contract dynamically with volatility.
They provide a contextual envelope that helps visualize price dispersion relative to the underlying trend.
These bands are intended as a volatility reference, not fixed support or resistance levels.
3. Trend Bars (Momentum State Layer)
Price candles are recolored using a dual-CCI momentum model:
A fast and a slow CCI operate together to classify momentum agreement.
When both momentum measures align, bars reflect directional bias.
When momentum disagrees, bars shift to a neutral state.
This layer highlights momentum consistency, not execution timing.
Trend State Visualization:
Discrete visual markers may appear when the slope direction of the ALMA curve changes.
These markers indicate structural trend transitions based on confirmed bar closes and do not repaint.
They are intended to support visual interpretation of trend evolution, not to automate decisions.
Reliability:
No repainting: all states, colors, and markers are confirmed on bar close.
Consistent behavior across instruments and timeframes.
Designed for stable visual output during live market conditions.
Customization Options:
ALMA length, offset, sigma, and optional shift.
Adaptive filtering sensitivity.
ATR period and deviation multiplier.
Momentum sensitivity modes for bar coloring.
Fully customizable color palette.
Optional alerts for structural trend changes.
Linear Regression Market State IndexStandard Deviation Market Structure Indicator
A Comprehensive Multi-Timeframe Market Analysis Tool
🎯 Overview
The Standard Deviation Market Structure (SDMS) indicator is a sophisticated technical analysis tool that integrates multiple proven methodologies to identify market structure, trend direction, and potential reversal zones. By combining price action, statistical analysis, and momentum indicators across multiple timeframes, SDMS provides traders with a comprehensive view of market dynamics.
✨ Key Features
Multi-Timeframe Integration
Primary analysis on current timeframe
1-hour statistical confirmation for support/resistance levels
Order block extension across 500 future bars
Comprehensive Technical Suite
RSI with Deviation Analysis
Dynamic Order Block Detection
Gaussian Filter Channels
Linear Regression with Statistical Bands
Standard deviation to detect price outliers
Directional Movement Index (DMI/ADX)
Bollinger Band % Analysis
Support/Resistance Line System
Visual Clarity
Color-coded signals and zones
Automatic level management
Clean, intuitive display
📊 Core Components Explained
1. Order Block System
What Are Order Blocks?
Order blocks are price zones where institutional activity has occurred, creating future support or resistance levels. SDMS automatically detects these critical zones.
Detection Logic:
Bullish Order Blocks: Form when price breaks above recent highs following bearish candles
Bearish Order Blocks: Form when price breaks below recent lows following bullish candles
Visual Identification:
Green boxes with "BuOB" labels (support zones)
Red boxes with "BeOB" labels (resistance zones)
Each block shows its boundary price for easy reference
Dynamic Management:
Automatically extends 300 bars into the future
Self-cleaning: removes blocks when price breaches their boundaries
Real-time adjustment to changing market structure
2. Statistical Support/Resistance System
How It Works:
SDMS creates support and resistance lines based on statistical extremes confirmed on the 1-hour timeframe.
Trigger Conditions:
Support Lines (Green): Trigger when 1H Bollinger Band % crosses above 0 and bearish momentum subsides.
Resistance Lines (Red): Trigger when 1H Bollinger Band % crosses below 1 and bullish momentum subsides
The Science Behind BB%:
BB% = (Price - Lower Band) / (Upper Band - Lower Band)
BB% <= 0: Price at statistical oversold extreme; also indicated by white candles.
BB% > 1: Price at statistical overbought extreme; also indicated by white candles.
Line Management:
Maximum of 15 active lines
Oldest lines automatically removed
Lines extend across chart for ongoing reference
3. Trend Analysis Suite
Hull Moving Average (HMA):
55-period smoothed trend indicator
Color-coded: Green = bullish, Red = bearish
Visual band shows trend acceleration/deceleration
Gaussian Channel:
Advanced filtering of market noise
Dynamic channel based on true range volatility
Helps identify mean reversion opportunities
Form a yellow band when price is overbought or oversold zones.
Linear Regression System:
Statistical price modeling
Multiple standard deviation bands (up to 3SD)
Regression-based candlestick visualization
Candles turn white when in overbought zones. Yellow candles indicate extremely overbought zones. Blue candles indicate a bullish trend with high volume.
Bearish candles are bluish-purple when volume is high and red when the volume is within normal ranges or low.
4. Momentum & Oscillator Integration
RSI with Deviation Tracking:
21-period RSI with 30-period smoothing
Tracks deviation from moving average based off linear regression
Identifies momentum divergences
Directional Movement Index:
Multi-period DMI/ADX analysis
Used to detect overbought and oversold zones within the indicator calculations.
Combines with RSI for enhanced signals
Momentum confirmation for all entries/exits
🎯 Trading Signals & Alerts
Buy Signals (Yellow "Buy" Labels)
Multi-Condition Confirmation Required:
RSI Oversold Reversal: RSI crosses above 30
Trend Alignment: HMA showing bullish structure
Momentum Confirmation: DMI alignment
Statistical Support: Price at or near support zones
Risk Management: Multiple confirming indicators
Strong Buy Conditions:
Confluence of order block support + BB% support line
Multiple timeframe alignment
Volume confirmation at key levels
Sell Signals (Red/Yellow "Sell" Labels)
Multi-Condition Confirmation Required:
RSI Overbought Reversal: RSI crosses below 70
Trend Exhaustion: HMA showing bearish structure
Momentum Divergence: DMI bearish alignment
Statistical Resistance: Price at or near resistance zones
Timeframe Confirmation: 1H BB% bearish signals
Strong Sell Conditions:
Confluence of order block resistance + BB% resistance line
Multiple timeframe distribution
Volume surge at resistance
Additional Alerts
RSI Divergence Signals: Triangles showing momentum shifts
Extreme Price Alerts: Circles at statistical extremes
Structure Breaks: Visual cues for order block violations
🎨 Visual System Guide
Color Coding System
Green: Bullish conditions, support zones, rising trends
Red: Bearish conditions, resistance zones, falling trends
Blue: Statistical channels, neutral zones
Yellow: Alert conditions, extreme signals
White: Transition zones, neutral signals
Zone Identification
Buying Pressure Zones: Green/blue tinted areas below price or white candles with white dots within the moving average center line
Selling Pressure Zones: Red tinted areas above price with white dots within the moving average center line
Standard Deviation Zones: Gradient colors showing statistical extremes
⚙️ Customization Options
Adjustable Parameters
RSI Settings: Period, oversold/overbought levels, sensitivity
Order Block Detection: Lookback period, ATR multiplier, extension
Statistical Settings: Gaussian filter poles, regression periods
Support/Resistance: Maximum lines, BB% settings
Visual Preferences: Colors, band displays, alert styles
Input Groups
RSI Trading Strategy
Order Block Configuration
Gaussian Channel Settings
Linear Regression Parameters
DMI/ADX Configuration
Bollinger Band % Settings
📈 Practical Trading Applications
For Swing Traders
Identify Key Levels: Use order blocks + BB% lines for entry/exit planning
Trend Confirmation: HMA + Gaussian channel for trend direction
Risk Management: Standard deviation bands for stop placement
Timing Entries: RSI/DMI alignment for optimal entry timing
For Day Traders
Intraday Levels: Order blocks provide immediate S/R for day trading
Momentum Signals: Real-time RSI/DMI signals for quick moves
Statistical Edges: Gaussian channel for mean reversion plays
Breakout Confirmation: Order block breaks with volume
For Position Traders
Higher Timeframe Structure: 1H BB% lines for major levels
Trend Persistence: HMA for long-term trend identification
Accumulation/Distribution Zones: Order blocks show institutional activity
Multi-Timeframe Alignment: Confirmation across timeframes
🔍 How to Use SDMS Effectively
Step 1: Market Structure Assessment
Identify active order blocks (green/red boxes)
Note BB% support/resistance lines (horizontal lines)
Assess HMA and moving average trend direction (color)
Check Gaussian channel position (preferably outside 2SD)
Step 2: Signal Confirmation
Wait for multiple indicator alignment
look for doji candles.
Confirm with green (bullish) or red (bearish) candles
Confirm with volume if available
Check for confluence of levels
Assess risk/reward based on nearby levels
Step 3: Trade Management
Enter at confirmed support/resistance
Place stops beyond opposite levels
Take profits at next statistical level
Monitor for structure changes
Step 4: Risk Management
Use standard deviation bands for volatility assessment
Never risk more than 1-2% per trade
Adjust position size based on confluence strength
Have predefined exit rules
💡 Advanced Strategies
Strategy 1: Confluence Trading
Setup: Order block + BB% line at same level
Entry: Price tests confluence zone with RSI signal
Stop: Beyond the confluence zone
Target: Next statistical level
Strategy 2: Breakout Trading
Setup: Price approaching order block boundary
Entry: Break with volume + RSI/DMI confirmation
Stop: Re-entry into order block
Target: Next BB% line extension
Strategy 3: Mean Reversion
Setup: Price at Gaussian channel extremes
Entry: RSI reversal signal at channel boundary
Stop: Beyond channel extreme
Target: Channel midline or opposite boundary
⚠️ Important Considerations
Best Market Conditions
Trending Markets: Excellent performance in clear trends
Breakout Scenarios: Strong identification of break levels
Range Markets: Works well with defined ranges
Limitations
Choppy Markets: May give false signals in consolidation
News Events: Fundamental shocks can override technical levels
Timeframe Specific: Optimal on 15-minute to daily charts
Risk Management Rules
Always use stops
Never rely on single signals
Consider market context
Adjust for volatility changes
Keep position sizes consistent
🔧 Technical Specifications
Maximum Lines: 500
Maximum Bars Back: 1000
Maximum Boxes: 500
Calculation Efficiency: Optimized for real-time use
🏆 Why SDMS Stands Out
Unique Advantages
Integrated Approach: Combines multiple methodologies into one tool
Self-Adjusting: Automatically adapts to market changes
Multi-Timeframe: Provides both immediate and higher timeframe context
Visual Clarity: Clean, intuitive display of complex data
Professional Grade: Institutional-level analysis accessible to all traders
Educational Value: Learn how different indicators interact
Understand market structure development
See institutional order flow patterns
Develop disciplined trading habits
📚 Learning Resources
Recommended Study Approach
Start Simple: Focus on order blocks and BB% lines first
Add Complexity: Gradually incorporate other indicators
Paper Trade: Practice without risk
Keep Journal: Document setups and outcomes
Review Regularly: Analyze both wins and losses
Common Pitfalls to Avoid
Overtrading: Wait for high-quality setups
Ignoring Context: Consider overall market conditions
Chasing Signals: Enter at planned levels, not after moves
Risk Mismanagement: Always know your risk before entering
Confirmation Bias: Be objective about signals
🤝 Community & Support
Getting the Most from SDMS
Start with Defaults: Use default settings initially
Adjust Gradually: Make small changes as you understand the tool
Combine with Fundamentals: Use for timing within fundamental context
Stay Disciplined: Follow your trading plan consistently
Continuous Improvement
SDMS is designed for continuous learning. As you use the indicator, you'll develop insights into:
Market microstructure
Institutional trading patterns
Statistical edge identification
Risk management optimization
Risk management is more important than signal accuracy
Patience is required for high-quality setups
Success Factors
Discipline: Following your plan consistently
Patience: Waiting for proper setups
Risk Management: Protecting your capital
Continuous Learning: Improving your skills over time
🌟 Final Thoughts
The Standard Deviation Market Structure indicator represents a sophisticated approach to technical analysis, combining the best elements of price action, statistical analysis, and momentum indicators. While powerful, remember that no indicator guarantees success. SDMS is a tool – your skill, discipline, and risk management determine your trading results.
Use SDMS as part of a comprehensive trading plan, combine it with proper risk management, and continue developing your trading skills. The markets are always teaching – stay humble, stay disciplined, and trade well.
Disclaimer: This indicator is for educational purposes only. Past performance does not guarantee future results. Trading involves risk of loss. Always consult with a qualified financial professional before making investment decisions.
Aivance Opening Range & Vol FactorAivance Opening Range & Volume Factor
Overview
The Aivance Opening Range & Volume Factor is a comprehensive tool designed for Day Traders and Scalpers who rely on the "Opening Drive" or "Opening Range Breakout" (ORB) strategies.
The first candle of the trading session often sets the tone for the entire day. This indicator not only visualizes the price action of that critical first candle but also contextualizes the Volume to help you determine if there is enough institutional participation to sustain a trend.
Key Features
1. Opening Volume Factor
Unlike standard volume indicators, this tool calculates a specific Volume Factor for the opening candle:
Formula: (Volume of 1st Candle / Total Volume of Previous Day) * 100
Why it matters: A high Volume Factor (thresholds vary significantly depending on the chart timeframe and asset) suggests strong institutional interest immediately at the open. This often increases the probability of a sustained trend day rather than a choppy range day.
2. Automatic Session Detection
No manual time inputs are required.
The indicator uses time("D") to automatically detect the start of the trading day.
RTH vs. ETH: It adapts to your chart settings. If you use "Regular Trading Hours" (RTH), it marks the 09:30 NY open. If you use "Extended Trading Hours" (ETH), it marks the pre-market open.
3. Visual Opening Range
Box & Lines: Draws a box highlighting the High/Low and the Body (Open/Close) of the opening candle.
Extension: Extends support/resistance lines across the session to help identify breakouts or retests of the opening range later in the day.
4. Smart "Pullback" Logic (Optional)
This script includes a unique filter called "Show only on Pullback":
Default (False): The range is drawn immediately when the first candle closes.
Enabled (True): The range is hidden until the market prints a candle in the opposite direction of the opening move.
Strategy: This helps filter out impulsive moves and encourages trading the "retest" or the failure of the initial drive, rather than chasing the first tick.
How to Use
Trend Confirmation: Look for a breakout of the Opening Box combined with a high Volume Factor.
Support/Resistance: Use the extended gray lines (High/Low of the first candle) as key pivot points for stop-losses or entry targets.
Context: Compare the Volume Factor across different days to establish a baseline for your specific asset (e.g., what constitutes "High Volume" for NQ vs. ES vs. AAPL).
Settings
Colors: Fully customizable colors for Long (Bullish) and Short (Bearish) opening ranges.
Volume Factor: Toggle the text label on/off and adjust size/color.
Logic: Toggle the "Pullback" requirement on/off.
Disclaimer: This tool is for informational purposes only and does not constitute financial advice. Always manage your risk.
Sakata Reversal MatrixThis indicator automatically detects key candlestick reversal patterns based on the traditional Japanese "Sakata Five Methods."
Key Features: Identifies patterns such as Hammer, Engulfing, Harami, Piercing/Dark Cloud, and Gaps (Sanku).
Strict Star Detection: "Morning Star" and "Evening Star" signals are filtered using a strict logic where the second candle (the star) must be visually isolated from the surrounding candles.
High-Accuracy Filter: Combines RSI (below 30 or above 70) with Bollinger Bands to ensure signals appear only during overbought or oversold conditions, reducing false signals.
Bilingual Support: Easily toggle between Japanese and English labels in the settings.
このインジケーターは、日本の伝統的な相場分析法である「酒田五法」をベースに、主要な反転ローソク足パターンを自動検知します。
主な機能: ハンマー(首吊り線)、包み足、はらみ足、切り込み線、三空などを表示。
厳格な明星判定: 「明けの明星」「宵の明星」は、2本目のローソク足の実体が前後の足から窓を開けて孤立している場合のみ検知する厳格なロジックを採用しています。
高精度フィルタ: RSI(35以下/65以上)とボリンジャーバンドを組み合わせ、相場が過熱しているポイントでのみサインを出すことで、騙しを軽減しています。
バイリンガル対応: 設定から日本語と英語の表示を切り替え可能です。
Balubas Candlestick Pattern DetectorDetects candlestick patterns. Developed for Godzilla Trader's Substack. 12/01/2026.
Pro-Vision ATR + ExhaustionThis indicator is designed to provide Real-Time Volatility Guardrails. Unlike standard ATR indicators that plot a single line at the bottom of your chart, this tool projects volatility "shells" directly onto the price action from the current candle.
It answers the most critical question in a live trade: "How far can this stock move right now before it is statistically exhausted?"
The Components
Current ATR Centerpiece: The lines originate from the most recent price action, updating live with every tick.
Target Lines (1.5x ATR - Yellow): These represent the "Normal Expected Move." In a healthy trend, price often reaches these levels without much resistance.
Exhaustion Lines (3.0x ATR - Red): These represent "Extreme Volatility." Statistically, it is rare for price to sustain a move beyond 3x its average range in a single period without a pullback or consolidation.
How to Trade It
1. Profit Taking (The "Target" Exit)
If you are in a long position and price hits the Yellow Upper Line, it has achieved its expected volatility move for that timeframe.
Strategy: Scale out 50% of your position here. This locks in gains based on math rather than emotion.
2. Reversal Trading (The "Exhaustion" Play)
When price pierces or touches the Red Exhaustion Line, the asset is "overbought" or "oversold" relative to its recent volatility.
Strategy: Look for a reversal candle (like a shooting star or hammer) touching the red line.
The Trade: Short the asset at the red line with a tight stop, or close your long position immediately. These levels often act as "invisible" ceilings.
3. Setting "Smart" Stop Losses
Standard stops are often placed at arbitrary percentages. Using this indicator, you can place your stop just outside the 1.5x ATR line.
Strategy: If you enter a trade and price moves past the opposite ATR line, the volatility has shifted against you, and the original trade thesis is likely invalid.
4. Filtering Bad Entries (The "Don't Chase" Rule)
Strategy: If you are looking to go Long, but the price is already sitting at the Yellow Line, the "meat of the move" is likely over.
Rule: Never enter a new position if the price is already 75% of the way to the Red Exhaustion line. Wait for a mean reversion back to the middle.
Support Resistance by EVThis indicator is designed to provide a clean and practical market structure view by combining automatic support and resistance detection with dynamic trend analysis. It identifies key support and resistance levels using confirmed swing highs and lows, intelligently merging nearby levels based on market volatility and filtering out outdated or irrelevant zones to keep the chart clear and focused on what matters now.
In addition to horizontal support and resistance, the indicator offers two complementary ways to read trend context. It can display diagonal trendlines built from the most recent swing highs and swing lows to visualize directional structure, or horizontal trend rays based on the latest pivots to highlight dynamic support and resistance acting as trend references. The user can switch between these modes depending on trading style and market conditions.
All visual elements are anchored by time rather than bar index to ensure stability when zooming or scrolling the chart. The indicator is fully non-repainting, relies only on confirmed pivots, and is suitable for any market or timeframe. It is intended as an open-source, professional-grade tool that helps traders quickly identify structure, trend bias, and key reaction levels without clutter or visual noise.
ICT/SMC HUDOverview
This indicator is an ICT/SMC-inspired market structure tool that detects:
Swing Structure (pivot-based)
BOS (Break of Structure) and CHoCH (Change of Character)
Liquidity Sweeps (buy-side & sell-side)
Premium/Discount filter using a simple equilibrium (EQ) midpoint
A Hold Score (0–5) system calculated from a higher timeframe (HTF)
Optional TP/SL visualization box (with TP2 expansion when Hold Score is strong)
⚠️ This is an educational tool, not a guaranteed trading system.
Core Logic (Where signals come from)
This script builds a simplified ICT/SMC framework using 3 layers:
1) Market Structure via Swings (Pivot High/Low)
The script finds swing highs/lows using:
ta.pivothigh(high, swingLen, swingLen)
ta.pivotlow(low, swingLen, swingLen)
These swings become the reference points for structure breaks.
2) BOS / CHoCH Detection
BOS Up = price closes above the last swing high
BOS Down = price closes below the last swing low
trend updates to 1 (bullish) or -1 (bearish) based on BOS
CHoCH triggers when BOS occurs against the current trend
CHoCH Up = trend was bearish, then BOS Up happens
CHoCH Down = trend was bullish, then BOS Down happens
3) Liquidity Sweep + Premium/Discount Filter
Sell-side sweep: low breaks below last swing low, but closes back above it
Buy-side sweep: high breaks above last swing high, but closes back below it
Equilibrium (EQ) midpoint is:
(lastSwingHigh + lastSwingLow) / 2
Discount = price below EQ
Premium = price above EQ
Signal Rules (Buy / Sell)
Buy Signal
Sell-side sweep + (CHoCH Up or BOS Up)
OR
BOS Up while price is in Discount
Sell Signal
Buy-side sweep + (CHoCH Down or BOS Down)
OR
BOS Down while price is in Premium
Hold Score System (0–5) — HTF confirmation
The script calculates a Hold Score from HTF using 5 checks:
HTF EMA Bias
Bullish hold bias: EMA Fast > EMA Mid
Bearish hold bias: EMA Fast < EMA Mid
Volatility Expansion
Uses HTF Bollinger Band width; if width is increasing, expansion is “OK”
Mid Acceptance
HTF close relative to HTF BB basis (SMA)
Follow-through after Entry
Requires N consecutive bars closing in favor of the entry direction
No Opposite Break
Avoid holding if opposite BOS/CHoCH appears
Hold Score = sum of the 5 checks (0–5)
TP/SL Box (Optional)
When a new Buy/Sell signal occurs:
Entry is set at current close
SL uses:
Swing-based stop (lowest/ highest of last N bars)
optional ATR buffer
TP1 and TP2 are set using Risk:Reward ratios
TP2 Expansion (Optional)
If Hold Score ≥ threshold:
TP2 RR increases by extraRRonHold
Can be set to expand only (never shrink)
Auto-hide TP/SL Drawings (Optional)
If enabled, the TP/SL box/lines/labels will automatically disappear after N bars.
This is useful for clean charts while still keeping Hold Score logic running.
Best Use Cases
✅ Works best during liquidity sessions:
London Killzone
New York Killzone
✅ Recommended timeframes:
Structure: 15m / 1h
Entry refinement: 5m / 1m
Hold Score HTF: 1h or 4h
Inputs Guide (Quick)
Swing length (Structure): controls swing sensitivity (higher = fewer swings)
Hold Score HTF: HTF used for Hold Score confirmation
TP/SL Box: visualization tool, not order execution
Auto-hide: removes drawings after N bars for clean charts
TP2 Expand: increases TP2 target when Hold Score is strong
Disclaimer
This indicator does not place trades and does not guarantee profits. Always manage risk, backtest, and validate with your own strategy.
UT Bot Alerts with R-Targets & Results< DONE BY RM ALOWAIS >
Indicator Overview
This indicator provides rule-based BUY and SELL signals with automatic risk management levels.
Each trade setup includes a predefined Stop Loss and up to three Take Profit targets (TP1, TP2, TP3), allowing traders to manage risk and scale exits systematically.
How It Works
BUY and SELL signals are generated based on internal market conditions.
Each signal plots:
Entry point
Stop Loss (SL)
Take Profit levels (TP1, TP2, TP3)
After price action completes, the indicator displays the actual result of the trade:
Result: TP1 / TP2 / TP3 / SL
Exit labels may appear when a trade is closed early due to invalidation or opposite conditions.
Key Features
Non-repainting signals
Built-in risk-to-reward structure
Visual trade tracking with clear outcomes
Suitable for intraday and swing trading
Works on multiple markets and timeframes
Usage Notes
This indicator is a decision-support tool, not financial advice.
Best results are achieved when used with proper risk management and higher-timeframe confirmation.
Performance may vary depending on market conditions (trend vs range).
Disclaimer
This script is provided for educational and informational purposes only.
The author is not responsible for any financial losses. Always test and validate before using in live trading.
Custom Price Offsets v6.1For use on ES, default 3, 6, 9, 13, and 19 point targets. Add indicator and click the price level that you want to use in order to measure the targets. Delete and re-apply to change set point.
Sarina - EMA Dynamic -01112026This script creates a Dynamic Adaptive EMA System that goes beyond traditional moving averages by adjusting its "length" (lookback period) in real-time based on price action.Core MechanismUnlike standard EMAs with fixed periods, this indicator uses variable lengths ($c1$ and $c2$).Acceleration: When price moves aggressively, the EMA lengths increase or decrease dynamically to track the trend more closely.Time-Based Deceleration: It includes a unique feature where the "speed" of these adjustments decays every 30 seconds to prevent the indicator from becoming too erratic during high-volatility spikes.Signal Logic (The "No-Summary" System)The system categorizes signals into two tiers:S-Signals (Small): Occur when the baseline EMA (9) stabilizes above/below the Fast Dynamic EMA (13).P-Signals (Power): Occur when the baseline EMA (9) stabilizes above/below the Slow Dynamic EMA (34).Noise Reduction FeaturesTo ensure high-quality entries, the code employs two filters:Stabilization Filter (conf_bars): Price (via the 9 EMA) must hold its position for a specific number of candles before a label appears. This acts as a "shock absorber" against sudden wicks.Proximity Filter (signal_filter_window): It prevents "signal clustering" by enforcing a minimum candle distance between consecutive buy or sell labels.Visual Output: You will see a color-coded cloud between the two dynamic EMAs and a real-time Status Table in the top-right corner showing the current calculated lengths of your averages.
SuperTrend AI + PVSRA Full DashboardOPERATIONAL MANUAL: SuperTrend AI + PVSRA (4H Timeframe)
1. CORE STRATEGY OVERVIEW
The 4H timeframe is the "Institutional Standard." This strategy combines K-Means AI Clustering for trend detection with PVSRA (Price, Volume, Spread, Range Analysis) to identify bank maneuvers.
The goal is to enter trades only when AI trend, Institutional Volume, and Moving Average momentum align perfectly.
2. OPTIMAL 4H CONFIGURATION
AI Performance Memory: 15 to 20 (Provides trend stability against 4H noise).
Factor Range: 1.5 - 5.0 (Allows AI to scale during massive BTC/Crypto cycles).
PVSRA Climax Factor: 2.7 (The filter for significant institutional intervention).
SMA 200 (Institutional): Always active; serves as the ultimate "Bull/Bear" boundary.
3. ENTRY PROTOCOLS: "SUPER CONFLUENCE"
Entries are strictly executed upon the appearance of the SUPER CONFLUENCE label.
A. LONG SETUP (BUY)
AI Trend: The AI Trailing Stop line must be Teal (Bullish).
PVSRA Volume: A Green (Climax) or Blue (Rising) candle must be present.
The Trigger: A "SUPER CONFLUENCE BUY" tag appears (signaling a SMA 20 / AI Line crossover).
Confirmation: Higher probability if the Dashboard shows "Trend 200: ABOVE".
B. SHORT SETUP (SELL)
AI Trend: The AI Trailing Stop line must be Magenta/Red (Bearish).
PVSRA Volume: A Purple (Climax) or Orange (Rising) candle must be present.
The Trigger: A "SUPER CONFLUENCE SELL" tag appears.
Confirmation: Higher probability if the Dashboard shows "Trend 200: BELOW".
4. RISK & TRADE MANAGEMENT
ACTION 4H TIME-BASED RULE
Stop Loss Place SL behind the most recent PVSRA Climax candle wick or the AI Line.
Take Profit 1 Exit 50% at the nearest S/R Level (Red/Blue rectangles) or 1:1.5 RR.
Trailing Stop Trail the Dynamic SMA 20. Exit if the SMA 20 changes color against you.
Exit Signal Immediate exit if a Climax volume of the opposite color appears at a key level
for Me the best settings but You experiment and find yours;
ATR lenght AI :10
Factor range min 2 max 5
Step 1
Perfor.Mem.10
Source : Best
Volume Period 10
Climax 2.5
Multiplier Rising 1.5
Thank you all and happy trading
7-13 Sequential CounterThis indicator displays a sequential count (7-13) setup phase. It tracks consecutive bars where the close is lower than the close 4 bars ago (bullish/buy count, labeled below bars) or higher (bearish/sell count, labeled above bars), resetting on interruption or after 13. Toggle individual numbers (I personally use 7,9,13) and customize bullish/bearish label colors to spot potential trend exhaustion and reversal points.
Leotin ScalperThis is a quick scalping indicator. Mostly used on the 1 minute timeframe. It uses the RSI on the 14 period with 30 and 70. When it crosses the 70 line it and a hanging man or shooting star candle forms, it will give a sell indication. when crossing the 30 line and a hammer or inverted hammer is formed it will give a buy indication.
***CILGIN INDIKATOR***ÇILGIN INDICATOR – User Guide
OVERVIEW
ÇILGIN INDICATOR is a multi-layer trend and momentum confirmation tool designed for discretionary traders.
It combines Relative RSI, EMA structure, SuperTrend logic, Momentum, and optional CCI & ADX filters into a single visual system.
Purpose:
Filter market noise, confirm trend strength, and highlight high-probability Buy / Sell zones.
The indicator works on all symbols and all timeframes.
RELATIVE RSI & MOMENTUM
The indicator can work in two modes:
NORMAL MODE (Formula OFF)
RSI is calculated directly from the chart symbol.
FORMULA MODE (Formula ON)
RSI is calculated from a relative price formula:
Base Symbol / Denominator 1 / Denominator 2
This allows relative strength analysis against indices, sectors, or benchmarks.
RSI SIGNAL LOGIC
RSI Signal Line = SMA of RSI
RSI 50 Level = Trend bias reference
BUY SIGNAL
RSI crosses above the signal line
Optional: RSI must also cross above 50 (Double Confirmation)
SELL SIGNAL
RSI crosses below the signal line
Optional: RSI must also cross below 50
Small arrows on the chart represent RSI-based Buy and Sell signals.
EMA STRUCTURE
Five adaptive EMAs are plotted: EMA 1
EMA 5
EMA 21
EMA 50
EMA 100
EMA lengths automatically adapt to timeframe speed.
EMA BUY LOGIC
Fast EMA crosses above any slower EMA.
EMA SELL LOGIC
Fast EMA crosses below any slower EMA.
EMAs define:
Trend direction
Dynamic support and resistance
Momentum shifts
SUPERTREND SYSTEM
A custom ATR-based SuperTrend is used.
Features:
Optional candle wick usage
Dynamic trailing stop
Visual Buy / Sell labels
SUPERTREND BUY
Trend flips from bearish to bullish.
SUPERTREND SELL
Trend flips from bullish to bearish.
Colored zones visualize the active trend direction.
STRONG BUY & STRONG SELL SIGNALS
A Strong Signal is generated only when multiple conditions agree.
STRONG BUY
RSI Buy Signal
SuperTrend Buy Signal
Optional CCI Filter confirmation
Optional ADX Filter confirmation
STRONG SELL
RSI Sell Signal
SuperTrend Sell Signal
Optional CCI Filter confirmation
Optional ADX Filter confirmation
Strong signals are displayed as large labeled markers: “STRONG BUY”
“STRONG SELL”
Designed for trend-following entries, not market noise.
CCI & ADX FILTERS (OPTIONAL)
CCI FILTER
Buy allowed only if CCI > 0
Sell allowed only if CCI < 0
ADX FILTER
ADX must be above minimum level
Direction confirmed using +DI and -DI
These filters help avoid sideways markets and weak trends.
INFORMATION PANELS
PANEL A (Top Right)
Daily percentage change
Weekly percentage change
Monthly percentage change
Daily volume (millions)
PANEL B (Bottom Right)
Relative RSI value
RSI signal value
Relative momentum
Market status (Bull / Bear)
Provides instant market context without extra indicators.
ALERTS
Built-in alerts are available for:
STRONG BUY
STRONG SELL
Suitable for automation and watchlist monitoring.
BEST PRACTICES
Use Formula Mode for relative strength analysis
Enable CCI & ADX filters on higher timeframes
Combine signals with price action and key levels
Do not use as a standalone trading system
DISCLAIMER
This indicator is a decision-support tool and does not provide financial advice.
Always manage risk and confirm signals with your own analysis.
PLOW/PLHW (Potential weekly highs/lows)AP Capital – PLOW / PLHW (Potential Weekly Low / High)
This indicator highlights Potential Weekly Lows (PLOW) and Potential Weekly Highs (PLHW) in real time, using current-week price action, session context, and confirmed candle closes.
It is designed for intraday and swing traders who want early-week and late-week structure levels without repainting or hindsight bias.
🔹 How It Works
Potential Weekly Low (PLOW)
Detected during early week sessions
Triggers when price prints the current week’s lowest low
Confirmed only on candle close
Typically aligns with liquidity grabs, stop runs, or accumulation
Potential Weekly High (PLHW)
Detected during late week sessions
Triggers when price prints the current week’s highest high
Confirmed only on candle close
Often marks distribution or exhaustion zones
📊 Visual Elements
Clean weekly high & low levels
Optional weekly midpoint
Session-aware confirmation
Non-repainting labels
Minimalist layout (no clutter)
⚙️ Key Features
Works on any intraday timeframe
Fully non-repainting
Session-based logic (early vs late week)
Optional weekly range info panel
Suitable for Gold, FX, Indices, Crypto
🧠 Best Use Cases
Fade moves into weekly extremes
Combine with:
Previous Day High / Low
Liquidity sweeps
Market structure shifts
Identify high-probability reversals
Avoid chasing price late in the week
⚠️ Important Notes
This is NOT predictive — levels are confirmed from live price action
Best used as context, not a standalone entry system
Designed to complement price action & liquidity-based trading
📌 Disclaimer
This indicator is for educational purposes only.
Not financial advice. Always manage risk.
Bull Engulf @ Rolling Support + HTF Confluence (2-8w) This indicator is designed to identify high-probability bullish reversal setups that occur at proven support levels, with confirmation from higher timeframes.
It is built for swing traders targeting 2–8 week moves, prioritizing win rate and trade quality over frequency.
The script focuses on institutional-style price behavior: pullbacks into support, seller exhaustion, and clear buyer confirmation before entry.
Core Logic
A signal is generated only when all of the following align:
Bullish Engulfing Candle
Current candle fully engulfs the prior candle’s body
Optional filters ensure strong momentum (close above prior high, meaningful candle size)
Rolling-Low Support
Price must be near a rolling support level based on recent swing lows
Support adapts dynamically to market structure
Higher Timeframe (HTF) Confluence
Daily setups can require alignment with weekly and monthly support
Weekly setups can require monthly support
This dramatically reduces low-quality signals
Strongest-Only Scoring System
Each setup is scored based on:
Proximity to support
HTF confluence
Candle strength
Volume and volatility filters
Only setups meeting a minimum score threshold are shown
Signals & Labels
SETUP / TOP label
Appears when a valid bullish engulfing forms at support with HTF confirmation.
ENTRY label
Appears when price breaks above the high of the engulfing candle (confirmation entry).
Support Lines
Local (rolling) support
Weekly and Monthly support (when applicable)
Each label includes:
Timeframe
Score
Support distance
Suggested risk level
A standardized options structure for 2–8 week trades
Intended Trading Style
Timeframe: Daily and Weekly charts
Trade Duration: ~2–8 weeks
Market Type: Stocks (best on liquid, mid/large-cap names)
Approach:
Wait for price to come to support
Wait for buyers to prove control
Enter only after confirmation
This indicator is not designed for:
Day trading
Chasing breakouts
High-frequency signals
Fewer signals is intentional.
How to Use
Apply the indicator to Daily or Weekly charts
Wait for a SETUP/TOP label at support
Enter only after the ENTRY confirmation (break above engulfing high)
Use the displayed risk level to define invalidation
Let the trade develop over multiple weeks
Alerts can be enabled for:
Pre-market watchlist signals (yesterday’s setups)
Confirmed signals at the close
Entry confirmation
Why This Works
Markets often reverse at support, not randomly.
By combining:
Structural support
Price-action confirmation
Higher timeframe alignment
this indicator filters out most noise and focuses on areas where larger participants are likely active.
Disclaimer
This indicator is for educational and analytical purposes only.
It does not constitute financial advice. Always manage risk appropriately.
Engulfing + EMA + WMA + ICT Alejandradetector de velas engulfing
7 emas disponibles
wma
detector de bos y choch






















