Professional Documents
Culture Documents
RSI Table
RSI Table
0 at
https://mozilla.org/MPL/2.0/
// © Jib1979
//@version=5
//Binocular
//Settlement
// === INPUTS
useDaily = input(true, title='Use Daily Data to Calculate HV (default), otherwise chart TF')
sLength_ = input.int(1, minval=1, title='Settlement Volume Weighted Average Length (1=Use end of
day)')
//
//
// === /INPUTs
dodgerblue = #1E90FF
//
// Test for new Daily Session or start of new month for Daily.
change_1 = ta.change(start1)
hv = 0.0
hinow = high
lonow = low
stdhv = 0.0
stdhv1 = stdhv
SettleM = plot(not nohist and showset and (not pivotNow or firstDay) and not newDay ? settlement :
na, color=color.new(#ec186d, 0), title='Settlement', linewidth=2, style=plot.style_linebr)
stdhv05u = plot(not nohist and stddev1 and (not pivotNow or firstDay) and not newDay ? settlement
+ stdhv05 : na, color=color.new(color.orange, 20), title='+0.5 SD', linewidth=1,
style=plot.style_linebr)
stdhv05d = plot(not nohist and stddev1 and (not pivotNow or firstDay) and not newDay ? settlement
- stdhv05 : na, color=color.new(color.orange, 20), title='-0.5 SD', linewidth=1, style=plot.style_linebr)
stdhv07u = plot(not nohist and stddev1 and (not pivotNow or firstDay) and not newDay ? settlement
+ stdhv07 : na, color=color.new(color.red, 20), title='+0.7 SD', linewidth=1, style=plot.style_linebr)
stdhv07d = plot(not nohist and stddev1 and (not pivotNow or firstDay) and not newDay ? settlement
- stdhv07 : na, color=color.new(color.red, 20), title='-0.7 SD', linewidth=1, style=plot.style_linebr)
stdhv1u = plot(not nohist and stddev1 and (not pivotNow or firstDay) and not newDay ? settlement
+ stdhv1 : na, color=color.new(color.lime, 20), title='+1 SD', linewidth=3, style=plot.style_linebr)
stdhv1d = plot(not nohist and stddev1 and (not pivotNow or firstDay) and not newDay ? settlement -
stdhv1 : na, color=color.new(color.lime, 20), title='-1 SD', linewidth=3, style=plot.style_linebr)
//Show Settlement
if showset
label.delete(settlement[1])
if stddev1
if Stdhv05u
label.delete(Stdhv05u[1])
if Stdhv05d
label.delete(Stdhv05d[1])
if Stdhv07u
label.delete(Stdhv07u[1])
if Stdhv07d
Stdhv07d = label.new(start1, Stdhv07d, text='-0.7', xloc=xloc.bar_time,
textcolor=color.new(color.red,0), style=label.style_none)
label.delete(Stdhv07d[1])
if Stdhv1u
label.delete(Stdhv1u[1])
if Stdhv1d
label.delete(Stdhv1d[1])
//
//
//Buy Sell
// ======================================================================
// INPUTS
// ======================================================================
vwapd = input.bool(true,"",inline="1",group=gr1)
vwapw = input.bool(false,"",inline="1",group=gr1)
vwapm = input.bool(false,"",inline="1",group=gr1)
src = input.source(hlc3,title="Source",inline="1",group=gr1)
wvc = color.new(#44f513,0)
mvc = color.new(color.yellow,0)
// =============================== MA ===================================
mab1 = input.bool(false,"",inline="1",group=gr2)
mat1 = input.string(title = "", defval = "SMA", options=["SMA", "EMA", "SMMA (RMA)", "WMA",
"VWMA"],inline="1", group=gr2)
mas1 = input.source(hlc3,title="",inline="1",group=gr2)
mal1 = input.int(21,title="",inline="1",group=gr2)
c1 = color.new(color.lime,0)
mab2 = input.bool(false,"",inline="2",group=gr2)
mat2 = input.string(title = "", defval = "SMA", options=["SMA", "EMA", "SMMA (RMA)", "WMA",
"VWMA"],inline="2", group=gr2)
mas2 = input.source(hlc3,title="",inline="2",group=gr2)
mal2 = input.int(44,title="",inline="2",group=gr2)
c2 = color.new(color.red,0)
mab3 = input.bool(false,"",inline="3",group=gr2)
mat3 = input.string(title = "", defval = "SMA", options=["SMA", "EMA", "SMMA (RMA)", "WMA",
"VWMA"],inline="3", group=gr2)
mas3 = input.source(hlc3,title="",inline="3",group=gr2)
mal3 = input.int(100,title="",inline="3",group=gr2)
c3 = color.new(color.blue,0)
// ============================= TABLE ==================================
"Top Center", "Middle Center", "Bottom Center", "Top Left", "Middle Left", "Bottom Left"],
inline="1", group=tab)
tbgc = color.new(color.black,0)
brc = color.new(color.white,0)
tw = input.int(2,"",inline="1",group=tab)
[_TablePos,_size]
line li = na
label msg = na
label.delete(_offsetLabel[1])
line.delete(li[1])
entry(bool plt,table testTable,string _size,int bs,int pos,int index,float Price,float sl) =>
label le = na
line li = na
if bs == 1
if bs == -1
label.delete(le[1])
line.delete(li[1])
pl = 0.0
plp = math.round(math.abs(pl*100/Price),2)
htc = color.new(color.white,0)
btc = color.new(color.white,0)
bg = bs == 1 ? color.new(#025d06,0) : color.new(#b60000,0)
//
//
//EMA
longCond = bool(na)
shortCond = bool(na)
longCond := ma1 > ma6 and ma2 > ma6 and ma3 > ma6 and ma4 > ma6 and ma5 > ma6
shortCond := ma1 < ma6 and ma2 < ma6 and ma3 < ma6 and ma4 < ma6 and ma5 < ma6
CondIni = 0
//
//
rsi1 = ta.rsi(close,25)
rsi2 = ta.rsi(close,55)
length = 10
mult = 2.2
useClose = true
BUY = dir == 1 and ta.pvt > signal_1 and rsi1 > rsi2
SELL = dir == -1 and ta.pvt < signal_1 and rsi1 < rsi2
var index = 0
var pos = 0
var bs = 0
var en = 0.0
if display
bs := 1
label.new(bar_index,close,text='',size=size.normal,color=color.new(color.green,100),yloc=yloc.below
bar,style=label.style_label_up,textcolor=color.new(color.white,100))
pos := 0
index := bar_index
buy:=true
sell:=false
sell1:=false
en := high*(1+bfr/100)
HighVal:=high*(1+bfr/100)
Stoploss:=math.min(low[1],low)
diff = (high-low[1])*2
Target1:=high+diff
Target2:=Target1+diff
Target3:=Target2+diff
Target4:=Target3+diff
bs := -1
label.new(bar_index,close,text='',size=size.normal,color=color.new(color.red,100),yloc=yloc.aboveba
r,style=label.style_label_down,textcolor=color.new(color.white,100))
pos := 0
index := bar_index
sell:=true
buy:=false
buy1:=false
en := low*(1-bfr/100)
LowVal:=low*(1-bfr/100)
Stoploss:=math.max(high[1],high)
diff = (high[1]-low)*2
Target1:=low-diff
Target2:=Target1-diff
Target3:=Target2-diff
Target4:=Target3-diff
pos := 1
buy1:=true
sell1:=false
label.new(bar_index,close,text='',size=size.tiny,color=color.new(color.red,100),yloc=yloc.abovebar,st
yle=label.style_triangledown,textcolor=color.new(color.white,0))
pos := -1
buy1:=false
sell1:=true
[bs,pos,index,en,Stoploss,Target1,Target2,Target3]
[v1,v2,v3]
ma(float source,simple int length,string type) =>
if display
switch type
else
na
[bs,pos,index,e,sl,t1,t2,t3] = calculation(bfr)
plot(tm == "All Trade" and eb and pos != 0 ? e : na, title = "Entry", color=color.new(#019a66,0), style
= plot.style_linebr)
plot(tm == "All Trade" and tb1 and pos != 0 ? t1 : na, title = "TG 1",color=color.new(color.lime,0),
style = plot.style_linebr)
plot(tm == "All Trade" and tb2 and pos != 0 ? t2 : na, title = "TG 2",color=color.new(color.lime,0),
style = plot.style_linebr)
plot(tm == "All Trade" and tb3 and pos != 0 ? t3 : na, title = "TG 3",color=color.new(color.lime,0),
style = plot.style_linebr)
plot(tm == "All Trade" and slb and pos != 0 ? sl : na, title = "SL",color=color.new(color.red,0), style =
plot.style_linebr)
DefineLabel(eb,pos,index,e,color.new(#019a66,0),'EN')
DefineLabel(slb,pos,index,sl,color.new(color.red,0),'SL')
DefineLabel(tb1,pos,index,t1,color.new(color.green,0),'TG1')
DefineLabel(tb2,pos,index,t2,color.new(color.green,0),'TG2')
DefineLabel(tb3,pos,index,t3,color.new(color.green,0),'TG3')
[_TablePos,_size] = tablelocation(TablePos,size)
entry(plt,testTable,_size,bs,pos,index,e,sl)
//
==================================================================================
======================================
[v1,v2,v3] = vwapc(src,"D","W","M")
//
==================================================================================
======================================
signal() =>
rsi1 = ta.rsi(close,25)
rsi2 = ta.rsi(close,55)
length = 10
mult = 2.2
useClose = true
[BUY,SELL]
"Top Center", "Middle Center", "Bottom Center", "Top Left", "Middle Left", "Bottom Left"],
inline="1", group = "MTF SIGNAL")
tf_2 = input.timeframe('5', title = "Time Frame", inline = "1", group = "MTF SIGNAL")
tf_3 = input.timeframe('15', title = "Time Frame", inline = "1", group = "MTF SIGNAL")
tf_4 = input.timeframe('30', title = "Time Frame", inline = "1", group = "MTF SIGNAL")
[_mtf_p,_mtf_s] = tablelocation(mtf_p,mtf_s)
b = array.get(buy,array.size(buy)-1)
s = array.get(sell,array.size(sell)-1)
//
//Supertrend
//
//EMA200
//
Ema_Len = input(50)
Ema_Len2 = input(200)
if showemalb
//
//BarColor
ap = hlc3
wt1 = tci
wt2 = ta.sma(wt1, 4)
//
//RSI Table
//TABLE INPUTS
//RSI INPUTS
tfTxt(x)=>
out = x
if str.tonumber(x)%60 == 0
out := str.tostring(str.tonumber(x)/60)+"H"
else
out := x + "m"
out
f_fillCellText(_table, _column, _row, _value, _timeframe) =>
cell_color = #000000
cell_txt = #00000000
cell_color := #8B0000
cell_txt := #FF8C00
cell_color := #006400
cell_txt := #00FF00
else
cell_color := #1C1C1C
cell_txt := #DCDCDC
//
if barstate.islast
//
//SETTINGS
//
// INDICATOR SETTINGS
swing_length = input.int(10, title = 'Swing High/Low Length', group = 'Settings', minval = 1, maxval =
50)
show_zigzag = input.bool(false, title = 'Show Zig Zag', group = 'Visual Settings', inline = '1')
bos_label_color = input.color(color.white, title = 'BOS Label', group = 'Visual Settings', inline = '5')
poi_label_color = input.color(color.white, title = 'POI Label', group = 'Visual Settings', inline = '7')
swing_type_color = input.color(color.black, title = 'Price Action Label', group = 'Visual Settings', inline
= '8')
zigzag_color = input.color(color.new(#000000,0), title = 'Zig Zag', group = 'Visual Settings', inline = '9')
//
//END SETTINGS
//
//
//FUNCTIONS
//
array.unshift(array, new_value_to_add)
array.pop(array)
if swing_type == 1
else
label_text := 'LH'
else if swing_type == -1
label_text := 'HL'
else
label_text := 'LL'
atr_threshold = atr * 2
okay_to_draw = true
for i = 0 to array.size(box_array) - 1
okay_to_draw := false
break
else
okay_to_draw := true
okay_to_draw
box_left = array.get(bn_array, 0)
box_right = bar_index
if box_type == 1
box_top := array.get(value_array, 0)
else if box_type == -1
box_bottom := array.get(value_array, 0)
// okay_to_draw = true
//delete oldest box, and then create a new box and add it to the array
if box_type == 1 and okay_to_draw
if zone_type == 1
for i = 0 to array.size(box_array) - 1
level_to_break = box.get_top(array.get(box_array,i))
// if ta.crossover(close, level_to_break)
copied_box = box.copy(array.get(box_array,i))
f_array_add_pop(bos_array, copied_box)
box.set_top(array.get(bos_array,0), mid)
box.set_bottom(array.get(bos_array,0), mid)
box.delete(array.get(box_array, i))
box.delete(array.get(label_array, i))
if zone_type == -1
for i = 0 to array.size(box_array) - 1
level_to_break = box.get_bottom(array.get(box_array,i))
// if ta.crossunder(close, level_to_break)
copied_box = box.copy(array.get(box_array,i))
f_array_add_pop(bos_array, copied_box)
box.set_top(array.get(bos_array,0), mid)
box.set_bottom(array.get(bos_array,0), mid)
box.delete(array.get(box_array, i))
box.delete(array.get(label_array, i))
f_extend_box_endpoint(box_array) =>
for i = 0 to array.size(box_array) - 1
//
//END FUNCTIONS
//
//
//CALCULATIONS
//
// CALCULATE ATR
atr = ta.atr(50)
//
//END CALCULATIONS
//
if not na(swing_high)
f_array_add_pop(swing_high_values, swing_high)
f_array_add_pop(swing_high_bns, bar_index[swing_length])
if show_price_action_labels
f_sh_sl_labels(swing_high_values, 1)
f_array_add_pop(swing_low_values, swing_low)
f_array_add_pop(swing_low_bns, bar_index[swing_length])
if show_price_action_labels
f_sh_sl_labels(swing_low_values, -1)
f_extend_box_endpoint(current_supply_box)
f_extend_box_endpoint(current_demand_box)
//ZIG ZAG
h = ta.highest(high, swing_length * 2 + 1)
l = ta.lowest(low, swing_length * 2 + 1)
f_isMin(len) =>
l == low[len]
f_isMax(len) =>
h == high[len]
var dirUp = false
var line li = na
f_drawLine() =>
if dirUp
lastLow := low[swing_length]
timeLow := bar_index
line.delete(li)
li := f_drawLine()
li
lastHigh := high[swing_length]
timeHigh := bar_index
dirUp := false
li := f_drawLine()
li
if not dirUp
lastHigh := high[swing_length]
timeHigh := bar_index
line.delete(li)
li := f_drawLine()
li
lastLow := low[swing_length]
timeLow := bar_index
dirUp := true
li := f_drawLine()
lastHigh := high[swing_length]
timeHigh := bar_index
dirUp := false
li := f_drawLine()
li
// if barstate.islast
//
//Trend Bar
DodgerBlue = #1E90FF
lime100 = #00FF00FF
blue100 = #0000FFFF
aqua100 = #00FFFFFF
darkred100 = #8B0000FF
wcolor = high > pacHi and low > pacHi ? color.lime : low < pacLo and high < pacLo ? color.red :
color.gray
////