fixed libs

This commit is contained in:
Bojan Kucera 2025-06-04 22:56:03 -04:00
parent 528be93804
commit 5cd24ade09
6 changed files with 29 additions and 420 deletions

View file

@ -812,25 +812,6 @@ export function amihudIlliquidityHFT(
return validTrades > 0 ? illiquiditySum / validTrades : 0;
}
/**
* Parkinson Volatility
*/
export function parkinsonVolatility(
highPrices: number[],
lowPrices: number[]
): number {
if (highPrices.length !== lowPrices.length || highPrices.length < 2) return 0;
let sumSquaredLogHL = 0;
for (let i = 0; i < highPrices.length; i++) {
const logHL = Math.log(highPrices[i] / lowPrices[i]);
sumSquaredLogHL += logHL * logHL;
}
const parkinsonVariance = (1 / (4 * highPrices.length * Math.log(2))) * sumSquaredLogHL;
return Math.sqrt(parkinsonVariance);
}
/**
* Garman-Klass Volatility
*/