[Elite Algo Modded]// ALERT READY ON TELEGRAM ==> t.me
//@version=5
indicator(" ", overlay=true, max_lines_count=500, max_labels_count=500, max_boxes_count=350)
// FUNCTIONS
// Close to Close Volatility
f_coc(x, period, sqrtAnnual) =>
mean = ta.sma(x, period)
s = array.new_float(0)
for i = 0 to period - 1 by 1
array.push(s, math.pow(x - mean, 2))
sqrtAnnual * math.sqrt(array.sum(s) / (period - 1))
//
// Parkinson Volatility
f_park(period, sqrtAnnual) =>
var LOG2 = math.log(2)
powLogHighLow = math.pow(math.log(high / low), 2)
sqrtAnnual * math.sqrt(1.0 / period * math.sum(1.0 / (4.0 * LOG2) * powLogHighLow, period))
// Garman Klass Volatility
f_gk(period, sqrtAnnual) =>
var LOG2 = math.log(2)
var SQRT_1_PERIOD = math.sqrt(1 / period)
powLogHighLow = math.pow(math.log(high / low), 2)
powLogCloseOpen = math.pow(math.log(close / open), 2)
tmp = 0.5 * powLogHighLow - (2.0 * LOG2 - 1.0) * powLogCloseOpen
sqrtAnnual * math.sqrt(math.sum(tmp, period)) * SQRT_1_PERIOD
// Rogers Satchell Volatility
f_rsv(period, sqrtAnnual) =>
tmp = math.log(high / close) * math.log(high / open) + math.log(low / close) * math.log(low / open)
sqrtAnnual * math.sqrt(math.sum(tmp, period) / period)
// Garman Klass Yang Zhang Extension Volatility
f_gkyz(period, sqrtAnnual) =>
var LOG2 = math.log(2)
var SQRT_1_PERIOD = math.sqrt(1 / period)
powLogHighLow = math.pow(math.log(high / low), 2)
powLogCloseOpen = math.pow(math.log(close / open), 2)
lastClose = nz(close , close)
powLogOpenClose1 = math.pow(math.log(open / lastClose), 2)
tmp = powLogOpenClose1 + 0.5 * powLogHighLow - (2.0 * LOG2 - 1.0) * powLogCloseOpen
sqrtAnnual * math.sqrt(math.sum(tmp, period)) * SQRT_1_PERIOD
// Yang Zhang Volatility
f_yz(a, period, sqrtAnnual) =>
o = math.log(open) - math.log(nz(close , close))
u = math.log(high) - math.log(open)
d = math.log(low) - math.log(open)
c = math.log(close) - math.log(open)
nMinusOne = period - 1
avgo = ta.sma(o, period)
avgc = ta.sma(c, period)
so = array.new_float(0)
sc = array.new_float(0)
for i = 0 to period - 1 by 1
array.push(so, math.pow(o - avgo, 2))
array.push(sc, math.pow(c - avgc, 2))
sumo = array.sum(so)
sumc = array.sum(sc)
Vo = sumo / nMinusOne
Vc = sumc / nMinusOne
Vrs = math.sum(u * (u - c) + d * (d - c), period) / period
k = (a - 1.0) / (a + (period + 1.0) / nMinusOne)
sqrtAnnual * math.sqrt(Vo + k * Vc + (1.0 - k) * Vrs)
// Exponentially Weighted Volatility
f_ewma(source, period, sqrtAnnual) =>
var lambda = (period - 1) / (period + 1)
squared = math.pow(source, 2)
float v = na
v := lambda * nz(v , squared) + (1.0 - lambda) * squared
sqrtAnnual * math.sqrt(v)
// Mean Absolute Deviation (Adjusted)
f_mad(source, period, sqrtAnnual) =>
var SQRT_HALF_PI = math.sqrt(math.asin(1))
mean = ta.sma(source, period)
S = array.new_float(0)
for i = 0 to period - 1 by 1
array.push(S, math.abs(source - mean))
sumS = array.sum(S)
sqrtAnnual * (sumS / period) * SQRT_HALF_PI
// Median Absolute Deviation
f_mead(source, period, sqrtAnnual) =>
median = ta.percentile_nearest_rank(source, period, 50)
E = 0.0
for i = 0 to period - 1 by 1
E += math.abs(source - median)
E
sqrtAnnual * math.sqrt(2) * (E / period)
//Rescale Function
f_rescale(_src, _size) =>
math.max(0, math.min(_size, int(_src / 100 * _size)))
// label Panel Function
_label(T, color_PnL) =>
label PnL_Label = na
label.delete(PnL_Label )
PnL_Label := label.new(time, 0, text=T, color=color_PnL, textcolor=color.white, size=size.normal, style=label.style_label_left, xloc=xloc.bar_time, textalign=text.align_left)
label.set_x(PnL_Label, label.get_x(PnL_Label) + math.round(ta.change(time) * 3))
// Round Function
Round(src, digits) =>
p = math.pow(10, digits)
math.round(math.abs(src) * p) / p * math.sign(src)
//Options for Inputs
ON = 'On'
OFF = 'Off'
CTC = 'Close to Close'
PKS = 'Parkinson'
GK = 'Garman Klass'
RS = 'Rogers Satchell'
GKYZ = 'Garman Klass Yang Zhang Extension'
YZ = 'Yang Zhang'
EWMA = 'EWMA'
MAD = 'Mean Absolute Deviation'
MAAD = 'Median Absolute Deviation'
L = 'Line'
SL = 'StepLine'
Ar = 'Area'
CL = 'Columns'
// Settings
H = EWMA
period = 10
Annual = 365
a = 1.34
Plen = 365
Pco = ON
sma = ON
malen = 55
bsg = OFF
stl = CL
lT = 3
i_invert = OFF
bg = OFF
sp = OFF
// bgcolor(bg ? color.new(#000000, 20) : na, title='Dark Background', transp=90)
var sqrtAnnual = math.sqrt(Annual) * 100
logr = math.log(close / close )
// Historical Volatiity Models
Hv = if H == CTC
f_coc(logr, period, sqrtAnnual)
else if H == PKS
f_park(period, sqrtAnnual)
else if H == RS
f_rsv(period, sqrtAnnual)
else if H == GK
f_gk(period, sqrtAnnual)
else if H == GKYZ
f_gkyz(period, sqrtAnnual)
else if H == EWMA
f_ewma(logr, period, sqrtAnnual)
else if H == YZ
f_yz(a, period, sqrtAnnual)
else if H == MAD
f_mad(logr, period, sqrtAnnual)
else
// H == "Median Absolute Deviation"
f_mead(logr, period, sqrtAnnual)
pstyle = stl == L ? plot.style_linebr : stl == SL ? plot.style_stepline : stl == Ar ? plot.style_area : stl == CL ? plot.style_columns : plot.style_line
//Hv Stats
avgHV = ta.sma(Hv, malen)
HVP = ta.percentrank(Hv, Plen)
NearZero = HVP < 1.5 ? 1 : 0
HV50 = ta.percentile_nearest_rank(Hv, Plen, 50)
// // Text Functions
// texthv() =>
// ' HV: ' + str.tostring(Round(Hv, 2))
// textphv() =>
// 'HV 50áµ—Ê° Percentile: ' + str.tostring(Round(HV50, 2))
// texthvp() =>
// 'HV Percentile: ' + str.tostring(Round(HVP, 2)) + 'áµ—Ê°'
// // Coloring
// var c_ = array.new_color(na)
// if barstate.isfirst
// array.push(c_, #0effff)
// array.push(c_, #00fdf6)
// array.push(c_, #00fbee)
// array.push(c_, #00f9e4)
// array.push(c_, #00f6db)
// array.push(c_, #00f4d1)
// array.push(c_, #13f1c6)
// array.push(c_, #24efbc)
// array.push(c_, #31ecb1)
// array.push(c_, #3ce9a6)
// array.push(c_, #47e69b)
// array.push(c_, #51e390)
// array.push(c_, #5adf85)
// array.push(c_, #62dc7a)
// array.push(c_, #6ad96e)
// array.push(c_, #72d563)
// array.push(c_, #7ad157)
// array.push(c_, #81cd4b)
// array.push(c_, #88ca3f)
// array.push(c_, #8fc532)
// array.push(c_, #96c123)
// array.push(c_, #9cbd0e)
// array.push(c_, #a3b800)
// array.push(c_, #a9b300)
// array.push(c_, #b0ae00)
// array.push(c_, #b6a900)
// array.push(c_, #bca300)
// array.push(c_, #c29e00)
// array.push(c_, #c29e00)
// array.push(c_, #c89800)
// array.push(c_, #ce9100)
// array.push(c_, #d48b00)
// array.push(c_, #da8400)
// array.push(c_, #df7c00)
// array.push(c_, #e57400)
// array.push(c_, #ea6c00)
// array.push(c_, #ef6200)
// array.push(c_, #f35800)
// array.push(c_, #f74c00)
// array.push(c_, #fb3e00)
// array.push(c_, #ff2d00)
// if i_invert
// array.reverse(c_)
// var sizeOf = array.size(c_) - 1
// colorHV = Pco ? array.get(c_, f_rescale(HVP, sizeOf)) : color.aqua
// Plots
// plot(Hv, 'HV', color=colorHV, linewidth=lT, style=plot.style_line)
// plot(sma ? avgHV : na, 'sma', color=color.new(#FFFFFF, 25), linewidth=2)
//bgcolor(Hv > avgHV ? color.lime : na)
// if sp
// _label(H + texthv() + ' ' + textphv() + ' ' + texthvp() + ' ', #000000c0)
// col2 = HVP >= 1 ? color.yellow : HVP <= 1 and HVP >= 0.5 ? color.orange : HVP <= 0.5 ? #8D0000 : color.silver
// // bgcolor(bsg and NearZero ? col2 : na, transp=50)
//Custrom MAS
maa = avgHV / 100 * 140
mab = avgHV / 100 * 180
mac = avgHV / 100 * 240
mad = avgHV / 100 * 60
mae = avgHV / 100 * 20
// Auto Sensivity Volatility Band Settings
float volatility = 0.0
if Hv < maa and Hv > avgHV // ilk band ust
volatility := 3.15
else if Hv < mab and Hv > maa // ikinci band ust
volatility := 3.5
else if Hv < mac and Hv > mab // ucuncu band ust
volatility := 3.6
else if Hv > mac // volatilite en ust degerde
volatility := 4
else if Hv < maa and Hv > mad // altdaki ilk band
volatility := 3
else if Hv < mad and Hv > mae // altdaki ikinci band
volatility := 2.85
else if Hv < mae // volatilite butun bandlarin anltinda
volatility := 3
//plot(volatility,color = color.red)
// plot(maa, 'maa', color=color.new(color.aqua, 25))
// plot(mab, 'mab', color=color.new(color.aqua, 25))
// plot(mac, 'mac', color=color.new(color.aqua, 25))
// plot(mad, 'mad', color=color.new(color.aqua, 25))
// plot(mae, 'mae', color=color.new(color.aqua, 25))
//-------------- Elite Algo v22 | elitesignals.com -----------------//
// Get user input
enableDashboard = input(true, "Enable Dashboard", group="DASHBOARD SETTINGS")
locationDashboard = input.string("Middle right", "Location", , group="DASHBOARD SETTINGS")
sizeDashboard = input.string("Tiny", "Size", , group="DASHBOARD SETTINGS")
colorBackground = input(#2A2E39, "Bg color", group="DASHBOARD SETTINGS")
colorFrame = input(#2A2E39, "Frame color", group="DASHBOARD SETTINGS")
colorBorder = input(#363A45, "Border color", group="DASHBOARD SETTINGS")
showSignals = input(true, "Show signals", group="BUY AND SELL SIGNALS SETTINGS")
strategy = input.string("Normal", "Strategy", , group="BUY AND SELL SIGNALS SETTINGS")
sensitivity11 = input.float(defval=1.8, title="Sensitivity", minval=1, maxval=20, group = 'Signals')
sensitivity = sensitivity11
auto_button = input.bool(defval = true , title = "Auto Sensitivity", group = 'Signals')
consSignalsFilter = input(false, "Consolidation signals filter", group="BUY AND SELL SIGNALS SETTINGS")
smartSignalsOnly = input(false, "Smart signals only", group="BUY AND SELL SIGNALS SETTINGS")
candleColors = input(false, "Candle colors", group="BUY AND SELL SIGNALS SETTINGS")
momentumCandles = input(false, "Momentum candles", group="BUY AND SELL SIGNALS SETTINGS")
highVolSignals = input(false, "High volume signals only", group="BUY AND SELL SIGNALS SETTINGS")
enableTrailingSL = input(false, "Enable trailing stop-loss", group="RISK MANAGEMENT SETTINGS")
usePercSL = input(false, "% Trailing sl", inline="2", group="RISK MANAGEMENT SETTINGS")
percTrailingSL = input.float(1, "", 0, step=0.1, inline="2", group="RISK MANAGEMENT SETTINGS")
enableSwings = input(false, "Enable Swing High's & Swing's Low's", inline="3", group="RISK MANAGEMENT SETTINGS")
periodSwings = input.int(10, "", 2, inline="3", group="RISK MANAGEMENT SETTINGS")
enableTpSlAreas = input(false, "Enable take profit/stop-loss areas", group="RISK MANAGEMENT SETTINGS")
useTP1 = input(true, "", inline="4", group="RISK MANAGEMENT SETTINGS")
multTP1 = input.float(1, "TP 1", 0, inline="4", group="RISK MANAGEMENT SETTINGS")
useTP2 = input(true, "", inline="5", group="RISK MANAGEMENT SETTINGS")
multTP2 = input.float(2, "TP 2", 0, inline="5", group="RISK MANAGEMENT SETTINGS")
useTP3 = input(true, "", inline="6", group="RISK MANAGEMENT SETTINGS")
multTP3 = input.float(3, "TP 3", 0, inline="6", group="RISK MANAGEMENT SETTINGS")
tpLabels = input(true, "Take profit labels", group="RISK MANAGEMENT SETTINGS")
showTrendCloud = input(true, "Show Trend cloud", group="TREND CLOUD SETTINGS")
periodTrendCloud = input.string("New", "Trend cloud period", , group="TREND CLOUD SETTINGS")
signalsTrendCloud = input(false, "Trend only signals", group="TREND CLOUD SETTINGS")
fastTrendCloud = input(false, "Fast trend cloud", group="TREND CLOUD SETTINGS")
fastTrendCloudLen = input.int(55, "Fast trend cloud", 2, group="TREND CLOUD SETTINGS")
enableAutoTrend = input(false, "Enable Auto Trendlines", group="AUTO TRENDLINES SETTINGS")
srcTrendChannel = input(close, "Trend channel source", group="AUTO TRENDLINES SETTINGS")
lenTrendChannel = input.int(200, "Trend channel loopback", 2, group="AUTO TRENDLINES SETTINGS")
enableSR = input(false, "Enable support and resistance", group="AUTO SUPPORT AND RESISTANCE SETTINGS")
lineSrStyle = input.string("Dashed", "Line Style", , group="AUTO SUPPORT AND RESISTANCE SETTINGS")
lineSrWidth = input.int(2, "Line Width", 1, 4, group="AUTO SUPPORT AND RESISTANCE SETTINGS")
showCons = input(false, "Consolidation Zones", group="CONSOLIDATION ZONES")
lbPeriod = input.int(10, "Loopback Period", 2, 50, group="CONSOLIDATION ZONES")
lenCons = input.int(5, "Min Consolidation Length", 2, 20, group="CONSOLIDATION ZONES")
paintCons = input(true, "Paint Consolidation Area", group="CONSOLIDATION ZONES")
colorZone = input(color.new(color.blue, 70), "Zone Color", group="CONSOLIDATION ZONES")
box_ob = input.bool(false, "Toggle Order Block", group="ORDER BLOCK")
box_hide_gray = input.bool(false, "Hide gray boxes", group="ORDER BLOCK")
bos_type = input.string("High and Low", "MSB trigger", , group="ORDER BLOCK")
box_sv = input.bool(true, "Plot demand boxes", group="ORDER BLOCK")
box_test_delay = input.int(3, "Delay to count test of demand box", 1, group="ORDER BLOCK")
box_fill_delay = input.int(3, "Delay to count fill of demand box", 1, group="ORDER BLOCK")
box_test_sv = input.bool(true, "Dim tested demand boxes", group="ORDER BLOCK")
box_stop_sv = input.bool(true, "Stop plotting filled demand boxes", group="ORDER BLOCK")
eliteVP = input(false, "Elite volume profile", group="ELITE VOLUME PROFILE")
colorBorderVP = input(color.new(color.black, 80), "Border color", group="ELITE VOLUME PROFILE")
colorBuyVP = input(#7F1623, "Buy volume", group="ELITE VOLUME PROFILE")
colorSellVP = input(#00DD00, "Sell volume", group="ELITE VOLUME PROFILE")
offset = input.int(2, "Offset", 2, 20, group="ELITE VOLUME PROFILE")
lookback = input.int(100, "Lookback", 14, 10000, group="ELITE VOLUME PROFILE")
levelNum = input.int(100, "Number of levels", 10, 1000, group="ELITE VOLUME PROFILE")
levelWidth = input.int(50, "Level width", 2, 100, group="ELITE VOLUME PROFILE")
if auto_button == false
sensitivity
else if auto_button == true
sensitivity := volatility
// Functions
f_chartTfInMinutes() =>
float _resInMinutes = timeframe.multiplier * (
timeframe.isseconds ? 1. / 60 :
timeframe.isminutes ? 1. :
timeframe.isdaily ? 60. * 24 :
timeframe.isweekly ? 60. * 24 * 7 :
timeframe.ismonthly ? 60. * 24 * 30.4375 : na)
atr(len) =>
tr = ta.tr
atr = 0.0
atr := nz(atr + (tr - atr ) / len, tr)
supertrend(src, factor, len) =>
atr = ta.atr(len)
upperBand = src + factor * atr
lowerBand = src - factor * atr
prevLowerBand = nz(lowerBand )
prevUpperBand = nz(upperBand )
lowerBand := lowerBand > prevLowerBand or close < prevLowerBand ? lowerBand : prevLowerBand
upperBand := upperBand < prevUpperBand or close > prevUpperBand ? upperBand : prevUpperBand
int direction = na
float superTrend = na
prevSuperTrend = superTrend
if prevSuperTrend == prevUpperBand
direction := close > upperBand ? 1 : -1
else
direction := close < lowerBand ? -1 : 1
superTrend := direction == 1 ? lowerBand : direction == -1 ? upperBand : na
dchannel(len)=>
hh = ta.highest(len)
ll = ta.lowest (len)
trend = 0
trend := close > hh ? 1 : close < ll ? -1 : nz(trend )
trendScalper(show, len1, len2, len3, colorBull, colorBear, colorBarBull, colorBarBear) =>
avgOC = math.avg(open, close)
ha_o = 0.0, ha_o := na(ha_o ) ? avgOC : (ha_o + ohlc4 ) / 2
ema1 = ta.ema(ha_o, len1), ema2 = ta.ema(ha_o, len2), ema3 = ta.ema(ha_o, len3)
ris1 = ema1 > ema1 , ris2 = ema2 > ema2 , ris3 = ema3 > ema3
fal1 = ema1 < ema1 , fal2 = ema2 < ema2 , fal3 = ema3 < ema3
colorEma1 = ris1 ? colorBull : fal1 ? colorBear : na, colorEma2 = ris2 ? colorBull : fal2 ? colorBear : na, colorEma3 = ris3 ? colorBull : fal3 ? colorBear : na
fillEma1 = avgOC > ema1 ? colorBull : avgOC < ema1 ? colorBear : na, fillEma2 = ema1 > ema2 ? colorBull : ema1 < ema2 ? colorBear : na, fillEma3 = ema2 > ema3 ? colorBull : ema2 < ema3 ? colorBear : na
colorBar = close < ema1 and close < ema2 ? colorBarBear : colorBarBull
candlesMom() =>
= ta.macd(close, 12, 26, 9)
(macd > 0 and macd > macd ) or (macd < 0 and macd < macd )
trailingSL(buy, sell, factor, len, usePerc, perc) =>
atr = atr(len)
upperBand = high + (usePerc ? high * (perc / 100) : factor * atr)
lowerBand = low - (usePerc ? low * (perc / 100) : factor * atr)
prevLowerBand = nz(lowerBand )
prevUpperBand = nz(upperBand )
lowerBand := lowerBand > prevLowerBand or buy ? lowerBand : prevLowerBand
upperBand := upperBand < prevUpperBand or sell ? upperBand : prevUpperBand
int direction = na
float stop = na
prevSuperTrend = stop
if prevSuperTrend == prevUpperBand
direction := buy ? 1 : -1
else
direction := sell ? -1 : 1
stop := direction == 1 ? lowerBand : direction == -1 ? upperBand : na
add_to_zz(zz, val, bi) =>
array.unshift(zz, bi)
array.unshift(zz, val)
if array.size(zz) > 12
array.pop(zz)
update_zz(zz, val, bi, dir) =>
if array.size(zz) == 0
add_to_zz(zz, val, bi)
else
if dir == 1 and val > array.get(zz, 0) or dir == -1 and val < array.get(zz, 0)
array.set(zz, 0, val)
array.set(zz, 1, bi)
0
float ph = ta.pivothigh(high, 10, 10)
float pl = ta.pivotlow (low , 10, 10)
LSRstyle = lineSrStyle == "Dashed" ? line.style_dashed : lineSrStyle == "Solid" ? line.style_solid : line.style_dotted
prdhighest = ta.highest(300)
prdlowest = ta.lowest (300)
cwidth = (prdhighest - prdlowest) * 10 / 100
var pivotvals = array.new_float(0)
if ph or pl
array.unshift(pivotvals, ph ? ph : pl)
if array.size(pivotvals) > 20
array.pop(pivotvals)
get_sr_vals(ind) =>
float lo = array.get(pivotvals, ind)
float hi = lo
int numpp = 0
for y = 0 to array.size(pivotvals) - 1 by 1
float cpp = array.get(pivotvals, y)
float wdth = cpp <= lo ? hi - cpp : cpp - lo
if wdth <= cwidth
lo := cpp <= lo ? cpp : lo
hi := cpp > lo ? cpp : hi
numpp += 1
numpp
var sr_up_level = array.new_float(0)
var sr_dn_level = array.new_float(0)
sr_strength = array.new_float(0)
find_loc(strength) =>
ret = array.size(sr_strength)
for i = ret > 0 ? array.size(sr_strength) - 1 : na to 0 by 1
if strength <= array.get(sr_strength, i)
break
ret := i
ret
ret
check_sr(hi, lo, strength) =>
ret = true
for i = 0 to array.size(sr_up_level) > 0 ? array.size(sr_up_level) - 1 : na by 1
if array.get(sr_up_level, i) >= lo and array.get(sr_up_level, i) <= hi or array.get(sr_dn_level, i) >= lo and array.get(sr_dn_level, i) <= hi
if strength >= array.get(sr_strength, i)
array.remove(sr_strength, i)
array.remove(sr_up_level, i)
array.remove(sr_dn_level, i)
ret
else
ret := false
ret
break
ret
// Get components
rsi = ta.rsi(close, 14)
vosc = ta.obv - ta.ema(ta.obv, 20)
bs = ta.ema(nz(math.abs((open - close) / (high - low) * 100)), 3)
ema = ta.ema(close, 200)
emaBull = close > ema
equal_tf(res) => str.tonumber(res) == f_chartTfInMinutes()
higher_tf(res) => str.tonumber(res) > f_chartTfInMinutes()
too_small_tf(res) => (timeframe.isweekly and res=="1") or (timeframe.ismonthly and str.tonumber(res) < 10)
securityNoRep(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()) : 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
TF1Bull = securityNoRep(syminfo.tickerid, "1" , emaBull)
TF3Bull = securityNoRep(syminfo.tickerid, "3" , emaBull)
TF5Bull = securityNoRep(syminfo.tickerid, "5" , emaBull)
TF10Bull = securityNoRep(syminfo.tickerid, "10" , emaBull)
TF15Bull = securityNoRep(syminfo.tickerid, "15" , emaBull)
TF30Bull = securityNoRep(syminfo.tickerid, "30" , emaBull)
TF60Bull = securityNoRep(syminfo.tickerid, "60" , emaBull)
TF120Bull = securityNoRep(syminfo.tickerid, "120" , emaBull)
TF240Bull = securityNoRep(syminfo.tickerid, "240" , emaBull)
TF720Bull = securityNoRep(syminfo.tickerid, "720" , emaBull)
TFDBull = securityNoRep(syminfo.tickerid, "1440", emaBull)
ema150 = ta.ema(close, 150)
ema250 = ta.ema(close, 250)
hma55 = ta.hma(close, 55 )
= ta.macd(close, 12, 26, 9)
supertrend = supertrend(ohlc4, sensitivity, 10)
maintrend = dchannel(30)
confBull = (ta.crossover (close, supertrend) or (ta.crossover (close, supertrend) and maintrend < 0)) and macd > 0 and macd > macd and ema150 > ema250 and hma55 > hma55 and maintrend > 0
confBear = (ta.crossunder(close, supertrend) or (ta.crossunder(close, supertrend) and maintrend > 0)) and macd < 0 and macd < macd and ema150 < ema250 and hma55 < hma55 and maintrend < 0
trendcloud = supertrend(ohlc4, periodTrendCloud == "Long term" ? 7 : 4, 10)
hma = fastTrendCloud ? ta.hma(close, fastTrendCloudLen) : na
none = close > 0
= ta.dmi(14, 14)
consFilter = adx > 20
smartFilter = ta.ema(close, 200)
volFilter = (ta.ema(volume, 25) - ta.ema(volume, 26)) / ta.ema(volume, 26) > 0
trendFilter = trendcloud
bull = (strategy == "Normal" ? ta.crossover (close, supertrend) : confBull and not confBull ) and strategy != "Trend scalper" and (smartSignalsOnly ? close > smartFilter : none) and (consSignalsFilter ? consFilter : none) and (highVolSignals ? volFilter : none) and (signalsTrendCloud ? (periodTrendCloud == "New" ? ema150 > ema250 : close > trendFilter) : none)
bear = (strategy == "Normal" ? ta.crossunder(close, supertrend) : confBear and not confBear ) and strategy != "Trend scalper" and (smartSignalsOnly ? close < smartFilter : none) and (consSignalsFilter ? consFilter : none) and (highVolSignals ? volFilter : none) and (signalsTrendCloud ? (periodTrendCloud == "New" ? ema150 < ema250 : close < trendFilter) : none)
countBull = ta.barssince(bull)
countBear = ta.barssince(bear)
trigger = nz(countBull, bar_index) < nz(countBear, bar_index) ? 1 : 0
= trendScalper(strategy == "Trend scalper" ? true : false, 5, 9, 21, color.green, color.red, #00DD00, #DD0000)
trailingStop = trailingSL(bull, bear, 2.2, 14, usePercSL, percTrailingSL)
float _ph = ta.highestbars(high, periodSwings) == 0 ? high : na
float _pl = ta.lowestbars (low, periodSwings) == 0 ? low : na
var _dir = 0, dir_ = _pl and na(_ph) ? -1 : _dir, _dir := _ph and na(_pl) ? 1 : dir_, dirChg = ta.change(_dir)
var zz = array.new_float(0), zzOld = array.copy(zz)
float zzLive = _ph or _pl ? (dirChg ? add_to_zz(zz, _dir == 1 ? _ph : _pl, bar_index) : update_zz(zz, _dir == 1 ? _ph : _pl, bar_index, _dir)) : na
aA = ta.wma(srcTrendChannel, lenTrendChannel), b = ta.sma(srcTrendChannel, lenTrendChannel)
A = 4 * b - 3 * aA, B = 3 * aA - 2 * b
m = (A - B) / (lenTrendChannel - 1)
d = 0., for i = 0 to lenTrendChannel - 1 by 1
l = B + m * i
d += math.pow(srcTrendChannel - l, 2)
rmse = math.sqrt(d / (lenTrendChannel - 1)) * 2
float hb_ = ta.highestbars(lbPeriod) == 0 ? high : na
float lb_ = ta.lowestbars (lbPeriod) == 0 ? low : na
var int dir = 0
float zz_ = na
float pp = na
var int consCnt = 0
var float condHi = na
var float condLo = na
float H_ = ta.highest(lenCons)
float L_ = ta.lowest (lenCons)
var line lineUp = na
var line lineDn = na
bool breakUp = false
bool breakDn = false
var float pvh1_price = array.new_float(1000, na)
var int pvh1_time = array.new_int (1000, na)
var float pvl1_price = array.new_float(1000, na)
var int pvl1_time = array.new_int (1000, na)
var float pvh2_price = array.new_float(1000, na)
var int pvh2_time = array.new_int (1000, na)
var float pvl2_price = array.new_float(1000, na)
var int pvl2_time = array.new_int (1000, na)
var float htcmrll_price = na
var int htcmrll_time = na
var float ltcmrhh_price = na
var int ltcmrhh_time = na
var box long_boxes = array.new_box()
var box short_boxes = array.new_box()
var float temp_pv_0 = na
var float temp_pv_1 = na
var float temp_pv_2 = na
bool pvh = high < high and high > high
bool pvl = low > low and low < low
int pv1_time = bar_index
float pv1_high = high
float pv1_low = low
float trigger_high = bos_type == "High and Low" ? high : math.max(open, close)
float trigger_low = bos_type == "High and Low" ? low : math.min(open, close)
rangeHigh = ta.highest(high, lookback)
rangeLow = ta.lowest(low, lookback)
rangeHeight = rangeHigh - rangeLow
histogramHeight = rangeHeight / levelNum
histogramLowList = array.new_float(levelNum, na)
histogramHighList = array.new_float(levelNum, na)
histogramBuyVolumeList = array.new_float(levelNum, 0.0)
histogramSellVolumeList = array.new_float(levelNum, 0.0)
var buyBars = array.new_box(365, na)
for i = 0 to 364
box.delete(array.get(buyBars, i))
var sellBars = array.new_box(365, na)
for i = 0 to 364
box.delete(array.get(sellBars, i))
// Colors
green = #00DD00, green50 = color.new(green, 50), green20 = color.new(green, 80)
red = #DD0000, red50 = color.new(red, 50), red20 = color.new(red, 80)
silver = #B2B5BE, silver50 = color.new(silver, 50), silver20 = color.new(silver, 80)
// Plots
atrBand = usePercSL ? (trigger ? low : high) * (percTrailingSL / 100) : ta.atr(14) * 2.2
atrStop = trigger ? low - atrBand : high + atrBand
lastTrade(src) => ta.valuewhen(bull or bear, src, 0)
entry_y = lastTrade(close)
stop_y = lastTrade(atrStop)
tp1_y = (entry_y-lastTrade(atrStop))*multTP1 + entry_y
tp2_y = (entry_y-lastTrade(atrStop))*multTP2 + entry_y
tp3_y = (entry_y-lastTrade(atrStop))*multTP3 + entry_y
labelTpSl(cond, y, txt, color) =>
label labelTpSl = enableTpSlAreas and cond ? label.new(bar_index + 1, y, txt, xloc.bar_index, yloc.price, color, label.style_label_left, color.white, size.normal) : na
label.delete(labelTpSl )
labelTpSl(none, entry_y, "Entry : " + str.tostring(math.round_to_mintick(entry_y)), color.orange)
labelTpSl(none, stop_y , "Stop loss : " + str.tostring(math.round_to_mintick(atrStop)), color.red)
labelTpSl(useTP1 and multTP1 != 0, tp1_y, "TP 1 : " + str.tostring(math.round_to_mintick(tp1_y)), color.green)
labelTpSl(useTP2 and multTP2 != 0, tp2_y, "TP 2 : " + str.tostring(math.round_to_mintick(tp2_y)), color.green)
labelTpSl(useTP3 and multTP3 != 0, tp3_y, "TP 3 : " + str.tostring(math.round_to_mintick(tp3_y)), color.green)
lineTpSl(cond, y, color, style) =>
line lineTpSl = enableTpSlAreas and cond ? line.new(bar_index - (trigger ? countBull : countBear), y, bar_index + 1, y, xloc.bar_index, extend.none, color, style) : na
line.delete(lineTpSl )
lineTpSl(none, entry_y, color.orange, line.style_dashed)
lineTpSl(none, stop_y , color.red , line.style_solid )
lineTpSl(useTP1 and multTP1 != 0, tp1_y, color.green, line.style_dotted)
lineTpSl(useTP2 and multTP2 != 0, tp2_y, color.green, line.style_dotted)
lineTpSl(useTP3 and multTP3 != 0, tp3_y, color.green, line.style_dotted)
var dashboard_loc = locationDashboard == "Top right" ? position.top_right : locationDashboard == "Top left" ? position.top_left : locationDashboard == "Middle right" ? position.middle_right : locationDashboard == "Middle left" ? position.middle_left : locationDashboard == "Bottom right" ? position.bottom_right : position.bottom_left
var dashboard_size = sizeDashboard == "Tiny" ? size.tiny : sizeDashboard == "Small" ? size.small : size.normal
var dashboard = table.new(dashboard_loc, 2, 20, colorBackground, colorFrame, 3, colorBorder, 3)
dashboard_cell(column, row, txt) => table.cell(dashboard, column, row, txt, 0, 0, color.white, text_size=dashboard_size)
dashboard_cell_bg(column, row, col) => table.cell_set_bgcolor(dashboard, column, row, col)
if barstate.islast and enableDashboard
dashboard_cell(0, 0 , "Current strategy")
dashboard_cell(0, 1 , "Current sensitivity")
dashboard_cell(0, 2 , "Current Position")
dashboard_cell(0, 3 , "Current trend")
dashboard_cell(0, 4 , "Trend strength")
dashboard_cell(0, 5 , "Volume")
dashboard_cell(0, 6 , "Volatility")
dashboard_cell(0, 7 , "Momentum")
dashboard_cell(0, 8 , "Timeframe trends📊"), table.merge_cells(dashboard, 0, 8, 1, 8)
dashboard_cell(0, 9 , "1 min")
dashboard_cell(0, 10, "3 min")
dashboard_cell(0, 11, "5 min")
dashboard_cell(0, 12, "10 min")
dashboard_cell(0, 13, "15 min")
dashboard_cell(0, 14, "30 min")
dashboard_cell(0, 15, "1 Hour")
dashboard_cell(0, 16, "2 Hour")
dashboard_cell(0, 17, "4 Hour")
dashboard_cell(0, 18, "12 Hour")
dashboard_cell(0, 19, "Daily")
dashboard_cell(1, 0 , strategy)
dashboard_cell(1, 1 , str.tostring(sensitivity))
dashboard_cell(1, 2 , strategy != "Trend scalper" ? (trigger ? "Buy" : "Sell") : ""), dashboard_cell_bg(1, 2, strategy != "Trend scalper" ? (trigger ? color.green : color.red) : colorBackground)
dashboard_cell(1, 3 , emaBull ? "Bullish" : "Bearish"), dashboard_cell_bg(1, 3, emaBull ? color.green : color.red)
dashboard_cell(1, 4 , str.tostring(bs, "0.0") + " %")
dashboard_cell(1, 5 , vosc > 0 ? "Bullish" : "Bearish"), dashboard_cell_bg(1, 5, vosc > 0 ? color.green : color.red)
dashboard_cell(1, 6 , adx > 20 ? "Trending 🚀" : "Ranging ⚠️"), dashboard_cell_bg(1, 6, adx > 20 ? color.green : color.orange)
dashboard_cell(1, 7 , rsi > 50 ? "Bullish" : "Bearish"), dashboard_cell_bg(1, 7, rsi > 50 ? color.green : color.red)
dashboard_cell(1, 9 , TF1Bull ? "Bullish" : "Bearish"), dashboard_cell_bg(1, 9 , TF1Bull ? color.green : color.red)
dashboard_cell(1, 10, TF3Bull ? "Bullish" : "Bearish"), dashboard_cell_bg(1, 10, TF3Bull ? color.green : color.red)
dashboard_cell(1, 11, TF5Bull ? "Bullish" : "Bearish"), dashboard_cell_bg(1, 11, TF5Bull ? color.green : color.red)
dashboard_cell(1, 12, TF10Bull ? "Bullish" : "Bearish"), dashboard_cell_bg(1, 12, TF10Bull ? color.green : color.red)
dashboard_cell(1, 13, TF15Bull ? "Bullish" : "Bearish"), dashboard_cell_bg(1, 13, TF15Bull ? color.green : color.red)
dashboard_cell(1, 14, TF30Bull ? "Bullish" : "Bearish"), dashboard_cell_bg(1, 14, TF30Bull ? color.green : color.red)
dashboard_cell(1, 15, TF60Bull ? "Bullish" : "Bearish"), dashboard_cell_bg(1, 15, TF60Bull ? color.green : color.red)
dashboard_cell(1, 16, TF120Bull ? "Bullish" : "Bearish"), dashboard_cell_bg(1, 16, TF120Bull ? color.green : color.red)
dashboard_cell(1, 17, TF240Bull ? "Bullish" : "Bearish"), dashboard_cell_bg(1, 17, TF240Bull ? color.green : color.red)
dashboard_cell(1, 18, TF720Bull ? "Bullish" : "Bearish"), dashboard_cell_bg(1, 18, TF720Bull ? color.green : color.red)
dashboard_cell(1, 19, TFDBull ? "Bullish" : "Bearish"), dashboard_cell_bg(1, 19, TFDBull ? color.green : color.red)
l(css, k) =>
line lr = enableAutoTrend ? line.new(bar_index - lenTrendChannel + 1, A + k, bar_index, B + k, extend=extend.right, color=css) : na
line.delete(lr )
l(color.blue, rmse), l(color.blue, 0), l(color.blue, -rmse)
//
//======================================
อินดิเคเตอร์และกลยุทธ์
Trend Filter (2-pole) [BigBeluga]Trend Filter (2-pole)
The Trend Filter (2-pole) is an advanced trend-following indicator based on a two-pole filter, which smooths out market noise while effectively highlighting trends and their strength. It incorporates color gradients and support/resistance dots to enhance trend visualization and decision-making for traders.
SP500:
🔵What is a Two-Pole Filter?
A two-pole filter is a digital signal processing technique widely used in electronics, control systems, and time series data analysis to smooth data and reduce noise.
//@function Two-pole filter
//@param src (series float) Source data (e.g., price)
//@param length (float) Length of the filter (higher value means smoother output)
//@param damping (float) Damping factor for the filter
//@returns (series float) Filtered value
method two_pole_filter(float src, int length, float damping) =>
// Calculate filter coefficients
float omega = 2.0 * math.pi / length
float alpha = damping * omega
float beta = math.pow(omega, 2)
// Initialize the filter variables
var float f1 = na
var float f2 = na
// Update the filter
f1 := nz(f1 ) + alpha * (src - nz(f1 ))
f2 := nz(f2 ) + beta * (f1 - nz(f2 ))
f2
It operates using two cascaded smoothing stages (poles), allowing for a more refined and responsive output compared to simple moving averages or other basic filters.
Two-pole filters are particularly valued for their ability to maintain smooth transitions while reducing lag, making them ideal for applications where precision and responsiveness are critical.
In trading, this filter helps detect trends by smoothing price data while preserving significant directional changes.
🔵Key Features of the Indicator:
Gradient-Colored Trend Filter Line: The main filter line dynamically changes color based on trend strength and direction:
- Green: Strong uptrend.
- Red: Strong downtrend.
- Yellow: Indicates a transition phase, signaling potential trend shifts.
Support and Resistance Dots with Signals:
- Dots are plotted below the filter line during uptrends and above it during downtrends.
- These dots represent consecutive rising or falling conditions of the filter line, which traders can set in the settings (e.g., the number of consecutive rises or falls required).
- The dots often act as dynamic support or resistance levels, providing valuable guidance during trends.
- Trend Signals:
Customizable Sensitivity: The indicator allows traders to adjust the filter length, damping factor, and the threshold for rising/falling conditions, enabling it to adapt to different trading styles and timeframes.
Bar Color Option: The indicator can optionally color bars to match the gradient of the filter line, enhancing visual clarity of trends directly on the price chart.
🔵How It Works:
The Trend Filter (2-pole) smooths price data using a two-pole filter, which reduces noise and highlights the underlying trend.
The gradient coloring of the filter line helps traders visually assess the strength and direction of trends.
Rising and falling conditions of the filter line are tracked, and dots are plotted when consecutive conditions meet the threshold, acting as potential support or resistance levels during trends.
The yellow transition color signals periods of indecision, helping traders anticipate potential reversals or consolidations.
🔵Use Cases:
Identify and follow strong uptrends and downtrends with gradient-based visual cues.
Use the yellow transition color to anticipate trend shifts or consolidation zones.
Leverage the plotted dots as dynamic support and resistance levels to refine entry and exit strategies.
Combine with other indicators for confirmation of trends and reversals.
This indicator is perfect for traders who want a visually intuitive and highly customizable tool to spot trends, gauge their strength, and make informed trading decisions.
PTS CloudThe Precise Trading EMA Cloud indicator is designed to improve your chart analysis by knowing simple trend direction with the use of the 9, 21, 50 EMA's. This special tool is particularly helpful for Day Traders & Swing Traders to easily see the trend direction & possible market shifts & support & resistance.
Bullish Trend = Blue Color wave
Bearish Trend = Red Color wave
[blackcat] L1 Small Wave Operation L1 Small Wave Operation
Overview
Are you looking to catch those elusive small waves in the market? Look no further than " L1 Small Wave Operation." This script offers a unique way to identify potential buying opportunities by analyzing price movements, volume changes, and trend directions. With customizable inputs and clear visual indicators, it’s designed to help traders spot favorable entry points with precision.
Features
Dynamic Signal Identification: Automatically detects two types of buy signals labeled "S" and "B."
Adaptable Parameters: Allows users to adjust low period, high period, EMA periods, SMA period, and various threshold values to fine-tune the strategy.
Visual Clarity: Plots K and D lines along with four distinct threshold levels for easy visualization.
Condition-Based Signals: Uses multiple conditions including volume increases, price actions, and crossover events to confirm signals.
How It Works
Calculate Percent Range: Determines where the current closing price lies within the recent low and high range.
Compute Moving Averages: Calculates Exponential Moving Average (EMA) and Simple Moving Average (SMA) of the percent range.
Define Conditions: Checks for bullish or strong bullish patterns, uptrends, and specific crossover events between K and D lines.
Generate Signals: Marks potential buying opportunities when predetermined conditions are met.
How To Use
Add this script to your TradingView chart.
Adjust the input parameters according to your preferred settings.
Monitor the plotted lines and look for "S" and "B" labels indicating buy signals.
Consider incorporating these signals into a broader trading strategy that includes risk management techniques.
What Makes It Special
Flexibility: Users can easily modify parameters to adapt the script to different markets or personal preferences.
Automation: Saves time by automatically scanning for trade setups based on predefined rules.
Comprehensive Analysis: Combines multiple factors like volume, price action, and moving averages to provide reliable signals.
Limitations
Past performance does not guarantee future results.
Market conditions can vary, affecting signal reliability.
Not suitable for very short-term trades without additional refinements.
Notes
Always perform backtesting on historical data before implementing live trades.
Understand the underlying logic of the script to avoid misinterpretation of signals.
Regularly review and adjust parameters based on changing market dynamics.
XAUUSD STRATGEY BUY AND SELL SIGNALSThis indicator primarily focuses on the concepts of Overbought and Oversold conditions, serving as a tool for short-term trading strategies. It provides modest yet reliable signals for traders. The fundamental operation of the indicator is outlined as follows:
For purchasing, the indicator monitors the asset for an Oversold condition as indicated by the Relative Strength Index (RSI). Subsequently, a buy signal is generated when the price chart crosses the lower boundary of the Envelope indicator from below to above.
Conversely, for selling, the indicator observes the asset for an Overbought condition according to the RSI. A sell signal is triggered when the price chart crosses the upper boundary of the Envelope indicator from above to below.
The underlying principle is the alignment between the price movement and the RSI readings.
The optimal settings I have developed are as follows:
- Time frame: 15 minutes
- Overbought threshold: 80
- Oversold threshold: 25
- RSI Length: 8
This approach can be applied across various financial instruments, but it is essential to establish clear profit and loss limits.
Advanced Swing High/Low Trend Lines# Advanced Swing High/Low Trend Lines Indicator
## Features:
### Dynamic Trend Lines
This indicator dynamically identifies swing highs and swing lows based on the user-defined `Swing Length`. It then connects these points to create trend lines that visualize the market's direction and key support/resistance levels.
### Customizable Settings
- **Swing Length**: Define the sensitivity for detecting swing highs and lows.
- **Points Required to Draw Trend**: Specify the minimum number of swing highs or lows required to establish a valid trend line.
- **Show Old Trends**: Toggle the visibility of previous trend lines to focus on the current market structure.
- **Line Appearance**: Customize the color, style (`solid`, `dotted`, `dashed`), and width of both trend and support lines.
### Trend Break Detection
- Automatically detects and highlights when the price breaks above a high trend line or below a low trend line.
- The broken trend line changes its color to indicate a trend break, helping traders quickly identify significant market shifts.
### Continuous Updates
- As new swing highs or lows are detected, the indicator updates existing trend lines or creates new ones, ensuring relevance in dynamic market conditions.
- Trend lines extend into the future, projecting potential areas of interest for traders.
## Benefits:
1. **Enhanced Market Visualization**:
- Provides a clear view of market trends, swing points, and potential reversal zones.
2. **Trend Reversal Alerts**:
- Identifies and visually emphasizes trend breaks, enabling proactive trading decisions.
3. **Fully Customizable**:
- Adjust settings to suit your trading style and strategy, ensuring compatibility with various markets and timeframes.
4. **Real-Time Adaptation**:
- Automatically adapts to changing market conditions, maintaining accuracy and relevance.
## Use Cases:
- **Trend Following**: Identify and trade in the direction of established trends.
- **Breakout Trading**: Spot trend breaks and capitalize on momentum shifts.
- **Support and Resistance Analysis**: Use trend lines to identify key levels where price may react.
This indicator is an essential tool for traders seeking to combine technical precision with visual clarity in their analysis.
Sood 2025// © AdibXmos
//@version=5
indicator('Sood Indicator V2 ', overlay=true, max_labels_count=500)
show_tp_sl = input.bool(true, 'Display TP & SL', group='Techical', tooltip='Display the exact TP & SL price levels for BUY & SELL signals.')
rrr = input.string('1:2', 'Risk to Reward Ratio', group='Techical', options= , tooltip='Set a risk to reward ratio (RRR).')
tp_sl_multi = input.float(1, 'TP & SL Multiplier', 1, group='Techical', tooltip='Multiplies both TP and SL by a chosen index. Higher - higher risk.')
tp_sl_prec = input.int(2, 'TP & SL Precision', 0, group='Techical')
candle_stability_index_param = 0.5
rsi_index_param = 70
candle_delta_length_param = 4
disable_repeating_signals_param = input.bool(true, 'Disable Repeating Signals', group='Techical', tooltip='Removes repeating signals. Useful for removing clusters of signals and general clarity.')
GREEN = color.rgb(29, 255, 40)
RED = color.rgb(255, 0, 0)
TRANSPARENT = color.rgb(0, 0, 0, 100)
label_size = input.string('huge', 'Label Size', options= , group='Cosmetic')
label_style = input.string('text bubble', 'Label Style', , group='Cosmetic')
buy_label_color = input(GREEN, 'BUY Label Color', inline='Highlight', group='Cosmetic')
sell_label_color = input(RED, 'SELL Label Color', inline='Highlight', group='Cosmetic')
label_text_color = input(color.white, 'Label Text Color', inline='Highlight', group='Cosmetic')
stable_candle = math.abs(close - open) / ta.tr > candle_stability_index_param
rsi = ta.rsi(close, 14)
atr = ta.atr(14)
bullish_engulfing = close < open and close > open and close > open
rsi_below = rsi < rsi_index_param
decrease_over = close < close
var last_signal = ''
var tp = 0.
var sl = 0.
bull_state = bullish_engulfing and stable_candle and rsi_below and decrease_over and barstate.isconfirmed
bull = bull_state and (disable_repeating_signals_param ? (last_signal != 'buy' ? true : na) : true)
bearish_engulfing = close > open and close < open and close < open
rsi_above = rsi > 100 - rsi_index_param
increase_over = close > close
bear_state = bearish_engulfing and stable_candle and rsi_above and increase_over and barstate.isconfirmed
bear = bear_state and (disable_repeating_signals_param ? (last_signal != 'sell' ? true : na) : true)
round_up(number, decimals) =>
factor = math.pow(10, decimals)
math.ceil(number * factor) / factor
if bull
last_signal := 'buy'
dist = atr * tp_sl_multi
tp_dist = rrr == '2:3' ? dist / 2 * 3 : rrr == '1:2' ? dist * 2 : rrr == '1:4' ? dist * 4 : dist
tp := round_up(close + tp_dist, tp_sl_prec)
sl := round_up(close - dist, tp_sl_prec)
if label_style == 'text bubble'
label.new(bar_index, low, 'BUY', color=buy_label_color, style=label.style_label_up, textcolor=label_text_color, size=label_size)
else if label_style == 'triangle'
label.new(bar_index, low, 'BUY', yloc=yloc.belowbar, color=buy_label_color, style=label.style_triangleup, textcolor=TRANSPARENT, size=label_size)
else if label_style == 'arrow'
label.new(bar_index, low, 'BUY', yloc=yloc.belowbar, color=buy_label_color, style=label.style_arrowup, textcolor=TRANSPARENT, size=label_size)
label.new(show_tp_sl ? bar_index : na, low, 'TP: ' + str.tostring(tp) + ' SL: ' + str.tostring(sl), yloc=yloc.price, color=color.gray, style=label.style_label_down, textcolor=label_text_color)
if bear
last_signal := 'sell'
dist = atr * tp_sl_multi
tp_dist = rrr == '2:3' ? dist / 2 * 3 : rrr == '1:2' ? dist * 2 : rrr == '1:4' ? dist * 4 : dist
tp := round_up(close - tp_dist, tp_sl_prec)
sl := round_up(close + dist, tp_sl_prec)
if label_style == 'text bubble'
label.new(bear ? bar_index : na, high, 'SELL', color=sell_label_color, style=label.style_label_down, textcolor=label_text_color, size=label_size)
else if label_style == 'triangle'
label.new(bear ? bar_index : na, high, 'SELL', yloc=yloc.abovebar, color=sell_label_color, style=label.style_triangledown, textcolor=TRANSPARENT, size=label_size)
else if label_style == 'arrow'
label.new(bear ? bar_index : na, high, 'SELL', yloc=yloc.abovebar, color=sell_label_color, style=label.style_arrowdown, textcolor=TRANSPARENT, size=label_size)
label.new(show_tp_sl ? bar_index : na, low, 'TP: ' + str.tostring(tp) + ' SL: ' + str.tostring(sl), yloc=yloc.price, color=color.gray, style=label.style_label_up, textcolor=label_text_color)
alertcondition(bull or bear, 'BUY & SELL Signals', 'New signal!')
alertcondition(bull, 'BUY Signals (Only)', 'New signal: BUY')
alertcondition(bear, 'SELL Signals (Only)', 'New signal: SELL')
Support and Resistance with Buy/Sell Signals**Support and Resistance with Buy/Sell Signals**
Support and resistance are key concepts in technical analysis used to identify price levels at which an asset tends to reverse or pause in its trend. These levels are pivotal for traders to anticipate potential entry (buy) or exit (sell) opportunities.
### **Support**
Support is a price level where a downward trend tends to pause or reverse due to an increase in buying interest. It acts as a "floor" for the price. Traders consider this level as an area to look for **buy signals**.
#### **Buy Signals near Support**:
1. **Bounce Confirmation**: When the price touches the support level and rebounds upward, confirming the strength of the support.
2. **Bullish Candlestick Patterns**: Patterns like hammers or engulfing candles forming at support levels suggest buying opportunities.
3. **Volume Increase**: A spike in trading volume at the support level often reinforces the likelihood of a reversal.
---
### **Resistance**
Resistance is a price level where an upward trend tends to pause or reverse due to an increase in selling pressure. It acts as a "ceiling" for the price. Traders consider this level as an area to look for **sell signals**.
#### **Sell Signals near Resistance**:
1. **Price Rejection**: When the price reaches the resistance level and fails to break above it, moving downward instead.
2. **Bearish Candlestick Patterns**: Patterns like shooting stars or bearish engulfing candles at resistance levels signal selling opportunities.
3. **Divergences**: If the price forms higher highs near resistance while an indicator (e.g., RSI) shows lower highs, it suggests weakening momentum.
---
### **Dynamic Indicators for Support and Resistance**
1. **Moving Averages**: Commonly used as dynamic support/resistance, especially the 50, 100, and 200-period moving averages.
2. **Fibonacci Retracements**: Highlight potential support and resistance levels based on mathematical ratios.
3. **Pivot Points**: Daily, weekly, or monthly pivot levels offer reliable zones for support and resistance.
---
### **Combining Buy/Sell Signals with Indicators**
To enhance accuracy, traders combine support and resistance levels with additional indicators such as:
- **RSI (Relative Strength Index)**: To confirm overbought (sell) or oversold (buy) conditions.
- **MACD (Moving Average Convergence Divergence)**: For momentum and trend reversals at key levels.
- **Volume Analysis**: To validate the strength of price movements near support or resistance.
By using support and resistance levels with these signals, traders can develop a structured approach to identifying high-probability trade setups.
흑트1 시그널(BW1 signal)
This indicator is inspired by 흑백트레이더 and generates buy/sell signals based on EMA and MACD with certain conditions. It includes the following features:
1. Base Long/Short Signal:
* Long Signal: The price must be above the 200 EMA, and a MACD Golden Cross occurs below the zero line.
* Short Signal: The price must be below the 200 EMA, and a MACD Death Cross occurs above the zero line.
2. Filtering Features:
* Day Candle Bias: Filters signals based on the daily candle direction.
* Multi-Timeframe Validation: Supports higher timeframe EMA alignment checks (e.g., 15m, 30m, 1h, 4h) for trend confirmation.
* Stochastic RSI (StoRSI): Confirms entry points using overbought(def. 80)/oversold(def. 20) zones with a designated time frame(def. 30m).
* ATR Volatility Check: Ensures signals occur within acceptable ATR-based price divergence levels to manage risk in volatile conditions.
* Note that base filters are optimized with 5m timeframe.
3. Alerts:
* Configures custom alerts for buy/sell detection in real-time.
한국어 설명 (Korean Description)
이 지표는 흑백트레이더님의 EMA200과 MACD 골든 크로스를 활용한 흑트1 기법을 바탕으로 개발되었습니다. 주요 기능은 다음과 같습니다:
1. 기본 롱/숏 신호:
* 롱 신호: 가격이 200 EMA 위에 있어야 하며, MACD가 제로선 아래에서 골든 크로스가 발생해야 합니다.
* 숏 신호: 가격이 200 EMA 아래에 있어야 하며, MACD가 제로선 위에서 데드 크로스가 발생해야 합니다.
2. 필터링 기능:
* 일봉 필터: 일봉의 양봉/음봉 방향에 따라 신호를 필터링.
* 멀티 타임프레임 확인: 상위 타임프레임(15분, 30분, 1시간, 4시간)의 EMA 정배열/역배열 확인.
* 스토캐스틱 RSI (StoRSI): 지정된 타임프렘임(기본값 30m) 에서 과매수(기본값 80)/과매도(기본값 20) 구간에서 진입 지점을 확인.
* ATR 변동성 체크: ATR 기반 가격 괴리 수준 내에서 신호가 발생하도록 하여 높은 변동성에서 리스크를 줄임.
* 필터 기본 설정은 5분 시간프레임에 최적화되었습니다.
3. 알림:
* 매수/매도 신호 감지 시 실시간 알림 설정 가능.
Harmonic Heikin-Ashi TraderHarmonic Heikin-Ashi Trader
A comprehensive tool for traders who prefer a blend of trend analysis and technical signals. This script offers:
Heikin-Ashi Candles
Smoothens market noise to help identify trends with ease.
Candles change dynamically based on calculated Heikin-Ashi open, high, low, and close.
Custom Background Color
Customize the chart's background for improved clarity and focus.
EMAs with Buy/Sell Signals
Two customizable Exponential Moving Averages (EMAs).
Visual buy/sell signals when EMA crossover events occur.
MACD Integration
Detect momentum shifts with the classic MACD indicator.
Configurable fast, slow, and signal line parameters.
Generates buy/sell signals for actionable insights.
Customizable Display
Toggle signal visibility for a cleaner or more detailed chart.
Price line harmonized with the background color.
Harmonic Heikin-Ashi Trader is designed for all trading styles and enhances decision-making in dynamic markets.
MadTrendXOThis Pine Script™ code combines multiple trading strategies and indicators into a single script on TradingView. Here's a breakdown of what it does:
### Key Components:
1. **MadTrend Indicator**:
- This part calculates the **Median Absolute Deviation (MAD)** to measure volatility and uses it to create dynamic trend lines (upper and lower bounds) around the median price. Signals are generated when the price crosses these bounds, indicating potential trends (long or short).
**Inputs for MadTrend**:
- `Source`: Defines the price data (open, close, high, etc.) used for calculations.
- `Median Length`: The length used for calculating the median in MAD.
- `MAD Multiplier`: Multiplier for the MAD value, adjusting the sensitivity.
**Plots**:
- The script plots the median, upper and lower bounds, and colors the bars based on the trend direction (green for up and red for down).
2. **Trader XO MACRO**:
- The **Exponential Moving Average (EMA)** strategy is included, using two EMAs (fast and slow) to identify buy and sell signals based on crossovers.
**Inputs for Trader XO**:
- The script allows customization of fast and slow EMAs and the option to show both or just the consolidated EMA (average of the two).
**Alerts**:
- Alerts are set for bullish and bearish EMA crossovers.
3. **Stochastic RSI**:
- This part of the script uses the **Stochastic RSI** (Relative Strength Index) to generate signals when certain levels are crossed (overbought, oversold).
**Inputs for Stochastic RSI**:
- RSI Length, Stochastic Length, and smoothing factors for the K and D lines.
- There are customizable levels for overbought and oversold conditions.
**Alerts**:
- Alerts are triggered for crossovers of the K and D lines, as well as when the K line moves above the overbought level or below the oversold level.
### Alerts:
- The script has several alert conditions set up:
- For **long** and **short signals** based on MadTrend and EMA crossovers.
- For **risk-on** and **risk-off** conditions.
- For **Stochastic RSI crossovers** and overbought/oversold alerts.
### Backtesting:
- The code also contains backtest capabilities where performance can be evaluated over a defined date range. The script tracks metrics such as total equity, buy & hold performance, and trade statistics like the number of wins and losses.
### Visuals:
- The chart shows signals on the price with green and red bars, along with buy and sell markers.
- For backtesting, the equity line is plotted alongside the strategy's performance versus a buy-and-hold strategy.
Let me know if you'd like further clarification on any specific part or if you'd like to modify the script!
Total2 rokket bölgesi (Mayısa kadar)Nisan - mayısa kadar beklenilen rallide gelecek olan potansiyel düşüşlerin destek bulabileceğini düşündüğüm alan.
1D SMMA21 ve EMA35
buy sel StrategyGöstergenin Amacı
Bu gösterge:
Alım ve satım sinyalleri üretmek için MACD ve Bollinger Bantları kombinasyonunu kullanır.
Sinyalleri grafik üzerinde göstermek için oklar (yukarı ve aşağı) çizer.
Önemli sinyal durumlarında kullanıcıyı uyarmak için uyarı mekanizması içerir.
2. Kullanılan Teknik Göstergeler
A) MACD (Moving Average Convergence Divergence)
MACD, iki üstel hareketli ortalama arasındaki farkı ölçer:
Hızlı MACD Periyodu: Kısa dönem EMA (varsayılan: 12).
Yavaş MACD Periyodu: Uzun dönem EMA (varsayılan: 26).
Sinyal MACD Periyodu: MACD hattının yumuşatılmış versiyonu (varsayılan: 9).
Koşullar:
Alım Sinyali: MACD hattı, sinyal hattını yukarı yönde keser (ta.crossover fonksiyonu).
Satım Sinyali: MACD hattı, sinyal hattını aşağı yönde keser (ta.crossunder fonksiyonu).
B) Bollinger Bantları
Bollinger Bantları, fiyatın oynaklığını (volatilite) ölçmek için kullanılır:
Orta Bant: Fiyatın hareketli ortalamasıdır (varsayılan: 20 periyotluk SMA).
Üst Bant: Orta banda, standart sapmanın belirli bir katı eklenir (varsayılan: 2.0).
Alt Bant: Orta bandan, standart sapmanın belirli bir katı çıkarılır (varsayılan: 2.0).
3. Göstergenin İşlevselliği
A) Alım Koşulu (buy_condition):
pinescript
Kopyala
Düzenle
buy_condition = ta.crossover(macd_line, signal_line) and close > bb_lower
Al sinyali, şu iki şart sağlandığında tetiklenir:
MACD hattı, sinyal hattını yukarı yönde keserse (pozitif momentum).
Fiyat, Bollinger Bantları'nın alt bandının üzerine çıkarsa (fiyatın potansiyel dipten yukarı dönüşü).
B) Satım Koşulu (sell_condition):
pinescript
Kopyala
Düzenle
sell_condition = ta.crossunder(macd_line, signal_line) and close < bb_upper
Sat sinyali, şu iki şart sağlandığında tetiklenir:
MACD hattı, sinyal hattını aşağı yönde keserse (negatif momentum).
Fiyat, Bollinger Bantları'nın üst bandının altına düşerse (fiyatın potansiyel zirveden dönüşü).
4. Grafik Üzerindeki Gösterim
A) Bollinger Bantları:
Üst Bant (kırmızı çizgi).
Alt Bant (yeşil çizgi).
Orta Bant (turuncu çizgi).
B) Alım ve Satım Sinyalleri:
Oklar:
Yeşil ok (yukarı): Alım sinyali.
Kırmızı ok (aşağı): Satım sinyali.
C) Plotlama:
plotarrow fonksiyonu, yukarı ve aşağı sinyalleri oklarla grafik üzerinde gösterir:
pinescript
Kopyala
Düzenle
plotarrow(buy_condition ? 1 : sell_condition ? -1 : na, colorup=color.green, colordown=color.red, offset=-1)
5. Uyarılar
Uyarılar, sinyallerle kullanıcıyı bilgilendirir:
Alım Sinyali Uyarısı:
Mesaj: "MACD ve fiyat, Bollinger Bandı'nın alt sınırının üzerine çıktı."
Satım Sinyali Uyarısı:
Mesaj: "MACD ve fiyat, Bollinger Bandı'nın üst sınırının altına indi."
6. Kodun Avantajları
Kombinasyon Stratejisi: MACD ve Bollinger Bantları’nın birleşimi daha doğruluklu sinyaller üretebilir.
Basit ve Görsel: Grafik üzerinde sinyaller net bir şekilde belirtilmiştir.
Uyarı Mekanizması: Otomatik olarak işlem yapmak veya uyarı almak isteyen kullanıcılar için uygundur.
7. Dezavantajlar
Lag (Gecikme): Hem MACD hem de Bollinger Bantları gecikmeli göstergelerdir, bu da sinyalin gecikmesine neden olabilir.
Trend Filtreleme Eksikliği: Yanlış sinyalleri azaltmak için trend yönünü doğrulayan ek bir filtre (ör. EMA 200) faydalı olabilir.
8. Geliştirme Önerileri
Trend Filtresi: Yanlış sinyalleri azaltmak için EMA (200) gibi bir trend filtresi eklenebilir.
Fazla Sinyallerin Azaltılması: RSI gibi bir gösterge ile daha fazla doğrulama katmanı eklenebilir.
Zaman Aralığı Testi: Bu strateji en iyi 15 dakika, 1 saat veya 1 günlük zaman aralıklarında test edilerek optimize edilebilir.
Bu kod, daha sofistike stratejiler oluşturmak için güçlü bir başlangıç noktasıdır. Doğru parametre ayarlarıyla etkili bir ticaret aracı haline gelebilir.
IU Trailing Stop Loss MethodsThe 'IU Trailing Stop Loss Methods' it's a risk management tool which allows users to apply 12 trailing stop-loss (SL) methods for risk management of their trades and gives live alerts when the trailing Stop loss has hit. Below is a detailed explanation of each input and the working of the Script.
Main Inputs:
- bar_time: Specifies the date from which the trade begins and entry price will be the open of the first candle.
- entry_type: Choose between 'Long' or 'Short' positions.
- trailing_method: Select the trailing stop-loss method. Options include ATR, Parabolic SAR, Supertrend, Point/Pip based, Percentage, EMA, Highest/Lowest, Standard Deviation, and multiple target-based methods.
- exit_after_close: If checked, exits the trade only after the candle closes.
Optional Inputs:
ATR Settings:
- atr_Length: Length for the ATR calculation.
- atr_factor: ATR multiplier for SL calculation.
Parabolic SAR Settings:
- start, increment, maximum: Parameters for the Parabolic SAR indicator.
Supertrend Settings:
- supertrend_Length, supertrend_factor: Length and factor for the Supertrend indicator.
Point/Pip Based:
- point_base: Set trailing SL in points/pips.
Percentage Based:
- percentage_base: Set SL as a percentage of entry price.
EMA Settings:
- ema_Length: Length for EMA calculation.
Standard Deviation Settings:
- std_Length, std_factor: Length and factor for standard deviation calculation.
Highest/Lowest Settings:
- highest_lowest_Length: Length for the highest/lowest SL calculation.
Target-Based Inputs:
- ATR, Point, Percentage, and Standard Deviation based target SL settings with customizable lengths and multipliers.
Entry Logic:
- Trades initiate based on the entry_type selected and the specified bar_time.
- If Long is selected, a long trade is initiated when the conditions match, and vice versa for Short.
Trailing Stop-Loss (SL) Methods Explained:
The strategy dynamically adjusts stop-loss based on the chosen method. Each method has its calculation logic:
- ATR: Stop-loss calculated using ATR multiplied by a user-defined factor.
- Parabolic SAR: Uses the Parabolic SAR indicator for trailing stop-loss.
- Supertrend: Utilizes the Supertrend indicator as the stop-loss line.
- Point/Pip Based: Fixed point-based stop-loss.
- Percentage Based: SL set as a percentage of entry price.
- EMA: SL based on the Exponential Moving Average.
- Highest/Lowest: Uses the highest high or lowest low over a specified period.
- Standard Deviation: SL calculated using standard deviation.
Exit Conditions:
- If exit_after_close is enabled, the position will only close after the candle confirms the stop-loss hit.
- If exit_after_close is disabled, the strategy will close the trade immediately when the SL is breached.
Visualization:
The script plots the chosen trailing stop-loss method on the chart for easy visualization.
Target-Based Trailing SL Logic:
- When a position is opened, the strategy calculates the initial stop-loss and progressively adjusts it as the price moves favorably.
- Each SL adjustment is stored in an array for accurate tracking and visualization.
Alerts and Labels:
- When the Entry or trailing stop loss is hit this scripts draws a label and give alert to the user that trailing stop has been hit for the trade.
Note - on the historical data The Script will show nothing if the entry and the exit has happened on the same candle, because we don't know what was hit first SL or TP (basically how the candle was formed on the lower timeframe).
Summary:
This script offers flexible trailing stop-loss options for traders who want dynamic risk management in their strategies. By offering multiple methods like ATR, SAR, Supertrend, and EMA, it caters to various trading styles and risk preferences.
CVD Sinathis is delta cu and bolinger band
it has line and candel cvd mode
you can change bb setting too !!!!
Ultra Round NumbersThe Ultra Round Numbers indicator is designed to improve your market analysis by visually emphasizing significant price levels. These round numbers often act as psychological levels where traders and investors tend to make decisions. With this tool, you can easily spot these levels, adjust their precision, and customize their appearance.
Detailed Description
Ultra Round Numbers dynamically plots horizontal lines at key price intervals based on user-defined step sizes. These intervals represent round-numbered price levels, which can serve as critical support and resistance zones.
Step Configurations
The indicator features three customizable steps: Biggest, Middle, and Smallest.
Each step allows you to define:
The step size in price to determine the intervals for the lines.
The maximum number of lines above and below the current price.
The color, style, and thickness of the lines for better visualization.
The script efficiently handles the creation and deletion of lines to prevent clutter on the chart. It ensures only the relevant lines (from biggest step to lowest step) are displayed based on your settings and the current price movement.
This indicator is a powerful yet user-friendly indicator for identifying psychological price levels on your charts. With fully customizable steps, dynamic line management, and clean visuals, this tool empowers traders of all skill levels to make more informed trading decisions.
FGW | dobofulopThis indicator automatically detects recent swing highs and lows, then plots two Fibonacci-based retracement lines to highlight the “Golden Zone.” By default, it uses the 50% and 61.8% Fibonacci levels as potential support or resistance. The script can also fill the zone between these levels to visually emphasize possible reversal areas. Ideal for identifying key pullback zones in a trending market, the Fibonacci Golden Wave helps traders gauge where a correction might end and a trend may resume.
Volume profile [Signals] - By Leviathan [Mindyourbuisness]Market Sessions and Volume Profile with Sweep Signals - Based on Leviathan's Volume Profile
This indicator is an enhanced version of Leviathan's Volume Profile indicator, adding session-based value area analysis and sweep detection signals. It combines volume profile analysis with market structure concepts to identify potential reversal opportunities.
Features
- Session-based volume profiles (Daily, Weekly, Monthly, Quarterly, Yearly)
- Forex sessions support (Tokyo, London, New York)
- Value Area analysis with POC, VAH, and VAL levels
- Extended level visualization for the last completed session
- Sweep detection signals for key value area levels
Sweep Signals Explanation
The indicator detects two types of sweeps at VAH, VAL, and POC levels:
Bearish Sweeps (Red Triangle Down)
Conditions:
- Price makes a high above the level (VAH/VAL/POC)
- Closes below the level
- Closes below the previous candle's low
- Previous candle must be bullish
Trading Implication: Suggests a failed breakout and potential reversal to the downside. These sweeps often indicate stop-loss hunting above key levels followed by institutional selling.
Bullish Sweeps (Green Triangle Up)
Conditions:
- Price makes a low below the level (VAH/VAL/POC)
- Closes above the level
- Closes above the previous candle's high
- Previous candle must be bearish
Trading Implication: Suggests a failed breakdown and potential reversal to the upside. These sweeps often indicate stop-loss hunting below key levels followed by institutional buying.
Trading Guidelines
1. Use sweep signals in conjunction with the overall trend
2. Look for additional confirmation like:
- Volume surge during the sweep
- Price action patterns
- Support/resistance levels
3. Consider the session's volatility and time of day
4. More reliable signals often occur at VAH and VAL levels
5. POC sweeps might indicate stronger reversals due to their significance as fair value levels
Notes
- The indicator works best on higher timeframes (1H and above)
- Sweep signals are more reliable during active market hours
- Consider using multiple timeframe analysis for better confirmation
- Past performance is not indicative of future results
Credits: Original Volume Profile indicator by Leviathan
MA RSI MACD Signal SuiteThis Pine Script™ is designed for use in Trading View and generates trading signals based on moving average (MA) crossovers, RSI (Relative Strength Index) signals, and MACD (Moving Average Convergence Divergence) indicators. It provides visual markers on the chart and can be configured to suit various trading strategies.
1. Indicator Overview
The indicator includes signals for:
Moving Averages (MA): It tracks crossovers between different types of moving averages.
RSI: Signals based on RSI crossing certain levels or its signal line.
MACD: Buy and sell signals generated by MACD crossovers.
2. Inputs and Customization
Moving Averages (MAs):
You can customize up to 6 moving averages with different types, lengths, and colors.
MA Type: Choose from different types of moving averages:
SMA (Simple Moving Average)
EMA (Exponential Moving Average)
HMA (Hull Moving Average)
SMMA (RMA) (Smoothed Moving Average)
WMA (Weighted Moving Average)
VWMA (Volume Weighted Moving Average)
T3, DEMA, TEMA
Source: Select the price to base the MA on (e.g., close, open, high, low).
Length: Define the number of periods for each moving average.
Examples:
MA1: Exponential Moving Average (EMA) with a period of 9
MA2: Exponential Moving Average (EMA) with a period of 21
RSI Settings:
RSI is calculated based on a user-defined period and is used to identify potential overbought or oversold conditions.
RSI Length: Lookback period for RSI (default 14).
Overbought Level: Defines the overbought threshold for RSI (default 70).
Oversold Level: Defines the oversold threshold for RSI (default 30).
You can also adjust the smoothing for the RSI signal line and customize when to trigger buy and sell signals based on the RSI crossing these levels.
MACD Settings:
MACD is used for identifying changes in momentum and trends.
Fast Length: The period for the fast moving average (default 12).
Slow Length: The period for the slow moving average (default 26).
Signal Length: The period for the signal line (default 9).
Smoothing Method: Choose between SMA or EMA for both the MACD and the signal line.
3. Signal Logic
Moving Average (MA) Crossover Signals:
Crossover: A bullish signal is generated when a fast MA crosses above a slow MA.
Crossunder: A bearish signal is generated when a fast MA crosses below a slow MA.
The crossovers are plotted with distinct colors, and the chart will display markers for these crossover events.
RSI Signals:
Oversold Crossover: A bullish signal when RSI crosses over its signal line below the oversold level (30).
Overbought Crossunder: A bearish signal when RSI crosses under its signal line above the overbought level (70).
RSI signals are divided into:
Aggressive (Early) Entries: Signals when RSI is crossing the oversold/overbought levels.
Conservative Entries: Signals when RSI confirms a reversal after crossing these levels.
MACD Signals:
Buy Signal: Generated when the MACD line crosses above the signal line (bullish crossover).
Sell Signal: Generated when the MACD line crosses below the signal line (bearish crossunder).
Additionally, the MACD histogram is used to identify momentum shifts:
Rising to Falling Histogram: Alerts when the MACD histogram switches from rising to falling.
Falling to Rising Histogram: Alerts when the MACD histogram switches from falling to rising.
4. Visuals and Alerts
Plotting:
The script plots the following on the price chart:
Moving Averages (MA): The selected MAs are plotted as lines.
Buy/Sell Shapes: Triangular markers are displayed for buy and sell signals generated by RSI and MACD.
Crossover and Crossunder Markers: Crosses are shown when two MAs crossover or crossunder.
Alerts:
Alerts can be configured based on the following conditions:
RSI Signals: Alerts for oversold or overbought crossover and crossunder events.
MACD Signals: Alerts for MACD line crossovers or momentum shifts in the MACD histogram.
Alerts are triggered when specific conditions are met, such as:
RSI crosses over or under the oversold/overbought levels.
MACD crosses the signal line.
Changes in the MACD histogram.
5. Example Usage
1. Trend Reversal Setup:
Buy Signal: Use the RSI oversold crossover and MACD bullish crossover to identify potential entry points in a downtrend.
Sell Signal: Use the RSI overbought crossunder and MACD bearish crossunder to identify potential exit points or short entries in an uptrend.
2. Momentum Strategy:
Combine MACD and RSI signals to identify the strength of a trend. Use MACD histogram analysis and RSI levels for confirmation.
3. Moving Average Crossover Strategy:
Focus on specific MA crossovers, such as the 9-period EMA crossing above the 21-period EMA, for buy signals. When a longer-term MA (e.g., 50-period) crosses a shorter-term MA, it may indicate a strong trend change.
6. Alerts Conditions
The script includes several alert conditions, which can be triggered and customized based on the user’s preferences:
RSI Oversold Crossover: Alerts when RSI crosses over the signal line below the oversold level (30).
RSI Overbought Crossunder: Alerts when RSI crosses under the signal line above the overbought level (70).
MACD Buy/Sell Crossover: Alerts when the MACD line crosses the signal line for a buy or sell signal.
7. Conclusion
This script is highly customizable and can be adjusted to suit different trading strategies. By combining MAs, RSI, and MACD, traders can gain multiple perspectives on the market, enhancing their ability to identify potential buy and sell opportunities.
[blackat] L2 Bull and Bear Heaven LineOVERVIEW
The L2 Bull and Bear Heaven Line script is a custom indicator designed to visualize trend directions using Exponential Moving Average (EMA)-based lines and generate trade signals based on crossovers between those lines. It also incorporates an RSI-like feature to provide additional insight into overbought and oversold conditions.
FEATURES
Utilizes two EMAs: a longer-term "Heaven Line" (default 60 bars) and a shorter-term "Trading Line" (default 30 bars).
Generates buy/sell signals based on crossovers between the "Trading Line" and "Heaven Line".
Identifies potential turning points in the market, indicating shifts from bullish to bearish or vice versa.
Includes an "Operation Line" similar to RSI, aiding in detecting overbought/oversold levels.
HOW TO USE
Add the script to your TradingView chart.
Observe the crossovers between the "Trading Line" and "Heaven Line":
Buy signal when the "Trading Line" crosses above the "Heaven Line".
Sell signal when the "Trading Line" crosses below the "Heaven Line".
Monitor the "Operation Line" for additional confirmation:
Secondary sell signal when the "Operation Line" drops below 90% and there is downward price action.
Complementary buy signal when the "Operation Line" rises above 10% and there is upward price action.
Consider the identified trend direction and potential turning points to make informed trading decisions.
LIMITATIONS
The effectiveness of the signals depends on the chosen time frame and specific market conditions.
False signals may occur due to volatile price movements or rapid changes in market sentiment.
NOTES
This script combines traditional technical analysis tools like EMAs with an RSI-like approach to enhance decision-making processes. Users should backtest the strategy under various market scenarios before implementing it in live trading.
THANKS
Special thanks to the contributors whose work inspired parts of this script.
Static Gann High and Low Across All TimeframesStatic Gann High and Low Across All Timeframes
Static Gann High and Low Across All Timeframes
Static Gann High and Low Across All Timeframes
Static Gann High and Low Across All Timeframes
Static Gann High and Low Across All Timeframes
Static Gann High and Low Across All Timeframes
Static Gann High and Low Across All Timeframes
my all in one INDICATORTake on the role of one Daimyo, the clan leader, and use military engagements, economics and diplomacy to achieve the ultimate goal: re-unite Japan under his supreme command and become the new Shogun – the undisputed ruler of a pacified nation.
Trendilo ARTrendilo AR is a custom trading indicator designed to identify market trends using advanced techniques such as the Arnaud Legoux Moving Average (ALMA), volume confirmations, and dynamic volatility bands. This indicator provides a clear visualization of trends, including significant changes and custom alerts.
Review of Indicators Used
1. ALMA
Description:
ALMA is a moving average that applies an advanced filter to smooth price data, reducing noise and focusing on actual trends.
Usage in the Indicator:
Used to calculate the smoothed percentage price change and determine trend direction. Customizable parameters include:
- Length: Defines the number of bars to consider.
- Offset: Adjusts sensitivity toward recent prices.
- Sigma: Controls the degree of smoothing.
Advantages:
- Reduced lag in trend detection.
- Resistance to market noise.
2. ATR
Description:
ATR measures the market’s average volatility by considering the range between high and low prices over a given period.
Usage in the Indicator:
ATR is used to calculate "dynamic smoothing", adjusting the indicator’s sensitivity based on current market volatility.
Advantages:
- Adapts to high or low volatility conditions.
- Helps define dynamic support and resistance levels.
3. SMA
Description:
SMA calculates the average of prices or volume over a specific time period.
Usage in the Indicator:
Used to calculate the volume moving average (Volume SMA) to confirm whether the current volume supports the detected trend.
Advantages:
- Easy to understand and calculate.
- Provides volume-based trend confirmation.
4. RMS Bands
Description:
RMS Bands calculate the standard deviation of percentage price changes, creating upper and lower levels that act as overbought and oversold indicators.
Usage in the Indicator:
- Define the range within which the market is considered neutral.
- Crosses above or below the bands indicate trend changes.
Advantages:
- Visual identification of strong trends.
- Helps filter false signals.
Colors and Visuals Used in the Indicator
1. ALMA Line
Colors:
- Green: Indicates a confirmed uptrend (with sufficient volume).
- Red: Indicates a confirmed downtrend (with sufficient volume).
- Gray: Indicates a neutral phase or insufficient volume to confirm a trend.
2. RMS Bands
- Upper and Lower Lines:
- Purple (with transparency): These lines represent the RMS bands (upper and lower) and
adjust opacity based on trend strength.
- Stronger trends result in less transparency (more solid colors).
3. Highlighted Background (Strong Trends)
- Color:
- Light Green (transparent): Highlights a strong trend when the smoothed percentage change (ALMA) exceeds 1.5 times the RMS.
4. Horizontal Lines
- Baseline (0):
- Dark Gray: Serves as a central reference to identify the directionality of percentage changes.
- Additional Line (0.1):
- Blue: A customizable line to mark user-defined key levels.
5. Bar Colors
- Bar Colors:
- Green: When the price is in a confirmed uptrend.
- Red: When the price is in a confirmed downtrend.
- No color: When there is insufficient volume or no clear trend.
How to Use the Indicator
1. Initial Setup
1. Add the Indicator to Your Chart: Copy the code into the Pine Editor on TradingView and apply it to your chart.
2. Customize Parameters: Adjust values based on your trading strategy:
- Smoothing: Controls the level of smoothing for percentage changes.
- Lookback Length: Defines the observation period for calculations.
- Band Multiplier: Adjusts the width of RMS bands.
2. Signal Interpretation
1. Indicator Colors:
- Green: Confirmed uptrend.
- Red: Confirmed downtrend.
- Gray: No clear trend or insufficient volume.
2. RMS Bands:
- If the ALMA line (smoothed percentage change) crosses above the upper RMS band, it signals a potential uptrend.
- If it crosses below the lower RMS band, it signals a potential downtrend.
3. Volume Confirmation:
- The indicator's color activates only if the current volume exceeds the Volume SMA.
3. Alerts and Decisions
1. Trend Change Alerts:
- The indicator automatically triggers alerts when an uptrend or downtrend is detected.
- Configure these alerts to receive real-time notifications.
2. Strong Trend Signals:
- When the magnitude of the percentage change exceeds 1.5 times the RMS, the chart background highlights the strong trend.
4. Trading Strategies
1. Buy:
- Enter long positions when:
- The indicator turns green.
- Volume confirms the trend.
- Consider placing a stop-loss just below the lower RMS band.
2. Sell:
- Enter short positions when:
- The indicator turns red.
- Volume confirms the trend.
- Consider placing a stop-loss just above the upper RMS band.
3. Neutral:
- Avoid trading when the indicator is gray, as no clear trend or insufficient volume is present.
Disclaimer: As this is my first published indicator, please use it with caution. Feedback is highly appreciated to improve its performance.
Happy Trading!