Range PolarityDescription:
This indicator is a "Rate of Change" style oscillator designed to measure market dynamics through the lens of price ranges. By utilizing the true range in conjunction with high and low separation, this script produces two distinct oscillators: one for positive price shifts and one for negative price shifts.
Key Features:
High/Low Isolation:
The script calculates the relative movement of upwards and downwards price movements over a user-defined period. This separation provides a nuanced view of market behavior, offering two separate signals for comparison.
Dynamic Transform Smoothing:
A smoothing transform is applied to the signals, ensuring better outlier handling while maintaining sensitivity to price extremes. This makes the oscillator especially suited for identifying overbought and oversold conditions.
Zero-Centered:
The zero line acts as a "gravity point," where shifts away or toward zero indicate market momentum. Signal crosses or reversals from extreme zones can signal potential entry or exit points.
Outlier Identification:
Unlike traditional ATR based strategies (e.g., Keltner Channels ), this indicator isolates high and low ranges, creating a more granular view of market extremes. These measurements can help identify shifts from the outlying positions and reversal opportunities.
Visual Enhancements:
Multiple layers enhance the visual distinction of the positive and negative transformations. Horizontal lines at key thresholds provide visual reference for overbought, oversold, and equilibrium zones.
How to Use:
Primary signals are shifts from outlying positions or a positive/negative cross. An extreme reading itself can reveal an incoming reversal when calibrated with other indicators or compared with higher timeframes. Pairing "Range Polarity" with volume and momentum can create a comprehensive strategy.
In conclusion, be aware the base length controls the window for high/low contributions while the transform smoothing enhances the raw data through normalization within a tempered range to filter out insignificant fluctuations.
Merry Christmas to all and have a Happy New Year!
指標和策略
Volatility ProfileVolatility Profile allows for a fast comparison of the Average True Range from different time frames.
In addition to that, for each time frame it calculates the maximum and the minimum value over a set number of bars and divides the range between the maximum and the minimum in three parts to create three different volatility classes, which allows the user to quickly see how big the current value really is in relation to the past.
The settings allow the user to set the two extra time frames apart from the main time frame and the ATR length for each of the three ATR's, as well as the look back period to calculate the maximum and the minimum values.
This indicator is meant to help create a much more comprehensive view of the instrument's volatility.
My script//@version=5
indicator(title='Trade Bulls v1.2', shorttitle='Trade Bulls v1.2', overlay=true, max_boxes_count=20)
// Block Order
BO_on =input(defval=true, title='Enable Block Order', group='Block Order')
Senset = input.int(28, minval=1, title='Sensitivity', group='Block Order')
OB_mtype = input.string("Close", title="OB Mitigation Type", options= , group="Block Order")
colUpp = input.color(#50b090, title="Bullish OB Border", inline="1", group="Block Order")
colUpp_ob = input.color(color.new(#60C0A0, 85), title="BackGround", inline="1", group="Block Order")
colDnn = input.color(#4060b0, title="Bearish OB Border", inline="2", group="Block Order")
colDnn_ob = input.color(color.new(#5060D0, 85), title="BackGround", inline="2", group="Block Order")
bool BO_is = false
bool BO_is_Upp = false
boUpp = OB_mtype=="Close" ? close : low
boDnn = OB_mtype=="Close" ? close : high
var box Lbox = na
var box Sbox = na
var L_boxes = array.new_box()
var S_boxes = array.new_box()
var int jj = na
CrDt = (open - open ) / open * 100
Senset /= 100
if ta.crossover(CrDt, Senset)
BO_is_Upp := true
jj := bar_index
jj
if ta.crossunder(CrDt, -Senset)
BO_is := true
jj := bar_index
jj
if BO_is and jj - jj > 5 and BO_on
float Lgrn = 0
for i = 4 to 15 by 1
if close > open
Lgrn := i
break
Sbox := box.new(left=bar_index , top=high , bottom=low , right=bar_index , bgcolor=colDnn_ob, border_color=colDnn, extend=extend.right)
array.push(S_boxes, Sbox)
if BO_is_Upp and jj - jj > 5 and BO_on
float Lred = 0
for i = 4 to 15 by 1
if close < open
Lred := i
break
Lbox := box.new(left=bar_index , top=high , bottom=low , right=bar_index , bgcolor=colUpp_ob, border_color=colUpp, extend=extend.right)
array.push(L_boxes, Lbox)
if array.size(S_boxes) > 0
for i = array.size(S_boxes) - 1 to 0 by 1
sbox = array.get(S_boxes, i)
B_top = box.get_top(sbox)
B_bot = box.get_bottom(sbox)
if boDnn > B_top
array.remove(S_boxes, i)
box.delete(sbox)
if high > B_bot
alert('Price inside Bearish Block Order', alert.freq_once_per_bar)
if array.size(L_boxes) > 0
for i = array.size(L_boxes) - 1 to 0 by 1
sbox = array.get(L_boxes, i)
B_bot = box.get_bottom(sbox)
B_top = box.get_top(sbox)
if boUpp < B_bot
array.remove(L_boxes, i)
box.delete(sbox)
if low < B_top
alert('Price inside Bullish Block Order', alert.freq_once_per_bar)
// Sell/Buy/
BS_on =input(defval=true, title='Enable Buy/Sell', group='Buy/Sell')
LB_on =input(defval=true, title='Enable labels', group='Buy/Sell')
BS_type = input.string('Atr',options= ,inline='ln1', group='Buy/Sell')
BS_size = input(1.,'',inline='ln1', group='Buy/Sell')
BS_max = input(3,'Sequence Length', group='Buy/Sell')
var BS_fib = array.from(1,1)
var BS_dist = 0.
var BS_avg = 0.
var BS_fib_n = 1
var BS_os = 0
BS_src = close
BS_n = bar_index
if barstate.isfirst
for i = 1 to BS_max
array.push(BS_fib,array.get(BS_fib,i-1) + array.get(BS_fib,i))
if BS_type == 'Atr'
BS_dist := ta.atr(200)*BS_size*array.get(BS_fib,BS_fib_n)
else
BS_dist := BS_size*array.get(BS_fib,BS_fib_n)
BS_fib_n := math.abs(BS_src-BS_avg) > BS_dist ? BS_fib_n+1 : BS_fib_n
BS_avg := nz(BS_fib_n > BS_max+1 ? BS_src : BS_avg ,BS_src)
BS_fib_n := BS_fib_n > BS_max+1 ? 1 : BS_fib_n
BS_sell = BS_avg < BS_avg
BS_buy = BS_avg > BS_avg
BS_os := BS_buy ? 1 : BS_sell ? 0 : BS_os
BS_css = BS_os == 1 ? #00b010 : #fe1100
BS_stop = BS_avg != BS_avg ? na : BS_os == 0 ? BS_avg + BS_dist : BS_avg - BS_dist
BS_take = BS_avg != BS_avg ? na : BS_os == 1 ? BS_avg + BS_dist : BS_avg - BS_dist
p_0 = plot( BS_on? BS_src:na,color=na)
p_1 = plot( BS_on? BS_avg:na,color=na)
plot(BS_on ? BS_take:na,'Take',#00b010,1,plot.style_linebr)
plot(BS_on ? BS_stop:na,'Stop',#f01000,1,plot.style_linebr)
fill(p_0,p_1,color.new(BS_css,85))
plotshape(BS_on and BS_buy ? low : na,"Buy_Label",shape.labelup,location.absolute,#00b010,0,text="B",textcolor=color.white,size=size.tiny)
plotshape(BS_on and BS_sell ? high : na,"Sell_Label",shape.labeldown,location.absolute,#f01000,0,text="S",textcolor=color.white,size=size.tiny)
if BS_fib_n > BS_fib_n and BS_os == 1 and BS_src > BS_avg and BS_on and LB_on
label.new(BS_n,BS_src,str.tostring(array.get(BS_fib,BS_fib_n-1)) + ' ✅',yloc=yloc.abovebar,color=na,style=label.style_label_down,textcolor=color.gray,size=size.small)
else if BS_fib_n > BS_fib_n and BS_os == 1 and BS_src < BS_avg and BS_on and LB_on
label.new(BS_n,BS_src,str.tostring(array.get(BS_fib,BS_fib_n-1)) + ' ❌',yloc=yloc.belowbar,color=na,style=label.style_label_up,textcolor=color.gray,size=size.small)
if BS_fib_n > BS_fib_n and BS_os == 0 and BS_src < BS_avg and BS_on and LB_on
label.new(BS_n,BS_src,str.tostring(array.get(BS_fib,BS_fib_n-1)) + ' ✅',yloc=yloc.belowbar,color=na,style=label.style_label_up,textcolor=color.gray,size=size.small)
else if BS_fib_n > BS_fib_n and BS_os == 0 and BS_src > BS_avg and BS_on and LB_on
label.new(BS_n,BS_src,str.tostring(array.get(BS_fib,BS_fib_n-1)) + ' ❌',yloc=yloc.abovebar,color=na,style=label.style_label_down,textcolor=color.gray,size=size.small)
//Channel
CH_on =input(defval=true, title='Enable Channel', group='Channel')
CH_src = input(defval=close, title='Source', group='Channel')
CH_len = input.int(defval=100, title='Length', minval=10, group='Channel')
CH_divlen = input.float(defval=2., title='Deviation', minval=0.1, step=0.1, group='Channel')
CH_ext = input(defval=true, title='Extend Lines', group='Channel')
CH_shwfib = input(defval=false, title='Show Fibonacci Levels', group='Channel')
CH_shwbrk = input.bool(defval=true, title='Show Broken Channel', inline='brk', group='Channel')
CH_brkclr = input.color(defval=color.blue, title='', inline='brk', group='Channel')
CH_upclr = input.color(defval=color.lime, title='Up/Down Trend Colors', inline='trcols', group='Channel')
CH_dnclr = input.color(defval=color.red, title='', inline='trcols', group='Channel')
CH_lnwdt = input(defval=2, title='Line Width', group='Channel')
var CH_fiboln = array.new_float(0)
var CH_clrs = array.new_color(2)
if barstate.isfirst
array.push(CH_fiboln, 0.236)
array.push(CH_fiboln, 0.382)
array.push(CH_fiboln, 0.618)
array.push(CH_fiboln, 0.786)
array.unshift(CH_clrs, CH_upclr)
array.unshift(CH_clrs, CH_dnclr)
get_Channel(CH_src, CH_len) =>
md = math.sum(CH_src, CH_len) / CH_len
Ugl = ta.linreg(CH_src, CH_len, 0) - ta.linreg(CH_src, CH_len, 1)
ip = md - Ugl * math.floor(CH_len / 2) + (1 - CH_len % 2) / 2 * Ugl
lst = ip + Ugl * (CH_len - 1)
dev = 0.0
for x = 0 to CH_len - 1 by 1
dev += math.pow(CH_src - (Ugl * (CH_len - x) + ip), 2)
dev
dev := math.sqrt(dev / CH_len)
= get_Channel(CH_src, CH_len)
CH_break = Ugl > 0 and close < y2_ - dev * CH_divlen ? 0 : Ugl < 0 and close > y2_ + dev * CH_divlen ? 2 : -1
var CH_rlns = array.new_line(3)
var CH_fiblns = array.new_line(4)
if CH_on
for x = 0 to 2 by 1
if not CH_shwbrk or CH_break != x or nz(CH_break , -1) != -1
line.delete(array.get(CH_rlns, x))
else
line.set_color(array.get(CH_rlns, x), color=CH_brkclr)
line.set_width(array.get(CH_rlns, x), width=2)
line.set_style(array.get(CH_rlns, x), style=line.style_dotted)
line.set_extend(array.get(CH_rlns, x), extend=extend.none)
array.set(CH_rlns, x, line.new(x1=bar_index - (CH_len - 1), y1=y1_ + dev * CH_divlen * (x - 1), x2=bar_index, y2=y2_ + dev * CH_divlen * (x - 1), color=array.get(CH_clrs, math.round(math.max(math.sign(Ugl), 0))), style=x % 2 == 1 ? line.style_solid : line.style_dashed, width=CH_lnwdt, extend=CH_ext ? extend.right : extend.none))
if CH_shwfib
for x = 0 to 3 by 1
line.delete(array.get(CH_fiblns, x))
array.set(CH_fiblns, x, line.new(x1=bar_index - (CH_len - 1), y1=y1_ - dev * CH_divlen + dev * CH_divlen * 2 * array.get(CH_fiboln, x), x2=bar_index, y2=y2_ - dev * CH_divlen + dev * CH_divlen * 2 * array.get(CH_fiboln, x), color=array.get(CH_clrs, math.round(math.max(math.sign(Ugl), 0))), style=line.style_dotted, width=CH_lnwdt, extend=CH_ext ? extend.right : extend.none))
var label lbl1 = label.new(x=bar_index - (CH_len - 1), y=y1_, text='S', size=size.large)
lb_text = Ugl > 0 ? Ugl > Ugl ? '⇑' : '⇗' : Ugl < 0 ? Ugl < Ugl ? '⇓' : '⇘' : '⇒'
lb_style = Ugl > 0 ? Ugl > Ugl ? label.style_label_up : label.style_label_upper_right : Ugl < 0 ? Ugl < Ugl ? label.style_label_down : label.style_label_lower_right : label.style_label_right
if CH_on
label.set_style(lbl1, lb_style)
label.set_text(lbl1, lb_text)
label.set_x(lbl1, bar_index - (CH_len - 1))
label.set_y(lbl1, Ugl > 0 ? y1_ - dev * CH_divlen : Ugl < 0 ? y1_ + dev * CH_divlen : y1_)
label.set_color(lbl1, Ugl > 0 ? CH_upclr : Ugl < 0 ? CH_dnclr : color.blue)
DnTrend = math.sign(Ugl) != math.sign(Ugl ) and Ugl < 0
UpTrend = math.sign(Ugl) != math.sign(Ugl ) and Ugl > 0
alertcondition(CH_break, title='Channel Broken', message='Channel Broken')
alertcondition(DnTrend, title='Channel Down trend', message='Channel Down trend')
alertcondition(UpTrend, title='Channel Up trend', message='Channel Up trend')
// Support/Resistance
SR_on =input(defval=true, title='Enable Support/Resistance', group='Support/Resistance')
SR_lb = input(15, title='Left Bars ', group='Support/Resistance')
SR_rb = input(15, title='Right Bars', group='Support/Resistance')
SR_vol = input(20, title='Volume Threshold', group='Support/Resistance')
SR_high = fixnan(ta.pivothigh(SR_lb, SR_rb) )
SR_low = fixnan(ta.pivotlow(SR_lb, SR_rb) )
plot(SR_on?SR_low:na, color=ta.change(SR_low) ? na : #2030e0, linewidth=3, offset=-(SR_rb + 1), title='Support')
plot(SR_on?SR_high:na, color=ta.change(SR_high) ? na : #F00000, linewidth=3, offset=-(SR_rb + 1), title='Resistance')
SR_short = ta.ema(volume, 5)
SR_long = ta.ema(volume, 10)
SR_dlt = 100 * (SR_short - SR_long) / SR_long
alertcondition(ta.crossover(close, SR_high) and SR_dlt > SR_vol, title='Resistance Broken', message='Resistance Broken')
alertcondition(ta.crossunder(close, SR_low) and SR_dlt > SR_vol, title='Support Broken', message='Support Broken')
Trade Bulls//@version=5
indicator(title='Trade Bulls v1.2', shorttitle='Trade Bulls v1.2', overlay=true, max_boxes_count=20)
// Block Order
BO_on =input(defval=true, title='Enable Block Order', group='Block Order')
Senset = input.int(28, minval=1, title='Sensitivity', group='Block Order')
OB_mtype = input.string("Close", title="OB Mitigation Type", options= , group="Block Order")
colUpp = input.color(#50b090, title="Bullish OB Border", inline="1", group="Block Order")
colUpp_ob = input.color(color.new(#60C0A0, 85), title="BackGround", inline="1", group="Block Order")
colDnn = input.color(#4060b0, title="Bearish OB Border", inline="2", group="Block Order")
colDnn_ob = input.color(color.new(#5060D0, 85), title="BackGround", inline="2", group="Block Order")
bool BO_is = false
bool BO_is_Upp = false
boUpp = OB_mtype=="Close" ? close : low
boDnn = OB_mtype=="Close" ? close : high
var box Lbox = na
var box Sbox = na
var L_boxes = array.new_box()
var S_boxes = array.new_box()
var int jj = na
CrDt = (open - open ) / open * 100
Senset /= 100
if ta.crossover(CrDt, Senset)
BO_is_Upp := true
jj := bar_index
jj
if ta.crossunder(CrDt, -Senset)
BO_is := true
jj := bar_index
jj
if BO_is and jj - jj > 5 and BO_on
float Lgrn = 0
for i = 4 to 15 by 1
if close > open
Lgrn := i
break
Sbox := box.new(left=bar_index , top=high , bottom=low , right=bar_index , bgcolor=colDnn_ob, border_color=colDnn, extend=extend.right)
array.push(S_boxes, Sbox)
if BO_is_Upp and jj - jj > 5 and BO_on
float Lred = 0
for i = 4 to 15 by 1
if close < open
Lred := i
break
Lbox := box.new(left=bar_index , top=high , bottom=low , right=bar_index , bgcolor=colUpp_ob, border_color=colUpp, extend=extend.right)
array.push(L_boxes, Lbox)
if array.size(S_boxes) > 0
for i = array.size(S_boxes) - 1 to 0 by 1
sbox = array.get(S_boxes, i)
B_top = box.get_top(sbox)
B_bot = box.get_bottom(sbox)
if boDnn > B_top
array.remove(S_boxes, i)
box.delete(sbox)
if high > B_bot
alert('Price inside Bearish Block Order', alert.freq_once_per_bar)
if array.size(L_boxes) > 0
for i = array.size(L_boxes) - 1 to 0 by 1
sbox = array.get(L_boxes, i)
B_bot = box.get_bottom(sbox)
B_top = box.get_top(sbox)
if boUpp < B_bot
array.remove(L_boxes, i)
box.delete(sbox)
if low < B_top
alert('Price inside Bullish Block Order', alert.freq_once_per_bar)
// Sell/Buy/
BS_on =input(defval=true, title='Enable Buy/Sell', group='Buy/Sell')
LB_on =input(defval=true, title='Enable labels', group='Buy/Sell')
BS_type = input.string('Atr',options= ,inline='ln1', group='Buy/Sell')
BS_size = input(1.,'',inline='ln1', group='Buy/Sell')
BS_max = input(3,'Sequence Length', group='Buy/Sell')
var BS_fib = array.from(1,1)
var BS_dist = 0.
var BS_avg = 0.
var BS_fib_n = 1
var BS_os = 0
BS_src = close
BS_n = bar_index
if barstate.isfirst
for i = 1 to BS_max
array.push(BS_fib,array.get(BS_fib,i-1) + array.get(BS_fib,i))
if BS_type == 'Atr'
BS_dist := ta.atr(200)*BS_size*array.get(BS_fib,BS_fib_n)
else
BS_dist := BS_size*array.get(BS_fib,BS_fib_n)
BS_fib_n := math.abs(BS_src-BS_avg) > BS_dist ? BS_fib_n+1 : BS_fib_n
BS_avg := nz(BS_fib_n > BS_max+1 ? BS_src : BS_avg ,BS_src)
BS_fib_n := BS_fib_n > BS_max+1 ? 1 : BS_fib_n
BS_sell = BS_avg < BS_avg
BS_buy = BS_avg > BS_avg
BS_os := BS_buy ? 1 : BS_sell ? 0 : BS_os
BS_css = BS_os == 1 ? #00b010 : #fe1100
BS_stop = BS_avg != BS_avg ? na : BS_os == 0 ? BS_avg + BS_dist : BS_avg - BS_dist
BS_take = BS_avg != BS_avg ? na : BS_os == 1 ? BS_avg + BS_dist : BS_avg - BS_dist
p_0 = plot( BS_on? BS_src:na,color=na)
p_1 = plot( BS_on? BS_avg:na,color=na)
plot(BS_on ? BS_take:na,'Take',#00b010,1,plot.style_linebr)
plot(BS_on ? BS_stop:na,'Stop',#f01000,1,plot.style_linebr)
fill(p_0,p_1,color.new(BS_css,85))
plotshape(BS_on and BS_buy ? low : na,"Buy_Label",shape.labelup,location.absolute,#00b010,0,text="B",textcolor=color.white,size=size.tiny)
plotshape(BS_on and BS_sell ? high : na,"Sell_Label",shape.labeldown,location.absolute,#f01000,0,text="S",textcolor=color.white,size=size.tiny)
if BS_fib_n > BS_fib_n and BS_os == 1 and BS_src > BS_avg and BS_on and LB_on
label.new(BS_n,BS_src,str.tostring(array.get(BS_fib,BS_fib_n-1)) + ' ✅',yloc=yloc.abovebar,color=na,style=label.style_label_down,textcolor=color.gray,size=size.small)
else if BS_fib_n > BS_fib_n and BS_os == 1 and BS_src < BS_avg and BS_on and LB_on
label.new(BS_n,BS_src,str.tostring(array.get(BS_fib,BS_fib_n-1)) + ' ❌',yloc=yloc.belowbar,color=na,style=label.style_label_up,textcolor=color.gray,size=size.small)
if BS_fib_n > BS_fib_n and BS_os == 0 and BS_src < BS_avg and BS_on and LB_on
label.new(BS_n,BS_src,str.tostring(array.get(BS_fib,BS_fib_n-1)) + ' ✅',yloc=yloc.belowbar,color=na,style=label.style_label_up,textcolor=color.gray,size=size.small)
else if BS_fib_n > BS_fib_n and BS_os == 0 and BS_src > BS_avg and BS_on and LB_on
label.new(BS_n,BS_src,str.tostring(array.get(BS_fib,BS_fib_n-1)) + ' ❌',yloc=yloc.abovebar,color=na,style=label.style_label_down,textcolor=color.gray,size=size.small)
//Channel
CH_on =input(defval=true, title='Enable Channel', group='Channel')
CH_src = input(defval=close, title='Source', group='Channel')
CH_len = input.int(defval=100, title='Length', minval=10, group='Channel')
CH_divlen = input.float(defval=2., title='Deviation', minval=0.1, step=0.1, group='Channel')
CH_ext = input(defval=true, title='Extend Lines', group='Channel')
CH_shwfib = input(defval=false, title='Show Fibonacci Levels', group='Channel')
CH_shwbrk = input.bool(defval=true, title='Show Broken Channel', inline='brk', group='Channel')
CH_brkclr = input.color(defval=color.blue, title='', inline='brk', group='Channel')
CH_upclr = input.color(defval=color.lime, title='Up/Down Trend Colors', inline='trcols', group='Channel')
CH_dnclr = input.color(defval=color.red, title='', inline='trcols', group='Channel')
CH_lnwdt = input(defval=2, title='Line Width', group='Channel')
var CH_fiboln = array.new_float(0)
var CH_clrs = array.new_color(2)
if barstate.isfirst
array.push(CH_fiboln, 0.236)
array.push(CH_fiboln, 0.382)
array.push(CH_fiboln, 0.618)
array.push(CH_fiboln, 0.786)
array.unshift(CH_clrs, CH_upclr)
array.unshift(CH_clrs, CH_dnclr)
get_Channel(CH_src, CH_len) =>
md = math.sum(CH_src, CH_len) / CH_len
Ugl = ta.linreg(CH_src, CH_len, 0) - ta.linreg(CH_src, CH_len, 1)
ip = md - Ugl * math.floor(CH_len / 2) + (1 - CH_len % 2) / 2 * Ugl
lst = ip + Ugl * (CH_len - 1)
dev = 0.0
for x = 0 to CH_len - 1 by 1
dev += math.pow(CH_src - (Ugl * (CH_len - x) + ip), 2)
dev
dev := math.sqrt(dev / CH_len)
= get_Channel(CH_src, CH_len)
CH_break = Ugl > 0 and close < y2_ - dev * CH_divlen ? 0 : Ugl < 0 and close > y2_ + dev * CH_divlen ? 2 : -1
var CH_rlns = array.new_line(3)
var CH_fiblns = array.new_line(4)
if CH_on
for x = 0 to 2 by 1
if not CH_shwbrk or CH_break != x or nz(CH_break , -1) != -1
line.delete(array.get(CH_rlns, x))
else
line.set_color(array.get(CH_rlns, x), color=CH_brkclr)
line.set_width(array.get(CH_rlns, x), width=2)
line.set_style(array.get(CH_rlns, x), style=line.style_dotted)
line.set_extend(array.get(CH_rlns, x), extend=extend.none)
array.set(CH_rlns, x, line.new(x1=bar_index - (CH_len - 1), y1=y1_ + dev * CH_divlen * (x - 1), x2=bar_index, y2=y2_ + dev * CH_divlen * (x - 1), color=array.get(CH_clrs, math.round(math.max(math.sign(Ugl), 0))), style=x % 2 == 1 ? line.style_solid : line.style_dashed, width=CH_lnwdt, extend=CH_ext ? extend.right : extend.none))
if CH_shwfib
for x = 0 to 3 by 1
line.delete(array.get(CH_fiblns, x))
array.set(CH_fiblns, x, line.new(x1=bar_index - (CH_len - 1), y1=y1_ - dev * CH_divlen + dev * CH_divlen * 2 * array.get(CH_fiboln, x), x2=bar_index, y2=y2_ - dev * CH_divlen + dev * CH_divlen * 2 * array.get(CH_fiboln, x), color=array.get(CH_clrs, math.round(math.max(math.sign(Ugl), 0))), style=line.style_dotted, width=CH_lnwdt, extend=CH_ext ? extend.right : extend.none))
var label lbl1 = label.new(x=bar_index - (CH_len - 1), y=y1_, text='S', size=size.large)
lb_text = Ugl > 0 ? Ugl > Ugl ? '⇑' : '⇗' : Ugl < 0 ? Ugl < Ugl ? '⇓' : '⇘' : '⇒'
lb_style = Ugl > 0 ? Ugl > Ugl ? label.style_label_up : label.style_label_upper_right : Ugl < 0 ? Ugl < Ugl ? label.style_label_down : label.style_label_lower_right : label.style_label_right
if CH_on
label.set_style(lbl1, lb_style)
label.set_text(lbl1, lb_text)
label.set_x(lbl1, bar_index - (CH_len - 1))
label.set_y(lbl1, Ugl > 0 ? y1_ - dev * CH_divlen : Ugl < 0 ? y1_ + dev * CH_divlen : y1_)
label.set_color(lbl1, Ugl > 0 ? CH_upclr : Ugl < 0 ? CH_dnclr : color.blue)
DnTrend = math.sign(Ugl) != math.sign(Ugl ) and Ugl < 0
UpTrend = math.sign(Ugl) != math.sign(Ugl ) and Ugl > 0
alertcondition(CH_break, title='Channel Broken', message='Channel Broken')
alertcondition(DnTrend, title='Channel Down trend', message='Channel Down trend')
alertcondition(UpTrend, title='Channel Up trend', message='Channel Up trend')
// Support/Resistance
SR_on =input(defval=true, title='Enable Support/Resistance', group='Support/Resistance')
SR_lb = input(15, title='Left Bars ', group='Support/Resistance')
SR_rb = input(15, title='Right Bars', group='Support/Resistance')
SR_vol = input(20, title='Volume Threshold', group='Support/Resistance')
SR_high = fixnan(ta.pivothigh(SR_lb, SR_rb) )
SR_low = fixnan(ta.pivotlow(SR_lb, SR_rb) )
plot(SR_on?SR_low:na, color=ta.change(SR_low) ? na : #2030e0, linewidth=3, offset=-(SR_rb + 1), title='Support')
plot(SR_on?SR_high:na, color=ta.change(SR_high) ? na : #F00000, linewidth=3, offset=-(SR_rb + 1), title='Resistance')
SR_short = ta.ema(volume, 5)
SR_long = ta.ema(volume, 10)
SR_dlt = 100 * (SR_short - SR_long) / SR_long
alertcondition(ta.crossover(close, SR_high) and SR_dlt > SR_vol, title='Resistance Broken', message='Resistance Broken')
alertcondition(ta.crossunder(close, SR_low) and SR_dlt > SR_vol, title='Support Broken', message='Support Broken')
Profit Algoa//@versi
// نمایش سود/زیان در نمودار
plot(profitLoss, title="Profit/Loss", color=color.blue, linewidth=2)
// نمایش مقدار سود/زیان به صورت متن
plotchar(profitLoss, title="Profit/Loss Value", location=location.top, color=color.blue, size=size.small)
MSB-OB Strategy//@version=5
strategy("MSB-OB Strategy", overlay=true)
// تعریف تایم فریم 15 دقیقه
higher_tf = "15"
// تنظیمات حجم و استاپ لیمیت
stop_percentage = 0.20
target_percentage = 0.20
// محاسبه محدوده اردر بلاک
order_block_high = request.security(syminfo.tickerid, higher_tf, high)
order_block_low = request.security(syminfo.tickerid, higher_tf, low)
// محاسبه نقاط ورود
long_entry = close > order_block_high
short_entry = close < order_block_low
// نقاط استاپ و تارگت
long_stop = close * (1 - stop_percentage)
long_target = close * (1 + target_percentage)
short_stop = close * (1 + stop_percentage)
short_target = close * (1 - target_percentage)
// نمایش نواحی اردر بلاک
bgcolor(long_entry ? color.new(color.green, 90) : na, title="Long Zone", offset=-1)
bgcolor(short_entry ? color.new(color.red, 90) : na, title="Short Zone", offset=-1)
// نمایش استاپ و تارگت
plot(long_stop, color=color.red, linewidth=2, title="Long Stop")
plot(long_target, color=color.green, linewidth=2, title="Long Target")
plot(short_stop, color=color.green, linewidth=2, title="Short Stop")
plot(short_target, color=color.red, linewidth=2, title="Short Target")
// سیگنالهای ورود و خروج
if long_entry
strategy.entry("Long", strategy.long, stop=long_stop, limit=long_target)
if short_entry
strategy.entry("Short", strategy.short, stop=short_stop, limit=short_target)
Multi-Feature IndicatorThe Multi-Feature Indicator combines three popular technical analysis tools — RSI, Moving Averages (MA), and MACD — into a single indicator to provide unified buy and sell signals. This script is designed for traders who want to filter out noise and focus on signals confirmed by multiple criteria.
Features:
RSI (Relative Strength Index):
Measures momentum and identifies overbought (70) and oversold (30) conditions.
A signal is triggered when RSI crosses these thresholds.
Moving Averages (MA):
Uses a short-term moving average (default: 9 periods) and a long-term moving average (default: 21 periods).
Buy signals occur when the short-term MA crosses above the long-term MA, indicating an uptrend.
Sell signals occur when the short-term MA crosses below the long-term MA, indicating a downtrend.
MACD (Moving Average Convergence Divergence):
A trend-following momentum indicator that shows the relationship between two moving averages of an asset's price.
Signals are based on the crossover of the MACD line and its signal line.
Unified Buy and Sell Signals:
Buy Signal: Triggered when:
RSI crosses above 30 (leaving oversold territory).
Short-term MA crosses above the long-term MA.
MACD line crosses above the signal line.
Sell Signal: Triggered when:
RSI crosses below 70 (leaving overbought territory).
Short-term MA crosses below the long-term MA.
MACD line crosses below the signal line.
Visualization:
The indicator plots the short-term and long-term moving averages on the price chart.
Green "BUY" labels appear below price bars when all buy conditions are met.
Red "SELL" labels appear above price bars when all sell conditions are met.
Parameters:
RSI Length: Default is 14. This controls the sensitivity of the RSI.
Short MA Length: Default is 9. This determines the short-term trend.
Long MA Length: Default is 21. This determines the long-term trend.
Use Case:
The Multi-Feature Indicator is ideal for traders seeking higher confirmation before entering or exiting trades. By combining momentum (RSI), trend (MA), and momentum shifts (MACD), it reduces false signals and enhances decision-making.
How to Use:
Apply the indicator to your chart in TradingView.
Look for "BUY" or "SELL" signals, which appear when all conditions align.
Use this tool in conjunction with other analysis techniques for best results.
Note:
The default settings are suitable for many assets, but you may need to adjust them for different timeframes or market conditions.
This indicator is meant to assist in trading decisions and should not be used as the sole basis for trading.
FVG Breakout/BreakdownThe FVG Breakout/Breakdown indicator is designed to identify potential breakout and breakdown opportunities in the market, based on the concept of Fair Value Gaps (FVGs). FVGs are areas where price moves too quickly, leaving behind gaps between candlesticks, often seen as areas of inefficiency or imbalance that the market tends to revisit.
Key Concepts:
Fair Value Gaps (FVG):
FVG occurs when a price gap is created between candlesticks, typically when the high of one candle is lower than the low of the previous candle (for a bearish FVG) or the low of one candle is higher than the high of the previous candle (for a bullish FVG).
These gaps represent an imbalance between buying and selling pressure, and the market often revisits them, making them valuable for identifying potential entry points.
Bullish FVG: This occurs when the low of the current candle is higher than the high of the previous candle.
Condition: low > high
Bearish FVG: This occurs when the high of the current candle is lower than the low of the previous candle.
Condition: high < low
Breakout/Breakdown Signals:
Breakout: A bullish breakout signal occurs when the price breaks above a defined resistance level after an FVG gap. This suggests that the market may continue moving higher.
Breakdown: A bearish breakdown signal occurs when the price breaks below a defined support level after an FVG gap. This suggests that the market may continue moving lower.
NWOG (New Week Opening Gap):
The NWOG can be used as an additional factor to confirm the FVG signal. The gap between Friday's close and Monday's open is a crucial level for identifying the start of a new move for the week.
NWOG helps to further refine the timing of breakout or breakdown signals, only triggering them when price moves relative to the Monday Open and shows a new direction.
Merry Christmas Tree🎄 Merry Christmas 2024 🎅
May your holidays sparkle with joy and laughter, and may the year ahead be full of blessings and success. Wishing you and your loved ones peace, love, and happiness this Christmas and always! 🌟🎁
Dynamic Hybrid IndicatorHedef: Kısa vadeli trend dönüşlerini erken tespit ederek al-sat sinyalleri üretmek.
Zaman Dilimi: 1 dakikalık, 5 dakikalık ya da 15 dakikalık grafikler.
FVG at NWOGFVG at NWOG (Fair Value Gap at New Week Opening Gap)
This concept combines two key ideas:
New Week Opening Gap (NWOG)
Fair Value Gap (FVG)
When we combine these two concepts, we are looking for Fair Value Gaps (which indicate market inefficiencies or price imbalances) that occur around the New Week Opening Gap. This can provide insight into potential breakout or breakdown opportunities for the next trading week.
Agrupación de velas 5m en una vela 15mcon este indicador podras saber en el grafico de 5 minutos, cuales velas pertenecen al grupo de una vela de 15 minutos
Enhanced Multi-Indicator StrategyEnhance your strategy by incorporating a combination of indicators to improve accuracy. We'll use the Relative Strength Index (RSI) and the Moving Average Convergence Divergence (MACD) along with your moving averages to provide a more robust signal.
5SMA W/TrendTrend Filter for identifying 5 day trend based on direction of moving averages and price.
Moyenne Mobile Réactive MulticoloreUses a custom weighting formula to give more weight to recent prices
Incorporates trend calculation based on period comparisons, similar to the logic used in complex trading systems.
Range phase detection uses a threshold of 0.1% variation, which allows consolidation periods to be identified
Three Consecutive Candles with Increasing VolumeNOT MY SCRIPT, this script tells you if candles are moving in 3 or more in a row (TREYLLO)
NWOG with FVGThe New Week Opening Gap (NWOG) and Fair Value Gap (FVG) combined indicator is a trading tool designed to analyze price action and detect potential support, resistance, and trade entry opportunities based on two significant concepts:
New Week Opening Gap (NWOG): The price range between the high and low of the first candle of the new trading week.
Fair Value Gap (FVG): A price imbalance or gap between candlesticks, where price may retrace to fill the gap, indicating potential support or resistance zones.
When combined, these two concepts help traders identify key price levels (from the new week open) and price imbalances (from FVGs), which can act as powerful indicators for potential market reversals, retracements, or continuation trades.
1. New Week Opening Gap (NWOG):
Definition:
The New Week Opening Gap (NWOG) refers to the range between the high and low of the first candle in a new trading week (often, the Monday open in most markets).
Purpose:
NWOG serves as a significant reference point for market behavior throughout the week. Price action relative to this range helps traders identify:
Support and Resistance zones.
Bullish or Bearish sentiment depending on price’s relation to the opening gap levels.
Areas where the market may retrace or reverse before continuing in the primary trend.
How NWOG is Identified:
The high and low of the first candle of the new week are drawn on the chart, and these levels are used to assess the market's behavior relative to this range.
Trading Strategy Using NWOG:
Above the NWOG Range: If price is trading above the NWOG levels, it signals bullish sentiment.
Below the NWOG Range: If price is trading below the NWOG levels, it signals bearish sentiment.
Price Touching the NWOG Levels: If price approaches or breaks through the NWOG levels, it can indicate a potential retracement or reversal.
2. Fair Value Gap (FVG):
Definition:
A Fair Value Gap (FVG) occurs when there is a gap or imbalance between two consecutive candlesticks, where the high of one candle is lower than the low of the next candle (or vice versa), creating a zone that may act as a price imbalance.
Purpose:
FVGs represent an imbalance in price action, often indicating that the market moved too quickly and left behind a price region that was not fully traded.
FVGs can serve as areas where price is likely to retrace to fill the gap, as traders seek to correct the imbalance.
How FVG is Identified:
An FVG is detected if:
Bearish FVG: The high of one candle is less than the low of the next (gap up).
Bullish FVG: The low of one candle is greater than the high of the next (gap down).
The area between the gap is drawn as a shaded region, indicating the FVG zone.
Trading Strategy Using FVG:
Price Filling the FVG: Price is likely to retrace to fill the gap. A reversal candle in the FVG zone can indicate a trade setup.
Support and Resistance: FVG zones can act as support (in a bullish FVG) or resistance (in a bearish FVG) if the price retraces to them.
Combined Strategy: New Week Opening Gap (NWOG) and Fair Value Gap (FVG):
The combined use of NWOG and FVG helps traders pinpoint high-probability price action setups where:
The New Week Opening Gap (NWOG) acts as a major reference level for potential support or resistance.
Fair Value Gaps (FVG) represent market imbalances where price might retrace to, filling the gap before continuing its move.
Signal Logic:
Buy Signal:
Price touches or breaks above the NWOG range (indicating a bullish trend) and there is a bullish FVG present (gap indicating a support area).
Price retraces to fill the bullish FVG, offering a potential buy opportunity.
Sell Signal:
Price touches or breaks below the NWOG range (indicating a bearish trend) and there is a bearish FVG present (gap indicating a resistance area).
Price retraces to fill the bearish FVG, offering a potential sell opportunity.
Example:
Buy Setup:
Price breaks above the NWOG resistance level, and a bullish FVG (gap down) appears below. Traders can wait for price to pull back to fill the gap and then take a long position when confirmation occurs.
Sell Setup:
Price breaks below the NWOG support level, and a bearish FVG (gap up) appears above. Traders can wait for price to retrace and fill the gap before entering a short position.
Key Benefits of the Combined NWOG & FVG Indicator:
Combines Two Key Concepts:
NWOG provides context for the market's overall direction based on the start of the week.
FVG highlights areas where price imbalances exist and where price might retrace to, making it easier to spot entry points.
High-Probability Setups:
By combining these two strategies, the indicator helps traders spot high-probability trades based on major market levels (from NWOG) and price inefficiencies (from FVG).
Helps Identify Reversal and Continuation Opportunities:
FVGs act as potential support and resistance zones, and when combined with the context of the NWOG levels, it gives traders clearer guidance on where price might reverse or continue its trend.
Clear Visual Signals:
The indicator can plot the NWOG levels on the chart, and shade the FVG areas, providing a clean and easy-to-read chart with entry signals marked for buy and sell opportunities.
Conclusion:
The New Week Opening Gap (NWOG) and Fair Value Gap (FVG) combined indicator is a powerful tool for traders who use price action strategies. By incorporating the New Week's opening range and identifying gaps in price action, this indicator helps traders identify potential support and resistance zones, pinpoint entry opportunities, and increase the probability of successful trades.
This combined strategy enhances your analysis by adding layers of confirmation for trades based on significant market levels and price imbalances. Let me know if you'd like more details or modifications!
SMA & RSI Al Sinyalleri kendi özel ayarlarımdır her grafikte çalışmaz genelde 4s 2s gibi grafiklerde çalışır
EMA36ssasdasdsaasddsasaddasdassaddsadasasddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
Optimal Grid Levels with Trend, RSI, MACD, and FibonacciOptimal Grid Levels with Trend, RSI, MACD, and Fibonacci