TradingView
capam
Oct 8, 2020 4:23 PM

Buying Selling Volume low lag 

CVS Health CorporationNYSE

Description

Originally written by @ceyhun
I added a low lag filter to key components to smooth the bars. The user can adjust the parameters 'fast' and 'slow' to tune.
capam

The original comments of ceyhun are below repeated:

Buying Selling Volume

-Buy Volume
-Sell Volume
-Buy Volume Percent %
-Sell Volume Percent %
-Volume Index


-Buy Sell Volume-
BuyVolume>SellVolume=Blue barcolor
SellVolume>BuyVolume=Purple barcolor

-Volume Index-
VolumeIndex>length and close > open =Cyan barcolor
VolumeIndex>length and close < open =Gray barcolor
VolumeIndex<=length = Yellow barcolor
Comments
SnachGainsAndGo
THIS IS GOLD!
MistaGreat
@SnachGainsAndGo, bro pls could you help me out on how this indicator works?
SbeeH
good job
MistaGreat
Pls can anyone help me with how this volume indicator works I really wanna understand it
capam
@MistaGreat, a very good question and sorry for the delay. The below description is for the moving average version. In the version above I used low lag filters to try to eliminate the lag. Lines 14-18 describe the main filter.

Lines 20 & 21 are for setting the fast and slow filters. These are adjustable and the user can optimize based on the ticker data he chooses. Lines 22-27 are the main calculations to get the volume incorporated into the filtered data.

I suggest you track some of @ceyhun's work as he uses this concept in several of his scripts.

Good luck.

An N-day volume weighted moving average (VWMA) is the average of the past N days closing prices,
each weighted in proportion to the volume on that day. So if p1 is today’s closing price,
p2 yesterday’s, etc, and v1, v2, etc similarly the volumes, then the VWMA for today is

v1 * p1 + v2 * p2 + ... + vN * pN
VWMA = ---------------------------------
v1 + v2 + ... + vN
The effect is to give greater significance to days with greater volume, making the average
tend towards those days’ closing prices more. If all volumes are about the same then the
VWMA becomes a simple moving average (see Simple Moving Average).

A true VWMA, the kind frequently specified for dividend reinvestment plans and other things
needing an average price around a particular period, takes every price level and the volume
transacted at that level. Chart doesn’t have the data needed for that and the calculation
above instead effectively attributes all volume to the closing price.
framingham508
@capam, what if i wouldn’t know what to change it to Am new, i trade spy and qqq options mainly daytrade, what would be the suggested settings?
capam
@framingham508, Great question. Since there are so many variables in the signals, backtesting is the best way to compare tuning ideas. The volume changes as well as volatility & price from news, etc. I would mainly adjust lines 13, 20, & 21. Best of luck.
MistaGreat
More