Comert Ultimate KY-ToolBox by Hassonya
Comert Ultimate KY-ToolBox by Hassonya
Comert Ultimate KY-ToolBox by Hassonya
//@version=4
study(title="Comert Ultimate KY-ToolBox by Hassonya", shorttitle="ComertTOOLBOX
V2", overlay=true, max_lines_count=500, max_labels_count=500, precision=2)
//Source
src = input(close, title="Source")
trade = input(defval="Stock", title="Which Market: ", options=["Stock", "Crypto"],
type=input.string)
//Moving Averages
////////////////////////
moving_ok = input(title = "═══════════════ Moving Averages Settings ", defval=true,
type=input.bool)
////////////////////////////////////////////////////// MOVAV
//moving average lengths and independent moving average types
//MA1 settings
ma1_active = input(true, title="MA1", inline="MA1")
ma1_length = input(21, title="Length", inline="MA1")
MAType_1 = input(defval="EMA", title="Type", options=["SMA", "EMA", "WMA", "VWMA",
"SMMA", "DEMA", "TEMA", "HullMA", "EHMA", "ETMA", "ZEMA", "TMA", "SSMA", "STMA",
"ALMA"], type=input.string, inline="MA1")
//MA2 settings
ma2_active = input(true, title="MA2", inline="MA2")
ma2_length = input(55, title="Length", inline="MA2")
MAType_2 = input(defval="EMA", title="Type", options=["SMA", "EMA", "WMA", "VWMA",
"SMMA", "DEMA", "TEMA", "HullMA", "EHMA", "ETMA", "ZEMA", "TMA", "SSMA", "STMA",
"ALMA"], type=input.string, inline="MA2")
//MA3 settings
ma3_active = input(true, title="MA3", inline="MA3")
ma3_length = input(89, title="Length", inline="MA3")
MAType_3 = input(defval="EMA", title="Type", options=["SMA", "EMA", "WMA", "VWMA",
"SMMA", "DEMA", "TEMA", "HullMA", "EHMA", "ETMA", "ZEMA", "TMA", "SSMA", "STMA",
"ALMA"], type=input.string, inline="MA3")
//MA4 settings
ma4_active = input(true, title="MA4", inline="MA4")
ma4_length = input(200, title="Length", inline="MA4")
MAType_4 = input(defval="EMA", title="Type", options=["SMA", "EMA", "WMA", "VWMA",
"SMMA", "DEMA", "TEMA", "HullMA", "EHMA", "ETMA", "ZEMA", "TMA", "SSMA", "STMA",
"ALMA"], type=input.string, inline="MA4")
//MA5 settings
ma5_active = input(true, title="MA5", inline="MA5")
ma5_length = input(233, title="Length", inline="MA5")
MAType_5 = input(defval="EMA", title="Type", options=["SMA", "EMA", "WMA", "VWMA",
"SMMA", "DEMA", "TEMA", "HullMA", "EHMA", "ETMA", "ZEMA", "TMA", "SSMA", "STMA",
"ALMA"], type=input.string, inline="MA5")
//gamma değeri
gamma = 0.55
//ssma
variant_supersmoother(src,MovAv) =>
a1 = exp(-1.414*3.14159 / MovAv)
b1 = 2*a1*cos(1.414*3.14159 / MovAv)
c2 = b1
c3 = (-a1)*a1
c1 = 1 - c2 - c3
v9 = 0.0
v9 := c1*(src + nz(src[1])) / 2 + c2*nz(v9[1]) + c3*nz(v9[2])
v9
//smma
variant_smoothed(src,MovAv) =>
_sma = sma(src, MovAv)
v5 = 0.0
v5 := na(v5[1]) ? _sma : (v5[1] * (MovAv - 1) + src) / MovAv
v5
//zema
variant_zerolagema(src,MovAv) =>
ema1 = ema(src, MovAv)
ema2 = ema(ema1, MovAv)
v10 = ema1+(ema1-ema2)
v10
//dema
variant_doubleema(src,MovAv) =>
v2 = ema(src, MovAv)
v6 = 2 * v2 - ema(v2, MovAv)
v6
//tema
variant_tripleema(src,MovAv) =>
v2 = ema(src, MovAv)
v7 = 3 * (v2 - ema(v2, MovAv)) + ema(ema(v2, MovAv), MovAv)
v7
//Laguerre
variant_lag(p,g) =>
L0 = 0.0
L1 = 0.0
L2 = 0.0
L3 = 0.0
L0 := (1 - g)*p+g*nz(L0[1])
L1 := -g*L0+nz(L0[1])+g*nz(L1[1])
L2 := -g*L1+nz(L1[1])+g*nz(L2[1])
L3 := -g*L2+nz(L2[1])+g*nz(L3[1])
f = (L0 + 2*L1 + 2*L2 + L3)/6
f
//alma
variant_alma(src, MovAv) =>
var float _offset = 0.85
var float _sigma = 6.0
alma(src, MovAv, _offset, _sigma)
//vidya
variant_vidya(src, MovAv) =>
_cmo = cmo(src, MovAv)/100 //Change Momentum Oscillator
var _factor = 2 / (MovAv + 1)
var _vidya = 0.0
_vidya := src * _factor * abs(_cmo) + nz(_vidya[1]) * (1 - _factor *
abs(_cmo))
//assign functions
mov_1 = variant(MAType_1, src, ma1_length, gamma)
mov_2 = variant(MAType_2, src, ma2_length, gamma)
mov_3 = variant(MAType_3, src, ma3_length, gamma)
mov_4 = variant(MAType_4, src, ma4_length, gamma)
mov_5 = variant(MAType_5, src, ma5_length, gamma)
//mtf source
mtf1 = security(syminfo.tickerid, res, mov_1)
mtf2 = security(syminfo.tickerid, res, mov_2)
mtf3 = security(syminfo.tickerid, res, mov_3)
mtf4 = security(syminfo.tickerid, res, mov_4)
mtf5 = security(syminfo.tickerid, res, mov_5)
//Pivot Points
////////////////////////
pivot_ok = input(title = "═══════════════ Pivot Points Settings ", defval=false,
type=input.bool)
AUTO = "Auto"
DAILY = "Daily"
WEEKLY = "Weekly"
MONTHLY = "Monthly"
QUARTERLY = "Quarterly"
YEARLY = "Yearly"
BIYEARLY = "Biyearly"
TRIYEARLY = "Triyearly"
QUINQUENNIALLY = "Quinquennially"
DECENNIALLY = "Decennially"
TRADITIONAL = "Traditional"
FIBONACCI = "Fibonacci"
WOODIE = "Woodie"
CLASSIC = "Classic"
DEMARK = "DM"
CAMARILLA = "Camarilla"
var r1 = array.new_float()
var s1 = array.new_float()
s1r1_show = input(true, "S1/R1", inline = "S1/R1")
s1_color = input(color.red, "S1", inline = "S1/R1")
r1_color = input(color.green, "R1", inline = "S1/R1")
var r2 = array.new_float()
var s2 = array.new_float()
s2r2_show = input(true, "S2/R2", inline = "S2/R2")
s2_color = input(color.red, "S2", inline = "S2/R2")
r2_color = input(color.green, "R2", inline = "S2/R2")
var r3 = array.new_float()
var s3 = array.new_float()
s3r3_show = input(true, "S3/R3", inline = "S3/R3")
s3_color = input(color.red, "S3", inline = "S3/R3")
r3_color = input(color.green, "R3", inline = "S3/R3")
var r4 = array.new_float()
var s4 = array.new_float()
s4r4_show = input(true, "S4/R4", inline = "S4/R4")
s4_color = input(color.red, "S4", inline = "S4/R4")
r4_color = input(color.green, "R4", inline = "S4/R4")
var r5 = array.new_float()
var s5 = array.new_float()
s5r5_show = input(true, "S5/R5", inline = "S5/R5")
s5_color = input(color.red, "S5", inline = "S5/R5")
r5_color = input(color.green, "R5", inline = "S5/R5")
pivotX_open = float(na)
pivotX_open := nz(pivotX_open[1],open)
pivotX_high = float(na)
pivotX_high := nz(pivotX_high[1],high)
pivotX_low = float(na)
pivotX_low := nz(pivotX_low[1],low)
pivotX_prev_open = float(na)
pivotX_prev_open := nz(pivotX_prev_open[1])
pivotX_prev_high = float(na)
pivotX_prev_high := nz(pivotX_prev_high[1])
pivotX_prev_low = float(na)
pivotX_prev_low := nz(pivotX_prev_low[1])
pivotX_prev_close = float(na)
pivotX_prev_close := nz(pivotX_prev_close[1])
get_pivot_resolution() =>
resolution = "M"
if pivot_time_frame == AUTO
if timeframe.isintraday
resolution := timeframe.multiplier <= 15 ? "D" : "W"
else if timeframe.isweekly or timeframe.ismonthly
resolution := "12M"
else if pivot_time_frame == DAILY
resolution := "D"
else if pivot_time_frame == WEEKLY
resolution := "W"
else if pivot_time_frame == MONTHLY
resolution := "M"
else if pivot_time_frame == QUARTERLY
resolution := "3M"
else if pivot_time_frame == YEARLY or pivot_time_frame == BIYEARLY or
pivot_time_frame == TRIYEARLY or pivot_time_frame == QUINQUENNIALLY or
pivot_time_frame == DECENNIALLY
resolution := "12M"
resolution
//tostring(pp)
draw_label(i, y, txt, pp, txt_color,z) =>
if show_labels and pivot_ok
o = z == "Stock" ? tostring(pp, "##.##") : tostring(pp)
offset = ' '
labels_align_str_left= position_labels == "Left" ? txt + " " + o + offset :
offset + txt + " " + o
x = position_labels == "Left" ? array.get(arr_time, i) :
array.get(arr_time, i + 1)
array.push(labels, label.new(x = x, y=y, text=labels_align_str_left,
textcolor=txt_color, style=label.style_label_center, color=#00000000,
xloc=xloc.bar_time))
traditional() =>
pivotX_Median = (pivotX_prev_high + pivotX_prev_low + pivotX_prev_close) / 3
array.push(p, pivotX_Median)
array.push(r1, pivotX_Median * 2 - pivotX_prev_low)
array.push(s1, pivotX_Median * 2 - pivotX_prev_high)
array.push(r2, pivotX_Median + 1 * (pivotX_prev_high - pivotX_prev_low))
array.push(s2, pivotX_Median - 1 * (pivotX_prev_high - pivotX_prev_low))
array.push(r3, pivotX_Median * 2 + (pivotX_prev_high - 2 * pivotX_prev_low))
array.push(s3, pivotX_Median * 2 - (2 * pivotX_prev_high - pivotX_prev_low))
array.push(r4, pivotX_Median * 3 + (pivotX_prev_high - 3 * pivotX_prev_low))
array.push(s4, pivotX_Median * 3 - (3 * pivotX_prev_high - pivotX_prev_low))
array.push(r5, pivotX_Median * 4 + (pivotX_prev_high - 4 * pivotX_prev_low))
array.push(s5, pivotX_Median * 4 - (4 * pivotX_prev_high - pivotX_prev_low))
fibonacci() =>
pivotX_Median = (pivotX_prev_high + pivotX_prev_low + pivotX_prev_close) / 3
pivot_range = pivotX_prev_high - pivotX_prev_low
array.push(p, pivotX_Median)
array.push(r1, pivotX_Median + 0.382 * pivot_range)
array.push(s1, pivotX_Median - 0.382 * pivot_range)
array.push(r2, pivotX_Median + 0.618 * pivot_range)
array.push(s2, pivotX_Median - 0.618 * pivot_range)
array.push(r3, pivotX_Median + 1 * pivot_range)
array.push(s3, pivotX_Median - 1 * pivot_range)
woodie() =>
pivotX_Woodie_Median = (pivotX_prev_high + pivotX_prev_low + pivotX_open * 2)/4
pivot_range = pivotX_prev_high - pivotX_prev_low
array.push(p, pivotX_Woodie_Median)
array.push(r1, pivotX_Woodie_Median * 2 - pivotX_prev_low)
array.push(s1, pivotX_Woodie_Median * 2 - pivotX_prev_high)
array.push(r2, pivotX_Woodie_Median + 1 * pivot_range)
array.push(s2, pivotX_Woodie_Median - 1 * pivot_range)
classic() =>
pivotX_Median = (pivotX_prev_high + pivotX_prev_low + pivotX_prev_close)/3
pivot_range = pivotX_prev_high - pivotX_prev_low
array.push(p, pivotX_Median)
array.push(r1, pivotX_Median * 2 - pivotX_prev_low)
array.push(s1, pivotX_Median * 2 - pivotX_prev_high)
array.push(r2, pivotX_Median + 1 * pivot_range)
array.push(s2, pivotX_Median - 1 * pivot_range)
array.push(r3, pivotX_Median + 2 * pivot_range)
array.push(s3, pivotX_Median - 2 * pivot_range)
array.push(r4, pivotX_Median + 3 * pivot_range)
array.push(s4, pivotX_Median - 3 * pivot_range)
demark() =>
pivotX_Demark_X = pivotX_prev_high + pivotX_prev_low * 2 + pivotX_prev_close
if pivotX_prev_close == pivotX_prev_open
pivotX_Demark_X := pivotX_prev_high + pivotX_prev_low + pivotX_prev_close *
2
if pivotX_prev_close > pivotX_prev_open
pivotX_Demark_X := pivotX_prev_high * 2 + pivotX_prev_low +
pivotX_prev_close
array.push(p, pivotX_Demark_X / 4)
array.push(r1, pivotX_Demark_X / 2 - pivotX_prev_low)
array.push(s1, pivotX_Demark_X / 2 - pivotX_prev_high)
camarilla() =>
pivotX_Median = (pivotX_prev_high + pivotX_prev_low + pivotX_prev_close) / 3
pivot_range = pivotX_prev_high - pivotX_prev_low
array.push(p, pivotX_Median)
array.push(r1, pivotX_prev_close + pivot_range * 1.1 / 12.0)
array.push(s1, pivotX_prev_close - pivot_range * 1.1 / 12.0)
array.push(r2, pivotX_prev_close + pivot_range * 1.1 / 6.0)
array.push(s2, pivotX_prev_close - pivot_range * 1.1 / 6.0)
array.push(r3, pivotX_prev_close + pivot_range * 1.1 / 4.0)
array.push(s3, pivotX_prev_close - pivot_range * 1.1 / 4.0)
array.push(r4, pivotX_prev_close + pivot_range * 1.1 / 2.0)
array.push(s4, pivotX_prev_close - pivot_range * 1.1 / 2.0)
resolution = get_pivot_resolution()
var number_of_years = 0
is_change_years = false
var custom_years_resolution = pivot_time_frame == BIYEARLY or pivot_time_frame ==
TRIYEARLY or pivot_time_frame == QUINQUENNIALLY or pivot_time_frame == DECENNIALLY
if custom_years_resolution and change(time(resolution))
number_of_years += 1
if pivot_time_frame == BIYEARLY and number_of_years % 2 == 0
is_change_years := true
number_of_years := 0
else if pivot_time_frame == TRIYEARLY and number_of_years % 3 == 0
is_change_years := true
number_of_years := 0
else if pivot_time_frame == QUINQUENNIALLY and number_of_years % 5 == 0
is_change_years := true
number_of_years := 0
else if pivot_time_frame == DECENNIALLY and number_of_years % 10 == 0
is_change_years := true
number_of_years := 0
if kind == TRADITIONAL
traditional()
else if kind == FIBONACCI
fibonacci()
else if kind == WOODIE
woodie()
else if kind == CLASSIC
classic()
else if kind == DEMARK
demark()
else if kind == CAMARILLA
camarilla()
for i = 0 to array.size(lines) - 1
if array.size(lines) > 0
line.delete(array.shift(lines))
if array.size(lines) > 0
label.delete(array.shift(labels))
for i = 0 to array.size(arr_time) - 2
if array.size(p) > 0 and p_show
draw_line(i, p, p_color)
draw_label(i, array.get(p, i), "P", array.get(p, i), p_color,trade)
//draw_values(i, array.get(p, i), p, p_color)
if array.size(r1) > 0 and s1r1_show
draw_line(i, r1, r1_color)
draw_label(i, array.get(r1, i), "R1", array.get(r1, i), r1_color,trade)
if array.size(s1) > 0 and s1r1_show
draw_line(i, s1, s1_color)
draw_label(i, array.get(s1, i), "S1", array.get(s1, i), s1_color,trade)
if array.size(r2) > 0 and s2r2_show
draw_line(i, r2, r2_color)
draw_label(i, array.get(r2, i), "R2", array.get(r2, i), r2_color,trade)
if array.size(s2) > 0 and s2r2_show
draw_line(i, s2, s2_color)
draw_label(i, array.get(s2, i), "S2", array.get(s2, i), s2_color,trade)
if array.size(r3) > 0 and s3r3_show
draw_line(i, r3, r3_color)
draw_label(i, array.get(r3, i), "R3", array.get(r3, i), r3_color,trade)
if array.size(s3) > 0 and s3r3_show
draw_line(i, s3, s3_color)
draw_label(i, array.get(s3, i), "S3", array.get(s3, i), s3_color,trade)
if array.size(r4) > 0 and s4r4_show
draw_line(i, r4, r4_color)
draw_label(i, array.get(r4, i), "R4", array.get(r4, i), r4_color,trade)
if array.size(s4) > 0 and s4r4_show
draw_line(i, s4, s4_color)
draw_label(i, array.get(s4, i), "S4", array.get(s4, i), s4_color,trade)
if array.size(r5) > 0 and s5r5_show
draw_line(i, r5, r5_color)
draw_label(i, array.get(r5, i), "R5", array.get(r5, i), r5_color,trade)
if array.size(s5) > 0 and s5r5_show
draw_line(i, s5, s5_color)
draw_label(i, array.get(s5, i), "S5", array.get(s5, i), s5_color,trade)
//SuperTrend
////////////////////////
super_ok = input(title = "═══════════════ SuperTrend Settings ", defval=false,
type=input.bool)
//Bollinger Bands
////////////////////////
bband_ok = input(title = "═══════════════ Bollinger Bands Settings ", defval=false,
type=input.bool)
bb_length = input(20, minval=1, title="BBands Length")
bb_mult1 = input(2.0, minval=0.001, maxval=50, title="BBands Multiplier-1")
bb_basis = sma(src, bb_length)
bb_dev1 = bb_mult1 * stdev(src, bb_length)
bb_upper1 = bb_basis + bb_dev1
bb_lower1 = bb_basis - bb_dev1
bb_offset = input(0, "BBands Offset", type = input.integer, minval = -500, maxval =
500)
plot(bband_ok ? bb_basis : na, "BBands Basis", color=#872323, offset = bb_offset)
bb_p1 = plot(bband_ok ? bb_upper1 : na, "BBands Upper 1", color=color.teal, offset
= bb_offset)
bb_p3 = plot(bband_ok ? bb_lower1 : na, "BBands Lower 1", color=color.teal, offset
= bb_offset)
fill(bb_p1, bb_p3, title = "BBands 1 Background", color=color.new(#198787,95))
//Ichimoku
////////////////////////
ichi_ok = input(title = "═══════════════ Ichimoku Cloud Settings ", defval=false,
type=input.bool)
tenkan_ok = input(false, title="Show/Hide Only Tenkansen")
kijun_ok = input(false, title="Show/Hide Only Kijunsen")
ichi_conversionPeriods = input(9, minval=1, title="ICHI Conversion Line Periods")
ichi_basePeriods = input(26, minval=1, title="ICHI Base Line Periods")
ichi_laggingSpan2Periods = input(52, minval=1, title="ICHI Lagging Span 2 Periods")
ichi_displacement = input(26, minval=1, title="ICHI Displacement")
donchian(len) => avg(lowest(len), highest(len))
ichi_conversionLine = donchian(ichi_conversionPeriods)
ichi_baseLine = donchian(ichi_basePeriods)
ichi_leadLine1 = avg(ichi_conversionLine, ichi_baseLine)
ichi_leadLine2 = donchian(ichi_laggingSpan2Periods)
plot(ichi_ok ? ichi_conversionLine : na, color=#0496ff, title="ICHI-Conversion
Line")
plot(ichi_ok ? ichi_baseLine : na, color=#991515, title="ICHI-Base Line")
plot(ichi_ok ? close : na, offset = -ichi_displacement + 1, color=#459915,
title="ICHI-Lagging Span")
ichi_p1 = plot(ichi_ok ? ichi_leadLine1 : na, offset = ichi_displacement - 1,
color=color.green,
title="ICHI-Lead 1")
ichi_p2 = plot(ichi_ok ? ichi_leadLine2: na, offset = ichi_displacement - 1,
color=color.red,
title="ICHI-Lead 2")
fill(ichi_p1, ichi_p2, color = ichi_leadLine1 > ichi_leadLine2 ? color.green :
color.red)
plot(tenkan_ok ? ichi_conversionLine : na, color=#0496ff, title="ICHI-Conversion
Line")
plot(kijun_ok ? ichi_baseLine : na, color=#991515, title="ICHI-Base Line")
//Don Chain Channels
////////////////////////
don_ok = input(title = "═══════════════ DonChain Channels Settings ", defval=false,
type=input.bool)
don_length = input(20, minval=1)
lower = lowest(don_length)
upper = highest(don_length)
basis = avg(upper, lower)
plot(don_ok ? basis : na, "Basis", color=#FF6D00)
u = plot(don_ok ? upper : na, "Upper", color=#2962FF)
l = plot(don_ok ? lower : na, "Lower", color=#2962FF)
fill(u, l, color=color.rgb(33, 150, 243, 95), title="Background")
//Parabolic Sar
////////////////////////
psar_ok = input(title = "═══════════════ Parabolic Sar Settings ", defval=false,
type=input.bool)
psar_start = input(0.02, title="PSAR Start")
psar_increment = input(0.02, title="PSAR Increment")
psar_maximum = input(0.2, "PSAR Max Value")
psar_out = sar(psar_start, psar_increment, psar_maximum)
plot(psar_ok ? psar_out : na, "ParabolicSAR", style=plot.style_cross,
color=#3A6CA8)
vbcb_cold1 = #800000
vbcb_cold2 = #FF0000
vbcb_cold3 = color.orange
vbcb_colu1 = #006400
vbcb_colu2 = color.lime
vbcb_colu3 = #7FFFD4
vbcb_VolColor = vbcb_vold1 ? vbcb_cold1 : vbcb_vold2 ? vbcb_cold2 : vbcb_vold3 ?
vbcb_cold3 : vbcb_volu1 ? vbcb_colu1 : vbcb_volu2 ? vbcb_colu2 : vbcb_volu3 ?
vbcb_colu3 : na
barcolor(vbcb_ok ? vbcb_VolColor : na, title="Volume Based Coloured Bars")
//Mavilimw
////////////////////////
show_mav = input(title = "═══════════════ Mavilim Settings ", defval=false,
type=input.bool)
mavilimold = input(false, title="Show Previous Version of MavilimW?")
fmal=input(3,"Mavilim First Moving Average length")
smal=input(5,"Mavilim Second Moving Average length")
tmal=fmal+smal
Fmal=smal+tmal
Ftmal=tmal+Fmal
Smal=Fmal+Ftmal
//Tillson
////////////////////////
show_t3 = input(title = "═══════════════ Tillson T3 Settings ", defval=false,
type=input.bool)
//OTT
////////////////////////
ott_ok = input(title = "═══════════════ Optimized Trend Tracker Settings ",
defval=false, type=input.bool)
if mav == "EMA"
ma := ema(src, length)
ma
if mav == "WMA"
ma := wma(src, length)
ma
if mav == "TMA"
ma := sma(sma(src, ceil(length / 2)), floor(length / 2) + 1)
ma
if mav == "VAR"
ma := VAR
ma
if mav == "WWMA"
ma := WWMA
ma
if mav == "ZLEMA"
ma := ZLEMA
ma
if mav == "TSF"
ma := TSF
ma
ma
MAvg=getMA(src, length)
fark=MAvg*percent*0.01
longStop = MAvg - fark
longStopPrev = nz(longStop[1], longStop)
longStop := MAvg > longStopPrev ? max(longStop, longStopPrev) : longStop
shortStop = MAvg + fark
shortStopPrev = nz(shortStop[1], shortStop)
shortStop := MAvg < shortStopPrev ? min(shortStop, shortStopPrev) : shortStop
dir = 1
dir := nz(dir[1], dir)
dir := dir == -1 and MAvg > shortStopPrev ? 1 : dir == 1 and MAvg < longStopPrev ?
-1 : dir
MT = dir==1 ? longStop: shortStop
OTT=MAvg>MT ? MT*(200+percent)/200 : MT*(200-percent)/200
plot(ott_ok ? showsupport ? MAvg : na : na, color=#0585E1, linewidth=2,
title="Support Line")
OTTC = highlight ? OTT[2] > OTT[3] ? color.green : color.red : #B800D9
pALL=plot(ott_ok ? nz(OTT[2]) : na, color=OTTC, linewidth=2, title="OTT")
alertcondition(cross(OTT[2], OTT[3]), title="Color ALARM", message="OTT Has Changed
Color!")
alertcondition(crossover(OTT[2], OTT[3]), title="GREEN ALERT", message="OTT GREEN
BUY SIGNAL!")
alertcondition(crossunder(OTT[2], OTT[3]), title="RED ALERT", message="OTT RED SELL
SIGNAL!")
alertcondition(cross(MAvg, OTT[2]), title="Cross Alert", message="OTT - Support
Line Crossing!")
alertcondition(crossover(MAvg, OTT[2]), title="Crossover Alarm", message="Support
Line BUY SIGNAL!")
alertcondition(crossunder(MAvg, OTT[2]), title="Crossunder Alarm", message="Support
Line SELL SIGNAL!")
alertcondition(cross(src, OTT[2]), title="Price Cross Alert", message="OTT - Price
Crossing!")
alertcondition(crossover(src, OTT[2]), title="Price Crossover Alarm",
message="PRICE OVER OTT - BUY SIGNAL!")
alertcondition(crossunder(src, OTT[2]), title="Price Crossunder Alarm",
message="PRICE UNDER OTT - SELL SIGNAL!")
buySignalk = crossover(MAvg, OTT[2])
plotshape(ott_ok ? buySignalk and showsignalsk ? OTT*0.995 : na : na, title="Buy",
text="Buy", location=location.absolute, style=shape.labelup, size=size.tiny,
color=color.green, textcolor=color.white)
sellSignallk = crossunder(MAvg, OTT[2])
plotshape(ott_ok ? sellSignallk and showsignalsk ? OTT*1.005 : na : na,
title="Sell", text="Sell", location=location.absolute, style=shape.labeldown,
size=size.tiny, color=color.red, textcolor=color.white)
buySignalc = crossover(src, OTT[2])
plotshape(buySignalc and showsignalsc ? OTT*0.995 : na, title="Buy", text="Buy",
location=location.absolute, style=shape.labelup, size=size.tiny, color=color.green,
textcolor=color.white)
sellSignallc = crossunder(src, OTT[2])
plotshape(sellSignallc and showsignalsc ? OTT*1.005 : na, title="Sell",
text="Sell", location=location.absolute, style=shape.labeldown, size=size.tiny,
color=color.red, textcolor=color.white)
ott_mPlot = plot(ohlc4, title="", style=plot.style_circles,
linewidth=0,display=display.none)
ott_longFillColor = ott_highlighting ? (MAvg>OTT ? color.green : na) : na
ott_shortFillColor = ott_highlighting ? (MAvg<OTT ? color.red : na) : na
fill(mPlot, pALL, title="UpTrend Highligter", color=longFillColor)
fill(mPlot, pALL, title="DownTrend Highligter", color=shortFillColor)
buySignalr = crossover(OTT[2], OTT[3])
plotshape(buySignalr and showsignalsr ? OTT*0.995 : na, title="Buy", text="Buy",
location=location.absolute, style=shape.labelup, size=size.tiny, color=color.green,
textcolor=color.white)
sellSignallr = crossunder(OTT[2], OTT[3])
plotshape(sellSignallr and showsignalsr ? OTT*1.005 : na, title="Sell",
text="Sell", location=location.absolute, style=shape.labeldown, size=size.tiny,
color=color.red, textcolor=color.white)