spartandir
New member
Hello, i saw this code and I'm trying to figure out what's wrong in my code. I'd also like to convert it thinkscript as well. any help is greatly appreciated.
length = input (20,minval= 1)
mult = input (2.0, minval = .1, maxval=5.0)
band_top = sma(close, length) + mult * stdev(close, length)
band_bottom = sma(close, length) - mult * stdev(close, length)
rl618 = fib(high,low, 61.8)
rl50 = fibonacci(high,low, 50)
rl382 = fibonacci(high,low, 38.2)
buy = close > band_top and close < rl618
sell = close < band_bottom and close > rl382
plot (band_top, color =orange,linewidth = 1, title="BBTop")
plot (band_bottom, color =orange, linewidth = 1, title = "BBBot")
plot (rl618,color = purple, linewidth = 1, title = "61%")
plot (rl50,color = purple, linewidth = 1, title = "50%")
plot (rl382,color = purple, linewidth = 1, title = "38%")
buy = close > band_top and close < rl618
sell = close < band_bottom and close > rl382
plotshape(buy, color=green,style=shape.triangleup, title="Buy")
plotshape(sell, color=green,style=shape.triangleup, title="sell")
TV is currently complaining about fibonacci function and variables not being declared.
thanks in advance.
length = input (20,minval= 1)
mult = input (2.0, minval = .1, maxval=5.0)
band_top = sma(close, length) + mult * stdev(close, length)
band_bottom = sma(close, length) - mult * stdev(close, length)
rl618 = fib(high,low, 61.8)
rl50 = fibonacci(high,low, 50)
rl382 = fibonacci(high,low, 38.2)
buy = close > band_top and close < rl618
sell = close < band_bottom and close > rl382
plot (band_top, color =orange,linewidth = 1, title="BBTop")
plot (band_bottom, color =orange, linewidth = 1, title = "BBBot")
plot (rl618,color = purple, linewidth = 1, title = "61%")
plot (rl50,color = purple, linewidth = 1, title = "50%")
plot (rl382,color = purple, linewidth = 1, title = "38%")
buy = close > band_top and close < rl618
sell = close < band_bottom and close > rl382
plotshape(buy, color=green,style=shape.triangleup, title="Buy")
plotshape(sell, color=green,style=shape.triangleup, title="sell")
TV is currently complaining about fibonacci function and variables not being declared.
thanks in advance.