PHP Code:
fi(ki)=>'ra'
// © fikira This work is licensed under a Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) https://creativecommons.org/licenses/by-nc-sa/4.0/
// @version=5
indicator ( "Sentinels"
, overlay=true
)
_ = '
Settings
------------- '
typeMA1 = input.string( "EMA" , 'Type' , options=["SMA", "EMA", "SMMA (RMA)", "HullMA", "WMA", "VWMA", "DEMA", "TEMA", "NONE"], group= 'MA 1' )
len1 = input.int ( 20 , 'Length' , group= 'MA 1' )
typeMA2 = input.string( "EMA" , 'Type' , options=["SMA", "EMA", "SMMA (RMA)", "HullMA", "WMA", "VWMA", "DEMA", "TEMA", "NONE"], group= 'MA 2' )
len2 = input.int ( 50 , 'Length' , group= 'MA 2' )
tentacles = input.bool ( true , '' , inline= '1', group='tentacles')
typeMA3 = input.string( "EMA" ,'******' , inline= '1'
, options=["SMA", "EMA", "SMMA (RMA)", "HullMA", "WMA", "VWMA", "DEMA", "TEMA", "NONE"], group='tentacles')
UpCol1 = input.color (color.rgb( 5, 250, 131 ), "" , inline= '1', group = '***********Head************-**Tentacles')
UpCol2 = input.color (color.rgb(255, 176, 6, 80), "" , inline= '1', group = '***********Head************-**Tentacles')
UpCol3 = input.color (color.rgb( 14, 236, 243, 37),"*-**", inline= '1', group = '***********Head************-**Tentacles')
DnCol1 = input.color (color.rgb(255, 0, 0 ), "" , inline= '2', group = '***********Head************-**Tentacles')
DnCol2 = input.color (color.rgb(255, 176, 6, 80), "" , inline= '2', group = '***********Head************-**Tentacles')
DnCol3 = input.color (color.rgb(243, 25, 255, 37),"*-**", inline= '2', group = '***********Head************-**Tentacles')
_ = '
Methods
----------- '
method ma(string type, int length) =>
//
ema1 = ta.ema(close, length)
ema2 = ta.ema(ema1 , length)
ema3 = ta.ema(ema2 , length)
//
switch type
"SMA" => ta.sma (close, length)
"EMA" => ema1
"SMMA (RMA)" => ta.rma (close, length)
"HullMA" => ta.hma (close, length)
"WMA" => ta.wma (close, length)
"sar" => ta.ema(close, length)
"DEMA" => 2 * ema1 - ema2
"TEMA" => (3 * ema1) - (3 * ema2) + ema3
=> na
method cond(int count, int n1, int n2) => count >= n1 and count <= n2
_ = '
Calculations
-------------- '
ma1 = typeMA1.ma(len1)
ma2 = typeMA2.ma(len2)
trigUp = ta.crossover (ma1, ma2), bsUp = ta.barssince(trigUp)
trigDn = ta.crossunder(ma1, ma2), bsDn = ta.barssince(trigDn)
UpR1 = color.r(UpCol1), UpG1 = color.g(UpCol1), UpB1 = color.b(UpCol1), UpT1 = color.t(UpCol1)
UpR2 = color.r(UpCol2), UpG2 = color.g(UpCol2), UpB2 = color.b(UpCol2), UpT2 = color.t(UpCol2)
DnR1 = color.r(DnCol1), DnG1 = color.g(DnCol1), DnB1 = color.b(DnCol1), DnT1 = color.t(DnCol1)
DnR2 = color.r(DnCol2), DnG2 = color.g(DnCol2), DnB2 = color.b(DnCol2), DnT2 = color.t(DnCol2)
TupMn = math.min(UpT1, UpT2), TupMx = math.max(UpT1, UpT2)
TdnMn = math.min(DnT1, DnT2), TdnMx = math.max(DnT1, DnT2)
Rdn = (DnR1 - DnR2) / 12, Rup = (UpR1 - UpR2) / 12
Gdn = (DnG1 - DnG2) / 12, Gup = (UpG1 - UpG2) / 12
Bdn = (DnB1 - DnB2) / 12, Bup = (UpB1 - UpB2) / 12
Tup = (TupMx - TupMn) / 12, Tdn = (TdnMx - TdnMn) / 12
_ = '
Sentinels
-------------- '
plot(bsUp.cond( 0, 1) ? ma1 : na, '', color= color.rgb(UpR1 - (Rup * 0), UpG1 - (Gup * 0), UpB1 - (Bup * 0), TupMn + (Tup * 0)), style=plot.style_linebr, linewidth=7)
plot(bsUp.cond( 1, 2) ? ma1 : na, '', color= color.rgb(UpR1 - (Rup * 1), UpG1 - (Gup * 1), UpB1 - (Bup * 1), TupMn + (Tup * 1)), style=plot.style_linebr, linewidth=6)
plot(bsUp.cond( 2, 5) ? ma1 : na, '', color=bsUp < 3 ? color.rgb(UpR1 - (Rup * 2), UpG1 - (Gup * 2), UpB1 - (Bup * 2), TupMn + (Tup * 2))
: color.rgb(UpR1 - (Rup * 3), UpG1 - (Gup * 3), UpB1 - (Bup * 3), TupMn + (Tup * 3)), style=plot.style_linebr, linewidth=5)
plot(bsUp.cond( 5, 11) ? ma1 : na, '', color=bsUp < 7 ? color.rgb(UpR1 - (Rup * 4), UpG1 - (Gup * 4), UpB1 - (Bup * 4), TupMn + (Tup * 4))
: color.rgb(UpR1 - (Rup * 5), UpG1 - (Gup * 5), UpB1 - (Bup * 5), TupMn + (Tup * 5)), style=plot.style_linebr, linewidth=4)
plot(bsUp.cond(11, 27) ? ma1 : na, '', color=bsUp < 18 ? color.rgb(UpR1 - (Rup * 6), UpG1 - (Gup * 6), UpB1 - (Bup * 6), TupMn + (Tup * 6))
: color.rgb(UpR1 - (Rup * 7), UpG1 - (Gup * 7), UpB1 - (Bup * 7), TupMn + (Tup * 7)), style=plot.style_linebr, linewidth=3)
plot(bsUp.cond(27, 40) ? ma1 : na, '', color=bsUp < 30 ? color.rgb(UpR1 - (Rup * 8), UpG1 - (Gup * 8), UpB1 - (Bup * 8), TupMn + (Tup * 8))
: color.rgb(UpR1 - (Rup * 9), UpG1 - (Gup * 9), UpB1 - (Bup * 9), TupMn + (Tup * 9)), style=plot.style_linebr, linewidth=2)
plot(bsUp.cond(40, 60) ? ma1 : na, '', color=bsUp < 50 ? color.rgb(UpR1 - (Rup * 10), UpG1 - (Gup * 10), UpB1 - (Bup * 10), TupMn + (Tup * 10))
: color.rgb(UpR1 - (Rup * 11), UpG1 - (Gup * 11), UpB1 - (Bup * 11), TupMn + (Tup * 11)), style=plot.style_linebr, linewidth=1)
plot(bsDn.cond( 0, 1) ? ma2 : na, '', color= color.rgb(DnR1 - (Rdn * 0), DnG1 - (Gdn * 0), DnB1 - (Bdn * 0), TdnMn + (Tdn * 0)), style=plot.style_linebr, linewidth=7)
plot(bsDn.cond( 1, 2) ? ma2 : na, '', color= color.rgb(DnR1 - (Rdn * 1), DnG1 - (Gdn * 1), DnB1 - (Bdn * 1), TdnMn + (Tdn * 1)), style=plot.style_linebr, linewidth=6)
plot(bsDn.cond( 2, 5) ? ma2 : na, '', color=bsDn < 3 ? color.rgb(DnR1 - (Rdn * 2), DnG1 - (Gdn * 2), DnB1 - (Bdn * 2), TdnMn + (Tdn * 2))
: color.rgb(DnR1 - (Rdn * 3), DnG1 - (Gdn * 3), DnB1 - (Bdn * 3), TdnMn + (Tdn * 3)), style=plot.style_linebr, linewidth=5)
plot(bsDn.cond( 5, 11) ? ma2 : na, '', color=bsDn < 7 ? color.rgb(DnR1 - (Rdn * 4), DnG1 - (Gdn * 4), DnB1 - (Bdn * 4), TdnMn + (Tdn * 4))
: color.rgb(DnR1 - (Rdn * 5), DnG1 - (Gdn * 5), DnB1 - (Bdn * 5), TdnMn + (Tdn * 5)), style=plot.style_linebr, linewidth=4)
plot(bsDn.cond(11, 27) ? ma2 : na, '', color=bsDn < 18 ? color.rgb(DnR1 - (Rdn * 6), DnG1 - (Gdn * 6), DnB1 - (Bdn * 6), TdnMn + (Tdn * 6))
: color.rgb(DnR1 - (Rdn * 7), DnG1 - (Gdn * 7), DnB1 - (Bdn * 7), TdnMn + (Tdn * 7)), style=plot.style_linebr, linewidth=3)
plot(bsDn.cond(27, 40) ? ma2 : na, '', color=bsDn < 30 ? color.rgb(DnR1 - (Rdn * 8), DnG1 - (Gdn * 8), DnB1 - (Bdn * 8), TdnMn + (Tdn * 8))
: color.rgb(DnR1 - (Rdn * 9), DnG1 - (Gdn * 9), DnB1 - (Bdn * 9), TdnMn + (Tdn * 9)), style=plot.style_linebr, linewidth=2)
plot(bsDn.cond(40, 60) ? ma2 : na, '', color=bsDn < 50 ? color.rgb(DnR1 - (Rdn * 10), DnG1 - (Gdn * 10), DnB1 - (Bdn * 10), TdnMn + (Tdn * 10))
: color.rgb(DnR1 - (Rdn * 11), DnG1 - (Gdn * 11), DnB1 - (Bdn * 11), TdnMn + (Tdn * 11)), style=plot.style_linebr, linewidth=1)
plotshape(bsUp == 0 ? ma1 : na, '', color= chart.fg_color , location=location.absolute, style=shape.circle, size=size.tiny )
plotshape(bsUp == 0 ? ma1 : na, '', color=color.new(chart.fg_color, 75), location=location.absolute, style=shape.circle, size=size.small )
plotshape(bsUp == 0 ? ma1 : na, '', color=color.new(chart.fg_color, 85), location=location.absolute, style=shape.circle, size=size.normal)
plotshape(bsDn == 0 ? ma2 : na, '', color= chart.fg_color , location=location.absolute, style=shape.circle, size=size.tiny )
plotshape(bsDn == 0 ? ma2 : na, '', color=color.new(chart.fg_color, 75), location=location.absolute, style=shape.circle, size=size.small )
plotshape(bsDn == 0 ? ma2 : na, '', color=color.new(chart.fg_color, 85), location=location.absolute, style=shape.circle, size=size.normal)
diff = math.round((len2 - len1) / 6)
vwma1 = typeMA3.ma(len1 + diff * 1)
vwma2 = typeMA3.ma(len1 + diff * 2)
vwma3 = typeMA3.ma(len1 + diff * 3)
vwma4 = typeMA3.ma(len1 + diff * 4)
vwma5 = typeMA3.ma(len1 + diff * 5)
vwma6 = typeMA3.ma(len1 + diff * 6)
plot(tentacles ? bsDn > 0 and bsDn <= 15 ? bsDn < 3 ? ma2 : vwma1 : na : na, '', color=DnCol3, style=plot.style_linebr)
plot(tentacles ? bsDn > 0 and bsDn <= 20 ? bsDn < 3 ? ma2 : vwma2 : na : na, '', color=DnCol3, style=plot.style_linebr)
plot(tentacles ? bsDn > 0 and bsDn <= 25 ? bsDn < 3 ? ma2 : vwma3 : na : na, '', color=DnCol3, style=plot.style_linebr)
plot(tentacles ? bsDn > 0 and bsDn <= 30 ? bsDn < 3 ? ma2 : vwma4 : na : na, '', color=DnCol3, style=plot.style_linebr)
plot(tentacles ? bsDn > 0 and bsDn <= 35 ? bsDn < 3 ? ma2 : vwma5 : na : na, '', color=DnCol3, style=plot.style_linebr)
plot(tentacles ? bsDn > 0 and bsDn <= 40 ? bsDn < 3 ? ma2 : vwma6 : na : na, '', color=DnCol3, style=plot.style_linebr)
plot(tentacles ? bsUp > 0 and bsUp <= 15 ? bsUp < 3 ? ma1 : vwma1 : na : na, '', color=UpCol3, style=plot.style_linebr)
plot(tentacles ? bsUp > 0 and bsUp <= 20 ? bsUp < 3 ? ma1 : vwma2 : na : na, '', color=UpCol3, style=plot.style_linebr)
plot(tentacles ? bsUp > 0 and bsUp <= 25 ? bsUp < 3 ? ma1 : vwma3 : na : na, '', color=UpCol3, style=plot.style_linebr)
plot(tentacles ? bsUp > 0 and bsUp <= 30 ? bsUp < 3 ? ma1 : vwma4 : na : na, '', color=UpCol3, style=plot.style_linebr)
plot(tentacles ? bsUp > 0 and bsUp <= 35 ? bsUp < 3 ? ma1 : vwma5 : na : na, '', color=UpCol3, style=plot.style_linebr)
plot(tentacles ? bsUp > 0 and bsUp <= 40 ? bsUp < 3 ? ma1 : vwma6 : na : na, '', color=UpCol3, style=plot.style_linebr)
_ = '
-------------- '
Yer İmleri