(cfg: VpinConfig)
| 132 | pub fn total_volume(self) -> f64 { |
| 133 | self.buy_volume + self.sell_volume |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | /// Parameters of the VPIN estimator ([`VpinState`]). |
| 138 | #[derive(Debug, Clone, Copy, PartialEq)] |
| 139 | pub struct VpinConfig { |
| 140 | /// Volume in each bucket, in the units of the event volumes; finite and > 0. |
| 141 | pub bucket_volume: f64, |
| 142 | /// Number of completed buckets in rolling VPIN window (`n` in the VPIN mean); > 0. |
| 143 | pub support_buckets: usize, |
| 144 | /// Number of past VPIN values in the rolling history that VPIN's empirical CDF is taken over. |
| 145 | /// |
| 146 | /// One VPIN value is recorded each time a bucket completes (once `support_buckets` buckets |
| 147 | /// exist), so the history spans the last `cdf_lookback` buckets, i.e. |
| 148 | /// `cdf_lookback * bucket_volume` units of volume. The CDF is `None` until the history is |
| 149 | /// full. It includes the current value and ties count half (see [`VpinState::current_cdf`]), |
| 150 | /// so the largest CDF a value can reach is `1 - 0.5 / cdf_lookback`. Must be at least 2. |
| 151 | pub cdf_lookback: usize, |
| 152 | } |
| 153 |
nothing calls this directly
no outgoing calls
no test coverage detected