How It Works: BuyVol: Estimates buying volume by calculating the proportion of volume attributed to the upward price movement within each bar. SellVol: Estimates selling volume by calculating the proportion of volume attributed to the downward price movement within each bar.
Customization: length: You can adjust the length input parameter to change the period over which the average is calculated.
Visualization: The buy trendline is plotted in Green and represents the average net buying vs. selling volume over the specified period. The sell trendline is plotted in Red and represents the average net selling vs. buying volume over the specified period.
Note: This script provides an approximation and should be used in conjunction with other analysis tools to make informed trading decisions.