TradingView
ayob1
2019년 1월 24일 오후 1시 24분

3MA 

설명

3 moving averagers in one indicator
코멘트
alinajafi54
//@version=5
// Betatrader.ir

indicator(title='Betatrader Ichimoku Pro', shorttitle='Betatrader Ichimoku Pro', overlay=true)

TenkansenPeriods = input.int(9, minval=1, title='TenkanSen',group="Ichimoku")
KijunsenPeriods = input.int(26, minval=1, title='KijunSen',group="Ichimoku")
leadingSpan2Periods = input.int(52, minval=1, title='Span B',group="Ichimoku")
displacement = input.int(26, minval=1, title='Cloud Shift',group="Ichimoku")
HighLinePeriods = input.int(103, minval=1, title='103 Periods Line',group="Ichimoku")
displacementTenkanShift = input.int(-17, minval=-52, title='TenkanShift',group="Ichimoku")
displacementQualityLine = input.int(26, minval=1, title='QualityLine/ChikouSpan',group="Ichimoku")
displacementDirectionLine = input.int(-26, minval=-52, title='DirectionLine',group="Ichimoku")
xPeriods = input.int(26, minval=1, title='KijunSen Band Periods',group="Ichimoku")

showTenkan = input(true, title='Show TenkanSen',group="Ichimoku")
showKijun = input(true, title='Show KijunSen',group="Ichimoku")
showChikouSpan = input(false, title='Show Chikou Span',group="Ichimoku")
showCloud = input(true, title='Show cloud',group="Ichimoku")
cross1 = input(false, title='Show crossings Tenkan/Kijun',group="Ichimoku")
cross2 = input(false, title='Show crossings SpanA/SpanB',group="Ichimoku")
showQL = input(false, title='Show Quality Line',group="Ichimoku")
showDL = input(false, title='Show Direction Line',group="Ichimoku")
showTenkanShift = input(false, title='Show TenkanSen Shift',group="Ichimoku")
showHighLine = input(false, title='Show 103 Periods Line',group="Ichimoku")
showband = input(false, title='Show KijunSen Band',group="Ichimoku")

//
xdisplacement = 0
highband = ta.highest(xPeriods)
lowband = ta.lowest(xPeriods)
MiddleLine = math.avg(highband, lowband)
donchian(len) =>
math.avg(ta.lowest(len), ta.highest(len))
turning = donchian(TenkansenPeriods)
standard = donchian(KijunsenPeriods)
highline = donchian(HighLinePeriods)
leadingSpan1 = math.avg(turning, standard)
leadingSpan2 = donchian(leadingSpan2Periods)

crossUpTenkanKinjun = turning[1] < standard[1] and turning >= standard ? 1 : 0
crossDnTenkanKinjun = turning[1] > standard[1] and turning <= standard ? 1 : 0

crossUp = ta.crossover(leadingSpan1,leadingSpan2)
crossDn = ta.crossunder(leadingSpan1,leadingSpan2)

plot(showKijun and standard ? standard : na, title='KijunSen', linewidth=1, color=color.new(#0045ff, 0))
plot(showTenkan and turning ? turning : na, title='TenkanSen', linewidth=1, color=color.new(#ff0000, 0))
plot(showChikouSpan and close ? close : na, title='Chikou Span', linewidth=1, offset=-displacementQualityLine, color=color.new(#12b004, 0))

plot(showHighLine and highline ? highline : na, title='103 Periods Line', linewidth=1, color=color.new(#eeeeee, 0))
plot(showTenkanShift and turning ? turning : na, title='Tenkan-Sen Shift', linewidth=1, style=plot.style_line, offset=displacementTenkanShift, color=color.new(#F33315, 0))
plot(showQL and standard ? standard : na, title
더보기