Re: New Gann Swing Chartist Plan - Gann Trend Oscillator + Gann Swing Oscillator

11
shinnosuke wrote: Fri May 20, 2022 5:20 am Hi sal, thanks for the efforts.
And i found this indicator code on tra.....ew forums.
Can this help us to create the mt4 version?

//@version=4
// Copyright (c) 2019-present, Franklin Moormann (cheatcountry)
// Gann Trend Oscillator [CC] script may be freely distributed under the MIT license.
study("Gann Trend Oscillator [CC]", overlay=false)

inp = input(title="Source", type=input.source, defval=close)
res = input(title="Resolution", type=input.resolution, defval="")
rep = input(title="Allow Repainting?", type=input.bool, defval=false)
bar = input(title="Allow Bar Color Change?", type=input.bool, defval=true)
src = security(syminfo.tickerid, res, inp[rep ? 0 : barstate.isrealtime ? 1 : 0])[rep ? 0 : barstate.isrealtime ? 0 : 1]
length = input(title="Length", type=input.integer, defval=3, minval=1)

hv = highest(src, length)
lv = lowest(src, length)

gto = 0
gto := hv[2] > hv[1] and hv[0] > hv[1] ? 1 : lv[2] < lv[1] and lv[0] < lv[1] ? -1 : nz(gto[1])

sig = gto > 0 ? 1 : gto < 0 ? -1 : 0
alertcondition(crossover(sig, 0), "Buy Signal", "Bullish Change Detected")
alertcondition(crossunder(sig, 0), "Sell Signal", "Bearish Change Detected")
gtoColor = sig > 0 ? color.green : sig < 0 ? color.red : color.black
barcolor(bar ? gtoColor : na)
plot(gto, title="GTO", linewidth=2, color=gtoColor)
i am not coder... expert coders can helps on this..
These users thanked the author sal for the post:
shinnosuke
"There is NO GOD higher than TRUTH" - Mahatma Gandhi


Who is online

Users browsing this forum: Ahrefs [Bot], Amazon [Bot], Proximic [Bot] and 3 guests