mirror of
https://github.com/softwaredevelop/mql5.git
synced 2026-07-27 20:47:44 +00:00
refactor(indicators): Normalized Deviation (Score)
This commit is contained in:
@@ -43,5 +43,13 @@ public:
|
||||
return 0.0;
|
||||
return (price - level) / atr;
|
||||
}
|
||||
//--- Calculate Normalized Deviation (Score)
|
||||
// Formula: (CurrentValue - ReferenceValue) / Normalizer (e.g. ATR)
|
||||
static double CalculateDeviation(double current_val, double ref_val, double normalizer)
|
||||
{
|
||||
if(normalizer == 0)
|
||||
return 0.0;
|
||||
return (current_val - ref_val) / normalizer;
|
||||
}
|
||||
};
|
||||
//+------------------------------------------------------------------+
|
||||
|
||||
Reference in New Issue
Block a user