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:
Miha Kralj
2026-03-09 13:45:46 -07:00
parent 8e43d62cbb
commit 031f1b5fe6
491 changed files with 6156 additions and 5590 deletions
+6 -6
View File
@@ -135,7 +135,7 @@ public sealed class Vwma : ITValuePublisher
double v = _volBuffer[i];
if (v > 0)
{
sumPV += p * v;
sumPV = Math.FusedMultiplyAdd(p, v, sumPV);
sumVol += v;
}
}
@@ -224,14 +224,14 @@ public sealed class Vwma : ITValuePublisher
if (s.Count >= _period && oldVol > 0)
{
s.SumPV -= oldPrice * oldVol;
s.SumPV = Math.FusedMultiplyAdd(-oldPrice, oldVol, s.SumPV);
s.SumVol -= oldVol;
}
// Add new values
if (currentVol > 0)
{
s.SumPV += currentPrice * currentVol;
s.SumPV = Math.FusedMultiplyAdd(currentPrice, currentVol, s.SumPV);
s.SumVol += currentVol;
}
@@ -437,14 +437,14 @@ public sealed class Vwma : ITValuePublisher
if (count >= period && oldVol > 0)
{
sumPV -= oldPrice * oldVol;
sumPV = Math.FusedMultiplyAdd(-oldPrice, oldVol, sumPV);
sumVol -= oldVol;
}
// Add new values
if (currentVol > 0)
{
sumPV += currentPrice * currentVol;
sumPV = Math.FusedMultiplyAdd(currentPrice, currentVol, sumPV);
sumVol += currentVol;
}
@@ -474,7 +474,7 @@ public sealed class Vwma : ITValuePublisher
double vj = volBuffer[j];
if (vj > 0)
{
sumPV += pj * vj;
sumPV = Math.FusedMultiplyAdd(pj, vj, sumPV);
sumVol += vj;
}
}
+1 -1
View File
@@ -1,4 +1,4 @@
// The MIT License (MIT)
// Licensed under the Apache License, Version 2.0
// © mihakralj
//@version=6
indicator("Volume Weighted Moving Average (VWMA)", "VWMA", overlay=true)