Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // © Hookster
- //@version=5
- indicator(title='VisionVolume', shorttitle='VisVol', overlay=true)
- showLabels = input(true)
- weakpush = input(title='Weak push', defval=#9e32f9)
- resistance = input(title='Resistance', defval=color.orange)
- //average vol
- vcal(Series, Period) =>
- mean = math.sum(Series, Period) / Period
- return_1 = mean
- return_1
- avgV = vcal(volume, 200)
- medVlower = avgV > volume
- medVhigher = avgV < volume
- //bar heights
- barH2 = high[2] - low[2]
- barH1 = high[1] - low[1]
- barH0 = high - low
- isUp() =>
- close > open
- isUp1() =>
- close[1] > open[1]
- isUp2() =>
- close[2] > open[2]
- isDown() =>
- close <= open
- isDown1() =>
- close[1] <= open[1]
- isDown2() =>
- close[2] <= open[2]
- //INDICATOR 1 - weak push higher or lower
- higherPA() =>
- barH1 * 1.1 < barH0
- sameDirection = isUp() == isUp1()
- lowerV() =>
- volume[0] < volume[1] * 0.9
- ind1 = higherPA() and lowerV() and sameDirection and medVlower
- //confirmation
- //lower than avg
- secondlowerV() =>
- volume[0] < volume[2]
- ind1b = ind1[1] and secondlowerV() and sameDirection
- //COLOR IND 1//
- barcolor(ind1 ? weakpush : na)
- barcolor(ind1b ? color.black : na)
- pushUp = ind1 and isUp() and showLabels
- pushDown = ind1 and isDown() and showLabels
- plotshape(pushDown, title='buy', text='Fake! ⬆︎', color=weakpush, style=shape.labelup, location=location.belowbar, size=size.small, textcolor=color.new(color.white, 0), transp=0) //plot for buy icon
- plotshape(pushUp, title='sell', text='Fake! ⬇︎', color=weakpush, style=shape.labeldown, location=location.abovebar, size=size.small, textcolor=color.new(color.white, 0), transp=0)
- // Alert //
- alertcondition(pushDown, title='pushDown', message='Buy')
- alertcondition(pushUp, title='pushUp', message='Sell')
- //INDICATOR 2 - Rally that meets resistance by high volume - low price action
- lowerPA() =>
- barH1 > barH0
- higherV() =>
- volume[0] > volume[1]
- ind2 = lowerPA() and higherV() and sameDirection and medVhigher
- //COLOR IND 2//
- barcolor(ind2 ? resistance : na)
- resistUp = ind2 and isUp() and showLabels
- resistDown = ind2 and isDown() and showLabels
- plotshape(resistDown, title='buy', text='Reversal ⬆︎', color=resistance, style=shape.labelup, location=location.belowbar, size=size.small, textcolor=color.new(color.white, 0), transp=0) //plot for buy icon
- plotshape(resistUp, title='sell', text='Reversal ⬇︎', color=resistance, style=shape.labeldown, location=location.abovebar, size=size.small, textcolor=color.new(color.white, 0), transp=0)
- // Alert //
- alertcondition(resistDown, title='resistDown', message='Buy')
- alertcondition(resistUp, title='resistUp', message='Sell')
Advertisement
Add Comment
Please, Sign In to add comment