I added a low lag filter to key components to smooth the bars. The user can adjust the parameters 'fast' and 'slow' to tune.
The original comments of ceyhun are below repeated:
-Buy Percent %
-Sell Percent %
-Buy Sell Volume-
VolumeIndex>length and close > open =Cyan barcolor
VolumeIndex>length and close < open =Gray barcolor
VolumeIndex<=length = Yellow barcolor
Nello spirito di condivisione promosso da TradingView, l'autore (al quale vanno i nostri ringraziamenti) ha deciso di pubblicare questo script in modalità open-source, così che chiunque possa comprenderlo e testarlo. Puoi utilizzarlo gratuitamente, ma il riutilizzo del codice è subordinato al rispetto del Regolamento. Per aggiungerlo al grafico, mettilo tra i preferiti.
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.
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.