eBacktesting - Learning: RSI DivergenceseBacktesting - Learning: RSI Divergences is meant to train your eye to spot when a trend is losing momentum before price fully turns.
How to study it (step-by-step)
1. Start with the trend
- First decide if price is generally trending up or down (higher highs / higher lows vs lower highs / lower lows).
- Divergences matter most after a trend has been running for a while.
2. Look for the “mismatch”
- Bearish divergence: price prints higher highs, but RSI prints lower highs.
- This often shows up near the end of a strong bullish run, when buyers are still pushing price up but with less momentum.
- Bullish divergence: price prints lower lows, but RSI prints higher lows.
- This can show up near the end of a bearish move, when selling pressure is fading.
3. Treat divergence as a warning, not an entry
- The key lesson: divergence often signals trend weakness, not an instant reversal.
- After a divergence appears, study what happens next: stalling, ranging, a pullback, or a full reversal.
4. Add simple confirmation
- Practice waiting for something obvious after the divergence:
a break of a small support/resistance level,
a shift in swing structure,
or a clear rejection candle from a key area.
- This helps you avoid taking every divergence as a trade signal.
5. Use it inside eBacktesting (best practice)
- Replay the chart and pause on each divergence mark.
- Log:
Where it happened (after a long run or in the middle of chop?),
Whether price stalled first or reversed immediately,
What confirmation appeared (if any),
The best “invalidation” idea (what would prove you wrong?).
- Over time you’ll see which divergences are meaningful for your market and session, and which ones are noise.
These indicators are built to pair perfectly with the eBacktesting extension, where traders can practice these concepts step-by-step. Backtesting concepts visually like this is one of the fastest ways to learn, build confidence, and improve trading performance.
Educational use only. Not financial advice.
อินดิเคเตอร์และกลยุทธ์
Elder AutoEnvelope 1m/5mOverview
This script is an advanced implementation of Dr. Alexander Elder’s AutoEnvelope, specifically optimized for 1-minute (1m) and 5-minute (5m) low-timeframe trading.
The logic treats the market as a "manic-depressive" entity:
Center Line (26 EMA): Represents the fair value consensus.
Fast Line (13 EMA): Captures short-term price momentum.
Envelopes (Bands): Represent the limits of price "sanity." Under normal conditions, 95% of price action should remain within these bands.
Key Features
Powered by Pine Script V6: Built on the latest engine for maximum precision and performance.
Real-time Coverage Tracker: A dashboard in the top-right corner displays the percentage of price bars contained within the bands over the lookback period. The goal is to adjust the Multiplier until coverage is ~95%.
Dual Smoothing: To combat high-frequency noise on 1m/5m charts, this script applies a secondary smoothing layer to the channel width, preventing the "jagged" lines found in standard indicators.
Recommended Settings
Lookback: Defaulted to 300. On a 1m chart, this represents 5 hours of data, providing a much more robust "normal" range than the standard 100-period setting.
Multiplier: Usually ranges between 2.0 and 3.5 depending on the asset's volatility. Tune this until the Coverage Panel shows ~95%.
SmoothLen: Defaulted to 20. Increase this value for even smoother, more "parallel" bands during high-noise sessions.
Practical Trading Advice
Take Profit Zones: In an uptrend, treat the Upper Band as a primary target. When price pierces the band and closes back inside, it’s often the climax of the move.
Mean Reversion: When price touches the Lower Band while significantly stretched away from the yellow Center Line, look for a bounce back to the value area, especially if the Purple Fast Line begins to flatten.
Trend Filtering:
Price above Fast Line (Purple) + Upward slope: Bullish bias. Only look for Longs or Profit Taking.
Price below Fast Line (Purple) + Downward slope: Bearish bias. Only look for Shorts or Covering.
Asset Calibration: When switching assets (e.g., Gold to BTC), always fine-tune the Multiplier. The bands are only statistically valid when the Coverage Panel stays between 94% and 96%.
指标简介
本脚本是基于亚历山大·爱尔德博士(Dr. Alexander Elder)著名的“自动包络线”(AutoEnvelope)理论开发的进阶版本,特别针对 1分钟(1m)和 5分钟(5m) 等短周期高频交易进行了优化。
该指标的核心逻辑是将市场视为一个“躁郁症患者”:
中心线 (26 EMA):代表市场的平均价值认同。
快线 (13 EMA):代表短期价格动能。
包络线 (Bands):代表价格波动的极端边界(95% 的价格应运行在通道内)。
核心功能
V6 引擎驱动:采用最新的 Pine Script V6 编写,计算更精准,内存占用更低。
实时覆盖率统计:右上角实时显示过去 300 根 K 线中有多少比例落在通道内。目标是手动调整倍数(Multiplier)使该数值维持在 95% 左右。
双重平滑处理:针对短线噪音,对通道宽度进行了二次平滑,避免了传统指标在 1 分钟图上常见的“锯齿状”变形。
参数设置建议
Lookback (回溯周期):默认 300。在 1m 图上代表过去 5 小时,能提供比默认 100 周期更稳定的边界。
Multiplier (偏离倍数):根据不同品种调整(通常在 2.0 - 3.5)。请观察右上角面板,当覆盖率接近 95% 时,该倍数最为准确。
SmoothLen (平滑系数):默认 20。如果觉得轨道太乱,可调高此值。
实际交易建议
波段止盈点:在上升趋势中,当价格刺破上轨且 K 线实体收回上轨下方时,是绝佳的多头平仓位。
均值回归:当价格偏离中心线触碰下轨,且快线(紫色)开始走平时,预示即将反弹回中心线。
趋势过滤:
价格在快线(紫色)上方且快线斜率向上:只做多或平多,不逆势抄顶。
价格在快线(紫色)下方且快线斜率向下:只做空或平空。
覆盖率校准:切换交易品种(如从黄金切换到比特币)后,务必微调 Multiplier,确保覆盖率处于 94%-96% 之间,此时的边界才具有统计学意义。
Crypto MA Crossover indicator v0.1Research I conducted has shown that using moving average crossovers to determine when going long a cryptocurrency (or otherwise going to cash) performs better than both buy-and-hold as other similar strategies (e.g., going long when price crossover over moving averages).
Adaptive moving average strategy paper with full backtests
This indicator shows if a given cryptocurrency is in a state where the best-performing moving averages have crossed over. It also shows the specific moving average settings for each cryptocurrency.
Note: you will have to edit the script to update the coins and moving average settings manually.
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 ↑↑↑>
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.
Time Pressure ZonesTime Pressure Zones is a multi‑purpose candle and volume‑based indicator that highlights moments when markets are likely being driven by urgency rather than routine trading flow.
**Overview**
Detects sequences of strong, one‑directional candles accompanied by volume spikes to approximate institutional time pressure (forced buying or selling).
Paints subtle background zones, labels, and a net‑pressure histogram so you can see when aggressive flow is building or exhausting across any instrument and timeframe.
**Core Logic**
A bar is tagged “strong” when its real body occupies at least a user‑defined percentage of the full high‑low range, filtering out indecision candles and long‑wick noise.
Volume is compared to a rolling 20‑bar average; only bars with volume above a configurable multiple are treated as meaningful participation, which makes the tool adapt to different symbols and sessions.
The script counts consecutive bars that are both strong and high‑volume in the same direction, then flags a time‑pressure event once a set fraction of the lookback has been reached (e.g., 2 out of 3, 3 out of 5).
**Visual Outputs**
Background shading: green or red bands mark active bullish or bearish time‑pressure windows without overpowering other tools on the chart.
On‑chart labels: “↑ Time Pressure” and “↓ Time Pressure” appear only on the first bar of a new pressure sequence, ideal for alerts and discretionary entries.
Net Pressure histogram: plots the difference between bullish and bearish streak counts, giving a quick at‑a‑glance sense of which side currently dominates.
**Sessions and News**
Uses UTC‑based logic to highlight London and New York open and close windows, where institutional flows and intraday “deadline” behavior tend to cluster.
Includes a manual News Window toggle so you can mark high‑impact event periods (CPI, FOMC, NFP, etc.), aligning tape‑based urgency with scheduled catalysts.
**How To Use**
Look to join moves when fresh time‑pressure labels print into session opens, breakouts, or key levels, rather than fading them.
Tune the three main inputs per market and timeframe: lower thresholds for choppy or thin markets, and higher body/volume requirements for very liquid symbols like major indices or BTC pairs.
Vishall FINAL candle Power X Strategy - DAILY EXPORTVishall FINAL candle Power X Strategy - DAILY EXPORT
it show only day details
longPower = day_close - day_low
shortPower = day_high - day_close
Y = day_close
x_value = ((longPower - shortPower) / Y) * 100
XAUUSD lucky trendThis version introduces a strict midline filter to keep signals trend-aligned without revealing any specific settings. Long signals are permitted only when price is clearly established on the bullish side of the midline for the entire candle, so brief dips through the line are ignored. Short signals are permitted only when price is clearly established on the bearish side of the midline for the entire candle, so brief spikes through the line are ignored. This helps avoid whipsaws around the midline and reduces counter-trend entries, especially during choppy transitions. All other components of the indicator remain unchanged: the original signal logic, quality filters, and frequency controls still determine when a setup is valid. The result is fewer but cleaner prompts that better reflect sustained directional bias rather than temporary noise around the midline.
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.
Balubas Candlestick Pattern DetectorDetects candlestick patterns. Developed for Godzilla Trader's Substack. 12/01/2026.
Portfolio TrackerPortfolio Tracker – Manual Position Dashboard
This indicator provides a clean, non-intrusive dashboard for tracking open equity positions directly on your chart.
You can manually enter up to 20 positions (symbol, quantity, and buy price), and the dashboard will automatically compute:
- Invested amount per position
- Live market price
- Current market value
- Profit / Loss (absolute)
- Profit / Loss (%)
- Portfolio-level totals
The dashboard updates on the latest bar only, ensuring stable values and minimal redraw overhead.
Visuals :
- Supports up to 20 simultaneous positions
- Clear green / red P&L highlighting per position
- Portfolio totals calculated in real time
- Adjustable dashboard size (Small / Normal / Large)
- User-selectable dashboard position (top/bottom, left/right)
No trading logic, no signals, no repainting — tracking only
Delta Hedging Pressure📊 COT Delta Hedging Pressure – Institutional Sentiment Indicator
This indicator visualizes institutional hedging pressure by aggregating delta-style positioning into a clean, session-aware sentiment framework.
Instead of guessing direction, it shows who is likely hedging vs. pressing, helping traders align intraday execution with higher-timeframe positioning.
🔍 What This Indicator Does
Calculates cumulative hedging pressure using price-based delta logic
Classifies market state into:
Bullish (positive hedge pressure)
Bearish (negative hedge pressure)
Neutral (balanced flow)
Resets cleanly by session or user-defined period
Visualizes sentiment using:
Background shading
Labels
Cumulative plots
🧠 How Traders Use It
Directional bias filter (trade only with sentiment)
Context for FVGs, liquidity raids, and pullbacks
Avoids chop by identifying neutral hedge conditions
Pairs especially well with:
XAUUSD
Index CFDs
Futures / CFD hybrids
⚙️ Key Features
Session-aware cumulative logic
Adjustable sensitivity and lookback
Clean visual design (no clutter)
Non-repainting calculations
Works on 1m → HTF
⚠️ Important Notes
This is a context tool, not a signal generator
Best used alongside price structure and risk management
Designed for discipline and alignment, not overtrading
🎯 Ideal For
Scalpers & intraday traders
Traders using:
Fair Value Gaps (FVG)
Liquidity sweeps
Session-based models
Traders transitioning from prop logic to personal capital
🧩 Final Thought
This indicator answers one question:
“Is the market hedging or pressing — and should I be aggressive or patient?”
If you trade with structure, this keeps you on the right side.
Test screener to be deletedTest screener to be deleted
Test screener to be deleted
Test screener to be deleted
Test screener to be deleted
Test screener to be deleted
eBacktesting - Learning: Power of 3eBacktesting - Learning: Power of 3 highlights ICT’s “Power of 3” intraday story:
- Accumulation: price builds a quiet range
- Manipulation: a sweep grabs liquidity above or below that range (the classic stop hunt)
- Distribution: the real move expands away from that range, often in the opposite direction of the sweep
Use it to train your eyes to recognize when price is likely “setting up” vs when the session is actually “moving,” and to build a clean daily narrative around liquidity and expansion.
These indicators are built to pair perfectly with the eBacktesting extension, where traders can practice these concepts step-by-step. Backtesting concepts visually like this is one of the fastest ways to learn, build confidence, and improve trading performance.
Educational use only. Not financial advice.
Quality-Controlled Trend StrategyOverview
This strategy demonstrates a clean, execution-aware trend framework with fully isolated risk management.
Entry conditions and risk logic are intentionally separated so risk parameters can be adjusted without altering signal behavior.
All calculations are evaluated on confirmed bars to ensure backtest behavior reflects real-time execution.
Design intent
Many scripts mix entries and exits in ways that make results fragile or misleading.
This strategy focuses on structural clarity by enforcing:
confirmed-bar logic only
fixed and transparent risk handling
consistent indicator calculations
one position at a time
It is intended as a baseline framework rather than an optimized system.
Trading logic (high level)
Trend context
EMA 50 vs EMA 200 defines directional bias
Entry
Price alignment with EMA 50
RSI used as a momentum confirmation, not as an overbought/oversold signal
Risk management
Stop-loss based on ATR
Fixed risk–reward structure
Risk logic is isolated from entry logic
Editing risk without affecting signals
All stop-loss and take-profit calculations are handled in a dedicated block.
Users can adjust:
ATR length
stop-loss multiplier
risk–reward ratio
without modifying entry conditions.
This allows controlled experimentation while preserving signal integrity.
Usage notes
Results vary by market, timeframe, and volatility conditions.
This script is provided for testing and educational purposes and should be validated across multiple symbols and forward-tested before use in live environments.
TA Checklist and Kontext and VstupKontext a vstup pravidla TA, jednoduché věty pro vlastní vstup a přehled.
Market State Fear & Greed Bubble Index V1Market State Fear & Greed Bubble Index V1
📊 Comprehensive Market Sentiment Analyzer
This advanced indicator measures market psychology through a multi-dimensional scoring system, combining demand/supply pressure, trend momentum, and statistical extremes to identify fear/greed cycles and trading opportunities.
🎯 Core Features
Five-Factor Fear & Greed Score
Weighted sentiment analysis:
Demand/Supply (25%): Real-time buying/selling pressure
RSI (25%): Momentum extremes
KDJ (20%): Overbought/oversold detection
Bollinger Band % (20%): Statistical positioning
ADX Trend (10%): Trend strength confirmation
Multi-Layer Market State Detection
Extreme Fear/Greed: Statistical bubble identification
Trend Bias: Bullish/Bearish/Neutral classification
Confidence Scoring: Setup reliability assessment
Reversal Alerts: Early trend change signals
Visual Dashboard
Top-right information panel displays:
Fear & Greed Score (0-100)
Market State Classification
Trend Bias & Confidence
Signal Quality & Alerts
📈 Key Components
Fear & Greed Gauge
0-30: Extreme Fear (buying opportunities)
30-47: Fear (accumulation zones)
47-70: Neutral (consolidation)
70-90: Greed (caution zones)
90-100: Extreme Greed (selling opportunities)
Deviation Zones
Red Zone (±17.065): Critical reversal areas
Yellow Zone (±34.135): Warning levels
Blue Zone (±47.72): Statistical extremes where reversals are highly likely. These occur when asset prices are in a bubble that's about to pop.
Signal Types
Buy/Sell Labels: Primary entry/exit signals
Scalp Signals: Short-term opportunities
Bottom/Top Detectors: Extreme reversal zones
Whale Indicators: Institutional activity markers
🚀 Trading Applications
Extreme Fear Setups Conditions:
Fear & Greed Score < 34.135
BB% < 0 or < J-inverted line
RSI < 34.135
Confidence score > 68%
Bullish divergence present
Action: Accumulation positions, scaled entries
Extreme Greed Setup Conditions:
Fear & Greed Score > 68.2
BB% > 100 or > 80 with divergence
RSI > 68.2
ADX showing trend exhaustion
Multiple timeframe resistance
Action: Profit-taking, protective stops
Trend Following
Bullish Conditions:
Sentiment score rising from fear zones
DMI+ above DMI- and rising
Confidence > 75%
Volume supporting moves
Bearish Conditions:
Sentiment declining from greed zones
DMI- above DMI+ and rising
Distribution patterns
Multiple resistance failures
⚙️ Customization Options
Adjustable Parameters:
DMI Settings: DI lengths, ADX smoothing
KDJ Periods: Customizable sensitivity
BB% Range: Statistical band adjustments
Smoothing Options: Demand/Supply filtering
Alert Thresholds: Custom signal levels
Visual Customization:
Color schemes for different market states
Line thickness and style preferences
Information panel display options
Alert sound/visual preferences
📊 Signal Interpretation
Primary Signals:
Green 'B': Strong buy opportunity
Red 'S': Strong sell opportunity
White 'Scalp': Short-term trade
Trade Area: Accumulation/distribution zones
Visual Markers:
🔥: Bullish momentum building
🐻: Bear exhaustion building
🐳: Whale/institutional activity
Color-coded fills: Market state visualization
Confidence Levels:
≥80%: High reliability setups
60-79%: Moderate confidence
<60%: Low confidence, avoid or reduce size
⚠️ Risk Management Guidelines
Critical Rules:
Never trade against extreme sentiment (Extreme Fear → buy, Extreme Greed → sell)
Require multiple confirmation signals
Use confidence scores for position sizing
Avoid When:
Conflicting signals between components
Low volume participation
Confidence score < 50%
Major news events pending
Extreme volatility conditions
💡 Advanced Strategies
Sentiment Cycle Trading
Identify sentiment extremes
Wait for confirmation reversals
Enter with trend confirmation
Exit at opposite sentiment extreme
Use confidence scores and fear & greed scores to scale:
Fear & greed scores < 30 = buy area
Fear & greed score > 60 = sell area
Trend Momentum
Exit: At extreme greed with divergence
Enter: At extreme fear with divergence
📊 Market State Classification
Five Primary States:
EXTREME FEAR (BB% <0, RSI <34, Score <34)
FEAR (Score 34-47, bearish momentum)
NEUTRAL (Score 47-70, consolidation)
GREED (Score 70-90, bullish momentum)
EXTREME GREED (Score >90, BB% >100)
State Transitions:
Fear → Neutral: Early accumulation
Neutral → Greed: Trend development
Greed → Extreme Greed: Distribution
Extreme → Reversal: Trend change
🔍 Information Panel Guide
Real-Time Metrics:
FEAR & GREED: Current sentiment score
Market State: Classification and bias
Trend Bias: Bullish/Bearish/Neutral
Confidence: Setup reliability percentage
Momentum: Current directional strength
Volatility: Market condition assessment
Signal Quality: Trade recommendation
Reversal Imminent: Early warning alerts
🌟 Unique Advantages
Psychological Edge:
Quantifies market emotion through multiple indicators
Identifies bubbles before they pop
Provides statistical confidence for each setup
Combines technical extremes with sentiment analysis
Offers clear visual cues for decision making
Professional Features:
Multi-timeframe sentiment analysis
Real-time confidence scoring
Comprehensive alert system
Institutional activity detection
Clear risk/reward visualization
📚 Educational Value
This indicator teaches:
Market psychology cycles
Statistical extreme identification
Multi-indicator confirmation
Risk quantification methods
Professional trade management
Perfect for traders seeking to understand and profit from market sentiment cycles.
Disclaimer: For educational purposes. Trading involves risk. Past performance doesn't guarantee future results.
Smart Money Flow Cloud [BOSWaves]Smart Money Flow Cloud - Volume-Weighted Trend Detection with Adaptive Volatility Bands
Overview
Smart Money Flow Cloud is a volume flow-aware trend detection system that identifies directional market regimes through money flow analysis, constructing adaptive volatility bands that expand and contract based on institutional pressure intensity.
Instead of relying on traditional moving average crossovers or fixed-width channels, trend direction, band width, and signal generation are determined through volume-weighted money flow calculation, nonlinear flow strength modulation, and volatility-adaptive band construction.
This creates dynamic trend boundaries that reflect actual institutional buying and selling pressure rather than price momentum alone - tightening during periods of weak flow conviction, expanding during strong directional moves, and incorporating flow strength statistics to reveal whether regimes formed under accumulation or distribution conditions.
Price is therefore evaluated relative to adaptive bands anchored at a flow-informed baseline rather than conventional trend-following indicators.
Conceptual Framework
Smart Money Flow Cloud is founded on the principle that sustainable trends emerge where volume-weighted money flow confirms directional price movement rather than where price alone creates patterns.
Traditional trend indicators identify regime changes through price crossovers or slope analysis, which often ignore the underlying volume dynamics that validate or contradict those movements.This framework replaces price-centric logic with flow-driven regime detection informed by actual buying and selling volume.
Three core principles guide the design:
Trend direction should correspond to volume-weighted flow dominance, not price movement alone.
Band width must adapt dynamically to current flow strength and volatility conditions.
Flow intensity context reveals whether regimes formed under conviction or uncertainty.
This shifts trend analysis from static moving averages into adaptive, flow-anchored regime boundaries.
Theoretical Foundation
The indicator combines adaptive baseline smoothing, close location value (CLV) methodology, volume-weighted flow tracking, and nonlinear strength amplification.
A smoothed trend baseline (EMA or ALMA) establishes the core directional reference, while close location value measures where price settled within each bar's range. Volume weighting applies directional magnitude to flow calculation, which accumulates into a normalized money flow ratio. Flow strength undergoes nonlinear power transformation to amplify strong conviction periods and dampen weak flow environments. Average True Range (ATR) provides volatility-responsive band sizing, with final width determined by the interaction between base volatility and flow-modulated multipliers.
Four internal systems operate in tandem:
Adaptive Baseline Engine : Computes smoothed trend reference using either EMA or ALMA methodology with configurable secondary smoothing.
Money Flow Calculation System : Measures volume-weighted directional pressure through CLV analysis and ratio normalization.
Nonlinear Flow Strength Modulation : Applies power transformation to flow intensity, creating dynamic sensitivity scaling.
Volatility-Adaptive Band Construction : Scales band width using ATR measurement combined with flow-strength multipliers that range from minimum (calm) to maximum (strong flow) expansion.
This design allows bands to reflect actual institutional behavior rather than reacting mechanically to price volatility alone.
How It Works
Smart Money Flow Cloud evaluates price through a sequence of flow-aware processes:
Close Location Value (CLV) Calculation : Each bar's closing position within its high-low range is measured, creating a directional bias indicator ranging from -1 (closed at low) to +1 (closed at high).
Volume-Weighted Flow Tracking : CLV is multiplied by bar volume, then accumulated and normalized over a configurable flow window to produce a money flow ratio between -1 and +1.
Flow Smoothing and Strength Extraction : The raw money flow ratio undergoes optional smoothing, then nonlinear power transformation to amplify strong flow periods and compress weak flow environments.
Adaptive Baseline Construction : Price (both open and close) is smoothed using either EMA or ALMA methodology with optional secondary smoothing to create a stable trend reference.
Dynamic Band Sizing : ATR measurement is multiplied by a flow-strength-modulated factor that interpolates between minimum (tight) and maximum (wide) multipliers based on current flow conviction.
Regime Detection and Visualization : Price crossing above the upper band triggers bullish regime, crossing below the lower band triggers bearish regime. The baseline cloud visualizes open-close relationship within the current trend.
Retest Signal Generation : Price touching the baseline from within an established regime generates retest signals with configurable cooldown periods to prevent noise.
Together, these elements form a continuously updating trend framework anchored in volume flow reality.
Interpretation
Smart Money Flow Cloud should be interpreted as flow-confirmed trend boundaries:
Bullish Regime (Blue) : Activated when price crosses above the upper adaptive band, indicating volume-confirmed buying pressure exceeding volatility-adjusted resistance.
Bearish Regime (Red) : Established when price crosses below the lower adaptive band, identifying volume-confirmed selling pressure breaking volatility-adjusted support.
Baseline Cloud : The gap between smoothed open and smoothed close within the baseline visualizes intrabar directional bias - wider clouds indicate stronger intrabar momentum.
Adaptive Band Width : Reflects combined volatility and flow strength - wider bands during high-conviction institutional activity, tighter bands during consolidation or weak flow periods.
Buy/Sell Labels : Appear at regime switches when price crosses from one band to the other, marking potential trend inception points.
Retest Signals (✦) : Diamond markers indicate price touching the baseline within an established regime, often occurring during healthy pullbacks in trending markets.
Trend Strength Gauge : Visual meter displays current regime strength as a percentage, calculated from price position within the active band relative to baseline.
Background Gradient : Optional coloring intensity reflects flow strength magnitude, darkening during high-conviction periods.
Flow strength, band width adaptation, and baseline relationship outweigh isolated price fluctuations.
Signal Logic & Visual Cues
Smart Money Flow Cloud presents three primary interaction signals:
Regime Switch - Buy : Blue "Buy" label appears when price crosses above the upper band after previously being in a bearish regime, suggesting volume-confirmed bullish transition.
Regime Switch - Sell : Red "Sell" label displays when price crosses below the lower band after previously being in a bullish regime, indicating volume-confirmed bearish transition.
Trend Retest : Diamond (✦) markers appear when price touches the baseline within an established regime, with configurable cooldown periods to filter noise.
Alert generation covers regime switches and retest events for systematic monitoring.
Strategy Integration
Smart Money Flow Cloud fits within volume-informed and institutional flow trading approaches:
Flow-Confirmed Entry : Use regime switches as primary trend inception signals where volume validates directional breakouts.
Retest-Based Refinement : Enter on baseline retest signals within established regimes for improved risk-reward positioning during pullbacks.
Band Width Context : Expect wider price swings when bands expand (high flow strength), tighter ranges when bands contract (weak flow).
Baseline Cloud Confirmation : Favor trades where baseline cloud width confirms intrabar momentum alignment with regime direction.
Strength Gauge Filtering : Use trend strength percentage to gauge continuation probability - higher readings suggest stronger institutional conviction.
Multi-Timeframe Regime Alignment : Apply higher-timeframe regime context to filter lower-timeframe entries, taking only setups aligned with dominant flow direction.
Technical Implementation Details
Core Engine : Configurable EMA or ALMA baseline with secondary smoothing
Flow Model : Close Location Value (CLV) with volume weighting and ratio normalization
Strength Transformation : Configurable power function for nonlinear flow amplification
Band Construction : ATR-scaled width with flow-strength-interpolated multipliers
Visualization : Dual-line baseline cloud with gradient fills, regime-colored bands, and embedded strength gauge
Signal Logic : Band crossover detection with baseline retest identification and cooldown management
Performance Profile : Optimized for real-time execution with minimal computational overhead
Optimal Application Parameters
Timeframe Guidance:
1 - 5 min : Micro-structure regime detection for scalping and intraday reversals
15 - 60 min : Intraday trend identification with flow-validated swings
4H - Daily : Swing and position-level regime analysis with institutional flow context
Suggested Baseline Configuration:
Trend Length : 34
Trend Engine : EMA
Trend Smoothing : 3
Flow Window : 24
Flow Smoothing : 5
Flow Boost : 1.2
ATR Length : 14
Band Tightness (Calm) : 0.9
Band Expansion (Strong Flow) : 2.2
Reset Cooldown : 12
These suggested parameters should be used as a baseline; their effectiveness depends on the asset's volume profile, volatility characteristics, and preferred signal frequency, so fine-tuning is expected for optimal performance.
Parameter Calibration Notes
Use the following adjustments to refine behavior without altering the core logic:
Bands too wide/frequent whipsaws : Reduce "Band Expansion (Strong Flow)" to limit maximum band width, or increase "Band Tightness (Calm)" to widen minimum bands and reduce noise sensitivity.
Trend baseline too choppy : Increase "Trend Length" for smoother baseline, or increase "Trend Smoothing" for additional filtering.
Flow readings unstable : Increase "Flow Smoothing" to reduce bar-to-bar noise in money flow calculation.
Missing legitimate regime changes : Decrease "Trend Length" for faster baseline response, or reduce "Band Tightness (Calm)" for earlier breakout detection.
Too many retest signals : Increase "Reset Cooldown" to space out retest markers, or disable retest signals entirely if not using pullback entries.
Flow strength not responding : Increase "Flow Boost" (power factor) to amplify strong flow differentiation, or decrease "Flow Window" to emphasize recent volume activity.
Prefer different smoothing characteristics : Switch "Trend Engine" to ALMA and adjust "ALMA Offset" (higher = more recent weighting) and "ALMA Sigma" (higher = smoother) for alternative baseline behavior.
Adjustments should be incremental and evaluated across multiple session types rather than isolated market conditions.
Performance Characteristics
High Effectiveness:
Markets with consistent volume participation and institutional flow
Instruments where volume accurately reflects true liquidity and conviction
Trending environments where flow confirms directional price movement
Mean-reversion strategies using retest signals within established regimes
Reduced Effectiveness:
Extremely low volume environments where flow calculations become unreliable
News-driven or gapped markets with discontinuous volume patterns
Highly manipulated or thinly traded instruments with erratic volume distribution
Ranging markets where price oscillates within bands without conviction
Integration Guidelines
Confluence : Combine with BOSWaves structure, order flow analysis, or traditional volume profile
Flow Validation : Trust regime switches accompanied by strong flow readings and wide band expansion
Context Awareness : Consider whether current market regime matches historical flow patterns
Retest Discipline : Use baseline retest signals as confirmation within trends, not standalone entries
Breach Management : Exit regime-aligned positions when price crosses opposing band with volume confirmation
Disclaimer
Smart Money Flow Cloud is a professional-grade volume flow and trend analysis tool. Results depend on market conditions, volume reliability, parameter selection, and disciplined execution. BOSWaves recommends deploying this indicator within a broader analytical framework that incorporates price structure, market context, and comprehensive risk management.
eBacktesting - Learning: Liquidity GrabseBacktesting - Learning: Liquidity Grabs highlights moments when price pushes just beyond a recent swing high or swing low (where many stops tend to sit) and then quickly returns back inside the level. This behavior is often called a stop run, sweep, or liquidity grab.
Traders study these events because they can reveal:
- Where liquidity is “resting” (obvious highs/lows)
- A quick sweep and rejection (often a wick)
- When a breakout attempt is actually a trap
- A full candle close through the level, followed by an immediate reversal back inside (classic breakout trap)
- Potential areas where price may reverse or accelerate after stops are taken
Use it as a training tool to build pattern recognition and improve your patience around key levels, especially during active sessions where sweeps happen frequently.
These indicators are built to pair perfectly with the eBacktesting extension, where traders can practice these concepts step-by-step. Backtesting concepts visually like this is one of the fastest ways to learn, build confidence, and improve trading performance.
Educational use only. Not financial advice.
Fibonacci Sequence Grid [BigBeluga]🔵 OVERVIEW
A geometric price mapping tool that projects Fibonacci sequence levels and grid structures from recent price swings to help traders visualize natural expansion and reversion zones.
This indicator overlays Fibonacci-based structures directly on the chart, utilizing both grid projections and horizontal levels based on the classic Fibonacci integer sequence (0, 1, 1, 2, 3, 5, 8, ...). It identifies recent swing highs or lows and builds precision-aligned levels based on the trend direction.
🔵 CONCEPTS
Uses the Fibonacci integer sequence (not ratios) to define distances from the most recent swing point.
Identifies a trend based on EMA cross of fast and slow periods.
Projects two types of Fibonacci tools:
A grid projection from the swing point, displaying multiple sloped levels based on the sequence.
A set of horizontal Fibonacci levels for clean structural references.
Levels can be plotted from either swing low or high depending on the current trend direction.
Adjustable “Size” inputs control spacing between levels for better price alignment.
Lookback period defines how far the script searches for recent swing extremes.
🔵 FEATURES
Fibonacci Grid Projection:
Draws two mirrored Fibonacci grids—one expanding away from the swing high/low, the other converging toward price.
Swing-Based Trend Detection:
Uses a fast/slow EMA crossover to determine trend direction and reference swing points for projections.
Fibonacci Sequence Levels:
Displays horizontal levels based on the Fibonacci number sequence (0, 1, 2, 3, 5, 8, 13, 21...) for natural price targets.
Dynamic Labels and Coloring:
Each level is labeled with its sequence value and colored based on trend direction (e.g., red = downtrend, green = uptrend).
Both grids and levels can be toggled on/off independently.
Sizing controls allow tighter or looser clustering of levels depending on chart scale.
🔵 HOW TO USE
Enable Fibonacci Grid to visualize price expansion zones during impulsive trends.
Use Fibonacci Levels as horizontal support/resistance or target zones.
A label below price means the current trend is up and levels are projected from swing low.
A label above price means trend is down and levels are projected from swing high.
Adjust “Size” input to fit grid/level projection to your preferred chart scale or instrument volatility.
Use in confluence with price action, trend indicators, or volume tools for layered trading decisions.
🔵 CONCLUSION
Fibonacci Sequence Grid reimagines Fibonacci analysis using whole-number spacing from natural math progressions. Whether used for projecting grid-based expansions or horizontal support/resistance zones, it provides a powerful and intuitive structure to trade within. Perfect for traders who rely on symmetry, market geometry, and mathematically consistent levels.
Volume Dynamic Liquidity BandsThis indicator visualizes liquidity zones on the chart by detecting areas where high-volume trading occurred. It combines volume analysis with price action to identify significant liquidity levels that traders and market makers are likely watching.






















