From 62d165dfb1c02588f32e9c5b05f33d373a75276c Mon Sep 17 00:00:00 2001 From: Toh4iem9 Date: Tue, 2 Dec 2025 16:09:33 +0100 Subject: [PATCH] new files added --- .../MyIncludes/Symbol_Strength_Calculator.mqh | 113 ++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 Include/MyIncludes/Symbol_Strength_Calculator.mqh diff --git a/Include/MyIncludes/Symbol_Strength_Calculator.mqh b/Include/MyIncludes/Symbol_Strength_Calculator.mqh new file mode 100644 index 0000000..18207fd --- /dev/null +++ b/Include/MyIncludes/Symbol_Strength_Calculator.mqh @@ -0,0 +1,113 @@ +//+------------------------------------------------------------------+ +//| Symbol_Strength_Calculator.mqh | +//| VERSION 1.10: Robust data handling and synchronization. | +//| Copyright 2025, xxxxxxxx | +//+------------------------------------------------------------------+ +#property copyright "Copyright 2025, xxxxxxxx" + +//+------------------------------------------------------------------+ +//| | +//+------------------------------------------------------------------+ +class CSymbolStrengthCalculator + { +private: + int m_period; + ENUM_TIMEFRAMES m_timeframe; + string m_symbols[]; + int m_symbol_count; + + double GetROC(string symbol, int index); + +public: + CSymbolStrengthCalculator(void) : m_symbol_count(0) {}; + ~CSymbolStrengthCalculator(void) {}; + + bool Init(int period, ENUM_TIMEFRAMES tf, const string &symbols[]); + void CalculateStep(int bar_index, double &strengths[]); + int GetCount() { return m_symbol_count; } + + //--- NEW: Check if data is ready for all symbols + bool IsDataReady(void); + }; + +//+------------------------------------------------------------------+ +bool CSymbolStrengthCalculator::Init(int period, ENUM_TIMEFRAMES tf, const string &symbols[]) + { + m_period = period; + m_timeframe = tf; + + m_symbol_count = ArraySize(symbols); + ArrayResize(m_symbols, m_symbol_count); + + for(int i=0; i