Pulse
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// Original code by TradeStation
// s3raphic333 modified length, mulitpilier, and type of moving average 
// @version=5

indicator(title='Pulse', shorttitle='Pulse', format=format.volume)
showMA = input(false, title='Show Moving Avg')
volmalen = input(16, title='Avg Length')
volmult = input(1.8, title='Avg Multiplier')
volma = ta.ema(volume, volmalen)
volcolor = close > open and volume > volma * volmult ? color.new(#29d430, 50) : close < open and volume > volma * volmult ? color.new(#ff0000, 50) : color.new(#787b86, 65)
plot(volume, color=volcolor, style=plot.style_columns, title='Volume', transp=65)
plot(showMA ? volma * volmult : na, style=plot.style_area, color=color.new(color.white, 85), title='Volume MA')


