sal wrote: Fri May 20, 2022 2:12 am
I find someone posted the code, but needs to work with this code to get a final one. I am not coder and i dont know how to explain in detail
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?
Code: Select all
//@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)