Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //@version=4
- study("Volatility Bars")
- h= (swma(avg(high, high[1], high[2])))
- l= (swma(avg(low, low[1], low[2])))
- c= input(close, "Source", type = input.source)
- o= ((swma(open)))
- a = cum(tr) - cum(tr)[720]
- b = cum(tr)[720] - cum(tr)[1440]
- C = a/b
- plotcandle(o, h, l, c, wickcolor = color.black, color = C < .75 ? color.white: C > 1.25 ? color.yellow : c > o ? color.blue : c < o ? color.red : color.white)
- plotshape(c, location = location.absolute, style = shape.diamond, color = C < .75 ? color.white: C > 1.25 ? color.yellow : c > o ? color.blue : color.red, size = size.auto, transp = 0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement