Untitled

 avatar
unknown
plain_text
a year ago
5.8 kB
98
Indexable
//@version=5
//Developed by Tim Tillson
//author: KIVANÇ @fr3762 on twitter
indicator('M+AT+BOLL+T3', overlay=true)
T3FiboLine = input(false, title='Show T3 Fibonacci Ratio Line?')


length1 = input(8, 'T3 Length')
a1 = input(0.7, 'Volume Factor')

e1 = ta.ema((high + low + 2 * close) / 4, length1)
e2 = ta.ema(e1, length1)
e3 = ta.ema(e2, length1)
e4 = ta.ema(e3, length1)
e5 = ta.ema(e4, length1)
e6 = ta.ema(e5, length1)
c1 = -a1 * a1 * a1
c2 = 3 * a1 * a1 + 3 * a1 * a1 * a1
c3 = -6 * a1 * a1 - 3 * a1 - 3 * a1 * a1 * a1
c4 = 1 + 3 * a1 + a1 * a1 * a1 + 3 * a1 * a1
T3 = c1 * e6 + c2 * e5 + c3 * e4 + c4 * e3

col1 = T3 > T3[1]
col3 = T3 < T3[1]
color_1 = col1 ? color.green : col3 ? color.red : color.yellow
plot(T3, color=color_1, linewidth=3, title='T3')

length12 = input(5, 'T3 Length fibo')
a12 = input(0.618, 'Volume Factor fibo')

e12 = ta.ema((high + low + 2 * close) / 4, length12)
e22 = ta.ema(e12, length12)
e32 = ta.ema(e22, length12)
e42 = ta.ema(e32, length12)
e52 = ta.ema(e42, length12)
e62 = ta.ema(e52, length12)
c12 = -a12 * a12 * a12
c22 = 3 * a12 * a12 + 3 * a12 * a12 * a12
c32 = -6 * a12 * a12 - 3 * a12 - 3 * a12 * a12 * a12
c42 = 1 + 3 * a12 + a12 * a12 * a12 + 3 * a12 * a12
T32 = c12 * e62 + c22 * e52 + c32 * e42 + c42 * e32

col12 = T32 > T32[1]
col32 = T32 < T32[1]
color2 = col12 ? color.blue : col32 ? color.purple : color.yellow
plot(T3FiboLine and T32 ? T32 : na, color=color2, linewidth=2, title='T3fibo')

alertcondition(ta.crossover(T3, T3[1]), title='T3 BUY', message='T3 BUY!')
alertcondition(ta.crossunder(T3, T3[1]), title='T3 SELL', message='T3 SELL!')

alertcondition(ta.cross(T3, T3[1]), title='Color ALARM', message='T3 has changed color!')

////////////////

mavilimold = input(false, title='Show Previous Version of MavilimW?')
fmal = input(3, 'First Moving Average length')
smal = input(5, 'Second Moving Average length')
tmal = fmal + smal
Fmal = smal + tmal
Ftmal = tmal + Fmal
Smal = Fmal + Ftmal

M1 = ta.wma(close, fmal)
M2 = ta.wma(M1, smal)
M3 = ta.wma(M2, tmal)
M4 = ta.wma(M3, Fmal)
M5 = ta.wma(M4, Ftmal)
MAVW = ta.wma(M5, Smal)
col11 = MAVW > MAVW[1]
col31 = MAVW < MAVW[1]
colorM = col11 ? color.blue : col31 ? color.red : color.yellow

plot(MAVW, color=colorM, linewidth=2, title='MAVW')

M12 = ta.wma(close, 3)
M22 = ta.wma(M12, 5)
M32 = ta.wma(M22, 8)
M42 = ta.wma(M32, 13)
M52 = ta.wma(M42, 21)
MAVW2 = ta.wma(M52, 34)

plot(mavilimold and MAVW2 ? MAVW2 : na, color=color.new(color.blue, 0), linewidth=2, title='MavWOld')

alertcondition(ta.crossover(MAVW, MAVW[1]), title='MAVW BUY', message='MAVW BUY!')
alertcondition(ta.crossunder(MAVW, MAVW[1]), title='MAVW SELL', message='MAVW SELL!')

