From ae4c98c60191c6d03a4c0128bd60ab55affc5772 Mon Sep 17 00:00:00 2001 From: Hadi Khazaee Asl Date: Tue, 4 Jun 2024 19:41:18 +0330 Subject: [PATCH] add hull and sslc into x121 market ... --- .vscode/vscode-kanban.json | 56 +++---- Classes/x-saherelm.x121.provider.class.mq5 | 58 +++++-- Classes/x-saherelm.x121.xmcycle.class.mq5 | 156 ++++++++++++++++-- Experts/x-test.x121ea.mq5 | 25 ++- Helpers/x-saherelm.xsslc.helper.mq5 | 2 +- .../x-saherelm.x121.signaller.class.mq5 | 0 .../x-saherelm.x786.signaller.class.mq5 | 0 7 files changed, 245 insertions(+), 52 deletions(-) rename Classes/x-saherelm.x121.x121.provider.class.mq5 => Signallers/x-saherelm.x121.signaller.class.mq5 (100%) rename Classes/x-saherelm.x121.x786.provider.class.mq5 => Signallers/x-saherelm.x786.signaller.class.mq5 (100%) diff --git a/.vscode/vscode-kanban.json b/.vscode/vscode-kanban.json index 6abf9a65..c99b511d 100644 --- a/.vscode/vscode-kanban.json +++ b/.vscode/vscode-kanban.json @@ -57,20 +57,6 @@ "references": [], "title": "add XHULL/XSSLC/XAMA/XTM Indicators also to X121MarketCycle Calss" }, - { - "assignedTo": { - "name": "Hadi Khazaee Asl" - }, - "category": "X121 Provider", - "creation_time": "2024-05-30T21:40:26.010Z", - "description": { - "content": "- [x] implement a Signaller Struct to Describe a Signaller state;\n- [] use it in X121ProviderDescriptor;\n- [] inside X121Provider use this Struct to Handle Signaller's State;", - "mime": "text/markdown" - }, - "id": "63", - "references": [], - "title": "Implement a Signaller Struct" - }, { "assignedTo": { "name": "Hadi Khazaee Asl" @@ -85,20 +71,6 @@ "references": [], "title": "make provider and ea classes to instance XSCBaseAlert class" }, - { - "assignedTo": { - "name": "Hadi Khazaee Asl" - }, - "category": "X121 Provider", - "creation_time": "2024-05-30T21:41:50.930Z", - "description": { - "content": "Each Market must have their own Pivot Points;\n\n- [] Remove Current Support and Resistance;\n- [] add Support and Resistance and also Score Generating in each Market;\n- [] create a General Common Function to Access Support and Resistances;", - "mime": "text/markdown" - }, - "id": "64", - "references": [], - "title": "Move Support and Resistance Pivots Finders inside X121Market Class" - }, { "assignedTo": { "name": "Hadi Khazaee Asl" @@ -148,6 +120,34 @@ "id": "68", "references": [], "title": "fix cc and ct indicator issues ..." + }, + { + "assignedTo": { + "name": "Hadi Khazaee Asl" + }, + "category": "X121 Provider", + "creation_time": "2024-05-30T21:40:26.010Z", + "description": { + "content": "- [x] implement a Signaller Struct to Describe a Signaller state;\n- [x] use it in X121ProviderDescriptor;\n- [x] inside X121Provider use this Struct to Handle Signaller's State;", + "mime": "text/markdown" + }, + "id": "63", + "references": [], + "title": "Implement a Signaller Struct" + }, + { + "assignedTo": { + "name": "Hadi Khazaee Asl" + }, + "category": "X121 Provider", + "creation_time": "2024-05-30T21:41:50.930Z", + "description": { + "content": "Each Market must have their own Pivot Points;\n\n- [x] Remove Current Support and Resistance;\n- [x] add Support and Resistance and also Score Generating in each Market;\n- [x] create a General Common Function to Access Support and Resistances;", + "mime": "text/markdown" + }, + "id": "64", + "references": [], + "title": "Move Support and Resistance Pivots Finders inside X121Market Class" } ], "done": [ diff --git a/Classes/x-saherelm.x121.provider.class.mq5 b/Classes/x-saherelm.x121.provider.class.mq5 index 72586bac..5c6cfe1c 100644 --- a/Classes/x-saherelm.x121.provider.class.mq5 +++ b/Classes/x-saherelm.x121.provider.class.mq5 @@ -27,15 +27,17 @@ #include "../Helpers/x-saherelm.xcc.helper.mq5" #include "../Helpers/x-saherelm.xct.helper.mq5" #include "../Helpers/x-saherelm.xmc.helper.mq5" -#include "../Helpers/x-saherelm.xdon.helper.mq5" #include "../Helpers/x-saherelm.xzg.helper.mq5" #include "../Helpers/x-saherelm.xpv.helper.mq5" +#include "../Helpers/x-saherelm.xtm.helper.mq5" +#include "../Helpers/x-saherelm.xtd.helper.mq5" +#include "../Helpers/x-saherelm.xdon.helper.mq5" #include "../Helpers/x-saherelm.xstr.helper.mq5" #include "../Helpers/x-saherelm.xche.helper.mq5" #include "../Helpers/x-saherelm.xosc.helper.mq5" -#include "../Helpers/x-saherelm.xtm.helper.mq5" #include "../Helpers/x-saherelm.xama.helper.mq5" -#include "../Helpers/x-saherelm.xtd.helper.mq5" +#include "../Helpers/x-saherelm.xhull.helper.mq5" +#include "../Helpers/x-saherelm.xsslc.helper.mq5" // #include "../Classes/x-saherelm.xprovider.class.mq5" @@ -99,6 +101,8 @@ public: XSTRInputs strInputs; XDONInputs donInputs; XOSCInputs oscInputs; + XHULLInputs hullInputs; + XSSLCInputs sslcInputs; // X121MCycleInputs cMarketInputs; // Curent Market Inputs @@ -175,8 +179,14 @@ public: { ichInputs.Default(); } - - // + if (!hullInputs.IsValid()) + { + hullInputs.Default(); + } + if (!sslcInputs.IsValid()) + { + sslcInputs.Default(); + } if (!tdInputs.IsValid()) { tdInputs.Default(); @@ -198,6 +208,8 @@ public: cMarketInputs.cheInputs = this.cheInputs; cMarketInputs.ichInputs = this.ichInputs; cMarketInputs.donInputs = this.donInputs; + cMarketInputs.hullInputs = this.hullInputs; + cMarketInputs.sslcInputs = this.sslcInputs; result = cMarketInputs.Init( this.symbol, this.period, @@ -225,6 +237,8 @@ public: sMarketInputs.cheInputs = this.cheInputs; sMarketInputs.ichInputs = this.ichInputs; sMarketInputs.donInputs = this.donInputs; + sMarketInputs.hullInputs = this.hullInputs; + sMarketInputs.sslcInputs = this.sslcInputs; result = sMarketInputs.Init( this.symbol, this.period, @@ -252,6 +266,8 @@ public: mMarketInputs.cheInputs = this.cheInputs; mMarketInputs.ichInputs = this.ichInputs; mMarketInputs.donInputs = this.donInputs; + mMarketInputs.hullInputs = this.hullInputs; + mMarketInputs.sslcInputs = this.sslcInputs; result = mMarketInputs.Init( this.symbol, this.period, @@ -279,6 +295,8 @@ public: lMarketInputs.cheInputs = this.cheInputs; lMarketInputs.ichInputs = this.ichInputs; lMarketInputs.donInputs = this.donInputs; + lMarketInputs.hullInputs = this.hullInputs; + lMarketInputs.sslcInputs = this.sslcInputs; result = lMarketInputs.Init( this.symbol, this.period, @@ -306,6 +324,8 @@ public: hMarketInputs.cheInputs = this.cheInputs; hMarketInputs.ichInputs = this.ichInputs; hMarketInputs.donInputs = this.donInputs; + hMarketInputs.hullInputs = this.hullInputs; + hMarketInputs.sslcInputs = this.sslcInputs; result = hMarketInputs.Init( this.symbol, this.period, @@ -351,13 +371,15 @@ public: pvInputs.IsValid() && mcInputs.IsValid() && hkInputs.IsValid() && + tdInputs.IsValid() && mrbInputs.IsValid() && cheInputs.IsValid() && strInputs.IsValid() && donInputs.IsValid() && oscInputs.IsValid() && ichInputs.IsValid() && - tdInputs.IsValid() && + hullInputs.IsValid() && + sslcInputs.IsValid() && // cMarketInputs.IsValid() && sMarketInputs.IsValid() && @@ -406,14 +428,15 @@ public: pvInputs.Clean(); mcInputs.Clean(); hkInputs.Clean(); + tdInputs.Clean(); mrbInputs.Clean(); cheInputs.Clean(); strInputs.Clean(); donInputs.Clean(); oscInputs.Clean(); ichInputs.Clean(); - // - tdInputs.Clean(); + hullInputs.Clean(); + sslcInputs.Clean(); // cMarketInputs.Clean(); sMarketInputs.Clean(); @@ -457,13 +480,15 @@ public: pvInputs.Default(); mcInputs.Default(); hkInputs.Default(); + tdInputs.Default(); mrbInputs.Default(); cheInputs.Default(); strInputs.Default(); donInputs.Default(); oscInputs.Default(); ichInputs.Default(); - tdInputs.Default(); + hullInputs.Default(); + sslcInputs.Default(); // cMarketInputs.Default(); @@ -487,6 +512,18 @@ public: result = MathMax(result, ctInputs.Max()); result = MathMax(result, ccInputs.Max()); result = MathMax(result, tdInputs.Max()); + result = MathMax(result, zgInputs.Max()); + result = MathMax(result, pvInputs.Max()); + result = MathMax(result, mcInputs.Max()); + result = MathMax(result, hkInputs.Max()); + result = MathMax(result, mrbInputs.Max()); + result = MathMax(result, cheInputs.Max()); + result = MathMax(result, strInputs.Max()); + result = MathMax(result, donInputs.Max()); + result = MathMax(result, oscInputs.Max()); + result = MathMax(result, ichInputs.Max()); + result = MathMax(result, hullInputs.Max()); + result = MathMax(result, sslcInputs.Max()); // return result; @@ -1292,7 +1329,8 @@ struct X121ProviderDescriptor // // Check Waits Until New Bar ... result = !this.provider.CanIgnoreProcess(); - if (!result) { + if (!result) + { return result; } diff --git a/Classes/x-saherelm.x121.xmcycle.class.mq5 b/Classes/x-saherelm.x121.xmcycle.class.mq5 index c6568f81..14fe692f 100644 --- a/Classes/x-saherelm.x121.xmcycle.class.mq5 +++ b/Classes/x-saherelm.x121.xmcycle.class.mq5 @@ -38,6 +38,8 @@ #include "../Helpers/x-saherelm.xosc.helper.mq5" #include "../Helpers/x-saherelm.xstr.helper.mq5" #include "../Helpers/x-saherelm.xich.helper.mq5" +#include "../Helpers/x-saherelm.xhull.helper.mq5" +#include "../Helpers/x-saherelm.xsslc.helper.mq5" // #include "../Libraries/x-saherelm.xtrade.lib.mq5" @@ -165,17 +167,19 @@ public: bool drawPBarMid; // Draw Previous Bar Mid Line // - XHKInputs hkInputs; // HK Inputs ... - XMCInputs mcInputs; // MC Inputs ... - XPVInputs pvInputs; // PV Inputs ... - XZGInputs zgInputs; // ZG Inputs ... - XTDInputs tdInputs; // TD Inputs ... - XMRBInputs mrbInputs; // MRB Inputs ... - XSTRInputs strInputs; // STR Inputs ... - XOSCInputs oscInputs; // OSC Inputs ... - XCHEInputs cheInputs; // CHE Inputs ... - XICHInputs ichInputs; // ICH Inputs ... - XDONInputs donInputs; // DON Inputs ... + XHKInputs hkInputs; // HK Inputs ... + XMCInputs mcInputs; // MC Inputs ... + XPVInputs pvInputs; // PV Inputs ... + XZGInputs zgInputs; // ZG Inputs ... + XTDInputs tdInputs; // TD Inputs ... + XMRBInputs mrbInputs; // MRB Inputs ... + XSTRInputs strInputs; // STR Inputs ... + XOSCInputs oscInputs; // OSC Inputs ... + XCHEInputs cheInputs; // CHE Inputs ... + XICHInputs ichInputs; // ICH Inputs ... + XDONInputs donInputs; // DON Inputs ... + XHULLInputs hullInputs; // HULL Inputs ... + XSSLCInputs sslcInputs; // SSLC Inputs ... // // Constructor ... @@ -230,6 +234,8 @@ public: cheInputs.Default(); ichInputs.Default(); donInputs.Default(); + hullInputs.Default(); + sslcInputs.Default(); } // @@ -260,6 +266,8 @@ public: XCHEInputs &mCheInputs, // CHE Inputs XICHInputs &mIchInputs, // ICH Inputs ... XDONInputs &mDonInputs, // DON Inputs ... + XHULLInputs &mHullInputs, // HULL Inputs ... + XSSLCInputs &mSslcInputs, // SSLC Inputs ... int mHostBarIndex = 0, // Specified Host Period Bar Index string mPrefix = "" // Prefix ) @@ -293,6 +301,8 @@ public: cheInputs = mCheInputs; ichInputs = mIchInputs; donInputs = mDonInputs; + hullInputs = mHullInputs; + sslcInputs = mSslcInputs; // result = IsValid(); @@ -324,6 +334,8 @@ public: cheInputs.Clean(); ichInputs.Clean(); donInputs.Clean(); + hullInputs.Clean(); + sslcInputs.Clean(); // cBarDrawSpecs.Clean(); @@ -355,6 +367,8 @@ public: cheInputs.Default(); ichInputs.Default(); donInputs.Default(); + hullInputs.Default(); + sslcInputs.Default(); // drawLabels = false; @@ -455,6 +469,20 @@ public: return result; } + // + result = hullInputs.IsValid(); + if (!result) + { + return result; + } + + // + result = sslcInputs.IsValid(); + if (!result) + { + return result; + } + // return result; } @@ -481,6 +509,8 @@ public: result = MathMax(result, cheInputs.Max()); result = MathMax(result, ichInputs.Max()); result = MathMax(result, donInputs.Max()); + result = MathMax(result, hullInputs.Max()); + result = MathMax(result, sslcInputs.Max()); // return result; @@ -554,6 +584,16 @@ public: double zigzags[]; double zigzagPVs[]; + // + // XHULL ... + double hullUps[]; + double hullDowns[]; + + // + // XSSLC ... + double sslcUps[]; + double sslcDowns[]; + // // XMRB ... @@ -645,6 +685,12 @@ public: bool isZigZagInPeak; bool isZigZagInVale; + // + // XHULL ... + + // + // XSSLC ... + // // XPV ... @@ -986,6 +1032,10 @@ public: Clean(tdBullishs); Clean(tdBearishs); Clean(tdSignals); + Clean(hullUps); + Clean(hullDowns); + Clean(sslcUps); + Clean(sslcDowns); // // Buffers ... @@ -1067,12 +1117,22 @@ public: ArraySetAsSeries(tdBullishs, true); ArraySetAsSeries(tdBearishs, true); ArraySetAsSeries(tdSignals, true); + ArraySetAsSeries(hullUps, true); + ArraySetAsSeries(hullDowns, true); + ArraySetAsSeries(sslcUps, true); + ArraySetAsSeries(sslcDowns, true); // // XZG ... isZigZagInPeak = false; isZigZagInVale = false; + // + // XHULL ... + + // + // XSSLC ... + // // XPV ... @@ -1358,6 +1418,12 @@ public: bearScore++; } + // + // XHULL ... + + // + // XSSLC ... + // // XPV ... @@ -2633,6 +2699,8 @@ public: XSCXOSCHelper osc; XSCXICHHelper ich; XSCXDONHelper don; + XSCXHULLHelper hull; + XSCXSSLCHelper sslc; // // Properties ... @@ -2794,6 +2862,40 @@ public: // // Filling Buffers ... + // + // XHULL ... + + // + hull.CopyUp( + start, + count, + conditions.hullUps // + ); + + // + hull.CopyDown( + start, + count, + conditions.hullDowns // + ); + + // + // XSSLC ... + + // + sslc.CopyUp( + start, + count, + conditions.sslcUps // + ); + + // + sslc.CopyDown( + start, + count, + conditions.sslcDowns // + ); + // // XHK ... @@ -3512,6 +3614,12 @@ public: bool isSMHKSwitchedToBullish = cSMHKBar.IsBullish() && !pSMHKBar.IsBullish(); bool isSMHKSwitchedToBearish = cSMHKBar.IsBearish() && !pSMHKBar.IsBearish(); + // + // XHULL ... + + // + // XSSLC ... + // // XICH ... @@ -4355,6 +4463,32 @@ public: // // Init Helpers ... + // + // XHULL ... + result = hull.Init( + symbol, + period, + mInputs.hullInputs + // + ); + if (!result) + { + return result; + } + + // + // XSSLC ... + result = sslc.Init( + symbol, + period, + mInputs.sslcInputs + // + ); + if (!result) + { + return result; + } + // // XHK ... result = hk.Init( diff --git a/Experts/x-test.x121ea.mq5 b/Experts/x-test.x121ea.mq5 index 53b3cf5c..8d5e0cb4 100644 --- a/Experts/x-test.x121ea.mq5 +++ b/Experts/x-test.x121ea.mq5 @@ -24,8 +24,8 @@ // #include "../Classes/x-saherelm.x121.xea.class.mq5" -#include "../Classes/x-saherelm.x121.x121.provider.class.mq5" -#include "../Classes/x-saherelm.x121.x786.provider.class.mq5" +#include "../Signallers/x-saherelm.x121.signaller.class.mq5" +#include "../Signallers/x-saherelm.x786.signaller.class.mq5" // // "EURUSDb,USDCHFb,USDJPYb,XAUUSDb" @@ -309,6 +309,16 @@ void ConfigureDescriptor( iDescriptor.inputs.hkInputs.drawHikenAshi = false; iDescriptor.inputs.hkInputs.drawSmoothedHikenAshi = false; + // + // XHULL ... + iDescriptor.inputs.hullInputs.showUpZone = false; + iDescriptor.inputs.hullInputs.showDownZone = false; + + // + // XSSLC ... + iDescriptor.inputs.sslcInputs.showUp = false; + iDescriptor.inputs.sslcInputs.showDown = false; + // // XMRB ... iDescriptor.inputs.mrbInputs.showFastMa = false; @@ -979,6 +989,17 @@ void ApplyPreDefineConfigurations(X121ProviderDescriptor &iDescriptor) bool isX786 = false; bool isX121 = false; + + // + // XHULL ... + iDescriptor.inputs.hullInputs.showUpZone = false; + iDescriptor.inputs.hullInputs.showDownZone = false; + + // + // XSSLC ... + iDescriptor.inputs.sslcInputs.showUp = false; + iDescriptor.inputs.sslcInputs.showDown = false; + // if (isX786) { diff --git a/Helpers/x-saherelm.xsslc.helper.mq5 b/Helpers/x-saherelm.xsslc.helper.mq5 index 6198876a..f5cb7b4b 100644 --- a/Helpers/x-saherelm.xsslc.helper.mq5 +++ b/Helpers/x-saherelm.xsslc.helper.mq5 @@ -117,7 +117,7 @@ struct XSSLCInputs // result = // - false + length > 2 // ; diff --git a/Classes/x-saherelm.x121.x121.provider.class.mq5 b/Signallers/x-saherelm.x121.signaller.class.mq5 similarity index 100% rename from Classes/x-saherelm.x121.x121.provider.class.mq5 rename to Signallers/x-saherelm.x121.signaller.class.mq5 diff --git a/Classes/x-saherelm.x121.x786.provider.class.mq5 b/Signallers/x-saherelm.x786.signaller.class.mq5 similarity index 100% rename from Classes/x-saherelm.x121.x786.provider.class.mq5 rename to Signallers/x-saherelm.x786.signaller.class.mq5