SuperTrend Confluence Signals (AlgoAlpha)
SuperTrend Confluence Signals (AlgoAlpha)
volLen = 200
heightMult = 1.5
minAlpha = 20
maxAlpha = 80
for i = 0 to 4
tf = array.get(timeframes, i)
table.cell(multiAssetTable, 0, i + 1, tf, text_color=chart.fg_color,
text_halign=text.align_center, text_size=size.tiny)
for j = 0 to 4
asset = array.get(assets, j)
trendValue = getTrend(asset, tf)
trendText = trendValue == 1 ? "▲" : "▼"
cellColor = trendValue == 1 ? color.new(colBull, 70) :
color.new(colBear, 70)
table.cell(multiAssetTable, j + 1, i + 1, trendText,
text_color=chart.fg_color, bgcolor=cellColor, text_halign=text.align_center,
text_size=size.tiny)
var lowest = 0.0
var highest = 0.0
var lowest_ = 0
var highest_ = 0
var new = 1
x = ta.lowest(low, timing)
x_ = ta.highest(high, timing)
if levelHighArray.size() > 0
for ln = levelHighArray.size() - 1 to 0
if ln < levelHighArray.size()
cL = levelHighArray.get(ln)
cL_ = levelHighArray1.get(ln)
yL = cL.get_y1()
x1 = cL.get_x1()
age = bar_index - x1
is_body = mitigate == "body"
cross_body = close > yL
cross_body_confirmed = close > yL and close[1] > yL
cross_wick = high > yL
remove_by_mitigation = is_body ? (allow_rejection ?
cross_body_confirmed : cross_body) : cross_wick
if levelLowArray.size() > 0
for ln = levelLowArray.size() - 1 to 0
if ln < levelLowArray.size()
cL = levelLowArray.get(ln)
cL_ = levelLowArray1.get(ln)
yL = cL.get_y1()
x1 = cL.get_x1()
age = bar_index - x1
is_body = mitigate == "body"
cross_body = close < yL
cross_body_confirmed = close < yL and close[1] < yL
cross_wick = low < yL
remove_by_mitigation = is_body ? (allow_rejection ?
cross_body_confirmed : cross_body) : cross_wick
// Alerts
alertcondition(direction[1] > direction, title="Downtrend to Uptrend")
alertcondition(direction[1] < direction, title="Uptrend to Downtrend")
alertcondition(direction[1] != direction, title="Universal Trend Change")
alertcondition(bullishRetracement, title="Bullish Retracement Entries")
alertcondition(bearishRetracement, title="Bearish Retracement Entries")
alertcondition(highVolumeThreshold and direction < 0, title="Uptrend Volume TP")
alertcondition(highVolumeThreshold and direction >= 0, title="Downtrend Volume TP")