Javad finishes the Volume profile

Kernel Density Estimation (KDE)

To overcome the discontinuities in the Volume Profile and to provide a more continuous estimate of price levels with significant trading volume, Kernel Density Estimation (KDE) can be employed. KDE is a non-parametric method for estimating the probability density function of a random variable and is defined as:

\[f_v(p) = \frac{1}{n} \sum_{i=1}^{n} K_h \left( \frac{p - p_i}{h} \right)\]

Where $p_i$ is the price on day $i$, $K_h(.)$ is the kernel function, and $h$ is the bandwidth of the kernel. The choice of kernel function and bandwidth affects the smoothness and accuracy of the resulting density estimate. A well-chosen bandwidth strikes a balance between too much noise (under-smoothing) and the loss of important details (over-smoothing).