PHP Code:
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © borsaegitimcisi
//@version=5
indicator('King Kong Junior', overlay=true)
EMAlength = input(200, 'EMA LENGTH?')
src = ohlc4
haOpen = 0.0
haOpen := (src + nz(haOpen[1])) / 2
haC = (ohlc4 + nz(haOpen) + math.max(high, nz(haOpen)) + math.min(low, nz(haOpen))) / 4
EMA1 = ta.ema(haC, EMAlength)
EMA2 = ta.ema(EMA1, EMAlength)
EMA3 = ta.ema(EMA2, EMAlength)
TMA1 = 3 * EMA1 - 3 * EMA2 + EMA3
EMA4 = ta.ema(TMA1, EMAlength)
EMA5 = ta.ema(EMA4, EMAlength)
EMA6 = ta.ema(EMA5, EMAlength)
TMA2 = 3 * EMA4 - 3 * EMA5 + EMA6
IPEK = TMA1 - TMA2
YASIN = TMA1 + IPEK
EMA7 = ta.ema(hlc3, EMAlength)
EMA8 = ta.ema(EMA7, EMAlength)
EMA9 = ta.ema(EMA8, EMAlength)
TMA3 = 3 * EMA7 - 3 * EMA8 + EMA9
EMA10 = ta.ema(TMA3, EMAlength)
EMA11 = ta.ema(EMA10, EMAlength)
EMA12 = ta.ema(EMA11, EMAlength)
TMA4 = 3 * EMA10 - 3 * EMA11 + EMA12
IPEK1 = TMA3 - TMA4
YASIN1 = TMA3 + IPEK1
mavi = YASIN1
kirmizi = YASIN
longCond = mavi > kirmizi and mavi[1] <= kirmizi[1]
shortCond = mavi < kirmizi and mavi[1] >= kirmizi[1]
trendState = kirmizi < mavi ? true : kirmizi > mavi ? false : na
//closePlot = plot(kirmizi, title='Close Line', color=color.new(#009900, 90), linewidth=10, style=plot.style_line)
//openPlot = plot(mavi, title='Open Line', color=color.new(#CC0000, 90), linewidth=10, style=plot.style_line)
closePlotU = plot(trendState ? kirmizi : na, editable=false, transp=100)
openPlotU = plot(trendState ? mavi : na, editable=false, transp=100)
closePlotD = plot(trendState ? na : kirmizi, editable=false, transp=100)
openPlotD = plot(trendState ? na : mavi, editable=false, transp=100)
fill(openPlotU, closePlotU, title='Up Trend Fill', color=color.new(#009900, 1))
fill(openPlotD, closePlotD, title='Down Trend Fill', color=color.new(#CC0000, 1))
last_signal = 0
long_final = longCond and (nz(last_signal[1]) == 0 or nz(last_signal[1]) == -1)
short_final = shortCond and (nz(last_signal[1]) == 0 or nz(last_signal[1]) == 1)
alertcondition(long_final, title='buy alarm', message='buy signal!!!')
alertcondition(short_final, title='sell alarm', message='sell signal!!!')
last_signal := long_final ? 1 : short_final ? -1 : last_signal[1]
plotshape(long_final, style=shape.labelup, location=location.belowbar, color=color.new(color.blue, 0), size=size.tiny, title='buy label', text='al', textcolor=color.new(color.white, 0))
plotshape(short_final, style=shape.labeldown, location=location.abovebar, color=color.new(color.red, 0), size=size.tiny, title='sell label', text='Sat', textcolor=color.new(color.white, 0))
Yer İmleri