mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-22 12:38:06 +00:00
feat: add new indicators (Decay, Edecay, MinusDi, MinusDm, PlusDi, PlusDm, Maxindex, Minindex, Sarext) and update pine scripts, core libs, validation tests, and python bindings
This commit is contained in:
+1
-16
@@ -412,22 +412,7 @@ public sealed class Vhf : AbstractBase
|
||||
// Calculate VHF
|
||||
if (closeFilled >= closeBufSize && diffFilled >= period)
|
||||
{
|
||||
// Scan for max/min over close buffer
|
||||
double hi = double.MinValue;
|
||||
double lo = double.MaxValue;
|
||||
for (int k = 0; k < closeBufSize; k++)
|
||||
{
|
||||
double cv = closeBuf[k];
|
||||
if (cv > hi)
|
||||
{
|
||||
hi = cv;
|
||||
}
|
||||
if (cv < lo)
|
||||
{
|
||||
lo = cv;
|
||||
}
|
||||
}
|
||||
|
||||
var (lo, hi) = ((ReadOnlySpan<double>)closeBuf).MinMaxSIMD();
|
||||
double numerator = hi - lo;
|
||||
|
||||
if (diffSum > 1e-10)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// The MIT License (MIT)
|
||||
// Licensed under the Apache License, Version 2.0
|
||||
// © mihakralj
|
||||
//@version=6
|
||||
indicator("VHF: Vertical Horizontal Filter", "VHF", overlay=false)
|
||||
|
||||
Reference in New Issue
Block a user