refactor(indicators): Integrated with CMO Engine

This commit is contained in:
Toh4iem9
2026-01-02 14:12:19 +01:00
parent 0c01958304
commit fb0ac45397
+3 -7
View File
@@ -13,7 +13,7 @@
#property indicator_type1 DRAW_LINE
#property indicator_color1 clrRed
#property indicator_style1 STYLE_SOLID
#property indicator_width1 1
#property indicator_width1 2
#property indicator_label1 "VIDYA"
#include <MyIncludes\VIDYA_Calculator.mqh>
@@ -25,8 +25,6 @@ input ENUM_APPLIED_PRICE_HA_ALL InpSourcePrice = PRICE_CLOSE_STD;
double BufferVIDYA[];
CVIDYACalculator *g_calculator;
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int OnInit()
{
@@ -52,11 +50,9 @@ int OnInit()
void OnDeinit(const int reason) { if(CheckPointer(g_calculator) != POINTER_INVALID) delete g_calculator; }
//+------------------------------------------------------------------+
//| Custom indicator calculation function |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
const int prev_calculated, // <--- Now used!
const int prev_calculated,
const datetime &time[],
const double &open[],
const double &high[],
@@ -75,9 +71,9 @@ int OnCalculate(const int rates_total,
else
price_type = (ENUM_APPLIED_PRICE)InpSourcePrice;
//--- Delegate calculation with prev_calculated optimization
g_calculator.Calculate(rates_total, prev_calculated, price_type, open, high, low, close, BufferVIDYA);
return(rates_total);
}
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+