refactor: Reverted to Full Recalc for consistency

This commit is contained in:
Toh4iem9
2025-12-06 17:50:22 +01:00
parent 55556b0f0c
commit 9d64c0f3c9
@@ -1,10 +1,9 @@
//+------------------------------------------------------------------+
//| MAMA_Pro.mq5|
//| Copyright 2025, xxxxxxxx|
//| |
//+------------------------------------------------------------------+
#property copyright "Copyright 2025, xxxxxxxx"
#property version "1.00"
#property version "1.10" // Reverted to Full Recalc for consistency
#property description "John Ehlers' MESA Adaptive Moving Average (MAMA) and FAMA."
#property indicator_chart_window
@@ -79,7 +78,9 @@ void OnDeinit(const int reason)
}
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total, const int, const datetime&[], const double &open[], const double &high[], const double &low[], const double &close[], const long&[], const long&[], const int&[])
//| Custom indicator calculation function |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total, const int prev_calculated, const datetime&[], const double &open[], const double &high[], const double &low[], const double &close[], const long&[], const long&[], const int&[])
{
if(CheckPointer(g_calculator) == POINTER_INVALID)
return 0;
@@ -90,7 +91,9 @@ int OnCalculate(const int rates_total, const int, const datetime&[], const doubl
else
price_type = (ENUM_APPLIED_PRICE)InpSourcePrice;
// Full Recalc (no prev_calculated passed)
g_calculator.Calculate(rates_total, price_type, open, high, low, close, BufferMAMA, BufferFAMA);
return(rates_total);
}
//+------------------------------------------------------------------+