Dest123

VolumeVsVSMAComparison

Volume vs the volume sma .

Blue is low volume , green is normal, yellow is high, and red is very high.

Top bar is 100sma, middle is 25sma, and bottom is 5 sma .
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?
//@version=2
study("VolumeVsVSMAComparison")
//strategy("Testing")

//changePosition(up) =>
  //  strategy.close_all()
//    up ? strategy.entry("buy", strategy.long, 10) : strategy.entry("sell", strategy.short, 10)
  //  up

smaVal = 100
lowVolume = volume < sma(volume,smaVal)*0.8
highVolume = volume > sma(volume,smaVal)*1.5
mediumHighVolume = volume > sma(volume,smaVal)*1

smaVal2 = 25
lowVolume2 = volume < sma(volume,smaVal2)*0.8
highVolume2 = volume > sma(volume,smaVal2)*1.5
mediumHighVolume2 = volume > sma(volume,smaVal2)*1

smaVal3 = 5
lowVolume3 = volume < sma(volume,smaVal3)*0.8
highVolume3 = volume > sma(volume,smaVal3)*1.5
mediumHighVolume3 = volume > sma(volume,smaVal3)*1

change = sma((close-open),1)
goingUp = ((change > change[1]))// and (change[1] > change[2]))

plot(close,"", lowVolume ? blue : highVolume ? red : mediumHighVolume ? orange : green, linewidth=3)
plot(close-5,"", lowVolume2 ? blue : highVolume2 ? red : mediumHighVolume2 ? orange : green, linewidth=3)
plot(close-10,"", lowVolume3 ? blue : highVolume3 ? red : mediumHighVolume3 ? orange : green, linewidth=3)

//changePosition(goingUp)
//if (not na(goingUp[1]))
    //if (goingUp != goingUp[1])
        //if ((lowVolume[1] or lowVolume[2]) and highVolume) or (highVolume[1] and not highVolume)
        //if goingUp
            //strategy.entry("buy", strategy.long, strategy.position_size == 0 ? 10 : 20)
        //else
//            strategy.entry("sell", strategy.short, strategy.position_size == 0 ? 10 : 20)

//plot(strategy.equity, "", blue)
//plot(strategy.netprofit+100)
//plot(close, "", (goingUp ? green : red))
//plot(open, "", (((sma(open,3) > sma(open,3)[1]) and (sma(open,3)[1] > sma(open,3)[2])) ? green : red))

//plot(macd, color=blue)
//plot(signal, color=orange)