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
+7 -8
View File
@@ -1,4 +1,4 @@
// The MIT License (MIT)
// Licensed under the Apache License, Version 2.0
// © mihakralj
//@version=6
indicator("Elder's Thermometer", "ETHERM", overlay=false)
@@ -12,14 +12,13 @@ etherm(simple int period) =>
runtime.error("Period must be greater than 0")
// Step 1: Calculate raw thermometer value
// Temperature = max(abs(High - prevHigh), abs(prevLow - Low))
// Inside bar (High < prevHigh AND Low > prevLow) => 0
// Temperature = max of upward high protrusion and downward low protrusion
// Only outward extensions count; contractions clamp to zero
float prevHigh = nz(high[1], high)
float prevLow = nz(low[1], low)
float highDiff = math.abs(high - prevHigh)
float lowDiff = math.abs(prevLow - low)
bool isInsideBar = high < prevHigh and low > prevLow
float temp = isInsideBar ? 0.0 : math.max(highDiff, lowDiff)
float highDiff = math.max(high - prevHigh, 0.0)
float lowDiff = math.max(prevLow - low, 0.0)
float temp = math.max(highDiff, lowDiff)
// Step 2: EMA of thermometer with warmup compensation
float alpha = 2.0 / float(period + 1)
@@ -51,4 +50,4 @@ color thermColor = isExplosive ? color.red : isHot ? color.orange : color.new(co
// Plot
plot(thermValue, "Thermometer", color=thermColor, style=plot.style_histogram, linewidth=2)
plot(signalValue, "Signal", color=color.yellow, linewidth=2)
plot(signalValue, "Signal", color=color.yellow, linewidth=2)