From ee9f04b81767f784758e8ad832ff60869a170f0d Mon Sep 17 00:00:00 2001 From: Hadi Khazaee Asl Date: Tue, 9 Jul 2024 12:40:59 +0330 Subject: [PATCH] apply latest optimization on indicator helpers classes and also add time tracking configurations into ea ... --- Classes/x-saherelm.x121.setup.cycle.class.mq5 | 7 + Classes/x-saherelm.x121.setup.xea.mq5 | 2 +- Classes/x-saherelm.xea.class.mq5 | 27 +++ Classes/x-saherelm.xtrade.class.mq5 | 11 ++ Experts/x-saherelm.x121.ea.mq5 | 156 ++++++++++++------ Helpers/x-saherelm.xadxtd.helper.mq5 | 11 +- Helpers/x-saherelm.xama.helper.mq5 | 5 +- Helpers/x-saherelm.xasct.helper.mq5 | 20 ++- Helpers/x-saherelm.xatsl.helper.mq5 | 5 +- Helpers/x-saherelm.xche.helper.mq5 | 12 +- Helpers/x-saherelm.xchma.helper.mq5 | 17 +- Helpers/x-saherelm.xdmnt.helper.mq5 | 7 +- Helpers/x-saherelm.xdon.helper.mq5 | 16 +- Helpers/x-saherelm.xhk.helper.mq5 | 18 +- Helpers/x-saherelm.xhtd.helper.mq5 | 4 +- Helpers/x-saherelm.xhull.helper.mq5 | 10 +- Helpers/x-saherelm.xich.helper.mq5 | 15 +- Helpers/x-saherelm.xmc.helper.mq5 | 12 +- Helpers/x-saherelm.xmrb.helper.mq5 | 19 ++- Helpers/x-saherelm.xosc.helper.mq5 | 23 ++- Helpers/x-saherelm.xpv.helper.mq5 | 22 ++- Helpers/x-saherelm.xrl.helper.mq5 | 11 +- Helpers/x-saherelm.xsln.helper.mq5 | 7 +- Helpers/x-saherelm.xsslc.helper.mq5 | 10 +- Helpers/x-saherelm.xstr.helper.mq5 | 10 +- Helpers/x-saherelm.xtd.helper.mq5 | 11 +- Helpers/x-saherelm.xtm.helper.mq5 | 4 +- Helpers/x-saherelm.xvlm.helper.mq5 | 4 +- Helpers/x-saherelm.xzg.helper.mq5 | 12 +- Indicators/x-saherelm.xama.mq5 | 41 ++--- Indicators/x-saherelm.xcc.mq5 | 41 ++--- Indicators/x-saherelm.xche.mq5 | 41 ++--- Indicators/x-saherelm.xich.mq5 | 41 ++--- Indicators/x-saherelm.xosc.mq5 | 41 ++--- Indicators/x-saherelm.xsslc.mq5 | 41 ++--- Indicators/x-saherelm.xstr.mq5 | 41 ++--- Indicators/x-saherelm.xtd.mq5 | 41 ++--- Indicators/x-saherelm.xtd.osc.mq5 | 41 ++--- Indicators/x-saherelm.xtm.mq5 | 41 ++--- 39 files changed, 499 insertions(+), 399 deletions(-) diff --git a/Classes/x-saherelm.x121.setup.cycle.class.mq5 b/Classes/x-saherelm.x121.setup.cycle.class.mq5 index 6fdd5700..37365ed3 100644 --- a/Classes/x-saherelm.x121.setup.cycle.class.mq5 +++ b/Classes/x-saherelm.x121.setup.cycle.class.mq5 @@ -52,6 +52,13 @@ struct X121SetupCycleInputs { } + // + // Deconstructor Constructor ... + void ~X121SetupCycleInputs() + { + delete setup; + } + // // Initialization ... bool Init( diff --git a/Classes/x-saherelm.x121.setup.xea.mq5 b/Classes/x-saherelm.x121.setup.xea.mq5 index 99f687ac..e4ff4e2d 100644 --- a/Classes/x-saherelm.x121.setup.xea.mq5 +++ b/Classes/x-saherelm.x121.setup.xea.mq5 @@ -24,8 +24,8 @@ // Imports ... // -#include "../Classes/x-saherelm.x121.setup.cycle.class.mq5" #include "../Classes/x-saherelm.xea.class.mq5" +#include "../Classes/x-saherelm.x121.setup.cycle.class.mq5" // // Definitions ... diff --git a/Classes/x-saherelm.xea.class.mq5 b/Classes/x-saherelm.xea.class.mq5 index 3b3eb944..aacff44f 100644 --- a/Classes/x-saherelm.xea.class.mq5 +++ b/Classes/x-saherelm.xea.class.mq5 @@ -155,6 +155,21 @@ public: { // delete mTrader; + + // + Clean(mOnSignalEventHandlers); + + // + mOnSignal = NULL; + mOnModifyPosition = NULL; + mOnStopLossTriggered = NULL; + mOnTakeProfitTriggered = NULL; + mOnForceClosePosition = NULL; + mOnDealsChangedHandler = NULL; + mOnPartialClosePosition = NULL; + mOnOrdersChangedHandler = NULL; + mOnPositionsChangedHandler = NULL; + mOnTradeStateChangedHandler = NULL; } // @@ -345,6 +360,10 @@ public: // // Execute Signals ... HandleSignalsExecution(signals); + + // + Clean(guards); + Clean(signals); } // @@ -987,6 +1006,9 @@ protected: supports // ); + // + Clean(supports); + // return result; } @@ -1065,6 +1087,11 @@ protected: // mTrader.CancelOrders(mustCancel); + + // + Clean(orders); + Clean(positions); + Clean(mustCancel); } // diff --git a/Classes/x-saherelm.xtrade.class.mq5 b/Classes/x-saherelm.xtrade.class.mq5 index 3947d2c0..902631a8 100644 --- a/Classes/x-saherelm.xtrade.class.mq5 +++ b/Classes/x-saherelm.xtrade.class.mq5 @@ -586,6 +586,17 @@ public: // Remove Pointer ... delete mTrader; delete mAccount; + + // + Clean(mOnModifyEventHandlers); + Clean(mStopLossEventHandlers); + Clean(mTakeProfitEventHandlers); + Clean(mOnForceCloseEventHandlers); + Clean(mDealsChangedEventHandlers); + Clean(mOrdersChangedEventHandlers); + Clean(mOnPartialCloseEventHandlers); + Clean(mPositionsChangedEventHandlers); + Clean(mTradeStateChangedEventHandlers); } // diff --git a/Experts/x-saherelm.x121.ea.mq5 b/Experts/x-saherelm.x121.ea.mq5 index 1b093499..89a8294e 100644 --- a/Experts/x-saherelm.x121.ea.mq5 +++ b/Experts/x-saherelm.x121.ea.mq5 @@ -124,6 +124,15 @@ input bool x121EAMailAlerts = false; // Mail Alerts input bool x121EAPushAlerts = false; // Push Alerts input bool x121EATerminalAlerts = false; // Terminal Alerts +// +// Time Tracking ... +input group "Time Tracking"; +input bool x121EAAlertNewMonth = false; // Alert New Month +input bool x121EAAlertNewWeek = false; // Alert New Week +input bool x121EAAlertNewDay = false; // Alert New Day +input bool x121EAAlertNewHour = false; // Alert New Hour +input bool x121EAAlertNewMinute = false; // Alert New Minute + // // Definitions ... @@ -131,7 +140,7 @@ input bool x121EATerminalAlerts = false; // Terminal Alerts // Local Variables ... // -bool is121EAInTestMode = false; +const bool is121EAInTestMode = IsRunningOnTestMode(); XTimeTracker x121EATimeTracker; // @@ -159,12 +168,9 @@ int OnInit() return INIT_PARAMETERS_INCORRECT; } - // - is121EAInTestMode = IsRunningOnTestMode(); - // // Initializitation Succeed Message ... - x121EA.Alert("Initialized Successfully ..."); + x121EAAlert.Alert("Initialized Successfully ..."); // // Init Succeed ... @@ -187,18 +193,24 @@ void OnDeinit(const int reason) // REASON_INITFAILED 8 The OnInit() handler returned a non-zero value // REASON_CLOSE 9 Terminal closed + // + // De Initialization Succeed ... + x121EAAlert.Alert("De Initialized Successfully ..."); + + // + // Clean Array ... + Clean(x121EAUsedSymbols); + // // De Initialize XSampleEA Providers ... delete x121EA; // - delete x121EAAlert; delete x121EACTHelper; delete x121EACCHelper; // - // De Initialization Succeed ... - x121EA.Alert("De Initialized Successfully ..."); + delete x121EAAlert; } // @@ -206,51 +218,7 @@ void OnDeinit(const int reason) void OnTick() { // - // Time Tracking ... - - // - // Alert Month ... - if (x121EATimeTracker.IsNewMonth()) - { - // - if (!is121EAInTestMode) - { - x121EAAlert.Alert("New Mount ..."); - } - } - - // - // Alert Week ... - if (x121EATimeTracker.IsNewWeek()) - { - // - if (!is121EAInTestMode) - { - x121EAAlert.Alert("New Week ..."); - } - } - - // - // Alert New Day ... - if (x121EATimeTracker.IsNewDay()) - { - // - if (!is121EAInTestMode) - { - x121EAAlert.Alert("New Day ..."); - } - } - - // - // Alert New Hour ... - if (x121EATimeTracker.IsNewHour()) - { - // - if (!is121EAInTestMode) - { - x121EAAlert.Alert("New Hour ..."); - } - } + X121EAHandleTimeReports(); // x121EA.OnTick(); @@ -370,6 +338,11 @@ bool InitialEA() result = IsValidSize(symbolsCount); if (!result) { + // + Clean(inputSymbols); + Clean(allSymbols); + Clean(watchListSymbols); + Clean(x121EAUsedSymbols); return result; } @@ -474,14 +447,15 @@ bool InitialEA() // // Prepare Providers and Add them into mX121EA class ... + ENUM_TIMEFRAMES iHostPeriod = _Period; for (int i = 0; i < symbolsCount; i++) { // // Requirements ... string iSymbol = x121EAUsedSymbols[i]; - ENUM_TIMEFRAMES iHostPeriod = _Period; // + // Instancing Setup Cycle ... XSCX121SetupCycles *iSetupCycle; iSetupCycle = new XSCX121SetupCycles(); result = iSetupCycle.Init( @@ -495,6 +469,7 @@ bool InitialEA() } // + // Adding Instance Pointer Class to EA Class Instance ... result = x121EA.AddSetup(iSetupCycle); if (!result) { @@ -502,6 +477,12 @@ bool InitialEA() } } + // + // Cleaning Unused Arrays ... + Clean(inputSymbols); + Clean(allSymbols); + Clean(watchListSymbols); + // return result; } @@ -746,3 +727,70 @@ void X121ReportState() } // +void X121EAHandleTimeReports() +{ + // + // Time Tracking ... + + // + // Alert Month ... + if (x121EAAlertNewMonth) + { + // + bool isNewMonth = x121EATimeTracker.IsNewMonth(); + if (isNewMonth) + { + x121EAAlert.Alert("New Mount ..."); + } + } + + // + // Alert Week ... + if (x121EAAlertNewWeek) + { + // + bool isNewWeek = x121EATimeTracker.IsNewWeek(); + if (isNewWeek) + { + x121EAAlert.Alert("New Week ..."); + } + } + + // + // Alert New Day ... + if (x121EAAlertNewDay) + { + // + bool isNewDay = x121EATimeTracker.IsNewDay(); + if (isNewDay) + { + x121EAAlert.Alert("New Day ..."); + } + } + + // + // Alert New Hour ... + if (x121EAAlertNewHour) + { + // + bool isNewHour = x121EATimeTracker.IsNewHour(); + if (isNewHour) + { + x121EAAlert.Alert("New Hour ..."); + } + } + + // + // Alert New Minute ... + if (x121EAAlertNewMinute) + { + // + bool isNewMinute = x121EATimeTracker.IsNewMinute(); + if (isNewMinute) + { + x121EAAlert.Alert("New Minute ..."); + } + } +} + +// diff --git a/Helpers/x-saherelm.xadxtd.helper.mq5 b/Helpers/x-saherelm.xadxtd.helper.mq5 index 206b20ed..068e5364 100644 --- a/Helpers/x-saherelm.xadxtd.helper.mq5 +++ b/Helpers/x-saherelm.xadxtd.helper.mq5 @@ -307,7 +307,13 @@ public: // // Deconstructor ... - ~XSCXADXTDHelper() {} + ~XSCXADXTDHelper() + { + // + Clean(bullpBuffer); + Clean(bearpBuffer); + Clean(strengthBuffer); + } // // Tools ... @@ -662,7 +668,8 @@ private: { // int totalBars = CountBars(); - if (totalBars > 1000) { + if (totalBars > 1000) + { totalBars = 1000; } diff --git a/Helpers/x-saherelm.xama.helper.mq5 b/Helpers/x-saherelm.xama.helper.mq5 index a394f6cd..7690c6b5 100644 --- a/Helpers/x-saherelm.xama.helper.mq5 +++ b/Helpers/x-saherelm.xama.helper.mq5 @@ -141,7 +141,10 @@ public: // // Deconstructor ... - ~XSCXAMAHelper() {} + ~XSCXAMAHelper() { + // + Clean(mainBuffer); + } // // Tools ... diff --git a/Helpers/x-saherelm.xasct.helper.mq5 b/Helpers/x-saherelm.xasct.helper.mq5 index 1352885c..5a9cb0fb 100644 --- a/Helpers/x-saherelm.xasct.helper.mq5 +++ b/Helpers/x-saherelm.xasct.helper.mq5 @@ -277,7 +277,12 @@ public: // // Deconstructor ... - ~XSCXASCTHelper() {} + ~XSCXASCTHelper() + { + // + Clean(longsBuffer); + Clean(shortsBuffer); + } // // Tools ... @@ -465,8 +470,8 @@ public: // bool GetConditions( XASCTConditions &conditions, // - int barIndex = 0, // - int loopback = 3 // + int barIndex = 0, // + int loopback = 3 // ) { // @@ -513,14 +518,14 @@ public: // bool isLongSignal = NotEmptyZero(conditions.longSignal[cIndex]); bool isShortSignal = NotEmptyZero(conditions.shortSignal[cIndex]); - - // + + // conditions.isLongSignal = isLongSignal; conditions.isShortSignal = isShortSignal; // return result; - } + } // // Protected ... @@ -546,7 +551,8 @@ private: { // int totalBars = CountBars(); - if (totalBars > 1000) { + if (totalBars > 1000) + { totalBars = 1000; } diff --git a/Helpers/x-saherelm.xatsl.helper.mq5 b/Helpers/x-saherelm.xatsl.helper.mq5 index 606b2646..a9d50b40 100644 --- a/Helpers/x-saherelm.xatsl.helper.mq5 +++ b/Helpers/x-saherelm.xatsl.helper.mq5 @@ -285,7 +285,10 @@ public: // // Deconstructor ... - ~XSCXATSLHelper() {} + ~XSCXATSLHelper() + { + Clean(atslBuffer); + } // // Tools ... diff --git a/Helpers/x-saherelm.xche.helper.mq5 b/Helpers/x-saherelm.xche.helper.mq5 index a3ac938a..7efbb286 100644 --- a/Helpers/x-saherelm.xche.helper.mq5 +++ b/Helpers/x-saherelm.xche.helper.mq5 @@ -353,7 +353,14 @@ public: // // Deconstructor ... - ~XSCXCHEHelper() {} + ~XSCXCHEHelper() + { + // + Clean(longExit1Buffer); + Clean(longExit2Buffer); + Clean(shortExit1Buffer); + Clean(shortExit2Buffer); + } // // Tools ... @@ -751,7 +758,8 @@ private: { // int totalBars = CountBars(); - if (totalBars > 1000) { + if (totalBars > 1000) + { totalBars = 1000; } diff --git a/Helpers/x-saherelm.xchma.helper.mq5 b/Helpers/x-saherelm.xchma.helper.mq5 index 0222cb29..e290847f 100644 --- a/Helpers/x-saherelm.xchma.helper.mq5 +++ b/Helpers/x-saherelm.xchma.helper.mq5 @@ -2218,7 +2218,22 @@ public: // // Deconstructor ... - ~XSCXCHMAHelper() {} + ~XSCXCHMAHelper() + { + // + Clean(fastBuffer); + Clean(slowBuffer); + Clean(cFastBuffer); + Clean(cSlowBuffer); + Clean(sFastBuffer); + Clean(sSlowBuffer); + Clean(mFastBuffer); + Clean(mSlowBuffer); + Clean(lFastBuffer); + Clean(lSlowBuffer); + Clean(hFastBuffer); + Clean(hSlowBuffer); + } // // Tools ... diff --git a/Helpers/x-saherelm.xdmnt.helper.mq5 b/Helpers/x-saherelm.xdmnt.helper.mq5 index 4718fb1e..38fe5e61 100644 --- a/Helpers/x-saherelm.xdmnt.helper.mq5 +++ b/Helpers/x-saherelm.xdmnt.helper.mq5 @@ -263,7 +263,12 @@ public: // // Deconstructor ... - ~XSCXDMNTHelper() {} + ~XSCXDMNTHelper() + { + // + Clean(bullBuffer); + Clean(bearBuffer); + } // // Tools ... diff --git a/Helpers/x-saherelm.xdon.helper.mq5 b/Helpers/x-saherelm.xdon.helper.mq5 index c7ec287a..78096a2d 100644 --- a/Helpers/x-saherelm.xdon.helper.mq5 +++ b/Helpers/x-saherelm.xdon.helper.mq5 @@ -164,7 +164,18 @@ public: // // Deconstructor ... - ~XSCXDONHelper() {} + ~XSCXDONHelper() + { + // + Clean(upperOBuffer); + Clean(lowerOBuffer); + Clean(upperCBuffer); + Clean(lowerCBuffer); + Clean(upperHBuffer); + Clean(lowerHBuffer); + Clean(upperLBuffer); + Clean(lowerLBuffer); + } // // Tools ... @@ -968,7 +979,8 @@ private: { // int totalBars = CountBars(); - if (totalBars > 1000) { + if (totalBars > 1000) + { totalBars = 1000; } diff --git a/Helpers/x-saherelm.xhk.helper.mq5 b/Helpers/x-saherelm.xhk.helper.mq5 index 29445c8b..8b81b984 100644 --- a/Helpers/x-saherelm.xhk.helper.mq5 +++ b/Helpers/x-saherelm.xhk.helper.mq5 @@ -335,7 +335,18 @@ public: // // Deconstructor ... - ~XSCXHKHelper() {} + ~XSCXHKHelper() + { + // + Clean(openBuffer); + Clean(highBuffer); + Clean(lowBuffer); + Clean(closeBuffer); + Clean(smOpenBuffer); + Clean(smHighBuffer); + Clean(smLowBuffer); + Clean(smCloseBuffer); + } // // Tools ... @@ -1160,7 +1171,7 @@ public: conditions.isSMHKSwitchedToBullish = isSMHKSwitchedToBullish; conditions.isSMHKBearish = isSMHKBearish; conditions.isSMHKSwitchedToBearish = isSMHKSwitchedToBearish; - + // return result; } @@ -1195,7 +1206,8 @@ private: { // int totalBars = CountBars(); - if (totalBars > 1000) { + if (totalBars > 1000) + { totalBars = 1000; } diff --git a/Helpers/x-saherelm.xhtd.helper.mq5 b/Helpers/x-saherelm.xhtd.helper.mq5 index 8f7f4727..09fff617 100644 --- a/Helpers/x-saherelm.xhtd.helper.mq5 +++ b/Helpers/x-saherelm.xhtd.helper.mq5 @@ -292,7 +292,9 @@ public: // // Deconstructor ... - ~XSCXHTDHelper() {} + ~XSCXHTDHelper() { + Clean(htdBuffer); + } // // Tools ... diff --git a/Helpers/x-saherelm.xhull.helper.mq5 b/Helpers/x-saherelm.xhull.helper.mq5 index 741e23d2..7aaf1c71 100644 --- a/Helpers/x-saherelm.xhull.helper.mq5 +++ b/Helpers/x-saherelm.xhull.helper.mq5 @@ -337,7 +337,12 @@ public: // // Deconstructor ... - ~XSCXHULLHelper() {} + ~XSCXHULLHelper() + { + // + Clean(upBuffer); + Clean(downBuffer); + } // // Tools ... @@ -642,7 +647,8 @@ private: { // int totalBars = CountBars(); - if (totalBars > 1000) { + if (totalBars > 1000) + { totalBars = 1000; } diff --git a/Helpers/x-saherelm.xich.helper.mq5 b/Helpers/x-saherelm.xich.helper.mq5 index 30e060e4..c81c919b 100644 --- a/Helpers/x-saherelm.xich.helper.mq5 +++ b/Helpers/x-saherelm.xich.helper.mq5 @@ -770,7 +770,17 @@ public: // // Deconstructor ... - ~XSCXICHHelper() {} + ~XSCXICHHelper() + { + // + Clean(kijunSenBuffer); + Clean(tenkanSenBuffer); + Clean(chikouSpanBuffer); + Clean(senkouSpanABuffer); + Clean(senkouSpanBBuffer); + Clean(futureSenkouSpanABuffer); + Clean(futureSenkouSpanBBuffer); + } // // Tools ... @@ -1478,7 +1488,8 @@ private: { // int totalBars = CountBars(); - if (totalBars > 1000) { + if (totalBars > 1000) + { totalBars = 1000; } diff --git a/Helpers/x-saherelm.xmc.helper.mq5 b/Helpers/x-saherelm.xmc.helper.mq5 index b2dcdf50..3ffed6f2 100644 --- a/Helpers/x-saherelm.xmc.helper.mq5 +++ b/Helpers/x-saherelm.xmc.helper.mq5 @@ -542,7 +542,14 @@ public: // // Deconstructor ... - ~XSCXMCHelper() {} + ~XSCXMCHelper() + { + // + Clean(sarBuffer); + Clean(fastBuffer); + Clean(slowBuffer); + Clean(verifierBuffer); + } // // Tools ... @@ -1057,7 +1064,8 @@ private: { // int totalBars = CountBars(); - if (totalBars > 1000) { + if (totalBars > 1000) + { totalBars = 1000; } diff --git a/Helpers/x-saherelm.xmrb.helper.mq5 b/Helpers/x-saherelm.xmrb.helper.mq5 index 2e421600..85d1ed10 100644 --- a/Helpers/x-saherelm.xmrb.helper.mq5 +++ b/Helpers/x-saherelm.xmrb.helper.mq5 @@ -455,7 +455,24 @@ public: // // Deconstructor ... - ~XSCXMRBHelper() {} + ~XSCXMRBHelper() + { + // + Clean(fastBuffer); + Clean(slowBuffer); + Clean(r1FastBuffer); + Clean(r1SlowBuffer); + Clean(r2FastBuffer); + Clean(r2SlowBuffer); + Clean(r3FastBuffer); + Clean(r3SlowBuffer); + Clean(r4FastBuffer); + Clean(r4SlowBuffer); + Clean(r5FastBuffer); + Clean(r5SlowBuffer); + Clean(r6FastBuffer); + Clean(r6SlowBuffer); + } // // Tools ... diff --git a/Helpers/x-saherelm.xosc.helper.mq5 b/Helpers/x-saherelm.xosc.helper.mq5 index 8de18fd1..2d2da01e 100644 --- a/Helpers/x-saherelm.xosc.helper.mq5 +++ b/Helpers/x-saherelm.xosc.helper.mq5 @@ -272,7 +272,25 @@ public: // // Deconstructor ... - ~XSCXOSCHelper() {} + ~XSCXOSCHelper() + { + // + Clean(atrBuffer); + Clean(rsiBuffer); + Clean(cciBuffer); + Clean(sarBuffer); + Clean(bullPBuffer); + Clean(bearPBuffer); + Clean(stddevBuffer); + Clean(volumeBuffer); + Clean(rviMainBuffer); + Clean(momentumBuffer); + Clean(macdMainBuffer); + Clean(rviSignalBuffer); + Clean(stochMainBuffer); + Clean(macdSignalBuffer); + Clean(stochSignalBuffer); + } // // Tools ... @@ -1139,7 +1157,8 @@ private: { // int totalBars = CountBars(); - if (totalBars > 1000) { + if (totalBars > 1000) + { totalBars = 1000; } diff --git a/Helpers/x-saherelm.xpv.helper.mq5 b/Helpers/x-saherelm.xpv.helper.mq5 index d13dcc59..d867b825 100644 --- a/Helpers/x-saherelm.xpv.helper.mq5 +++ b/Helpers/x-saherelm.xpv.helper.mq5 @@ -964,7 +964,27 @@ public: // // Deconstructor ... - ~XSCXPVHelper() {} + ~XSCXPVHelper() + { + // + Clean(fib1Buffer); + Clean(fib2Buffer); + Clean(fib3Buffer); + Clean(fib4Buffer); + Clean(fib5Buffer); + Clean(scHHBuffer); + Clean(scLLBuffer); + Clean(mcHHBuffer); + Clean(mcLLBuffer); + Clean(lcHHBuffer); + Clean(lcLLBuffer); + Clean(hcHHBuffer); + Clean(hcLLBuffer); + Clean(peaksBuffer); + Clean(valesBuffer); + Clean(supportBuffer); + Clean(resistanceBuffer); + } // // Tools ... diff --git a/Helpers/x-saherelm.xrl.helper.mq5 b/Helpers/x-saherelm.xrl.helper.mq5 index 14d0b633..b65a9fc7 100644 --- a/Helpers/x-saherelm.xrl.helper.mq5 +++ b/Helpers/x-saherelm.xrl.helper.mq5 @@ -405,7 +405,16 @@ public: // // Deconstructor ... - ~XSCXRLHelper() {} + ~XSCXRLHelper() + { + // + Clean(fastBuffer); + Clean(slowBuffer); + Clean(verifierBuffer); + Clean(fastStateBuffer); + Clean(slowStateBuffer); + Clean(verifierStateBuffer); + } // // Tools ... diff --git a/Helpers/x-saherelm.xsln.helper.mq5 b/Helpers/x-saherelm.xsln.helper.mq5 index 7df7e9ab..4271ba7e 100644 --- a/Helpers/x-saherelm.xsln.helper.mq5 +++ b/Helpers/x-saherelm.xsln.helper.mq5 @@ -282,7 +282,12 @@ public: // // Deconstructor ... - ~XSCXSLNHelper() {} + ~XSCXSLNHelper() + { + // + Clean(slnBuffer); + Clean(stateBuffer); + } // // Tools ... diff --git a/Helpers/x-saherelm.xsslc.helper.mq5 b/Helpers/x-saherelm.xsslc.helper.mq5 index d9b7049c..c402b3d6 100644 --- a/Helpers/x-saherelm.xsslc.helper.mq5 +++ b/Helpers/x-saherelm.xsslc.helper.mq5 @@ -309,7 +309,12 @@ public: // // Deconstructor ... - ~XSCXSSLCHelper() {} + ~XSCXSSLCHelper() + { + // + Clean(upBuffer); + Clean(downBuffer); + } // // Tools ... @@ -599,7 +604,8 @@ private: { // int totalBars = CountBars(); - if (totalBars > 1000) { + if (totalBars > 1000) + { totalBars = 1000; } diff --git a/Helpers/x-saherelm.xstr.helper.mq5 b/Helpers/x-saherelm.xstr.helper.mq5 index 61d9867f..b6c1ea7c 100644 --- a/Helpers/x-saherelm.xstr.helper.mq5 +++ b/Helpers/x-saherelm.xstr.helper.mq5 @@ -298,7 +298,12 @@ public: // // Deconstructor ... - ~XSCXSTRHelper() {} + ~XSCXSTRHelper() + { + // + Clean(trendBuffer); + Clean(stateBuffer); + } // // Tools ... @@ -611,7 +616,8 @@ private: { // int totalBars = CountBars(); - if (totalBars > 1000) { + if (totalBars > 1000) + { totalBars = 1000; } diff --git a/Helpers/x-saherelm.xtd.helper.mq5 b/Helpers/x-saherelm.xtd.helper.mq5 index 4a4aacf6..8c57ebf6 100644 --- a/Helpers/x-saherelm.xtd.helper.mq5 +++ b/Helpers/x-saherelm.xtd.helper.mq5 @@ -306,7 +306,13 @@ public: // // Deconstructor ... - ~XSCXTDHelper() {} + ~XSCXTDHelper() + { + // + Clean(signalBuffer); + Clean(bullishBuffer); + Clean(bearishBuffer); + } // // Tools ... @@ -638,7 +644,8 @@ private: { // int totalBars = CountBars(); - if (totalBars > 1000) { + if (totalBars > 1000) + { totalBars = 1000; } diff --git a/Helpers/x-saherelm.xtm.helper.mq5 b/Helpers/x-saherelm.xtm.helper.mq5 index b8e1c7c4..0aacc6d8 100644 --- a/Helpers/x-saherelm.xtm.helper.mq5 +++ b/Helpers/x-saherelm.xtm.helper.mq5 @@ -135,7 +135,9 @@ public: // // Deconstructor ... - ~XSCXTMHelper() {} + ~XSCXTMHelper() { + Clean(mainBuffer); + } // // Tools ... diff --git a/Helpers/x-saherelm.xvlm.helper.mq5 b/Helpers/x-saherelm.xvlm.helper.mq5 index 2b9db8ec..8fa67d88 100644 --- a/Helpers/x-saherelm.xvlm.helper.mq5 +++ b/Helpers/x-saherelm.xvlm.helper.mq5 @@ -279,7 +279,9 @@ public: // // Deconstructor ... - ~XSCXVLMHelper() {} + ~XSCXVLMHelper() { + Clean(volumeBuffer); + } // // Tools ... diff --git a/Helpers/x-saherelm.xzg.helper.mq5 b/Helpers/x-saherelm.xzg.helper.mq5 index a68318d8..c6905cb6 100644 --- a/Helpers/x-saherelm.xzg.helper.mq5 +++ b/Helpers/x-saherelm.xzg.helper.mq5 @@ -160,7 +160,14 @@ public: // // Deconstructor ... - ~XSCXZGHelper() {} + ~XSCXZGHelper() + { + // + Clean(mainBuffer); + Clean(lowsBuffer); + Clean(highsBuffer); + Clean(PeaksAndValesBuffer); + } // // Tools ... @@ -476,7 +483,8 @@ private: { // int totalBars = CountBars(); - if (totalBars > 1000) { + if (totalBars > 1000) + { totalBars = 1000; } diff --git a/Indicators/x-saherelm.xama.mq5 b/Indicators/x-saherelm.xama.mq5 index 714a25d7..55c27190 100644 --- a/Indicators/x-saherelm.xama.mq5 +++ b/Indicators/x-saherelm.xama.mq5 @@ -159,36 +159,17 @@ void OnDeinit(const int reason) // // Calculating what we want ... int OnCalculate( - // - // total Candles on chart ... - const int rates_total, - // - // total calculated Candles on charts ... - const int prev_calculated, - // - // history of Candles Open Time ... - const datetime &time[], - // - // history of Candles Open Price ... - const double &open[], - // - // history of Candles High Price ... - const double &high[], - // - // history of Candles Low Price ... - const double &low[], - // - // history of Candles Close Price ... - const double &close[], - // - // history of Tick Volumes on Candle ... - const long &tick_volume[], - // - // history of Trade Volumes ... - const long &volume[], - // - // history of Candles Spread Price ... - const int &spread[]) + const int rates_total, // Total Bars on Chart ... + const int prev_calculated, // Total Calculated Bars on Charts ... + const datetime &time[], // History of Open Time ... + const double &open[], // History of Open Price ... + const double &high[], // History of High Price ... + const double &low[], // History of Low Price ... + const double &close[], // History of Close Price ... + const long &tick_volume[], // History of Tick Volumes on Bar ... + const long &volume[], // History of Trade Volumes ... + const int &spread[] // History of Spread Price ... +) { // // Prepare Buffers ... diff --git a/Indicators/x-saherelm.xcc.mq5 b/Indicators/x-saherelm.xcc.mq5 index 2e11f1c3..ebc45174 100644 --- a/Indicators/x-saherelm.xcc.mq5 +++ b/Indicators/x-saherelm.xcc.mq5 @@ -230,37 +230,16 @@ void OnDeinit(const int reason) // // Calculating what we want ... int OnCalculate( - // - // total Candles on chart ... - const int rates_total, - // - // total calculated Candles on charts ... - const int prev_calculated, - // - // history of Candles Open Time ... - const datetime &time[], - // - // history of Candles Open Price ... - const double &open[], - // - // history of Candles High Price ... - const double &high[], - // - // history of Candles Low Price ... - const double &low[], - // - // history of Candles Close Price ... - const double &close[], - // - // history of Tick Volumes on Candle ... - const long &tick_volume[], - // - // history of Trade Volumes ... - const long &volume[], - // - // history of Candles Spread Price ... - const int &spread[] - // + const int rates_total, // Total Bars on Chart ... + const int prev_calculated, // Total Calculated Bars on Charts ... + const datetime &time[], // History of Open Time ... + const double &open[], // History of Open Price ... + const double &high[], // History of High Price ... + const double &low[], // History of Low Price ... + const double &close[], // History of Close Price ... + const long &tick_volume[], // History of Tick Volumes on Bar ... + const long &volume[], // History of Trade Volumes ... + const int &spread[] // History of Spread Price ... ) { // diff --git a/Indicators/x-saherelm.xche.mq5 b/Indicators/x-saherelm.xche.mq5 index f47d3639..d4f18acc 100644 --- a/Indicators/x-saherelm.xche.mq5 +++ b/Indicators/x-saherelm.xche.mq5 @@ -247,36 +247,17 @@ void OnDeinit(const int reason) // // Calculating what we want ... int OnCalculate( - // - // total Candles on chart ... - const int rates_total, - // - // total calculated Candles on charts ... - const int prev_calculated, - // - // history of Candles Open Time ... - const datetime &time[], - // - // history of Candles Open Price ... - const double &open[], - // - // history of Candles High Price ... - const double &high[], - // - // history of Candles Low Price ... - const double &low[], - // - // history of Candles Close Price ... - const double &close[], - // - // history of Tick Volumes on Candle ... - const long &tick_volume[], - // - // history of Trade Volumes ... - const long &volume[], - // - // history of Candles Spread Price ... - const int &spread[]) + const int rates_total, // Total Bars on Chart ... + const int prev_calculated, // Total Calculated Bars on Charts ... + const datetime &time[], // History of Open Time ... + const double &open[], // History of Open Price ... + const double &high[], // History of High Price ... + const double &low[], // History of Low Price ... + const double &close[], // History of Close Price ... + const long &tick_volume[], // History of Tick Volumes on Bar ... + const long &volume[], // History of Trade Volumes ... + const int &spread[] // History of Spread Price ... +) { // if (Bars(_Symbol, _Period) < rates_total) diff --git a/Indicators/x-saherelm.xich.mq5 b/Indicators/x-saherelm.xich.mq5 index 00bf6fbb..9972879e 100644 --- a/Indicators/x-saherelm.xich.mq5 +++ b/Indicators/x-saherelm.xich.mq5 @@ -365,36 +365,17 @@ void OnDeinit(const int reason) // // Calculating what we want ... int OnCalculate( - // - // total Candles on chart ... - const int rates_total, - // - // total calculated Candles on charts ... - const int prev_calculated, - // - // history of Candles Open Time ... - const datetime &time[], - // - // history of Candles Open Price ... - const double &open[], - // - // history of Candles High Price ... - const double &high[], - // - // history of Candles Low Price ... - const double &low[], - // - // history of Candles Close Price ... - const double &close[], - // - // history of Tick Volumes on Candle ... - const long &tick_volume[], - // - // history of Trade Volumes ... - const long &volume[], - // - // history of Candles Spread Price ... - const int &spread[]) + const int rates_total, // Total Bars on Chart ... + const int prev_calculated, // Total Calculated Bars on Charts ... + const datetime &time[], // History of Open Time ... + const double &open[], // History of Open Price ... + const double &high[], // History of High Price ... + const double &low[], // History of Low Price ... + const double &close[], // History of Close Price ... + const long &tick_volume[], // History of Tick Volumes on Bar ... + const long &volume[], // History of Trade Volumes ... + const int &spread[] // History of Spread Price ... +) { // // Prepare Buffers ... diff --git a/Indicators/x-saherelm.xosc.mq5 b/Indicators/x-saherelm.xosc.mq5 index ecf3a27b..4e47f6d5 100644 --- a/Indicators/x-saherelm.xosc.mq5 +++ b/Indicators/x-saherelm.xosc.mq5 @@ -418,36 +418,17 @@ void OnDeinit(const int reason) // // Calculating what we want ... int OnCalculate( - // - // total Candles on chart ... - const int rates_total, - // - // total calculated Candles on charts ... - const int prev_calculated, - // - // history of Candles Open Time ... - const datetime &time[], - // - // history of Candles Open Price ... - const double &open[], - // - // history of Candles High Price ... - const double &high[], - // - // history of Candles Low Price ... - const double &low[], - // - // history of Candles Close Price ... - const double &close[], - // - // history of Tick Volumes on Candle ... - const long &tick_volume[], - // - // history of Trade Volumes ... - const long &volume[], - // - // history of Candles Spread Price ... - const int &spread[]) + const int rates_total, // Total Bars on Chart ... + const int prev_calculated, // Total Calculated Bars on Charts ... + const datetime &time[], // History of Open Time ... + const double &open[], // History of Open Price ... + const double &high[], // History of High Price ... + const double &low[], // History of Low Price ... + const double &close[], // History of Close Price ... + const long &tick_volume[], // History of Tick Volumes on Bar ... + const long &volume[], // History of Trade Volumes ... + const int &spread[] // History of Spread Price ... +) { // // Prepare Buffers ... diff --git a/Indicators/x-saherelm.xsslc.mq5 b/Indicators/x-saherelm.xsslc.mq5 index 620cb249..8a0fe9ee 100644 --- a/Indicators/x-saherelm.xsslc.mq5 +++ b/Indicators/x-saherelm.xsslc.mq5 @@ -220,36 +220,17 @@ void OnDeinit(const int reason) // // Calculating what we want ... int OnCalculate( - // - // total Candles on chart ... - const int rates_total, - // - // total calculated Candles on charts ... - const int prev_calculated, - // - // history of Candles Open Time ... - const datetime &time[], - // - // history of Candles Open Price ... - const double &open[], - // - // history of Candles High Price ... - const double &high[], - // - // history of Candles Low Price ... - const double &low[], - // - // history of Candles Close Price ... - const double &close[], - // - // history of Tick Volumes on Candle ... - const long &tick_volume[], - // - // history of Trade Volumes ... - const long &volume[], - // - // history of Candles Spread Price ... - const int &spread[]) + const int rates_total, // Total Bars on Chart ... + const int prev_calculated, // Total Calculated Bars on Charts ... + const datetime &time[], // History of Open Time ... + const double &open[], // History of Open Price ... + const double &high[], // History of High Price ... + const double &low[], // History of Low Price ... + const double &close[], // History of Close Price ... + const long &tick_volume[], // History of Tick Volumes on Bar ... + const long &volume[], // History of Trade Volumes ... + const int &spread[] // History of Spread Price ... +) { // // Prepare Buffers ... diff --git a/Indicators/x-saherelm.xstr.mq5 b/Indicators/x-saherelm.xstr.mq5 index 90e6eeb9..296149fa 100644 --- a/Indicators/x-saherelm.xstr.mq5 +++ b/Indicators/x-saherelm.xstr.mq5 @@ -210,36 +210,17 @@ void OnDeinit(const int reason) // // Calculating what we want ... int OnCalculate( - // - // total Candles on chart ... - const int rates_total, - // - // total calculated Candles on charts ... - const int prev_calculated, - // - // history of Candles Open Time ... - const datetime &time[], - // - // history of Candles Open Price ... - const double &open[], - // - // history of Candles High Price ... - const double &high[], - // - // history of Candles Low Price ... - const double &low[], - // - // history of Candles Close Price ... - const double &close[], - // - // history of Tick Volumes on Candle ... - const long &tick_volume[], - // - // history of Trade Volumes ... - const long &volume[], - // - // history of Candles Spread Price ... - const int &spread[]) + const int rates_total, // Total Bars on Chart ... + const int prev_calculated, // Total Calculated Bars on Charts ... + const datetime &time[], // History of Open Time ... + const double &open[], // History of Open Price ... + const double &high[], // History of High Price ... + const double &low[], // History of Low Price ... + const double &close[], // History of Close Price ... + const long &tick_volume[], // History of Tick Volumes on Bar ... + const long &volume[], // History of Trade Volumes ... + const int &spread[] // History of Spread Price ... +) { // int numOfRequiredAtrs; diff --git a/Indicators/x-saherelm.xtd.mq5 b/Indicators/x-saherelm.xtd.mq5 index ca796955..203a36f4 100644 --- a/Indicators/x-saherelm.xtd.mq5 +++ b/Indicators/x-saherelm.xtd.mq5 @@ -175,36 +175,17 @@ void OnDeinit(const int reason) // // Calculating what we want ... int OnCalculate( - // - // total Candles on chart ... - const int rates_total, - // - // total calculated Candles on charts ... - const int prev_calculated, - // - // history of Candles Open Time ... - const datetime &time[], - // - // history of Candles Open Price ... - const double &open[], - // - // history of Candles High Price ... - const double &high[], - // - // history of Candles Low Price ... - const double &low[], - // - // history of Candles Close Price ... - const double &close[], - // - // history of Tick Volumes on Candle ... - const long &tick_volume[], - // - // history of Trade Volumes ... - const long &volume[], - // - // history of Candles Spread Price ... - const int &spread[]) + const int rates_total, // Total Bars on Chart ... + const int prev_calculated, // Total Calculated Bars on Charts ... + const datetime &time[], // History of Open Time ... + const double &open[], // History of Open Price ... + const double &high[], // History of High Price ... + const double &low[], // History of Low Price ... + const double &close[], // History of Close Price ... + const long &tick_volume[], // History of Tick Volumes on Bar ... + const long &volume[], // History of Trade Volumes ... + const int &spread[] // History of Spread Price ... +) { // // Prepare Buffers ... diff --git a/Indicators/x-saherelm.xtd.osc.mq5 b/Indicators/x-saherelm.xtd.osc.mq5 index 4f40f3c8..34a63db3 100644 --- a/Indicators/x-saherelm.xtd.osc.mq5 +++ b/Indicators/x-saherelm.xtd.osc.mq5 @@ -175,36 +175,17 @@ void OnDeinit(const int reason) // // Calculating what we want ... int OnCalculate( - // - // total Candles on chart ... - const int rates_total, - // - // total calculated Candles on charts ... - const int prev_calculated, - // - // history of Candles Open Time ... - const datetime &time[], - // - // history of Candles Open Price ... - const double &open[], - // - // history of Candles High Price ... - const double &high[], - // - // history of Candles Low Price ... - const double &low[], - // - // history of Candles Close Price ... - const double &close[], - // - // history of Tick Volumes on Candle ... - const long &tick_volume[], - // - // history of Trade Volumes ... - const long &volume[], - // - // history of Candles Spread Price ... - const int &spread[]) + const int rates_total, // Total Bars on Chart ... + const int prev_calculated, // Total Calculated Bars on Charts ... + const datetime &time[], // History of Open Time ... + const double &open[], // History of Open Price ... + const double &high[], // History of High Price ... + const double &low[], // History of Low Price ... + const double &close[], // History of Close Price ... + const long &tick_volume[], // History of Tick Volumes on Bar ... + const long &volume[], // History of Trade Volumes ... + const int &spread[] // History of Spread Price ... +) { // // Prepare Buffers ... diff --git a/Indicators/x-saherelm.xtm.mq5 b/Indicators/x-saherelm.xtm.mq5 index 2ee52d1b..ff1300b1 100644 --- a/Indicators/x-saherelm.xtm.mq5 +++ b/Indicators/x-saherelm.xtm.mq5 @@ -161,36 +161,17 @@ void OnDeinit(const int reason) // // Calculating what we want ... int OnCalculate( - // - // total Candles on chart ... - const int rates_total, - // - // total calculated Candles on charts ... - const int prev_calculated, - // - // history of Candles Open Time ... - const datetime &time[], - // - // history of Candles Open Price ... - const double &open[], - // - // history of Candles High Price ... - const double &high[], - // - // history of Candles Low Price ... - const double &low[], - // - // history of Candles Close Price ... - const double &close[], - // - // history of Tick Volumes on Candle ... - const long &tick_volume[], - // - // history of Trade Volumes ... - const long &volume[], - // - // history of Candles Spread Price ... - const int &spread[]) + const int rates_total, // Total Bars on Chart ... + const int prev_calculated, // Total Calculated Bars on Charts ... + const datetime &time[], // History of Open Time ... + const double &open[], // History of Open Price ... + const double &high[], // History of High Price ... + const double &low[], // History of Low Price ... + const double &close[], // History of Close Price ... + const long &tick_volume[], // History of Tick Volumes on Bar ... + const long &volume[], // History of Trade Volumes ... + const int &spread[] // History of Spread Price ... +) { // // Prepare Buffers ...