alertcondition(ta.cross(MAVW, MAVW[1]), title='Color ALARM', message='MavilimW has changed color!')

////////////

/////////////bollınger
length = input.int(20, minval=1, title='BB MA')
src9 = input(close, title='BB Source')
mult = input.float(2.0, minval=0.001, maxval=50, title='Narrow BB Multitude')

basis = ta.sma(src9, length)
dev = mult * ta.stdev(src9, length)
upper = basis + dev
lower = basis - dev
plot(basis, color=color.new(#d70081, 0), title='BB MA')
p1 = plot(upper, color=color.new(color.green, 50), title='Narrow Upper')
p2 = plot(lower, color=color.new(color.red, 50), title='Narrow Lower')

length11 = input.int(20, minval=1, title='Wide BB Length')
mult1 = input.float(3.0, minval=0.001, maxval=50, title='Wide BB Multitude')
basis1 = ta.sma(src9, length11)
dev1 = mult1 * ta.stdev(src9, length11)
upper1 = basis1 + dev1
lower1 = basis1 - dev1

p3 = plot(upper1, color=color.new(color.green, 50), title='Wide Higher')
p4 = plot(lower1, color=color.new(color.red, 50), title='Wide Lower')
fill(p3, p1, color=color.new(color.green, 95), title='Upper Fill')
fill(p4, p2, color=color.new(color.red, 95), title='Lower Fill')
//////////////


coeff = input.float(1, 'Multiplier', step=0.1)
AP = input(14, 'Common Period')
ATR = ta.sma(ta.tr, AP)
src5 = input(close)
showsignalsk = input(title='Show Signals?', defval=true)
novolumedata = input(title='Change calculation (no volume data)?', defval=false)
upT = low - ATR * coeff
downT = high + ATR * coeff
AlphaTrend = 0.0
AlphaTrend := (novolumedata ? ta.rsi(src5, AP) >= 50 : ta.mfi(hlc3, AP) >= 50) ? upT < nz(AlphaTrend[1]) ? nz(AlphaTrend[1]) : upT : downT > nz(AlphaTrend[1]) ? nz(AlphaTrend[1]) : downT

color1 = AlphaTrend > AlphaTrend[2] ? #00E60F : AlphaTrend < AlphaTrend[2] ? #80000B : AlphaTrend[1] > AlphaTrend[3] ? #00E60F : #80000B
k14 = plot(AlphaTrend, color=color.new(#0022FC, 0), linewidth=3)
k24 = plot(AlphaTrend[2], color=color.new(#FC0400, 0), linewidth=3)

fill(k14, k24, color=color1)

buySignalk = ta.crossover(AlphaTrend, AlphaTrend[2])
sellSignalk = ta.crossunder(AlphaTrend, AlphaTrend[2])


K1 = ta.barssince(buySignalk)
K2 = ta.barssince(sellSignalk)
O1 = ta.barssince(buySignalk[1])
O2 = ta.barssince(sellSignalk[1])

plotshape(buySignalk and showsignalsk and O1 > K2 ? AlphaTrend[2] * 0.9999 : na, title='BUY', text='BUY', location=location.absolute, style=shape.labelup, size=size.tiny, color=color.new(#0022FC, 0), textcolor=color.new(color.white, 0))

plotshape(sellSignalk and showsignalsk and O2 > K1 ? AlphaTrend[2] * 1.0001 : na, title='SELL', text='SELL', location=location.absolute, style=shape.labeldown, size=size.tiny, color=color.new(color.maroon, 0), textcolor=color.new(color.white, 0))


alertcondition(buySignalk and O1 > K2, title='Potential BUY Alarm', message='BUY SIGNAL!')
alertcondition(sellSignalk and O2 > K1, title='Potential SELL Alarm', message='SELL SIGNAL!')

alertcondition(buySignalk[1] and O1[1] > K2, title='Confirmed BUY Alarm', message='BUY SIGNAL APPROVED!')
alertcondition(sellSignalk[1] and O2[1] > K1, title='Confirmed SELL Alarm', message='SELL SIGNAL APPROVED!')
Editor is loading...
Leave a Comment