From 421f271441db40a0ec5e91b282f09f86dff7400c Mon Sep 17 00:00:00 2001 From: Hadi Khazaee Asl Date: Fri, 31 May 2024 03:44:31 +0330 Subject: [PATCH] last works ... --- .vscode/vscode-kanban.json | 96 +- Classes/x-saherelm.x121.provider.class.mq5 | 6815 +----------------- Classes/x-saherelm.x121.xmcycle.class.mq5 | 17 +- Classes/x-saherelm.xea.class.mq5 | 137 +- Classes/x-saherelm.xprovider.class.mq5 | 100 +- Classes/x-saherelm.xtrade.class.mq5 | 35 +- Documents/Templates/XProvider/x-template.mq5 | 105 + Experts/x-test.x121ea.mq5 | 8 - Helpers/x-saherelm.xchlh.helper.mq5 | 967 --- Helpers/x-saherelm.xchma.helper.mq5 | 960 --- Helpers/x-saherelm.xfi.helper.mq5 | 292 - Helpers/x-saherelm.xlh.helper.mq5 | 422 -- Helpers/x-saherelm.xobd.helper.mq5 | 306 - Helpers/x-saherelm.xrsi.helper.mq5 | 392 - Helpers/x-saherelm.xts.helper.mq5 | 550 -- Indicators/vp-v6.mq5 | Bin 0 -> 84834 bytes Indicators/x-saherelm.xchlh.mq5 | 816 --- Indicators/x-saherelm.xchma.mq5 | 1134 --- Indicators/x-saherelm.xfi.mq5 | 309 - Indicators/x-saherelm.xfi.osc.mq5 | 309 - Indicators/x-saherelm.xlh.mq5 | 352 - Indicators/x-saherelm.xmidtest.mq5 | 242 - Indicators/x-saherelm.xobd.mq5 | 392 - Indicators/x-saherelm.xrsi.mq5 | 394 - Indicators/x-saherelm.xts.mq5 | 548 -- Libraries/x-saherelm.xtrade.lib.mq5 | 890 +-- 26 files changed, 728 insertions(+), 15860 deletions(-) create mode 100644 Documents/Templates/XProvider/x-template.mq5 delete mode 100644 Helpers/x-saherelm.xchlh.helper.mq5 delete mode 100644 Helpers/x-saherelm.xchma.helper.mq5 delete mode 100644 Helpers/x-saherelm.xfi.helper.mq5 delete mode 100644 Helpers/x-saherelm.xlh.helper.mq5 delete mode 100644 Helpers/x-saherelm.xobd.helper.mq5 delete mode 100644 Helpers/x-saherelm.xrsi.helper.mq5 delete mode 100644 Helpers/x-saherelm.xts.helper.mq5 create mode 100644 Indicators/vp-v6.mq5 delete mode 100644 Indicators/x-saherelm.xchlh.mq5 delete mode 100644 Indicators/x-saherelm.xchma.mq5 delete mode 100644 Indicators/x-saherelm.xfi.mq5 delete mode 100644 Indicators/x-saherelm.xfi.osc.mq5 delete mode 100644 Indicators/x-saherelm.xlh.mq5 delete mode 100644 Indicators/x-saherelm.xmidtest.mq5 delete mode 100644 Indicators/x-saherelm.xobd.mq5 delete mode 100644 Indicators/x-saherelm.xrsi.mq5 delete mode 100644 Indicators/x-saherelm.xts.mq5 diff --git a/.vscode/vscode-kanban.json b/.vscode/vscode-kanban.json index eff28fab..dcc99db7 100644 --- a/.vscode/vscode-kanban.json +++ b/.vscode/vscode-kanban.json @@ -14,20 +14,6 @@ "references": [], "title": "Add all Trail and Position State Managements inside Guards" }, - { - "assignedTo": { - "name": "Hadi Khazaee Asl" - }, - "category": "X121 Provider", - "creation_time": "2024-05-30T21:40:26.010Z", - "description": { - "content": "implement a Signaller Struct to Describe a Signaller state;\nuse it in X121ProviderDescriptor;\ninside 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" @@ -72,20 +58,6 @@ } ], "in-progress": [ - { - "assignedTo": { - "name": "Hadi Khazaee Asl" - }, - "category": "XTrade", - "creation_time": "2024-05-30T21:54:13.427Z", - "description": { - "content": "- [] SLS;\n- [] TPS;\n- [] ACTION;\n\n- [] also solve all side affects;\n", - "mime": "text/markdown" - }, - "id": "67", - "references": [], - "title": "Remove all Signal unused stuffs" - }, { "assignedTo": { "name": "Hadi Khazaee Asl" @@ -93,12 +65,50 @@ "category": "X121 Market Conditions", "creation_time": "2024-05-30T21:38:04.455Z", "description": { - "content": "- [] Remove all Unused Indicators and Helpers;\n-- [] XCHLH;\n-- [] XCHMA;\n-- [] XFI;\n-- [] XTS;\n-- [] XRSI;\n-- [] XOBD;\n-- [] XLH;\n- [] Cleanup Market Conditions;\n- [] Merge reading Required Data to XMarket Conditions;", + "content": "- [x] Remove all Unused Indicators and Helpers;\n-- [x] XCHLH;\n-- [x] XCHMA;\n-- [x] XFI;\n-- [x] XTS;\n-- [x] XRSI;\n-- [x] XOBD;\n-- [x] XLH;\n- [x] resolve side affects;\n- [x] Cleanup Market Conditions;\n- [] Merge reading Required Data to XMarket Conditions;", "mime": "text/markdown" }, "id": "62", "references": [], "title": "Cleanup all Old Indicator" + }, + { + "assignedTo": { + "name": "Hadi Khazaee Asl" + }, + "category": "XTrade", + "creation_time": "2024-05-30T22:23:48.918Z", + "id": "68", + "references": [], + "title": "fix cc and ct indicator issues ..." + }, + { + "assignedTo": { + "name": "Hadi Khazaee Asl" + }, + "category": "XMQL", + "creation_time": "2024-05-30T22:34:15.388Z", + "description": { + "content": "in this way all class can Has his own Alerts ...", + "mime": "text/markdown" + }, + "id": "69", + "references": [], + "title": "make provider and ea classes to instance XSCBaseAlert class" + }, + { + "assignedTo": { + "name": "Hadi Khazaee Asl" + }, + "category": "X121 Provider", + "creation_time": "2024-05-30T21:40:26.010Z", + "description": { + "content": "implement a Signaller Struct to Describe a Signaller state;\nuse it in X121ProviderDescriptor;\ninside X121Provider use this Struct to Handle Signaller's State;", + "mime": "text/markdown" + }, + "id": "63", + "references": [], + "title": "Implement a Signaller Struct" } ], "testing": [], @@ -737,6 +747,34 @@ "references": [], "title": "Refactor XSignal and Create a new One also New Trader" }, + { + "assignedTo": { + "name": "Hadi Khazaee Asl" + }, + "category": "XTrade", + "creation_time": "2024-05-30T21:54:13.427Z", + "description": { + "content": "- [x] SLS;\n- [x] TPS;\n- [x] ACTION;\n\n- [x] also solve all side affects;\n", + "mime": "text/markdown" + }, + "id": "67", + "references": [], + "title": "Remove all Signal unused stuffs" + }, + { + "assignedTo": { + "name": "Hadi Khazaee Asl" + }, + "category": "XMQL", + "creation_time": "2024-05-30T22:35:24.082Z", + "description": { + "content": "since they doesnt use ... \nremove them or comment them as for implementation document ...", + "mime": "text/markdown" + }, + "id": "70", + "references": [], + "title": "remove default base Market Conditions and Descriptor" + }, { "assignedTo": { "name": "Hadi Khazaee Asl" diff --git a/Classes/x-saherelm.x121.provider.class.mq5 b/Classes/x-saherelm.x121.provider.class.mq5 index 14e329e0..25a9c31d 100644 --- a/Classes/x-saherelm.x121.provider.class.mq5 +++ b/Classes/x-saherelm.x121.provider.class.mq5 @@ -35,14 +35,7 @@ #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.xlh.helper.mq5" #include "../Helpers/x-saherelm.xtd.helper.mq5" -#include "../Helpers/x-saherelm.xfi.helper.mq5" -#include "../Helpers/x-saherelm.xts.helper.mq5" -#include "../Helpers/x-saherelm.xrsi.helper.mq5" -#include "../Helpers/x-saherelm.xobd.helper.mq5" -#include "../Helpers/x-saherelm.xchlh.helper.mq5" -#include "../Helpers/x-saherelm.xchma.helper.mq5" // #include "../Classes/x-saherelm.xprovider.class.mq5" @@ -64,20 +57,11 @@ enum ENUM_X121_SIGNAL_PROVIDERS X110, X92, X128, - // - XTD, - XTAM, - XSI, - XTSFI, - XOBDLH, - XCHMACC, - XCHMAMN, - XCHMAMX, }; // // X121 Provider Inputs ... -class X121ProviderInputs : public XSCBaseProviderInpts +class X121ProviderInputs : public XSCBase { // // Public ... @@ -117,10 +101,13 @@ public: // Indicators ... XCCInputs ccInputs; XCTInputs ctInputs; + + // XZGInputs zgInputs; XPVInputs pvInputs; XHKInputs hkInputs; XMCInputs mcInputs; + XTDInputs tdInputs; XMRBInputs mrbInputs; XICHInputs ichInputs; XCHEInputs cheInputs; @@ -128,18 +115,6 @@ public: XDONInputs donInputs; XOSCInputs oscInputs; - // - XTSInputs tsInputs; - XTMInputs tmInputs; - XLHInputs lhInputs; - XTDInputs tdInputs; - XFIInputs fiInputs; - XOBDInputs obdInputs; - XAMAInputs amaInputs; - XRSIInputs rsiInputs; - XCHLHInputs chlhInputs; - XCHMAInputs chmaInputs; - // X121MCycleInputs cMarketInputs; // Curent Market Inputs X121MCycleInputs sMarketInputs; // Short Market Inputs @@ -217,46 +192,10 @@ public: } // - if (!tsInputs.IsValid()) - { - tsInputs.Default(); - } - if (!tmInputs.IsValid()) - { - tmInputs.Default(); - } - if (!lhInputs.IsValid()) - { - lhInputs.Default(); - } if (!tdInputs.IsValid()) { tdInputs.Default(); } - if (!fiInputs.IsValid()) - { - fiInputs.Default(); - } - if (!obdInputs.IsValid()) - { - obdInputs.Default(); - } - if (!amaInputs.IsValid()) - { - amaInputs.Default(); - } - if (!rsiInputs.IsValid()) - { - rsiInputs.Default(); - } - if (!chlhInputs.IsValid()) - { - chlhInputs.Default(); - } - if (!chmaInputs.IsValid()) - { - chmaInputs.Default(); - } // // Initialize Market Inputs ... @@ -405,7 +344,7 @@ public: // // Validate Input ... - bool IsValid() override + bool IsValid() { // bool result = false; @@ -433,17 +372,7 @@ public: donInputs.IsValid() && oscInputs.IsValid() && ichInputs.IsValid() && - // - tsInputs.IsValid() && - tmInputs.IsValid() && - lhInputs.IsValid() && tdInputs.IsValid() && - fiInputs.IsValid() && - obdInputs.IsValid() && - amaInputs.IsValid() && - rsiInputs.IsValid() && - chlhInputs.IsValid() && - chmaInputs.IsValid() && // cMarketInputs.IsValid() && sMarketInputs.IsValid() && @@ -459,7 +388,7 @@ public: // // Cleanup ... - void Clean() override + void Clean() { // symbol = NULL; @@ -499,16 +428,7 @@ public: oscInputs.Clean(); ichInputs.Clean(); // - tsInputs.Clean(); - tmInputs.Clean(); - lhInputs.Clean(); tdInputs.Clean(); - fiInputs.Clean(); - obdInputs.Clean(); - amaInputs.Clean(); - rsiInputs.Clean(); - chlhInputs.Clean(); - chmaInputs.Clean(); // cMarketInputs.Clean(); sMarketInputs.Clean(); @@ -519,7 +439,7 @@ public: // // Default ... - void Default() override + void Default() { // symbol = NULL; @@ -558,16 +478,9 @@ public: donInputs.Default(); oscInputs.Default(); ichInputs.Default(); - tsInputs.Default(); - tmInputs.Default(); - lhInputs.Default(); tdInputs.Default(); - fiInputs.Default(); - obdInputs.Default(); - amaInputs.Default(); - rsiInputs.Default(); - chlhInputs.Default(); - chmaInputs.Default(); + + // cMarketInputs.Default(); sMarketInputs.Default(); mMarketInputs.Default(); @@ -577,25 +490,18 @@ public: // // Max ... - int Max() override + int Max() { // int result = 0; // - result = MathMax(lhInputs.Max(), tmInputs.Max()); + result = MathMax(ctInputs.Max(), ccInputs.Max()); // - result = MathMax(result, tsInputs.Max()); result = MathMax(result, ctInputs.Max()); result = MathMax(result, ccInputs.Max()); result = MathMax(result, tdInputs.Max()); - result = MathMax(result, fiInputs.Max()); - result = MathMax(result, obdInputs.Max()); - result = MathMax(result, amaInputs.Max()); - result = MathMax(result, rsiInputs.Max()); - result = MathMax(result, chlhInputs.Max()); - result = MathMax(result, chmaInputs.Max()); // return result; @@ -617,6 +523,8 @@ public: // symbol = value; + + // cMarketInputs.cycle.symbol = value; sMarketInputs.cycle.symbol = value; mMarketInputs.cycle.symbol = value; @@ -643,6 +551,8 @@ public: // period = value; + + // cMarketInputs.cycle.period = value; sMarketInputs.cycle.period = value; mMarketInputs.cycle.period = value; @@ -658,240 +568,22 @@ public: // // X121 Provider Market Conditions ... -class X121MarketConditions : public XSCBaseProviderMarketConditions +class X121MarketConditions : public XSCBase { // // Public ... public: // + // Props ... + string symbol; // Symbol + ENUM_TIMEFRAMES period; // Period + datetime time; // Time // - // XTS ... - double tsCurrents[]; - double tsNearests[]; - double tsMediests[]; - double tsFarests[]; - - // - // XFI ... - double fis[]; - - // - // XTD ... - double tdBullishs[]; - double tdBearishs[]; - double tdSignals[]; - - // - // XLH ... - double lhHhs[]; - double lhLls[]; - double lhSignals[]; - - // - // XTM ... - double tms[]; - - // - // XAMA ... - double amas[]; - - // - // XOBD ... - double obds[]; - - // - // XRSI ... - double rsis[]; - - // - // XCHMA ... - double chmaScFasts[]; - double chmaScSlows[]; - double chmaMcFasts[]; - double chmaMcSlows[]; - double chmaLcFasts[]; - double chmaLcSlows[]; - double chmaHotStates[]; - - // - // XCHLH ... - double chlhScHHs[]; - double chlhScLLs[]; - double chlhMcHHs[]; - double chlhMcLLs[]; - double chlhLcHHs[]; - double chlhLcLLs[]; - double chlhHotStates[]; - - // - // Conditional Variables ... - - // - // XTM ... - bool isXTMPeak; - bool isXTMVale; - bool isXTMBullish; - bool isXTMBearish; - bool isXTMNeutural; - bool isXTMEndBullish; - bool isXTMEndBearish; - bool isXTMStartBullish; - bool isXTMStartBearish; - bool isXTMEndBullishByNeutural; - bool isXTMEndBearishByNeutural; - bool isXTMStartBullishAfterNeutural; - bool isXTMStartBearishAfterNeutural; - - // - // XAMA ... - bool isXAMAPeak; - bool isXAMAVale; - bool isXAMABullish; - bool isXAMABearish; - bool isXAMANeutural; - bool isXAMAEndBullish; - bool isXAMAEndBearish; - bool isXAMAStartBullish; - bool isXAMAStartBearish; - bool isXAMAEndBullishByNeutural; - bool isXAMAEndBearishByNeutural; - bool isXAMAStartBullishAfterNeutural; - bool isXAMAStartBearishAfterNeutural; - - // - // XLH ... - bool isXLHHHIncreased; - bool isXLHHHDecreased; - bool isXLHLLIncreased; - bool isXLHLLDecreased; - bool isXLHLowAttachedLL; - bool isXLHHighAttachedHH; - bool isXLHHHSameInLength; - bool isXLHLLSameInLength; - bool isXLHPriceOverSignal; - bool isXLHPriceUnderSignal; - bool isXLHPriceInSignalRange; - bool isXLHPriceCrossedOverSignal; - bool isXLHPriceCrossedUnderSignal; - - // - // XTD ... - bool isXTDSignalPeak; - bool isXTDSignalVale; - bool isXTDBullishPeak; - bool isXTDBullishVale; - bool isXTDBearishPeak; - bool isXTDBearishVale; - bool isXTDBullOverBear; - bool isXTDBullUnderBear; - bool isXTDSignalOverBear; - bool isXTDSignalUnderBear; - bool isXTDBullCrossedOverBear; - bool isXTDBullCrossedUnderBear; - bool isXTDSignalCrossedOverBear; - bool isXTDSignalCrossedUnderBear; - - // - // XFI ... - bool isXFIPeak; - bool isXFIVale; - bool isXFICrossedOverZero; - bool isXFIOverZero; - bool isXFICrossedUnderZero; - bool isXFIUnderZero; - - // - // XTS ... - bool isXTSAllSame; - bool isXTSCurrentMin; - bool isXTSCurrentMax; - bool isXTSCurrentOverFarest; - bool isXTSCurrentOverNearest; - bool isXTSCurrentOverMediest; - bool isXTSCurrentUnderFarest; - bool isXTSCurrentUnderNearest; - bool isXTSCurrentUnderMediest; - bool isXTSCurrentCrossedOverFarest; - bool isXTSCurrentCrossedOverNearest; - bool isXTSCurrentCrossedOverMediest; - bool isXTSCurrentCrossedUnderFarest; - bool isXTSCurrentCrossedUnderNearest; - bool isXTSCurrentCrossedUnderMediest; - - // - // XRSI ... - bool isXRSIPeak; - bool isXRSIVale; - bool isXRSICrossedOverLongExit; - bool isXRSICrossedOverLongEntry; - bool isXRSICrossedUnderShortExit; - bool isXRSICrossedUnderShortEntry; - - // - // XOBD ... - bool isXOBDSwingLow; - bool isXOBDSwingHigh; - - // - // XCHLH ... - // - bool isXCHLHSameHHs; - bool isXCHLHSameLLs; - // - bool isXCHLHSCMCHHSame; - bool isXCHLHSCMCLLSame; - // - bool isXCHLHSCLCHHSame; - bool isXCHLHSCLCLLSame; - // - bool isXCHLHMCLCHHSame; - bool isXCHLHMCLCLLSame; - // - bool isXCHLHMCOnTopOfLC; - bool isXCHLHMCInBottomOfLC; - - // - // XCHMA ... - // - bool isXCHMASCOverMax; - bool isXCHMASCOverMin; - bool isXCHMASCUnderMax; - bool isXCHMASCUnderMin; - // - bool isXCHMASCCrossedOverMax; - bool isXCHMASCCrossedUnderMax; - bool isXCHMASCCrossedOverMin; - bool isXCHMASCCrossedUnderMin; - // - bool isXCHMASCPeak; - bool isXCHMASCVale; - bool isXCHMASCTrendsUp; - bool isXCHMASCTrendsDown; - bool isXCHMASCFastOverSlow; - bool isXCHMASCFastUnderSlow; - bool isXCHMASCFastCrossedOverSlow; - bool isXCHMASCFastCrossedUnderSlow; - // - bool isXCHMAMCPeak; - bool isXCHMAMCVale; - bool isXCHMAMCTrendsUp; - bool isXCHMAMCTrendsDown; - bool isXCHMAMCFastOverSlow; - bool isXCHMAMCFastUnderSlow; - bool isXCHMAMCFastCrossedOverSlow; - bool isXCHMAMCFastCrossedUnderSlow; - // - bool isXCHMALCPeak; - bool isXCHMALCVale; - bool isXCHMALCTrendsUp; - bool isXCHMALCTrendsDown; - bool isXCHMALCFastOverSlow; - bool isXCHMALCFastUnderSlow; - bool isXCHMALCFastCrossedOverSlow; - bool isXCHMALCFastCrossedUnderSlow; + XOHCL bars[]; // Number of Bars ... // + // Market Props ... X121MCycleConditions cMarketConditions; // Current Market Conditions X121MCycleConditions sMarketConditions; // Short Market Conditions X121MCycleConditions mMarketConditions; // Medium Market Conditions @@ -938,976 +630,6 @@ public: double bullScore = 0; double bearScore = 0; - // - // XTM ... - - // - if (isXTMPeak) - { - // - bullScore--; - bearScore++; - } - - // - if (isXTMVale) - { - // - bullScore++; - bearScore--; - } - - // - if (isXTMBullish) - { - bullScore++; - } - - // - if (isXTMBearish) - { - bearScore++; - } - - // - if (isXTMNeutural) - { - } - - // - if (isXTMEndBullish) - { - bearScore++; - } - - // - if (isXTMEndBearish) - { - bullScore++; - } - - // - if (isXTMStartBullish) - { - bullScore++; - } - - // - if (isXTMStartBearish) - { - bearScore++; - } - - // - if (isXTMEndBullishByNeutural) - { - bearScore++; - } - - // - if (isXTMEndBearishByNeutural) - { - bullScore++; - } - - // - if (isXTMStartBullishAfterNeutural) - { - bullScore++; - } - - // - if (isXTMStartBearishAfterNeutural) - { - bearScore++; - } - - // - // XAMA ... - - // - if (isXAMAPeak) - { - // - bullScore--; - bearScore++; - } - - // - if (isXAMAVale) - { - // - bullScore++; - bearScore--; - } - - // - if (isXAMABullish) - { - bullScore++; - } - - // - if (isXAMABearish) - { - bearScore++; - } - - // - if (isXAMANeutural) - { - } - - // - if (isXAMAEndBullish) - { - bearScore++; - } - - // - if (isXAMAEndBearish) - { - bullScore++; - } - - // - if (isXAMAStartBullish) - { - bullScore++; - } - - // - if (isXAMAStartBearish) - { - bearScore++; - } - - // - if (isXAMAEndBullishByNeutural) - { - bearScore++; - } - - // - if (isXAMAEndBearishByNeutural) - { - bullScore++; - } - - // - if (isXAMAStartBullishAfterNeutural) - { - bullScore++; - } - - // - if (isXAMAStartBearishAfterNeutural) - { - bearScore++; - } - - // - // XLH ... - - // - if (isXLHHHIncreased) - { - // - bullScore--; - bearScore++; - } - - // - if (isXLHHHDecreased) - { - // - bullScore++; - bearScore--; - } - - // - if (isXLHLLIncreased) - { - // - bullScore++; - bearScore--; - } - - // - if (isXLHLLDecreased) - { - // - bullScore--; - bearScore++; - } - - // - if (isXLHLowAttachedLL) - { - // - bullScore++; - bearScore--; - } - - // - if (isXLHHighAttachedHH) - { - // - bullScore--; - bearScore++; - } - - // - if (isXLHHHSameInLength) - { - } - - // - if (isXLHLLSameInLength) - { - } - - // - if (isXLHPriceOverSignal) - { - bullScore++; - } - - // - if (isXLHPriceUnderSignal) - { - bearScore++; - } - - // - if (isXLHPriceInSignalRange) - { - } - - // - if (isXLHPriceCrossedOverSignal) - { - // - bullScore++; - bearScore--; - } - - // - if (isXLHPriceCrossedUnderSignal) - { - // - bullScore--; - bearScore++; - } - - // - // XTD ... - - // - if (isXTDSignalPeak) - { - // - bullScore--; - bearScore++; - } - - // - if (isXTDSignalVale) - { - // - bullScore++; - bearScore--; - } - - // - if (isXTDBullishPeak) - { - // - bullScore--; - bearScore++; - } - - // - if (isXTDBullishVale) - { - // - bullScore++; - bearScore--; - } - - // - if (isXTDBearishPeak) - { - // - bullScore++; - bearScore--; - } - - // - if (isXTDBearishVale) - { - // - bullScore--; - bearScore++; - } - - // - if (isXTDBullOverBear) - { - bullScore++; - } - - // - if (isXTDBullUnderBear) - { - bearScore++; - } - - // - if (isXTDSignalOverBear) - { - bullScore++; - } - - // - if (isXTDSignalUnderBear) - { - bearScore++; - } - - // - if (isXTDBullCrossedOverBear) - { - // - bullScore++; - bearScore--; - } - - // - if (isXTDBullCrossedUnderBear) - { - // - bullScore--; - bearScore++; - } - - // - if (isXTDSignalCrossedOverBear) - { - // - bullScore++; - bearScore--; - } - - // - if (isXTDSignalCrossedUnderBear) - { - // - bullScore--; - bearScore++; - } - - // - // XFI ... - - // - if (isXFIPeak) - { - // - bullScore--; - bearScore++; - } - - // - if (isXFIVale) - { - // - bullScore++; - bearScore--; - } - - // - if (isXFICrossedOverZero) - { - // - bullScore++; - bearScore--; - } - - // - if (isXFIOverZero) - { - bullScore++; - } - - // - if (isXFICrossedUnderZero) - { - // - bullScore--; - bearScore++; - } - - // - if (isXFIUnderZero) - { - bearScore++; - } - - // - // XTS ... - - // - if (isXTSAllSame) - { - } - - // - if (isXTSCurrentMin) - { - // - bullScore++; - bearScore--; - } - - // - if (isXTSCurrentMax) - { - // - bullScore--; - bearScore++; - } - - // - if (isXTSCurrentOverFarest) - { - bullScore--; - } - - // - if (isXTSCurrentOverNearest) - { - bullScore--; - } - - // - if (isXTSCurrentOverMediest) - { - bullScore--; - } - - // - if (isXTSCurrentUnderFarest) - { - bearScore--; - } - - // - if (isXTSCurrentUnderNearest) - { - bearScore--; - } - - // - if (isXTSCurrentUnderMediest) - { - bearScore--; - } - - // - if (isXTSCurrentCrossedOverFarest) - { - // - bullScore++; - bearScore--; - } - - // - if (isXTSCurrentCrossedOverNearest) - { - // - bullScore++; - bearScore--; - } - - // - if (isXTSCurrentCrossedOverMediest) - { - // - bullScore++; - bearScore--; - } - - // - if (isXTSCurrentCrossedUnderFarest) - { - // - bullScore--; - bearScore++; - } - - // - if (isXTSCurrentCrossedUnderNearest) - { - // - bullScore--; - bearScore++; - } - - // - if (isXTSCurrentCrossedUnderMediest) - { - // - bullScore--; - bearScore++; - } - - // - // XSI ... - - // - if (isXRSIPeak) - { - // - bullScore--; - bearScore++; - } - - // - if (isXRSIVale) - { - // - bullScore++; - bearScore--; - } - - // - if (isXRSICrossedOverLongExit) - { - // - bullScore--; - bearScore++; - } - - // - if (isXRSICrossedOverLongEntry) - { - // - bullScore++; - bearScore--; - } - - // - if (isXRSICrossedUnderShortExit) - { - // - bullScore++; - bearScore--; - } - - // - if (isXRSICrossedUnderShortEntry) - { - // - bullScore--; - bearScore++; - } - - // - // XOBD ... - - // - if (isXOBDSwingLow) - { - bullScore++; - } - - // - if (isXOBDSwingHigh) - { - bearScore++; - } - - // - // XCHLH ... - - // - if (isXCHLHSameHHs) - { - bearScore++; - } - - // - if (isXCHLHSameLLs) - { - bullScore++; - } - - // - if (isXCHLHSCMCHHSame) - { - bearScore++; - } - - // - if (isXCHLHSCMCLLSame) - { - bullScore++; - } - - // - if (isXCHLHSCLCHHSame) - { - bearScore++; - } - - // - if (isXCHLHSCLCLLSame) - { - bullScore++; - } - - // - if (isXCHLHMCLCHHSame) - { - bearScore++; - } - - // - if (isXCHLHMCLCLLSame) - { - bullScore++; - } - - // - if (isXCHLHMCOnTopOfLC) - { - } - - // - if (isXCHLHMCInBottomOfLC) - { - } - - // - // XCHMA ... - - // - if (isXCHMASCOverMax) - { - // - bullScore--; - bearScore++; - } - - // - if (isXCHMASCOverMin) - { - // - bullScore++; - bearScore--; - } - - // - if (isXCHMASCUnderMax) - { - // - bullScore--; - bearScore++; - } - - // - if (isXCHMASCUnderMin) - { - // - bullScore++; - bearScore--; - } - - // - if (isXCHMASCCrossedOverMax) - { - // - bearScore--; - bearScore++; - } - - // - if (isXCHMASCCrossedUnderMax) - { - // - bullScore--; - bearScore++; - } - - // - if (isXCHMASCCrossedOverMin) - { - // - bullScore++; - bearScore--; - } - - // - if (isXCHMASCCrossedUnderMin) - { - // - bullScore++; - bearScore--; - } - - // - if (isXCHMASCPeak) - { - // - bullScore--; - bearScore++; - } - - // - if (isXCHMASCVale) - { - // - bullScore++; - bearScore--; - } - - // - if (isXCHMASCTrendsUp) - { - // - if (isXCHMASCFastOverSlow) - { - // - bullScore++; - bearScore--; - } - - // - if (isXCHMASCFastUnderSlow) - { - // - bullScore--; - bearScore++; - } - } - - // - if (isXCHMASCTrendsDown) - { - // - if (isXCHMASCFastOverSlow) - { - // - bullScore--; - bearScore++; - } - - // - if (isXCHMASCFastUnderSlow) - { - // - bullScore++; - bearScore--; - } - } - - // - if (isXCHMASCFastOverSlow) - { - bearScore++; - } - - // - if (isXCHMASCFastUnderSlow) - { - bearScore++; - } - - // - if (isXCHMASCFastCrossedOverSlow) - { - // - bullScore++; - bearScore--; - } - - // - if (isXCHMASCFastCrossedUnderSlow) - { - // - bullScore--; - bearScore++; - } - - // - if (isXCHMAMCPeak) - { - // - bullScore--; - bearScore++; - } - - // - if (isXCHMAMCVale) - { - // - bullScore++; - bearScore--; - } - - // - if (isXCHMAMCTrendsUp) - { - // - if (isXCHMAMCFastOverSlow) - { - // - bullScore++; - bearScore--; - } - - // - if (isXCHMAMCFastUnderSlow) - { - // - bullScore--; - bearScore++; - } - } - - // - if (isXCHMAMCTrendsDown) - { - // - if (isXCHMAMCFastOverSlow) - { - // - bullScore--; - bearScore++; - } - - // - if (isXCHMAMCFastUnderSlow) - { - // - bullScore++; - bearScore--; - } - } - - // - if (isXCHMAMCFastOverSlow) - { - bullScore++; - } - - // - if (isXCHMAMCFastUnderSlow) - { - bearScore++; - } - - // - if (isXCHMAMCFastCrossedOverSlow) - { - // - bullScore++; - bearScore--; - } - - // - if (isXCHMAMCFastCrossedUnderSlow) - { - // - bullScore--; - bearScore++; - } - - // - if (isXCHMALCPeak) - { - // - bullScore--; - bearScore++; - } - - // - if (isXCHMALCVale) - { - // - bullScore++; - bearScore--; - } - - // - if (isXCHMALCTrendsUp) - { - // - if (isXCHMALCFastOverSlow) - { - // - bullScore++; - bearScore--; - } - - // - if (isXCHMALCFastUnderSlow) - { - // - bullScore--; - bearScore++; - } - } - - // - if (isXCHMALCTrendsDown) - { - // - if (isXCHMALCFastOverSlow) - { - // - bullScore--; - bearScore++; - } - - // - if (isXCHMALCFastUnderSlow) - { - // - bullScore++; - bearScore--; - } - } - - // - if (isXCHMALCFastOverSlow) - { - bullScore++; - } - - // - if (isXCHMALCFastUnderSlow) - { - bearScore++; - } - - // - if (isXCHMALCFastCrossedOverSlow) - { - // - bullScore++; - bearScore--; - } - - // - if (isXCHMALCFastCrossedUnderSlow) - { - // - bullScore--; - bearScore++; - } - // // Current Market ... double cMarketBullScore = 0; @@ -2043,223 +765,6 @@ public: // ; - // - // XOBD ... - string obdStr = - // - ToString("isXOBDSwingLow", isXOBDSwingLow, ignoreFalseConditions) + - ToString("isXOBDSwingHigh", isXOBDSwingHigh, ignoreFalseConditions) + - "" - // - ; - obdStr = SetLabel("XOBD: ", obdStr, separator); - - // - // ToString("", , ignoreFalseConditions) + - - // - // XFI ... - string fiStr = - // - ToString("isXFIPeak", isXFIPeak, ignoreFalseConditions) + - ToString("isXFIVale", isXFIVale, ignoreFalseConditions) + - ToString("isXFICrossedOverZero", isXFICrossedOverZero, ignoreFalseConditions) + - ToString("isXFIOverZero", isXFIOverZero, ignoreFalseConditions) + - ToString("isXFICrossedUnderZero", isXFICrossedUnderZero, ignoreFalseConditions) + - ToString("isXFIUnderZero", isXFIUnderZero, ignoreFalseConditions) + - "" - // - ; - fiStr = SetLabel("XFI: ", fiStr, separator); - - // - // XRSI ... - string rsiStr = - // - ToString("isXRSIPeak", isXRSIPeak, ignoreFalseConditions) + - ToString("isXRSIVale", isXRSIVale, ignoreFalseConditions) + - ToString("isXRSICrossedOverLongExit", isXRSICrossedOverLongExit, ignoreFalseConditions) + - ToString("isXRSICrossedOverLongEntry", isXRSICrossedOverLongEntry, ignoreFalseConditions) + - ToString("isXRSICrossedUnderShortExit", isXRSICrossedUnderShortExit, ignoreFalseConditions) + - ToString("isXRSICrossedUnderShortEntry", isXRSICrossedUnderShortEntry, ignoreFalseConditions) + - "" - // - ; - rsiStr = SetLabel("XRSI: ", rsiStr, separator); - - // - // XTM ... - string tmStr = - // - ToString("isXTMPeak", isXTMPeak, ignoreFalseConditions) + - ToString("isXTMVale", isXTMVale, ignoreFalseConditions) + - ToString("isXTMBullish", isXTMBullish, ignoreFalseConditions) + - ToString("isXTMBearish", isXTMBearish, ignoreFalseConditions) + - ToString("isXTMNeutural", isXTMNeutural, ignoreFalseConditions) + - ToString("isXTMEndBullish", isXTMEndBullish, ignoreFalseConditions) + - ToString("isXTMEndBearish", isXTMEndBearish, ignoreFalseConditions) + - ToString("isXTMStartBullish", isXTMStartBullish, ignoreFalseConditions) + - ToString("isXTMStartBearish", isXTMStartBearish, ignoreFalseConditions) + - ToString("isXTMEndBullishByNeutural", isXTMEndBullishByNeutural, ignoreFalseConditions) + - ToString("isXTMEndBearishByNeutural", isXTMEndBearishByNeutural, ignoreFalseConditions) + - ToString("isXTMStartBullishAfterNeutural", isXTMStartBullishAfterNeutural, ignoreFalseConditions) + - ToString("isXTMStartBearishAfterNeutural", isXTMStartBearishAfterNeutural, ignoreFalseConditions) + - "" - // - ; - tmStr = SetLabel("XTM: ", tmStr, separator); - - // - // XAMA ... - string amaStr = - // - ToString("isXAMAPeak", isXAMAPeak, ignoreFalseConditions) + - ToString("isXAMAVale", isXAMAVale, ignoreFalseConditions) + - ToString("isXAMABullish", isXAMABullish, ignoreFalseConditions) + - ToString("isXAMABearish", isXAMABearish, ignoreFalseConditions) + - ToString("isXAMANeutural", isXAMANeutural, ignoreFalseConditions) + - ToString("isXAMAEndBullish", isXAMAEndBullish, ignoreFalseConditions) + - ToString("isXAMAEndBearish", isXAMAEndBearish, ignoreFalseConditions) + - ToString("isXAMAStartBullish", isXAMAStartBullish, ignoreFalseConditions) + - ToString("isXAMAStartBearish", isXAMAStartBearish, ignoreFalseConditions) + - ToString("isXAMAEndBullishByNeutural", isXAMAEndBullishByNeutural, ignoreFalseConditions) + - ToString("isXAMAEndBearishByNeutural", isXAMAEndBearishByNeutural, ignoreFalseConditions) + - ToString("isXAMAStartBullishAfterNeutural", isXAMAStartBullishAfterNeutural, ignoreFalseConditions) + - ToString("isXAMAStartBearishAfterNeutural", isXAMAStartBearishAfterNeutural, ignoreFalseConditions) + - "" - // - ; - amaStr = SetLabel("XAMA: ", amaStr, separator); - - // - // XLH ... - string lhStr = - // - ToString("isXLHHHIncreased", isXLHHHIncreased, ignoreFalseConditions) + - ToString("isXLHHHDecreased", isXLHHHDecreased, ignoreFalseConditions) + - ToString("isXLHLLIncreased", isXLHLLIncreased, ignoreFalseConditions) + - ToString("isXLHLLDecreased", isXLHLLDecreased, ignoreFalseConditions) + - ToString("isXLHLowAttachedLL", isXLHLowAttachedLL, ignoreFalseConditions) + - ToString("isXLHHighAttachedHH", isXLHHighAttachedHH, ignoreFalseConditions) + - ToString("isXLHHHSameInLength", isXLHHHSameInLength, ignoreFalseConditions) + - ToString("isXLHLLSameInLength", isXLHLLSameInLength, ignoreFalseConditions) + - ToString("isXLHPriceOverSignal", isXLHPriceOverSignal, ignoreFalseConditions) + - ToString("isXLHPriceUnderSignal", isXLHPriceUnderSignal, ignoreFalseConditions) + - ToString("isXLHPriceInSignalRange", isXLHPriceInSignalRange, ignoreFalseConditions) + - ToString("isXLHPriceCrossedOverSignal", isXLHPriceCrossedOverSignal, ignoreFalseConditions) + - ToString("isXLHPriceCrossedUnderSignal", isXLHPriceCrossedUnderSignal, ignoreFalseConditions) + - "" - // - ; - lhStr = SetLabel("XLH: ", lhStr, separator); - - // - // XTD ... - string tdStr = - // - ToString("isXTDSignalPeak", isXTDSignalPeak, ignoreFalseConditions) + - ToString("isXTDSignalVale", isXTDSignalVale, ignoreFalseConditions) + - ToString("isXTDBullishPeak", isXTDBullishPeak, ignoreFalseConditions) + - ToString("isXTDBullishVale", isXTDBullishVale, ignoreFalseConditions) + - ToString("isXTDBearishPeak", isXTDBearishPeak, ignoreFalseConditions) + - ToString("isXTDBearishVale", isXTDBearishVale, ignoreFalseConditions) + - ToString("isXTDBullOverBear", isXTDBullOverBear, ignoreFalseConditions) + - ToString("isXTDBullUnderBear", isXTDBullUnderBear, ignoreFalseConditions) + - ToString("isXTDSignalOverBear", isXTDSignalOverBear, ignoreFalseConditions) + - ToString("isXTDSignalUnderBear", isXTDSignalUnderBear, ignoreFalseConditions) + - ToString("isXTDBullCrossedOverBear", isXTDBullCrossedOverBear, ignoreFalseConditions) + - ToString("isXTDBullCrossedUnderBear", isXTDBullCrossedUnderBear, ignoreFalseConditions) + - ToString("isXTDSignalCrossedOverBear", isXTDSignalCrossedOverBear, ignoreFalseConditions) + - ToString("isXTDSignalCrossedUnderBear", isXTDSignalCrossedUnderBear, ignoreFalseConditions) + - "" - // - ; - tdStr = SetLabel("XTD: ", tdStr, separator); - - // - // XTS ... - string tsStr = - // - ToString("isXTSAllSame", isXTSAllSame, ignoreFalseConditions) + - ToString("isXTSCurrentMin", isXTSCurrentMin, ignoreFalseConditions) + - ToString("isXTSCurrentMax", isXTSCurrentMax, ignoreFalseConditions) + - ToString("isXTSCurrentOverFarest", isXTSCurrentOverFarest, ignoreFalseConditions) + - ToString("isXTSCurrentOverNearest", isXTSCurrentOverNearest, ignoreFalseConditions) + - ToString("isXTSCurrentOverMediest", isXTSCurrentOverMediest, ignoreFalseConditions) + - ToString("isXTSCurrentUnderFarest", isXTSCurrentUnderFarest, ignoreFalseConditions) + - ToString("isXTSCurrentUnderNearest", isXTSCurrentUnderNearest, ignoreFalseConditions) + - ToString("isXTSCurrentUnderMediest", isXTSCurrentUnderMediest, ignoreFalseConditions) + - ToString("isXTSCurrentCrossedOverFarest", isXTSCurrentCrossedOverFarest, ignoreFalseConditions) + - ToString("isXTSCurrentCrossedOverNearest", isXTSCurrentCrossedOverNearest, ignoreFalseConditions) + - ToString("isXTSCurrentCrossedOverMediest", isXTSCurrentCrossedOverMediest, ignoreFalseConditions) + - ToString("isXTSCurrentCrossedUnderFarest", isXTSCurrentCrossedUnderFarest, ignoreFalseConditions) + - ToString("isXTSCurrentCrossedUnderNearest", isXTSCurrentCrossedUnderNearest, ignoreFalseConditions) + - ToString("isXTSCurrentCrossedUnderMediest", isXTSCurrentCrossedUnderMediest, ignoreFalseConditions) + - "" - // - ; - tsStr = SetLabel("XTS: ", tsStr, separator); - - // - // XCHLH ... - string chlhStr = - // - ToString("isXCHLHSameHHs", isXCHLHSameHHs, ignoreFalseConditions) + - ToString("isXCHLHSameLLs", isXCHLHSameLLs, ignoreFalseConditions) + - ToString("isXCHLHSCMCHHSame", isXCHLHSCMCHHSame, ignoreFalseConditions) + - ToString("isXCHLHSCMCLLSame", isXCHLHSCMCLLSame, ignoreFalseConditions) + - ToString("isXCHLHSCLCHHSame", isXCHLHSCLCHHSame, ignoreFalseConditions) + - ToString("isXCHLHSCLCLLSame", isXCHLHSCLCLLSame, ignoreFalseConditions) + - ToString("isXCHLHMCLCHHSame", isXCHLHMCLCHHSame, ignoreFalseConditions) + - ToString("isXCHLHMCLCLLSame", isXCHLHMCLCLLSame, ignoreFalseConditions) + - ToString("isXCHLHMCOnTopOfLC", isXCHLHMCOnTopOfLC, ignoreFalseConditions) + - ToString("isXCHLHMCInBottomOfLC", isXCHLHMCInBottomOfLC, ignoreFalseConditions) + - "" - // - ; - chlhStr = SetLabel("XCHLH: ", chlhStr, separator); - - // - // XCHMA ... - string chmaStr = - // - ToString("isXCHMASCOverMax", isXCHMASCOverMax, ignoreFalseConditions) + - ToString("isXCHMASCOverMin", isXCHMASCOverMin, ignoreFalseConditions) + - ToString("isXCHMASCUnderMax", isXCHMASCUnderMax, ignoreFalseConditions) + - ToString("isXCHMASCUnderMin", isXCHMASCUnderMin, ignoreFalseConditions) + - ToString("isXCHMASCCrossedOverMax", isXCHMASCCrossedOverMax, ignoreFalseConditions) + - ToString("isXCHMASCCrossedUnderMax", isXCHMASCCrossedUnderMax, ignoreFalseConditions) + - ToString("isXCHMASCCrossedOverMin", isXCHMASCCrossedOverMin, ignoreFalseConditions) + - ToString("isXCHMASCCrossedUnderMin", isXCHMASCCrossedUnderMin, ignoreFalseConditions) + - ToString("isXCHMASCPeak", isXCHMASCPeak, ignoreFalseConditions) + - ToString("isXCHMASCVale", isXCHMASCVale, ignoreFalseConditions) + - ToString("isXCHMASCTrendsUp", isXCHMASCTrendsUp, ignoreFalseConditions) + - ToString("isXCHMASCTrendsDown", isXCHMASCTrendsDown, ignoreFalseConditions) + - ToString("isXCHMASCFastOverSlow", isXCHMASCFastOverSlow, ignoreFalseConditions) + - ToString("isXCHMASCFastUnderSlow", isXCHMASCFastUnderSlow, ignoreFalseConditions) + - ToString("isXCHMASCFastCrossedOverSlow", isXCHMASCFastCrossedOverSlow, ignoreFalseConditions) + - ToString("isXCHMASCFastCrossedUnderSlow", isXCHMASCFastCrossedUnderSlow, ignoreFalseConditions) + - ToString("isXCHMAMCPeak", isXCHMAMCPeak, ignoreFalseConditions) + - ToString("isXCHMAMCVale", isXCHMAMCVale, ignoreFalseConditions) + - ToString("isXCHMAMCTrendsUp", isXCHMAMCTrendsUp, ignoreFalseConditions) + - ToString("isXCHMAMCTrendsDown", isXCHMAMCTrendsDown, ignoreFalseConditions) + - ToString("isXCHMAMCFastOverSlow", isXCHMAMCFastOverSlow, ignoreFalseConditions) + - ToString("isXCHMAMCFastUnderSlow", isXCHMAMCFastUnderSlow, ignoreFalseConditions) + - ToString("isXCHMAMCFastCrossedOverSlow", isXCHMAMCFastCrossedOverSlow, ignoreFalseConditions) + - ToString("isXCHMAMCFastCrossedUnderSlow", isXCHMAMCFastCrossedUnderSlow, ignoreFalseConditions) + - ToString("isXCHMALCPeak", isXCHMALCPeak, ignoreFalseConditions) + - ToString("isXCHMALCVale", isXCHMALCVale, ignoreFalseConditions) + - ToString("isXCHMALCTrendsUp", isXCHMALCTrendsUp, ignoreFalseConditions) + - ToString("isXCHMALCTrendsDown", isXCHMALCTrendsDown, ignoreFalseConditions) + - ToString("isXCHMALCFastOverSlow", isXCHMALCFastOverSlow, ignoreFalseConditions) + - ToString("isXCHMALCFastUnderSlow", isXCHMALCFastUnderSlow, ignoreFalseConditions) + - ToString("isXCHMALCFastCrossedOverSlow", isXCHMALCFastCrossedOverSlow, ignoreFalseConditions) + - ToString("isXCHMALCFastCrossedUnderSlow", isXCHMALCFastCrossedUnderSlow, ignoreFalseConditions) + - "" - // - ; - chmaStr = SetLabel("XCHMA: ", chmaStr, separator); - // string cMarketConditionsStr = cMarketConditions.GenerateSummary(onlySummary, cMarketMultiplier); string sMarketConditionsStr = sMarketConditions.GenerateSummary(onlySummary, sMarketMultiplier); @@ -2275,17 +780,7 @@ public: "-----------------------------" + separator + commonStr + (!onlySummary - ? obdStr + - fiStr + - rsiStr + - tmStr + - amaStr + - lhStr + - tdStr + - tsStr + - chlhStr + - chmaStr + - cMarketConditionsStr + + ? cMarketConditionsStr + sMarketConditionsStr + mMarketConditionsStr + lMarketConditionsStr + @@ -2299,29 +794,6 @@ public: // return result; } - - // - // For Data Collector ... - string GetToken() - { - return GetSpecificToken(this); - } - bool IsModelValid() - { - return false; - } - string ToModelString() - { - return NULL; - } - bool ParseModel(string content) - { - return false; - } - int FindIndex(X121MarketConditions &items[]) - { - return -1; - } }; // @@ -2341,18 +813,6 @@ public: XSCXCCHelper *ccHelper; // Candle Clear XSCXCTHelper *ctHelper; // Candle Timer - // - XSCXTSHelper *tsHelper; - XSCXFIHelper *fiHelper; - XSCXTDHelper *tdHelper; - XSCXLHHelper *lhHelper; - XSCXTMHelper *tmHelper; - XSCXOBDHelper *obdHelper; - XSCXRSIHelper *rsiHelper; - XSCXAMAHelper *amaHelper; - XSCXCHMAHelper *chmaHelper; - XSCXCHLHHelper *chlhHelper; - // XSCX121Market *cMarket; // Current Market XSCX121Market *sMarket; // Short Market @@ -2373,18 +833,6 @@ public: ccHelper = new XSCXCCHelper(); ctHelper = new XSCXCTHelper(); - // - tsHelper = new XSCXTSHelper(); - fiHelper = new XSCXFIHelper(); - tdHelper = new XSCXTDHelper(); - lhHelper = new XSCXLHHelper(); - tmHelper = new XSCXTMHelper(); - obdHelper = new XSCXOBDHelper(); - rsiHelper = new XSCXRSIHelper(); - amaHelper = new XSCXAMAHelper(); - chmaHelper = new XSCXCHMAHelper(); - chlhHelper = new XSCXCHLHHelper(); - // // Instantiate X121 Market Cycles Classes ... cMarket = new XSCX121Market(); @@ -2449,18 +897,6 @@ public: delete ccHelper; delete ctHelper; - // - delete tsHelper; - delete fiHelper; - delete tdHelper; - delete lhHelper; - delete tmHelper; - delete obdHelper; - delete rsiHelper; - delete amaHelper; - delete chmaHelper; - delete chlhHelper; - // delete cMarket; delete sMarket; @@ -2525,136 +961,6 @@ public: return result; } - // - result = tsHelper - .Init( - mSymbol, - mPeriod, - mInputs.tsInputs - // - ); - if (!result) - { - return result; - } - - // - result = fiHelper - .Init( - mSymbol, - mPeriod, - mInputs.fiInputs - // - ); - if (!result) - { - return result; - } - - // - result = tdHelper - .Init( - mSymbol, - mPeriod, - mInputs.tdInputs - // - ); - if (!result) - { - return result; - } - - // - result = lhHelper - .Init( - mSymbol, - mPeriod, - mInputs.lhInputs - // - ); - if (!result) - { - return result; - } - - // - result = tmHelper - .Init( - mSymbol, - mPeriod, - mInputs.tmInputs - // - ); - if (!result) - { - return result; - } - - // - result = obdHelper - .Init( - mSymbol, - mPeriod, - mInputs.obdInputs - // - ); - if (!result) - { - return result; - } - - // - result = rsiHelper - .Init( - mSymbol, - mPeriod, - mInputs.rsiInputs - // - ); - if (!result) - { - return result; - } - - // - result = amaHelper - .Init( - mSymbol, - mPeriod, - mInputs.amaInputs - // - ); - if (!result) - { - return result; - } - - // - result = chmaHelper - .Init( - mSymbol, - mPeriod, - mInputs.chmaInputs - // - ); - if (!result) - { - return result; - } - - // - result = chlhHelper - .Init( - mSymbol, - mPeriod, - mInputs.chlhInputs - // - ); - if (!result) - { - return result; - } - // // Initialize X121 Market Cycles ... @@ -2776,46 +1082,6 @@ public: case X128: mIsX128SignalProviderEnable = state; break; - - // - case XTD: - mIsXTDSignalProviderEnable = state; - break; - - // - case XTAM: - mIsXTAMSignalProviderEnable = state; - break; - - // - case XSI: - mIsXSISignalProviderEnable = state; - break; - - // - case XTSFI: - mIsXTSFISignalProviderEnable = state; - break; - - // - case XOBDLH: - mIsXOBDLHSignalProviderEnable = state; - break; - - // - case XCHMACC: - mIsXCHMACCSignalProviderEnable = state; - break; - - // - case XCHMAMN: - mIsXCHMAMNSignalProviderEnable = state; - break; - - // - case XCHMAMX: - mIsXCHMAMXSignalProviderEnable = state; - break; } } @@ -2994,9 +1260,6 @@ public: double tp = 0; double sl = 0; - // - ENUM_X_SIGNAL_MANAGING_ACTIONS action = X_SIGNAL_USE_NOTHING; - // // TODO: Make Configurable ... double r2r = providedR2r; @@ -3069,7 +1332,6 @@ public: mode, entry, volume, - action, sl, tp // @@ -4733,20 +2995,12 @@ private: // bool mIsXSPSignalProviderEnable; + bool mIsXTESTSignalProviderEnable; bool mIsX128SignalProviderEnable; bool mIsX92SignalProviderEnable; bool mIsX786SignalProviderEnable; bool mIsX121SignalProviderEnable; bool mIsX110SignalProviderEnable; - bool mIsXTESTSignalProviderEnable; - bool mIsXTDSignalProviderEnable; - bool mIsXTAMSignalProviderEnable; - bool mIsXSISignalProviderEnable; - bool mIsXTSFISignalProviderEnable; - bool mIsXOBDLHSignalProviderEnable; - bool mIsXCHMACCSignalProviderEnable; - bool mIsXCHMAMNSignalProviderEnable; - bool mIsXCHMAMXSignalProviderEnable; // // @@ -4797,14 +3051,6 @@ private: bool hasX110Signal = false; bool hasX92Signal = false; bool hasX128Signal = false; - bool hasXTDSignal = false; - bool hasXTAMSignal = false; - bool hasXSISignal = false; - bool hasXTSFISignal = false; - bool hasXOBDLHSignal = false; - bool hasXCHMACCSignal = false; - bool hasXCHMAMNSignal = false; - bool hasXCHMAMXSignal = false; // // XPS ... @@ -4988,214 +3234,6 @@ private: } } - // - // XTD ... - if (mIsXTDSignalProviderEnable) - { - // - hasXTDSignal = XTDHasSpecifiedLongSignal( - mConditions, - providedSL, - providedTP, - providedR2r // - ); - - // - if (hasXTDSignal) - { - // - if (!IsValid(provider)) - { - provider = ToString(XTD); - } - - // - signalPusher++; - } - } - - // - // XTAM ... - if (mIsXTAMSignalProviderEnable) - { - // - hasXTAMSignal = XTAMHasSpecifiedLongSignal( - mConditions, - providedSL, - providedTP, - providedR2r // - ); - - // - if (hasXTAMSignal) - { - // - if (!IsValid(provider)) - { - provider = ToString(XTAM); - } - - // - signalPusher++; - } - } - - // - // XSI ... - if (mIsXSISignalProviderEnable) - { - // - hasXSISignal = XSIHasSpecifiedLongSignal( - mConditions, - providedSL, - providedTP, - providedR2r // - ); - - // - if (hasXSISignal) - { - // - if (!IsValid(provider)) - { - provider = ToString(XSI); - } - - // - signalPusher++; - } - } - - // - // XTSFI ... - if (mIsXTSFISignalProviderEnable) - { - // - hasXTSFISignal = XTSFIHasSpecifiedLongSignal( - mConditions, - providedSL, - providedTP, - providedR2r // - ); - - // - if (hasXTSFISignal) - { - // - if (!IsValid(provider)) - { - provider = ToString(XTSFI); - } - - // - signalPusher++; - } - } - - // - // XOBDLH ... - if (mIsXOBDLHSignalProviderEnable) - { - // - hasXOBDLHSignal = XOBDLHHasSpecifiedLongSignal( - mConditions, - providedSL, - providedTP, - providedR2r // - ); - - // - if (hasXOBDLHSignal) - { - // - if (!IsValid(provider)) - { - provider = ToString(XOBDLH); - } - - // - signalPusher++; - } - } - - // - // XCHMACC ... - if (mIsXCHMACCSignalProviderEnable) - { - // - hasXCHMACCSignal = XCHMACCHasSpecifiedLongSignal( - mConditions, - providedSL, - providedTP, - providedR2r // - ); - - // - if (hasXCHMACCSignal) - { - // - if (!IsValid(provider)) - { - provider = ToString(XCHMACC); - } - - // - signalPusher++; - } - } - - // - // XCHMAMN ... - if (mIsXCHMAMNSignalProviderEnable) - { - // - hasXCHMAMNSignal = XCHMAMNHasSpecifiedLongSignal( - mConditions, - providedSL, - providedTP, - providedR2r // - ); - - // - if (hasXCHMAMNSignal) - { - // - if (!IsValid(provider)) - { - provider = ToString(XCHMAMN); - } - - // - signalPusher++; - } - } - - // - // XCHMAMX ... - if (mIsXCHMAMXSignalProviderEnable) - { - // - hasXCHMAMXSignal = XCHMAMXHasSpecifiedLongSignal( - mConditions, - providedSL, - providedTP, - providedR2r // - ); - - // - if (hasXCHMAMXSignal) - { - // - if (!IsValid(provider)) - { - provider = ToString(XCHMAMX); - } - - // - signalPusher++; - } - } - // result = // @@ -5252,14 +3290,6 @@ private: bool hasX110Signal = false; bool hasX92Signal = false; bool hasX128Signal = false; - bool hasXTDSignal = false; - bool hasXTAMSignal = false; - bool hasXSISignal = false; - bool hasXTSFISignal = false; - bool hasXOBDLHSignal = false; - bool hasXCHMACCSignal = false; - bool hasXCHMAMNSignal = false; - bool hasXCHMAMXSignal = false; // // XSP ... @@ -5443,214 +3473,6 @@ private: } } - // - // XTD ... - if (mIsXTDSignalProviderEnable) - { - // - hasXTDSignal = XTDHasSpecifiedShortSignal( - mConditions, - providedSL, - providedTP, - providedR2r // - ); - - // - if (hasXTDSignal) - { - // - if (!IsValid(provider)) - { - provider = ToString(XTD); - } - - // - signalPusher++; - } - } - - // - // XTAM ... - if (mIsXTAMSignalProviderEnable) - { - // - hasXTAMSignal = XTAMHasSpecifiedShortSignal( - mConditions, - providedSL, - providedTP, - providedR2r // - ); - - // - if (hasXTAMSignal) - { - // - if (!IsValid(provider)) - { - provider = ToString(XTAM); - } - - // - signalPusher++; - } - } - - // - // XSI ... - if (mIsXSISignalProviderEnable) - { - // - hasXSISignal = XSIHasSpecifiedShortSignal( - mConditions, - providedSL, - providedTP, - providedR2r // - ); - - // - if (hasXSISignal) - { - // - if (!IsValid(provider)) - { - provider = ToString(XSI); - } - - // - signalPusher++; - } - } - - // - // XTSFI ... - if (mIsXTSFISignalProviderEnable) - { - // - hasXTSFISignal = XTSFIHasSpecifiedShortSignal( - mConditions, - providedSL, - providedTP, - providedR2r // - ); - - // - if (hasXTSFISignal) - { - // - if (!IsValid(provider)) - { - provider = ToString(XTSFI); - } - - // - signalPusher++; - } - } - - // - // XOBDLH ... - if (mIsXOBDLHSignalProviderEnable) - { - // - hasXOBDLHSignal = XOBDLHHasSpecifiedShortSignal( - mConditions, - providedSL, - providedTP, - providedR2r // - ); - - // - if (hasXOBDLHSignal) - { - // - if (!IsValid(provider)) - { - provider = ToString(XOBDLH); - } - - // - signalPusher++; - } - } - - // - // XCHMACC ... - if (mIsXCHMACCSignalProviderEnable) - { - // - hasXCHMACCSignal = XCHMACCHasSpecifiedShortSignal( - mConditions, - providedSL, - providedTP, - providedR2r // - ); - - // - if (hasXCHMACCSignal) - { - // - if (!IsValid(provider)) - { - provider = ToString(XCHMACC); - } - - // - signalPusher++; - } - } - - // - // XCHMAMN ... - if (mIsXCHMAMNSignalProviderEnable) - { - // - hasXCHMAMNSignal = XCHMAMNHasSpecifiedShortSignal( - mConditions, - providedSL, - providedTP, - providedR2r // - ); - - // - if (hasXCHMAMNSignal) - { - // - if (!IsValid(provider)) - { - provider = ToString(XCHMAMN); - } - - // - signalPusher++; - } - } - - // - // XCHMAMX ... - if (mIsXCHMAMXSignalProviderEnable) - { - // - hasXCHMAMXSignal = XCHMAMXHasSpecifiedShortSignal( - mConditions, - providedSL, - providedTP, - providedR2r // - ); - - // - if (hasXCHMAMXSignal) - { - // - if (!IsValid(provider)) - { - provider = ToString(XCHMAMX); - } - - // - signalPusher++; - } - } - // result = // @@ -5680,38 +3502,6 @@ private: // hasX128Signal // - || - // - hasXTDSignal - // - || - // - hasXTAMSignal - // - || - // - hasXSISignal - // - || - // - hasXTSFISignal - // - || - // - hasXOBDLHSignal - // - || - // - hasXCHMACCSignal - // - || - // - hasXCHMAMNSignal - // - || - // - hasXCHMAMXSignal - // ; // @@ -5770,1012 +3560,6 @@ private: mNumberOfItems // ); - // - // Current Market Specified ... - - // - // XTM ... - tmHelper.CopyMain( - barIndex, - mNumberOfItems, - mConditions.tms); - // - mConditions.isXTMPeak = IsIncreasing( - mFrom, - curr, - mConditions.tms); - - // - mConditions.isXTMVale = IsDecreasing( - mFrom, - curr, - mConditions.tms); - - // - mConditions.isXTMBullish = mConditions.bars[curr].low > mConditions.tms[curr]; - bool isXTMBullishPrev = mConditions.bars[prev].low > mConditions.tms[prev]; - - // - mConditions.isXTMBearish = mConditions.bars[curr].high < mConditions.tms[curr]; - bool isXTMBearishPrev = mConditions.bars[prev].high < mConditions.tms[prev]; - - // - mConditions.isXTMNeutural = !mConditions.isXTMBullish && !mConditions.isXTMBearish; - bool isXTMNeuturalPrev = !isXTMBullishPrev && !isXTMBearishPrev; - - // - mConditions.isXTMEndBullish = - // - !mConditions.isXTMBullish && - isXTMBullishPrev - // - ; - - // - mConditions.isXTMEndBearish = - // - !mConditions.isXTMBearish && - isXTMBearishPrev - // - ; - - // - mConditions.isXTMStartBullish = - // - mConditions.isXTMBullish && - !isXTMBullishPrev - // - ; - - // - mConditions.isXTMStartBearish = - // - mConditions.isXTMBearish && - !isXTMBearishPrev - // - ; - - // - mConditions.isXTMEndBullishByNeutural = - // - mConditions.isXTMNeutural && - isXTMBullishPrev - // - ; - - // - mConditions.isXTMEndBearishByNeutural = - // - mConditions.isXTMNeutural && - isXTMBearishPrev - // - ; - - // - mConditions.isXTMStartBullishAfterNeutural = - // - mConditions.isXTMBullish && - isXTMNeuturalPrev - // - ; - - // - mConditions.isXTMStartBearishAfterNeutural = - // - mConditions.isXTMBearish && - isXTMNeuturalPrev - // - ; - - // - // XAMA ... - amaHelper.CopyMain( - barIndex, - mNumberOfItems, - mConditions.amas); - - // - mConditions.isXAMAPeak = IsIncreasing( - mFrom, - curr, - mConditions.amas); - - // - mConditions.isXAMAVale = IsDecreasing( - mFrom, - curr, - mConditions.amas); - - // - mConditions.isXAMABullish = mConditions.bars[curr].low > mConditions.amas[curr]; - bool isXAMABullishPrev = mConditions.bars[prev].low > mConditions.amas[prev]; - - // - mConditions.isXAMABearish = mConditions.bars[curr].high < mConditions.amas[curr]; - bool isXAMABearishPrev = mConditions.bars[prev].high < mConditions.amas[prev]; - - // - mConditions.isXAMANeutural = !mConditions.isXAMABullish && !mConditions.isXAMABearish; - bool isXAMANeuturalPrev = !isXAMABullishPrev && !isXAMABearishPrev; - - // - mConditions.isXAMAEndBullish = - // - !mConditions.isXAMABullish && - isXAMABullishPrev - // - ; - - // - mConditions.isXAMAEndBearish = - // - !mConditions.isXAMABearish && - isXAMABearishPrev - // - ; - - // - mConditions.isXAMAStartBullish = - // - mConditions.isXAMABullish && - !isXAMABullishPrev - // - ; - - // - mConditions.isXAMAStartBearish = - // - mConditions.isXAMABearish && - !isXAMABearishPrev - // - ; - - // - mConditions.isXAMAEndBullishByNeutural = - // - mConditions.isXAMANeutural && - isXAMABullishPrev - // - ; - - // - mConditions.isXAMAEndBearishByNeutural = - // - mConditions.isXAMANeutural && - isXAMABearishPrev - // - ; - - // - mConditions.isXAMAStartBullishAfterNeutural = - // - mConditions.isXAMABullish && - isXAMANeuturalPrev - // - ; - - // - mConditions.isXAMAStartBearishAfterNeutural = - // - mConditions.isXAMABearish && - isXAMANeuturalPrev - // - ; - - // - // XFI ... - fiHelper.CopyMain( - barIndex, - mNumberOfItems, - mConditions.fis); - - // - mConditions.isXFIPeak = IsIncreasing( - mFrom, - curr, - mConditions.fis); - - // - mConditions.isXFIVale = IsDecreasing( - mFrom, - curr, - mConditions.fis); - - // - mConditions.isXFIOverZero = mConditions.fis[curr] > 0; - - // - mConditions.isXFICrossedOverZero = - // - mConditions.isXFIOverZero && - mConditions.fis[prev] <= 0 - // - ; - - // - mConditions.isXFIUnderZero = mConditions.fis[curr] < 0; - - // - mConditions.isXFICrossedUnderZero = - // - mConditions.isXFIUnderZero && - mConditions.fis[prev] >= 0 - // - ; - - // - // XOBD ... - obdHelper.CopyMain( - barIndex, - mNumberOfItems, - mConditions.obds); - - // - mConditions.isXOBDSwingLow = mConditions.obds[curr] == X_SWING_LOW; - mConditions.isXOBDSwingHigh = mConditions.obds[curr] == X_SWING_HIGH; - - // - // XRSI ... - rsiHelper.CopyMain( - barIndex, - mNumberOfItems, - mConditions.rsis); - - // - double shortEntryValue = mInputs.rsiInputs.shortEntryValue; - double shortExitValue = mInputs.rsiInputs.shortExitValue; - double longEntryValue = mInputs.rsiInputs.longEntryValue; - double longExitValue = mInputs.rsiInputs.longExitValue; - - // - mConditions.isXRSIPeak = IsIncreasing( - mFrom, - curr, - mConditions.rsis); - - // - mConditions.isXRSIVale = IsDecreasing( - mFrom, - curr, - mConditions.rsis); - - // - mConditions.isXRSICrossedOverLongExit = - // - mConditions.rsis[curr] > longExitValue && - mConditions.rsis[prev] <= longExitValue; - // - ; - - // - mConditions.isXRSICrossedOverLongEntry = - // - mConditions.rsis[curr] > longEntryValue && - mConditions.rsis[prev] <= longEntryValue; - // - ; - - // - mConditions.isXRSICrossedUnderShortExit = - // - mConditions.rsis[curr] < shortExitValue && - mConditions.rsis[prev] >= shortExitValue; - // - ; - - // - mConditions.isXRSICrossedUnderShortEntry = - // - mConditions.rsis[curr] < shortEntryValue && - mConditions.rsis[prev] >= shortEntryValue; - // - ; - - // - // XLH ... - - // - // HH ... - lhHelper.CopyHH( - barIndex, - mNumberOfItems, - mConditions.lhHhs); - - // - // LL ... - lhHelper.CopyLL( - barIndex, - mNumberOfItems, - mConditions.lhLls); - - // - // Signal ... - lhHelper.CopySignal( - barIndex, - mNumberOfItems, - mConditions.lhSignals); - - // - mConditions.isXLHHHIncreased = IsIncreasing( - mFrom, - curr, - mConditions.lhHhs); - - // - mConditions.isXLHHHDecreased = IsDecreasing( - mFrom, - curr, - mConditions.lhHhs); - - // - mConditions.isXLHLLIncreased = IsIncreasing( - mFrom, - curr, - mConditions.lhLls); - - // - mConditions.isXLHLLDecreased = IsDecreasing( - mFrom, - curr, - mConditions.lhLls); - - // - mConditions.isXLHLowAttachedLL = mConditions.bars[curr].low == mConditions.lhLls[curr]; - - // - mConditions.isXLHHighAttachedHH = mConditions.bars[curr].high == mConditions.lhHhs[curr]; - ; - - // - mConditions.isXLHHHSameInLength = IsSame(mConditions.lhHhs); - - // - mConditions.isXLHLLSameInLength = IsSame(mConditions.lhLls); - - // - mConditions.isXLHPriceOverSignal = mConditions.bars[curr].low > mConditions.lhSignals[curr]; - - // - mConditions.isXLHPriceUnderSignal = mConditions.bars[curr].high < mConditions.lhSignals[curr]; - - // - mConditions.isXLHPriceInSignalRange = !mConditions.isXLHPriceOverSignal && !mConditions.isXLHPriceUnderSignal; - - // - mConditions.isXLHPriceCrossedOverSignal = - // - mConditions.isXLHPriceOverSignal && - !(mConditions.bars[prev].low > mConditions.lhSignals[prev]) - // - ; - - // - mConditions.isXLHPriceCrossedUnderSignal = - // - mConditions.isXLHPriceUnderSignal && - !(mConditions.bars[curr].high < mConditions.lhSignals[curr]) - // - ; - - // - // XTD ... - - // - // Bullish ... - tdHelper.CopyBullish( - barIndex, - mNumberOfItems, - mConditions.tdBullishs); - - // - // Bearish ... - tdHelper.CopyBearish( - barIndex, - mNumberOfItems, - mConditions.tdBearishs); - - // - // Signal ... - tdHelper.CopySignal( - barIndex, - mNumberOfItems, - mConditions.tdSignals); - - // - mConditions.isXTDSignalPeak = IsIncreasing( - mFrom, - curr, - mConditions.tdSignals); - - // - mConditions.isXTDSignalVale = IsDecreasing( - mFrom, - curr, - mConditions.tdSignals); - - // - mConditions.isXTDBullishPeak = IsIncreasing( - mFrom, - curr, - mConditions.tdBullishs); - - // - mConditions.isXTDBullishVale = IsDecreasing( - mFrom, - curr, - mConditions.tdBullishs); - - // - mConditions.isXTDBearishPeak = IsIncreasing( - mFrom, - curr, - mConditions.tdBearishs); - - // - mConditions.isXTDBearishVale = IsDecreasing( - mFrom, - curr, - mConditions.tdBearishs); - - // - mConditions.isXTDBullOverBear = mConditions.tdBullishs[curr] > mConditions.tdBearishs[curr]; - bool isXTDBullOverBearPrev = mConditions.tdBullishs[prev] > mConditions.tdBearishs[prev]; - - // - mConditions.isXTDBullUnderBear = mConditions.tdBullishs[curr] < mConditions.tdBearishs[curr]; - bool isXTDBullUnderBearPrev = mConditions.tdBullishs[prev] < mConditions.tdBearishs[prev]; - - // - mConditions.isXTDSignalOverBear = mConditions.tdSignals[curr] > mConditions.tdBearishs[curr]; - bool isXTDSignalOverBearPrev = mConditions.tdSignals[prev] > mConditions.tdBearishs[prev]; - - // - mConditions.isXTDSignalUnderBear = mConditions.tdSignals[curr] < mConditions.tdBearishs[curr]; - bool isXTDSignalUnderBearPrev = mConditions.tdSignals[prev] < mConditions.tdBearishs[prev]; - - // - mConditions.isXTDBullCrossedOverBear = - mConditions.isXTDBullOverBear && - !isXTDBullOverBearPrev; - - // - mConditions.isXTDBullCrossedUnderBear = - mConditions.isXTDBullUnderBear && - !isXTDBullUnderBearPrev; - - // - mConditions.isXTDSignalCrossedOverBear = - mConditions.isXTDSignalOverBear && - !isXTDSignalOverBearPrev; - - // - mConditions.isXTDSignalCrossedUnderBear = - mConditions.isXTDSignalUnderBear && - !isXTDSignalUnderBearPrev; - - // - // XTS ... - - // - // Current ... - tsHelper.CopyCurrent( - barIndex, - mNumberOfItems, - mConditions.tsCurrents); - - // - // Nearest ... - tsHelper.CopyNearest( - barIndex, - mNumberOfItems, - mConditions.tsNearests); - - // - // Mediest ... - tsHelper.CopyMediest( - barIndex, - mNumberOfItems, - mConditions.tsMediests); - - // - // Farest ... - tsHelper.CopyFarest( - barIndex, - mNumberOfItems, - mConditions.tsFarests); - - // - double current = mConditions.tsCurrents[curr]; - double currentPrev = mConditions.tsCurrents[prev]; - - // - double nearest = mConditions.tsNearests[curr]; - double nearestPrev = mConditions.tsNearests[prev]; - - // - double mediest = mConditions.tsMediests[curr]; - double mediestPrev = mConditions.tsMediests[prev]; - - // - double farest = mConditions.tsFarests[curr]; - double farestPrev = mConditions.tsFarests[prev]; - - // - double tsValues[] = {current, nearest, mediest, farest}; - double tsMax = GetMax(tsValues); - double tsMin = GetMin(tsValues); - - // - double tsPrevValues[] = {currentPrev, nearestPrev, mediestPrev, farestPrev}; - double tsPrevMax = GetMax(tsPrevValues); - double tsPrevMin = GetMin(tsPrevValues); - - // - mConditions.isXTSAllSame = - // - current == nearest && - nearest == mediest && - mediest == farest - // - ; - - // - mConditions.isXTSCurrentMin = current == tsMin; - mConditions.isXTSCurrentMax = current == tsMax; - - // - mConditions.isXTSCurrentOverFarest = current > farest; - bool isXTSCurrentOverFarestPrev = currentPrev > farestPrev; - - // - mConditions.isXTSCurrentOverNearest = current > nearest; - bool isXTSCurrentOverNearestPrev = currentPrev > nearestPrev; - - // - mConditions.isXTSCurrentOverMediest = current > mediest; - bool isXTSCurrentOverMediestPrev = currentPrev > mediestPrev; - - // - mConditions.isXTSCurrentUnderFarest = current < farest; - bool isXTSCurrentUnderFarestPrev = currentPrev < farestPrev; - - // - mConditions.isXTSCurrentUnderNearest = current < nearest; - bool isXTSCurrentUnderNearestPrev = currentPrev < nearestPrev; - - // - mConditions.isXTSCurrentUnderMediest = current < mediest; - bool isXTSCurrentUnderMediestPrev = currentPrev < mediestPrev; - - // - mConditions.isXTSCurrentCrossedOverFarest = - mConditions.isXTSCurrentOverFarest && - !isXTSCurrentOverFarestPrev; - - // - mConditions.isXTSCurrentCrossedOverNearest = - mConditions.isXTSCurrentOverNearest && - !isXTSCurrentOverNearestPrev; - - // - mConditions.isXTSCurrentCrossedOverMediest = - mConditions.isXTSCurrentOverMediest && - !isXTSCurrentOverMediestPrev; - - // - mConditions.isXTSCurrentCrossedUnderFarest = - mConditions.isXTSCurrentUnderFarest && - !isXTSCurrentUnderFarestPrev; - - // - mConditions.isXTSCurrentCrossedUnderNearest = - mConditions.isXTSCurrentUnderNearest && - !isXTSCurrentUnderNearestPrev; - - // - mConditions.isXTSCurrentCrossedUnderMediest = - mConditions.isXTSCurrentUnderMediest && - !isXTSCurrentUnderMediestPrev; - - // - // XCHMA ... - - // - // Short ... - - // - // Fast ... - chmaHelper.CopySCFast( - barIndex, - mNumberOfItems, - mConditions.chmaScFasts); - - // - // Slow ... - chmaHelper.CopySCSlow( - barIndex, - mNumberOfItems, - mConditions.chmaScSlows); - - // - // Medium ... - - // - // Fast ... - chmaHelper.CopyMCFast( - barIndex, - mNumberOfItems, - mConditions.chmaMcFasts); - - // - // Slow ... - chmaHelper.CopyMCSlow( - barIndex, - mNumberOfItems, - mConditions.chmaMcSlows); - - // - // Long ... - - // - // Fast ... - chmaHelper.CopyLCFast( - barIndex, - mNumberOfItems, - mConditions.chmaLcFasts); - - // - // Slow ... - chmaHelper.CopyLCSlow( - barIndex, - mNumberOfItems, - mConditions.chmaLcSlows); - - // - // Hot States ... - chmaHelper.CopyHotState( - barIndex, - mNumberOfItems, - mConditions.chmaHotStates); - - // - double scFast = mConditions.chmaScFasts[curr]; - double scSlow = mConditions.chmaScSlows[curr]; - double scFastPrev = mConditions.chmaScFasts[prev]; - double scSlowPrev = mConditions.chmaScSlows[prev]; - - // - double mcFast = mConditions.chmaMcFasts[curr]; - double mcSlow = mConditions.chmaMcSlows[curr]; - double mcFastPrev = mConditions.chmaMcFasts[prev]; - double mcSlowPrev = mConditions.chmaMcSlows[prev]; - - // - double lcFast = mConditions.chmaLcFasts[curr]; - double lcSlow = mConditions.chmaLcSlows[curr]; - double lcFastPrev = mConditions.chmaLcFasts[prev]; - double lcSlowPrev = mConditions.chmaLcSlows[prev]; - - // - double chmaValues[] = { - scFast, - scSlow, - mcFast, - mcSlow, - lcFast, - lcSlow}; - double chmaNonSCValues[] = { - mcFast, - mcSlow, - lcFast, - lcSlow}; - double chmaMin = GetMin(chmaValues); - double chmaMax = GetMax(chmaValues); - double chmaNonSCMin = GetMin(chmaNonSCValues); - double chmaNonSCMax = GetMax(chmaNonSCValues); - - // - double chmaValuesPrev[] = { - scFastPrev, - scSlowPrev, - mcFastPrev, - mcSlowPrev, - lcFastPrev, - lcSlowPrev}; - double chmaNonSCValuesPrev[] = { - mcFastPrev, - mcSlowPrev, - lcFastPrev, - lcSlowPrev}; - double chmaMinPrev = GetMin(chmaValuesPrev); - double chmaMaxPrev = GetMax(chmaValuesPrev); - double chmaNonSCMinPrev = GetMin(chmaNonSCValuesPrev); - double chmaNonSCMaxPrev = GetMax(chmaNonSCValuesPrev); - - // - mConditions.isXCHMASCOverMax = MathMin(scFast, scSlow) > chmaNonSCMax; - bool isXCHMASCOverMaxPrev = MathMin(scFastPrev, scSlowPrev) > chmaNonSCMaxPrev; - - // - mConditions.isXCHMASCOverMin = MathMin(scFast, scSlow) > chmaNonSCMin; - bool isXCHMASCOverMinPrev = MathMin(scFastPrev, scSlowPrev) > chmaNonSCMinPrev; - - // - mConditions.isXCHMASCUnderMax = MathMax(scFast, scSlow) < chmaNonSCMax; - bool isXCHMASCUnderMaxPrev = MathMax(scFastPrev, scSlowPrev) < chmaNonSCMaxPrev; - - // - mConditions.isXCHMASCUnderMin = MathMax(scFast, scSlow) < chmaNonSCMin; - bool isXCHMASCUnderMinPrev = MathMax(scFastPrev, scSlowPrev) < chmaNonSCMinPrev; - - // - mConditions.isXCHMASCCrossedOverMax = - mConditions.isXCHMASCOverMax && - !isXCHMASCOverMaxPrev; - - // - mConditions.isXCHMASCCrossedUnderMax = - mConditions.isXCHMASCUnderMax && - !isXCHMASCUnderMaxPrev; - - // - mConditions.isXCHMASCCrossedOverMin = - mConditions.isXCHMASCOverMin && - !isXCHMASCOverMinPrev; - - // - mConditions.isXCHMASCCrossedUnderMin = - mConditions.isXCHMASCUnderMin && - !isXCHMASCUnderMinPrev; - - // - // Short ... - - // - mConditions.isXCHMASCPeak = IsIncreasing( - mFrom, - curr, - mConditions.chmaScFasts); - - // - mConditions.isXCHMASCVale = IsDecreasing( - mFrom, - curr, - mConditions.chmaScFasts); - - // - mConditions.isXCHMASCTrendsUp = IsTrendingUp( - mConditions.chmaScFasts, - mConditions.chmaScSlows); - - // - mConditions.isXCHMASCTrendsDown = IsTrendingDown( - mConditions.chmaScFasts, - mConditions.chmaScSlows); - - // - mConditions.isXCHMASCFastOverSlow = scFast > scSlow; - bool isXCHMASCFastOverSlowPrev = scFastPrev > scSlowPrev; - - // - mConditions.isXCHMASCFastUnderSlow = scFast < scSlow; - bool isXCHMASCFastUnderSlowPrev = scFastPrev < scSlowPrev; - - // - mConditions.isXCHMASCFastCrossedOverSlow = - mConditions.isXCHMASCFastOverSlow && - !isXCHMASCFastOverSlowPrev; - - // - mConditions.isXCHMASCFastCrossedUnderSlow = - mConditions.isXCHMASCFastUnderSlow && - !isXCHMASCFastUnderSlowPrev; - - // - // Medium ... - - // - mConditions.isXCHMAMCPeak = IsIncreasing( - mFrom, - curr, - mConditions.chmaMcFasts); - - // - mConditions.isXCHMAMCVale = IsDecreasing( - mFrom, - curr, - mConditions.chmaMcFasts); - - // - mConditions.isXCHMAMCTrendsUp = IsTrendingUp( - mConditions.chmaMcFasts, - mConditions.chmaMcSlows); - - // - mConditions.isXCHMAMCTrendsDown = IsTrendingDown( - mConditions.chmaMcFasts, - mConditions.chmaMcSlows); - - // - mConditions.isXCHMAMCFastOverSlow = mcFast > mcSlow; - bool isXCHMAMCFastOverSlowPrev = mcFastPrev > mcSlowPrev; - - // - mConditions.isXCHMAMCFastUnderSlow = mcFast < mcSlow; - bool isXCHMAMCFastUnderSlowPrev = mcFastPrev < mcSlowPrev; - - // - mConditions.isXCHMAMCFastCrossedOverSlow = - mConditions.isXCHMAMCFastOverSlow && - !isXCHMAMCFastOverSlowPrev; - - // - mConditions.isXCHMAMCFastCrossedUnderSlow = - mConditions.isXCHMAMCFastUnderSlow && - !isXCHMAMCFastUnderSlowPrev; - - // - // Long ... - - // - mConditions.isXCHMALCPeak = IsIncreasing( - mFrom, - curr, - mConditions.chmaLcFasts); - - // - mConditions.isXCHMALCVale = IsDecreasing( - mFrom, - curr, - mConditions.chmaLcFasts); - - // - mConditions.isXCHMALCTrendsUp = IsTrendingUp( - mConditions.chmaLcFasts, - mConditions.chmaLcSlows); - - // - mConditions.isXCHMALCTrendsDown = IsTrendingDown( - mConditions.chmaMcFasts, - mConditions.chmaMcSlows); - - // - mConditions.isXCHMALCFastOverSlow = lcFast > lcSlow; - bool isXCHMALCFastOverSlowPrev = lcFastPrev > lcSlowPrev; - - // - mConditions.isXCHMALCFastUnderSlow = lcFast < lcSlow; - bool isXCHMALCFastUnderSlowPrev = lcFastPrev < lcSlowPrev; - - // - mConditions.isXCHMALCFastCrossedOverSlow = - mConditions.isXCHMALCFastOverSlow && - !isXCHMALCFastOverSlowPrev; - - // - mConditions.isXCHMALCFastCrossedUnderSlow = - mConditions.isXCHMALCFastUnderSlow && - !isXCHMALCFastUnderSlowPrev; - - // - // XCHLH ... - - // - // Short ... - - // - // HH ... - chlhHelper.CopySCHH( - barIndex, - mNumberOfItems, - mConditions.chlhScHHs); - - // - // LL ... - chlhHelper.CopySCLL( - barIndex, - mNumberOfItems, - mConditions.chlhScLLs); - - // - // Medium ... - - // - // HH ... - chlhHelper.CopyMCHH( - barIndex, - mNumberOfItems, - mConditions.chlhMcHHs); - - // - // LL ... - chlhHelper.CopyMCLL( - barIndex, - mNumberOfItems, - mConditions.chlhMcLLs); - - // - // Long ... - - // - // HH ... - chlhHelper.CopyLCHH( - barIndex, - mNumberOfItems, - mConditions.chlhLcHHs); - - // - // LL ... - chlhHelper.CopyLCLL( - barIndex, - mNumberOfItems, - mConditions.chlhLcLLs); - - // - // Hot State ... - chlhHelper.CopyHotState( - barIndex, - mNumberOfItems, - mConditions.chlhHotStates); - - // - mConditions.isXCHLHSameHHs = - // - mConditions.chlhScHHs[curr] == mConditions.chlhMcHHs[curr] && - mConditions.chlhMcHHs[curr] == mConditions.chlhLcHHs[curr] - // - ; - - // - mConditions.isXCHLHSameLLs = - // - mConditions.chlhScLLs[curr] == mConditions.chlhMcLLs[curr] && - mConditions.chlhMcLLs[curr] == mConditions.chlhLcLLs[curr] - // - ; - - // - mConditions.isXCHLHSCMCHHSame = - // - mConditions.chlhScHHs[curr] == mConditions.chlhMcHHs[curr] - // - ; - - // - mConditions.isXCHLHSCMCLLSame = - // - mConditions.chlhScLLs[curr] == mConditions.chlhMcLLs[curr] - // - ; - - // - mConditions.isXCHLHSCLCHHSame = - // - mConditions.chlhScHHs[curr] == mConditions.chlhLcLLs[curr] - // - ; - - // - mConditions.isXCHLHSCLCLLSame = - // - mConditions.chlhScLLs[curr] == mConditions.chlhLcLLs[curr] - // - ; - - // - mConditions.isXCHLHMCLCHHSame = - // - mConditions.chlhMcHHs[curr] == mConditions.chlhLcHHs[curr] - // - ; - - // - mConditions.isXCHLHMCLCLLSame = - // - mConditions.chlhMcLLs[curr] == mConditions.chlhLcLLs[curr] - // - ; - // // X121 Cycles Conditions ... @@ -6815,598 +3599,11 @@ private: ); } - // - // Check Market Conditions is Ready for Long Signals or not ... - bool IsReadyForLong( - X121MarketConditions &mConditions, // Market Conditions ... - bool checkXCHMAMin = true, // Force Check XCHMA Min State - bool checkXCHMAMax = true, // Force Check XCHMA Max State - bool checkXCHMACycles = true, // Force Check XCHMA Cycles State - bool checkXCHMAPeaks = true, // Force Check XCHMA Peaks State - bool checkXCHMATrendPowers = true, // Force Check XCHMA Trend Powers - bool checkXOBD = true, // Force Check XOBD State - bool checkXTS = true // Force Check XTS State - ) - { - // - bool result = true; - - // - if (checkXCHMAMin) - { - // - result = - // - // XCHMA MIN ... - !( - // - (mConditions.isXCHMASCOverMin || - mConditions.isXCHMASCCrossedOverMin) && - (mConditions.isXCHMASCUnderMin || - mConditions.isXCHMASCCrossedUnderMin) - // - ); - } - - // - if (checkXCHMAMax && result) - { - // - result = - // - // XCHMA MAX ... - !( - // - (mConditions.isXCHMASCOverMax || - mConditions.isXCHMASCCrossedOverMax) && - (mConditions.isXCHMASCUnderMax || - mConditions.isXCHMASCCrossedUnderMax) - // - ) - // - ; - } - - // - if (checkXCHMACycles && result) - { - // - result = - // - // Check XCHMA Trend Bullish ... - ( - // - // All Cycles Bullish ... - ( - // - // SC ... - (mConditions.isXCHMASCFastOverSlow || - mConditions.isXCHMASCFastCrossedOverSlow) - // - && - // - // MC ... - (mConditions.isXCHMAMCFastOverSlow || - mConditions.isXCHMAMCFastCrossedOverSlow) - // - && - // - // LC ... - (mConditions.isXCHMALCFastOverSlow || - mConditions.isXCHMALCFastCrossedOverSlow) - // - ) - // - || - // - // Two Cycle Fully Bullish ... - ( - // - // SC and MC ... - ( - // - // SC ... - (mConditions.isXCHMASCFastOverSlow || - mConditions.isXCHMASCFastCrossedOverSlow) - // - && - // - // MC ... - (mConditions.isXCHMAMCFastOverSlow || - mConditions.isXCHMAMCFastCrossedOverSlow) - // - ) - // - || - // - // SC and LC ... - ( - // - // SC ... - (mConditions.isXCHMASCFastOverSlow || - mConditions.isXCHMASCFastCrossedOverSlow) - // - && - // - // LC ... - (mConditions.isXCHMALCFastOverSlow || - mConditions.isXCHMALCFastCrossedOverSlow) - // - ) - // - || - // - // MC and LC ... - ( - // - // MC ... - (mConditions.isXCHMAMCFastOverSlow || - mConditions.isXCHMAMCFastCrossedOverSlow) - // - && - // - // LC ... - (mConditions.isXCHMALCFastOverSlow || - mConditions.isXCHMALCFastCrossedOverSlow) - // - ) - // - ) - // - ) - // - ; - } - - // - if (checkXCHMAPeaks && result) - { - // - result = - // - // XCHMA Check Peaks ... - !( - // - // All Cycles Peak ... - (mConditions.isXCHMASCPeak && - mConditions.isXCHMAMCPeak && - mConditions.isXCHMALCPeak) - // - || - // - ( - // - // SC MC ... - (mConditions.isXCHMASCPeak && - mConditions.isXCHMAMCPeak) - // - || - // - // SC LC ... - (mConditions.isXCHMASCPeak && - mConditions.isXCHMALCPeak) - // - || - // - // MC LC ... - (mConditions.isXCHMAMCPeak && - mConditions.isXCHMALCPeak) - // - ) - // - ) - // - ; - } - - // - if (checkXCHMATrendPowers && result) - { - // - result = - // - // XCHMA Check Trends Power ... - !( - // - // All Trends Down ... - (mConditions.isXCHMASCTrendsDown && - mConditions.isXCHMAMCTrendsDown && - mConditions.isXCHMALCTrendsDown) - // - || - // - // Twisted pairs ... - ( - // - (mConditions.isXCHMASCTrendsDown && - mConditions.isXCHMAMCTrendsDown) - // - || - // - (mConditions.isXCHMASCTrendsDown && - mConditions.isXCHMALCTrendsDown) - // - || - // - (mConditions.isXCHMAMCTrendsDown && - mConditions.isXCHMALCTrendsDown) - // - ) - // - ) - // - ; - } - - // - if (checkXOBD && result) - { - // - result = - // - // XOBD Check Swings ... - !mConditions.isXOBDSwingLow - // - ; - } - - // - if (checkXTS && result) - { - result = - // - // XTS Check ... - !( - // - mConditions.isXTSCurrentMin && - // - ( - // - // All Under ... - ( - (mConditions.isXTSCurrentUnderNearest || - mConditions.isXTSCurrentCrossedUnderNearest) && - (mConditions.isXTSCurrentUnderMediest || - mConditions.isXTSCurrentCrossedUnderMediest) && - (mConditions.isXTSCurrentUnderFarest || - mConditions.isXTSCurrentCrossedUnderFarest)) - // - || - // - // Pairs ... - ( - // - ((mConditions.isXTSCurrentUnderNearest || - mConditions.isXTSCurrentCrossedUnderNearest) && - (mConditions.isXTSCurrentUnderMediest || - mConditions.isXTSCurrentCrossedUnderMediest)) - // - || - // - ((mConditions.isXTSCurrentUnderNearest || - mConditions.isXTSCurrentCrossedUnderNearest) && - (mConditions.isXTSCurrentUnderFarest || - mConditions.isXTSCurrentCrossedUnderFarest)) - // - || - // - ((mConditions.isXTSCurrentUnderMediest || - mConditions.isXTSCurrentCrossedUnderMediest) && - (mConditions.isXTSCurrentUnderFarest || - mConditions.isXTSCurrentCrossedUnderFarest)) - // - ) - // - ) - // - ) - // - ; - } - - // - return result; - } - - // - // Check Market Conditions is Ready for Short Signals or not ... - bool IsReadyForShort( - X121MarketConditions &mConditions, // Market Conditions ... - bool checkXCHMAMin = true, // Force Check XCHMA Min State - bool checkXCHMAMax = true, // Force Check XCHMA Max State - bool checkXCHMACycles = true, // Force Check XCHMA Cycles State - bool checkXCHMAVales = true, // Force Check XCHMA Vales State - bool checkXCHMATrendPowers = true, // Force Check XCHMA Trend Powers - bool checkXOBD = true, // Force Check XOBD State - bool checkXTS = true // Force Check XTS State - ) - { - // - bool result = true; - - // - if (checkXCHMAMin) - { - // - result = - // - // XCHMA MIN ... - !( - // - (mConditions.isXCHMASCOverMin || - mConditions.isXCHMASCCrossedOverMin) && - (mConditions.isXCHMASCUnderMin || - mConditions.isXCHMASCCrossedUnderMin) - // - ); - } - - // - if (checkXCHMAMax && result) - { - // - result = - // - // XCHMA MAX ... - !( - // - (mConditions.isXCHMASCOverMax || - mConditions.isXCHMASCCrossedOverMax) && - (mConditions.isXCHMASCUnderMax || - mConditions.isXCHMASCCrossedUnderMax) - // - ) - // - ; - } - - // - if (checkXCHMACycles && result) - { - // - result = - // - // Check XCHMA Trend Bullish ... - ( - // - // All Cycles Bullish ... - ( - // - // SC ... - (mConditions.isXCHMASCFastUnderSlow || - mConditions.isXCHMASCFastCrossedUnderSlow) - // - && - // - // MC ... - (mConditions.isXCHMAMCFastUnderSlow || - mConditions.isXCHMAMCFastCrossedUnderSlow) - // - && - // - // LC ... - (mConditions.isXCHMALCFastUnderSlow || - mConditions.isXCHMALCFastCrossedUnderSlow) - // - ) - // - || - // - // Two Cycle Fully Bullish ... - ( - // - // SC and MC ... - ( - // - // SC ... - (mConditions.isXCHMASCFastUnderSlow || - mConditions.isXCHMASCFastCrossedOverSlow) - // - && - // - // MC ... - (mConditions.isXCHMAMCFastUnderSlow || - mConditions.isXCHMAMCFastCrossedOverSlow) - // - ) - // - || - // - // SC and LC ... - ( - // - // SC ... - (mConditions.isXCHMASCFastUnderSlow || - mConditions.isXCHMASCFastCrossedUnderSlow) - // - && - // - // LC ... - (mConditions.isXCHMALCFastUnderSlow || - mConditions.isXCHMALCFastCrossedUnderSlow) - // - ) - // - || - // - // MC and LC ... - ( - // - // MC ... - (mConditions.isXCHMAMCFastUnderSlow || - mConditions.isXCHMAMCFastCrossedOverSlow) - // - && - // - // LC ... - (mConditions.isXCHMALCFastUnderSlow || - mConditions.isXCHMALCFastCrossedOverSlow) - // - ) - // - ) - // - ) - // - ; - } - - // - if (checkXCHMAVales && result) - { - // - result = - // - // XCHMA Check Vales ... - !( - // - // All Cycles Vale ... - (mConditions.isXCHMASCVale && - mConditions.isXCHMAMCVale && - mConditions.isXCHMALCVale) - // - || - // - ( - // - // SC MC ... - (mConditions.isXCHMASCVale && - mConditions.isXCHMAMCVale) - // - || - // - // SC LC ... - (mConditions.isXCHMASCVale && - mConditions.isXCHMALCVale) - // - || - // - // MC LC ... - (mConditions.isXCHMAMCVale && - mConditions.isXCHMALCVale) - // - ) - // - ) - // - ; - } - - // - if (checkXCHMATrendPowers && result) - { - // - result = - // - // XCHMA Check Trends Power ... - !( - // - // All Trends Down ... - (mConditions.isXCHMASCTrendsDown && - mConditions.isXCHMAMCTrendsDown && - mConditions.isXCHMALCTrendsDown) - // - || - // - // Twisted pairs ... - ( - // - (mConditions.isXCHMASCTrendsDown && - mConditions.isXCHMAMCTrendsDown) - // - || - // - (mConditions.isXCHMASCTrendsDown && - mConditions.isXCHMALCTrendsDown) - // - || - // - (mConditions.isXCHMAMCTrendsDown && - mConditions.isXCHMALCTrendsDown) - // - ) - // - ) - // - ; - } - - // - if (checkXOBD && result) - { - // - result = - // - // XOBD Check Swings ... - !mConditions.isXOBDSwingHigh - // - ; - } - - // - if (checkXTS && result) - { - // - result = - // - // XTS Check ... - !( - // - mConditions.isXTSCurrentMax && - // - ( - // - // All Over ... - ( - (mConditions.isXTSCurrentOverNearest || - mConditions.isXTSCurrentCrossedOverNearest) && - (mConditions.isXTSCurrentOverMediest || - mConditions.isXTSCurrentCrossedOverMediest) && - (mConditions.isXTSCurrentOverFarest || - mConditions.isXTSCurrentCrossedOverFarest)) - // - || - // - // Pairs ... - ( - // - ((mConditions.isXTSCurrentOverNearest || - mConditions.isXTSCurrentCrossedOverNearest) && - (mConditions.isXTSCurrentOverMediest || - mConditions.isXTSCurrentCrossedOverMediest)) - // - || - // - ((mConditions.isXTSCurrentOverNearest || - mConditions.isXTSCurrentCrossedOverNearest) && - (mConditions.isXTSCurrentOverFarest || - mConditions.isXTSCurrentCrossedOverFarest)) - // - || - // - ((mConditions.isXTSCurrentOverMediest || - mConditions.isXTSCurrentCrossedOverMediest) && - (mConditions.isXTSCurrentOverFarest || - mConditions.isXTSCurrentCrossedOverFarest)) - // - ) - // - ) - // - ) - // - ; - } - - // - return result; - } - // // Signalling based On Signallers ... // - // Longs ... + // XSP ... // bool XSPHasSpecifiedLongSignal( @@ -7420,41 +3617,27 @@ private: bool result = false; // - double bearScore = 0; - double bullScore = 0; - mConditions.GenerateScore( - bullScore, - bearScore // - ); + return result; + } + // + bool XSPHasSpecifiedShortSignal( + X121MarketConditions &mConditions, // + double &sl, // Provided SL ... + double &tp, // Provided TP ... + double &r2r // Risk Reward Ratio ... + ) + { // - double bullScoreAVG3 = GetBullishScoreAverage(1, 3); - double bearScoreAVG100 = GetBearishScoreAverage(1, 100); - - // - result = - // - bearScore > bullScoreAVG3 && - ( - // - (bearScore > 100 && bearScore > bullScore && bullScore > (bearScore * 0.7)) - // - || - // - (bearScore < 30 && bullScore > 150) - // - || - // - (bearScore == bearScoreAVG100) - // - ) - // - ; + bool result = false; // return result; } + // + // XTEST ... + // bool XTESTHasSpecifiedLongSignal( X121MarketConditions &mConditions, // @@ -7471,7 +3654,25 @@ private: } // - // Use XSTR ... + bool XTESTHasSpecifiedShortSignal( + X121MarketConditions &mConditions, // + double &sl, // Provided SL ... + double &tp, // Provided TP ... + double &r2r // Risk Reward Ratio ... + ) + { + // + bool result = false; + + // + return result; + } + + // + // X786 ... + // TODO: Add Documentation Here ... + + // bool X786HasSpecifiedLongSignal( X121MarketConditions &mConditions, // double &sl, // Provided SL ... @@ -7552,984 +3753,6 @@ private: } // - // Use XMC ... - bool X121HasSpecifiedLongSignal( - X121MarketConditions &mConditions, // - double &sl, // Provided SL ... - double &tp, // Provided TP ... - double &r2r // Risk Reward Ratio ... - ) - { - // - bool result = false; - - // - int zIndex = 0; - int cIndex = zIndex + 1; - int pIndex = cIndex + 1; - - // - bool cHasX121 = cMarket.HasX121LongConditions(); - bool sHasX121 = sMarket.HasX121LongConditions(); - bool mHasX121 = mMarket.HasX121LongConditions(); - bool lHasX121 = lMarket.HasX121LongConditions(); - bool hHasX121 = hMarket.HasX121LongConditions(); - - // - if (cHasX121) - { - sl = cMarket.mrb.GetSlow(cIndex); - } - else if (sHasX121) - { - sl = sMarket.mrb.GetSlow(cIndex); - } - else if (mHasX121) - { - sl = mMarket.mrb.GetSlow(cIndex); - } - else if (lHasX121) - { - sl = lMarket.mrb.GetSlow(cIndex); - } - else if (hHasX121) - { - sl = hMarket.mrb.GetSlow(cIndex); - } - - // - result = - // - cHasX121 - // - && - // - sHasX121 - // - && - // - mHasX121 - // - && - // - lHasX121 - // - // && - // // - // hHasX121 - // - ; - - // - if (result) - { - // - r2r = 1; - sl = cMarket.mrb.GetSlow(cIndex); - } - - // - return result; - } - - // - // Use XCHE ... - bool X110HasSpecifiedLongSignal( - X121MarketConditions &mConditions, // - double &sl, // Provided SL ... - double &tp, // Provided TP ... - double &r2r // Risk Reward Ratio ... - ) - { - // - bool result = false; - - // - bool isCCHELong = - // - (mConditions.cMarketConditions.isCHESwitchedInStrongLong && - (mConditions.sMarketConditions.isCHEInStrongLong && - mConditions.mMarketConditions.isCHEInStrongLong && - mConditions.lMarketConditions.isCHEInStrongLong && - mConditions.hMarketConditions.isCHEInStrongLong)) - // - ; - - // - bool isSCHELong = - // - (mConditions.sMarketConditions.isCHESwitchedInStrongLong && - (mConditions.cMarketConditions.isCHEInStrongLong && - mConditions.mMarketConditions.isCHEInStrongLong && - mConditions.lMarketConditions.isCHEInStrongLong && - mConditions.hMarketConditions.isCHEInStrongLong)) - // - ; - - // - bool isMCHELong = - // - (mConditions.mMarketConditions.isCHESwitchedInStrongLong && - (mConditions.cMarketConditions.isCHEInStrongLong && - mConditions.sMarketConditions.isCHEInStrongLong && - mConditions.lMarketConditions.isCHEInStrongLong && - mConditions.hMarketConditions.isCHEInStrongLong)) - // - ; - - // - bool isLCHELong = - // - (mConditions.lMarketConditions.isCHESwitchedInStrongLong && - (mConditions.cMarketConditions.isCHEInStrongLong && - mConditions.sMarketConditions.isCHEInStrongLong && - mConditions.mMarketConditions.isCHEInStrongLong && - mConditions.hMarketConditions.isCHEInStrongLong)) - // - ; - - // - bool isHCHELong = - // - (mConditions.hMarketConditions.isCHESwitchedInStrongLong && - (mConditions.cMarketConditions.isCHEInStrongLong && - mConditions.sMarketConditions.isCHEInStrongLong && - mConditions.mMarketConditions.isCHEInStrongLong && - mConditions.lMarketConditions.isCHEInStrongLong)) - // - ; - - // - result = - // - // isCCHELong - // // - // || - // // - // isSCHELong - // // - // || - // - isMCHELong - // - || - // - isLCHELong - // - || - // - isHCHELong - // - ; - - // - return result; - } - - // - // Use XHK ... - bool X92HasSpecifiedLongSignal( - X121MarketConditions &mConditions, // - double &sl, // Provided SL ... - double &tp, // Provided TP ... - double &r2r // Risk Reward Ratio ... - ) - { - // - bool result = false; - - // - int curr = 0; - int prev = 1; - - // - bool isCSMHKSwitchedToBullish = - // - mConditions.cMarketConditions.smHKBars[curr].IsBullish() && - !mConditions.cMarketConditions.smHKBars[prev].IsBullish() - // - ; - - // - bool isCSMHKBullish = - // - mConditions.cMarketConditions.smHKBars[curr].IsBullish() && - mConditions.cMarketConditions.smHKBars[prev].IsBullish() && - !mConditions.bars[curr].open > mConditions.cMarketConditions.smHKBars[curr].GetUp() && - !mConditions.bars[prev].close > mConditions.cMarketConditions.smHKBars[prev].GetUp() - // - ; - - // - bool isSSMHKSwitchedToBullish = - // - mConditions.sMarketConditions.smHKBars[curr].IsBullish() && - !mConditions.sMarketConditions.smHKBars[prev].IsBullish() - // - ; - - // - bool isSSMHKBullish = - // - mConditions.sMarketConditions.smHKBars[curr].IsBullish() && - mConditions.sMarketConditions.smHKBars[prev].IsBullish() && - !mConditions.bars[curr].open > mConditions.sMarketConditions.smHKBars[curr].GetUp() && - !mConditions.bars[prev].close > mConditions.sMarketConditions.smHKBars[prev].GetUp() - // - ; - - // - bool isMSMHKSwitchedToBullish = - // - mConditions.mMarketConditions.smHKBars[curr].IsBullish() && - !mConditions.mMarketConditions.smHKBars[prev].IsBullish() - // - ; - - // - bool isMSMHKBullish = - // - mConditions.mMarketConditions.smHKBars[curr].IsBullish() && - mConditions.mMarketConditions.smHKBars[prev].IsBullish() && - !mConditions.bars[curr].open > mConditions.mMarketConditions.smHKBars[curr].GetUp() && - !mConditions.bars[prev].close > mConditions.mMarketConditions.smHKBars[prev].GetUp() - // - ; - - // - bool isLSMHKSwitchedToBullish = - // - mConditions.lMarketConditions.smHKBars[curr].IsBullish() && - !mConditions.lMarketConditions.smHKBars[prev].IsBullish() - // - ; - - // - bool isLSMHKBullish = - // - mConditions.lMarketConditions.smHKBars[curr].IsBullish() && - mConditions.lMarketConditions.smHKBars[prev].IsBullish() && - !mConditions.bars[curr].open > mConditions.lMarketConditions.smHKBars[curr].GetUp() && - !mConditions.bars[prev].close > mConditions.lMarketConditions.smHKBars[prev].GetUp() - // - ; - - // - bool isHSMHKSwitchedToBullish = - // - mConditions.hMarketConditions.smHKBars[curr].IsBullish() && - !mConditions.hMarketConditions.smHKBars[prev].IsBullish() - // - ; - - // - bool isHSMHKBullish = - // - mConditions.hMarketConditions.smHKBars[curr].IsBullish() && - mConditions.hMarketConditions.smHKBars[prev].IsBullish() && - !mConditions.bars[curr].open > mConditions.hMarketConditions.smHKBars[curr].GetUp() && - !mConditions.bars[prev].close > mConditions.hMarketConditions.smHKBars[prev].GetUp() - // - ; - - // - bool isCSMHKLong = - // - (isCSMHKBullish || - isCSMHKSwitchedToBullish) && - isSSMHKBullish && - isMSMHKBullish && - isLSMHKBullish && - isHSMHKBullish - // - ; - - // - bool isSSMHKLong = - // - (isSSMHKBullish || - isSSMHKSwitchedToBullish) && - isCSMHKBullish && - isMSMHKBullish && - isLSMHKBullish && - isHSMHKBullish - // - ; - - // - bool isMSMHKLong = - // - (isMSMHKBullish || - isMSMHKSwitchedToBullish) && - isSSMHKBullish && - isCSMHKBullish && - isLSMHKBullish && - isHSMHKBullish - // - ; - - // - bool isLSMHKLong = - // - (isLSMHKBullish || - isLSMHKSwitchedToBullish) && - isSSMHKBullish && - isCSMHKBullish && - isMSMHKBullish && - isHSMHKBullish - // - ; - - // - bool isHSMHKLong = - // - (isHSMHKBullish || - isHSMHKSwitchedToBullish) && - isSSMHKBullish && - isCSMHKBullish && - isMSMHKBullish && - isLSMHKBullish - // - ; - - // - result = - // - // isCSMHKLong - // // - // || - // // - // isSSMHKLong - // // - // || - // - isMSMHKLong - // - || - // - isLSMHKLong - // - || - // - isHSMHKLong - // - ; - - // - return result; - } - - // - // Use XMRB ... - bool X128HasSpecifiedLongSignal( - X121MarketConditions &mConditions, // - double &sl, // Provided SL ... - double &tp, // Provided TP ... - double &r2r // Risk Reward Ratio ... - ) - { - // - bool result = false; - - // - // Current Cycle ... - - // - bool isCMRBFastOverSlow = - // - mConditions.cMarketConditions.mrbFasts[1] > mConditions.cMarketConditions.mrbSlows[1] - // - ; - - // - bool isCMRBFastCrossedOverSlow = - // - mConditions.cMarketConditions.mrbFasts[1] > mConditions.cMarketConditions.mrbSlows[1] && - mConditions.cMarketConditions.mrbFasts[2] <= mConditions.cMarketConditions.mrbSlows[2] - // - ; - - // - bool isCMRBClosedOverFast = - // - mConditions.cMarketConditions.bars[1].close > mConditions.cMarketConditions.mrbFasts[1] - // - ; - - // - // Short Cycle ... - - // - bool isSMRBFastOverSlow = - // - mConditions.sMarketConditions.mrbFasts[1] > mConditions.sMarketConditions.mrbSlows[1] - // - ; - - // - bool isSMRBFastCrossedOverSlow = - // - mConditions.sMarketConditions.mrbFasts[1] > mConditions.sMarketConditions.mrbSlows[1] && - mConditions.sMarketConditions.mrbFasts[2] <= mConditions.sMarketConditions.mrbSlows[2] - // - ; - - // - bool isSMRBClosedOverFast = - // - mConditions.sMarketConditions.bars[1].close > mConditions.sMarketConditions.mrbFasts[1] - // - ; - - // - // Medium Cycle ... - - // - bool isMMRBFastOverSlow = - // - mConditions.mMarketConditions.mrbFasts[1] > mConditions.mMarketConditions.mrbSlows[1] - // - ; - - // - bool isMMRBFastCrossedOverSlow = - // - mConditions.mMarketConditions.mrbFasts[1] > mConditions.mMarketConditions.mrbSlows[1] && - mConditions.mMarketConditions.mrbFasts[2] <= mConditions.mMarketConditions.mrbSlows[2] - // - ; - - // - bool isMMRBClosedOverFast = - // - mConditions.mMarketConditions.bars[1].close > mConditions.mMarketConditions.mrbFasts[1] - // - ; - - // - // Long Cycle ... - - // - bool isLMRBFastOverSlow = - // - mConditions.lMarketConditions.mrbFasts[1] > mConditions.lMarketConditions.mrbSlows[1] - // - ; - - // - bool isLMRBFastCrossedOverSlow = - // - mConditions.lMarketConditions.mrbFasts[1] > mConditions.lMarketConditions.mrbSlows[1] && - mConditions.lMarketConditions.mrbFasts[2] <= mConditions.lMarketConditions.mrbSlows[2] - // - ; - - // - bool isLMRBClosedOverFast = - // - mConditions.lMarketConditions.bars[1].close > mConditions.lMarketConditions.mrbFasts[1] - // - ; - - // - // Hind Cycle ... - - // - bool isHMRBFastOverSlow = - // - mConditions.hMarketConditions.mrbFasts[1] > mConditions.hMarketConditions.mrbSlows[1] - // - ; - - // - bool isHMRBFastCrossedOverSlow = - // - mConditions.hMarketConditions.mrbFasts[1] > mConditions.hMarketConditions.mrbSlows[1] && - mConditions.hMarketConditions.mrbFasts[2] <= mConditions.hMarketConditions.mrbSlows[2] - // - ; - - // - bool isHMRBClosedOverFast = - // - mConditions.hMarketConditions.bars[1].close > mConditions.hMarketConditions.mrbFasts[1] - // - ; - - // - bool isMRBLongWeight = - // - ( - // - isCMRBFastOverSlow && - isSMRBFastOverSlow && - isMMRBFastOverSlow && - isLMRBFastOverSlow && - isHMRBFastOverSlow - // - ) - // - || - // - ( - // - isCMRBFastOverSlow && - (( - isSMRBFastOverSlow && - isMMRBFastOverSlow && - isLMRBFastOverSlow) - // - || - // - ( - isSMRBFastOverSlow && - isLMRBFastOverSlow && - isHMRBFastOverSlow) - // - || - // - ( - isMMRBFastOverSlow && - isLMRBFastOverSlow && - isHMRBFastOverSlow)) - // - ) - // - ; - - // - bool isMBRCloseLong = - // - ( - // - isCMRBClosedOverFast && - isSMRBClosedOverFast && - isMMRBClosedOverFast && - isLMRBClosedOverFast && - isHMRBClosedOverFast - // - ) - // - || - // - ( - // - isCMRBClosedOverFast && - (( - isSMRBClosedOverFast && - isMMRBClosedOverFast) - // - || - // - ( - isSMRBClosedOverFast && - isLMRBClosedOverFast) - // - || - // - ( - isSMRBClosedOverFast && - isHMRBClosedOverFast) - // - || - // - ( - isMMRBClosedOverFast && - isLMRBClosedOverFast) - // - || - // - ( - isLMRBClosedOverFast && - isHMRBClosedOverFast) - // - || - // - ( - isMMRBClosedOverFast && - isHMRBClosedOverFast) - // - || - // - ( - isSMRBClosedOverFast && - isMMRBClosedOverFast && - isLMRBClosedOverFast) - // - || - // - ( - isSMRBClosedOverFast && - isLMRBClosedOverFast && - isHMRBClosedOverFast) - // - || - // - ( - isMMRBClosedOverFast && - isLMRBClosedOverFast && - isHMRBClosedOverFast)) - // - ) - // - ; - - // - bool isCMRBShort = - // - (isCMRBFastOverSlow || - isCMRBFastCrossedOverSlow) - // - && - // - isCMRBClosedOverFast && - // - isMRBLongWeight && - // - isMBRCloseLong - // - ; - - // - bool isSMRBShort = - // - (isSMRBFastOverSlow || - isSMRBFastCrossedOverSlow) - // - && - // - isSMRBClosedOverFast && - // - isMRBLongWeight && - // - isMBRCloseLong - // - ; - - // - bool isMMRBShort = - // - (isMMRBFastOverSlow || - isMMRBFastCrossedOverSlow) - // - && - // - isMMRBClosedOverFast && - // - isMRBLongWeight && - // - isMBRCloseLong - // - ; - - // - bool isLMRBShort = - // - (isLMRBFastOverSlow || - isLMRBFastCrossedOverSlow) - // - && - // - isLMRBClosedOverFast && - // - isMRBLongWeight && - // - isMBRCloseLong - // - ; - - // - bool isHMRBShort = - // - (isHMRBFastOverSlow || - isHMRBFastCrossedOverSlow) - // - && - // - isHMRBClosedOverFast && - // - isMRBLongWeight && - // - isMBRCloseLong - // - ; - - // - result = - // - // isCMRBShort - // // - // || - // // - // isSMRBShort - // // - // || - // - isMMRBShort - // - || - // - isLMRBShort - // - || - // - isHMRBShort - // - ; - - // - return result; - } - - // - // XTD ... - bool XTDHasSpecifiedLongSignal( - X121MarketConditions &mConditions, // - double &sl, // Provided SL ... - double &tp, // Provided TP ... - double &r2r // Risk Reward Ratio ... - ) - { - // - bool result = false; - - // - result = - // - false - // - ; - - // - return result; - } - - // - // XTAM ... - bool XTAMHasSpecifiedLongSignal( - X121MarketConditions &mConditions, // - double &sl, // Provided SL ... - double &tp, // Provided TP ... - double &r2r // Risk Reward Ratio ... - ) - { - // - bool result = false; - - // - result = - // - false - // - ; - - // - return result; - } - - // - // XSI ... - bool XSIHasSpecifiedLongSignal( - X121MarketConditions &mConditions, // - double &sl, // Provided SL ... - double &tp, // Provided TP ... - double &r2r // Risk Reward Ratio ... - ) - { - // - bool result = false; - - // - result = - // - false - // - ; - - // - return result; - } - - // - // XTSFI ... - bool XTSFIHasSpecifiedLongSignal( - X121MarketConditions &mConditions, // - double &sl, // Provided SL ... - double &tp, // Provided TP ... - double &r2r // Risk Reward Ratio ... - ) - { - // - bool result = false; - - // - result = - // - false - // - ; - - // - return result; - } - - // - // XOBDLH ... - bool XOBDLHHasSpecifiedLongSignal( - X121MarketConditions &mConditions, // - double &sl, // Provided SL ... - double &tp, // Provided TP ... - double &r2r // Risk Reward Ratio ... - ) - { - // - bool result = false; - - // - result = - // - false - // - ; - - // - return result; - } - - // - // XCHMACC ... - bool XCHMACCHasSpecifiedLongSignal( - X121MarketConditions &mConditions, // - double &sl, // Provided SL ... - double &tp, // Provided TP ... - double &r2r // Risk Reward Ratio ... - ) - { - // - bool result = false; - - // - result = - // - false - // - ; - - // - return result; - } - - // - // XCHMAMN ... - bool XCHMAMNHasSpecifiedLongSignal( - X121MarketConditions &mConditions, // - double &sl, // Provided SL ... - double &tp, // Provided TP ... - double &r2r // Risk Reward Ratio ... - ) - { - // - bool result = false; - - // - result = - // - false - // - ; - - // - return result; - } - - // - // XCHMAMX ... - bool XCHMAMXHasSpecifiedLongSignal( - X121MarketConditions &mConditions, // - double &sl, // Provided SL ... - double &tp, // Provided TP ... - double &r2r // Risk Reward Ratio ... - ) - { - // - bool result = false; - - // - result = - // - false - // - ; - - // - return result; - } - - // - // Short ... - - // - bool XSPHasSpecifiedShortSignal( - X121MarketConditions &mConditions, // - double &sl, // Provided SL ... - double &tp, // Provided TP ... - double &r2r // Risk Reward Ratio ... - ) - { - // - bool result = false; - - // - double bearScore = 0; - double bullScore = 0; - mConditions.GenerateScore( - bullScore, - bearScore // - ); - - // - double bearScoreAVG3 = GetBearishScoreAverage(1, 3); - double bullScoreAVG100 = GetBullishScoreAverage(1, 100); - - // - result = - // - bearScore > bearScoreAVG3 && - ( - // - (bullScore > 100 && bullScore > bearScore && bearScore > (bullScore * 0.7)) - // - || - // - (bullScore < 30 && bearScore > 150) - // - || - // - (bullScore == bullScoreAVG100) - // - ); - - // - return result; - } - - // - bool XTESTHasSpecifiedShortSignal( - X121MarketConditions &mConditions, // - double &sl, // Provided SL ... - double &tp, // Provided TP ... - double &r2r // Risk Reward Ratio ... - ) - { - // - bool result = false; - - // - return result; - } - - // - // Use XSTR ... bool X786HasSpecifiedShortSignal( X121MarketConditions &mConditions, // double &sl, // Provided SL ... @@ -8685,7 +3908,90 @@ private: } // - // Use XMC ... + // X121 ... + // TODO: Add Documentation Here ... + + // + bool X121HasSpecifiedLongSignal( + X121MarketConditions &mConditions, // + double &sl, // Provided SL ... + double &tp, // Provided TP ... + double &r2r // Risk Reward Ratio ... + ) + { + // + bool result = false; + + // + int zIndex = 0; + int cIndex = zIndex + 1; + int pIndex = cIndex + 1; + + // + bool cHasX121 = cMarket.HasX121LongConditions(); + bool sHasX121 = sMarket.HasX121LongConditions(); + bool mHasX121 = mMarket.HasX121LongConditions(); + bool lHasX121 = lMarket.HasX121LongConditions(); + bool hHasX121 = hMarket.HasX121LongConditions(); + + // + if (cHasX121) + { + sl = cMarket.mrb.GetSlow(cIndex); + } + else if (sHasX121) + { + sl = sMarket.mrb.GetSlow(cIndex); + } + else if (mHasX121) + { + sl = mMarket.mrb.GetSlow(cIndex); + } + else if (lHasX121) + { + sl = lMarket.mrb.GetSlow(cIndex); + } + else if (hHasX121) + { + sl = hMarket.mrb.GetSlow(cIndex); + } + + // + result = + // + cHasX121 + // + && + // + sHasX121 + // + && + // + mHasX121 + // + && + // + lHasX121 + // + // && + // // + // hHasX121 + // + ; + + // + if (result) + { + // + r2r = 1; + sl = cMarket.mrb.GetSlow(cIndex); + } + + // + return result; + } + + // bool X121HasSpecifiedShortSignal( X121MarketConditions &mConditions, // double &sl, // Provided SL ... @@ -8766,7 +4072,25 @@ private: } // - // Use XCHE ... + // X110 ... + // TODO: Add Documentation Here ... + + // + bool X110HasSpecifiedLongSignal( + X121MarketConditions &mConditions, // + double &sl, // Provided SL ... + double &tp, // Provided TP ... + double &r2r // Risk Reward Ratio ... + ) + { + // + bool result = false; + + // + return result; + } + + // bool X110HasSpecifiedShortSignal( X121MarketConditions &mConditions, // double &sl, // Provided SL ... @@ -8778,89 +4102,29 @@ private: bool result = false; // - bool isCCHEShort = - // - (mConditions.cMarketConditions.isCHESwitchedInStrongShort && - (mConditions.sMarketConditions.isCHEInStrongShort && - mConditions.mMarketConditions.isCHEInStrongShort && - mConditions.lMarketConditions.isCHEInStrongShort && - mConditions.hMarketConditions.isCHEInStrongShort)) - // - ; + return result; + } - // - bool isSCHEShort = - // - (mConditions.sMarketConditions.isCHESwitchedInStrongShort && - (mConditions.cMarketConditions.isCHEInStrongShort && - mConditions.mMarketConditions.isCHEInStrongShort && - mConditions.lMarketConditions.isCHEInStrongShort && - mConditions.hMarketConditions.isCHEInStrongShort)) - // - ; + // + // X92 ... + // TODO: Add Documentation Here ... + // + bool X92HasSpecifiedLongSignal( + X121MarketConditions &mConditions, // + double &sl, // Provided SL ... + double &tp, // Provided TP ... + double &r2r // Risk Reward Ratio ... + ) + { // - bool isMCHEShort = - // - (mConditions.mMarketConditions.isCHESwitchedInStrongShort && - (mConditions.cMarketConditions.isCHEInStrongShort && - mConditions.sMarketConditions.isCHEInStrongShort && - mConditions.lMarketConditions.isCHEInStrongShort && - mConditions.hMarketConditions.isCHEInStrongShort)) - // - ; - - // - bool isLCHEShort = - // - (mConditions.lMarketConditions.isCHESwitchedInStrongShort && - (mConditions.cMarketConditions.isCHEInStrongShort && - mConditions.sMarketConditions.isCHEInStrongShort && - mConditions.mMarketConditions.isCHEInStrongShort && - mConditions.hMarketConditions.isCHEInStrongShort)) - // - ; - - // - bool isHCHEShort = - // - (mConditions.hMarketConditions.isCHESwitchedInStrongShort && - (mConditions.cMarketConditions.isCHEInStrongShort && - mConditions.sMarketConditions.isCHEInStrongShort && - mConditions.mMarketConditions.isCHEInStrongShort && - mConditions.lMarketConditions.isCHEInStrongShort)) - // - ; - - // - result = - // - // isCCHEShort - // // - // || - // // - // isSCHEShort - // // - // || - // - isMCHEShort - // - || - // - isLCHEShort - // - || - // - isHCHEShort - // - ; + bool result = false; // return result; } // - // Use XHK ... bool X92HasSpecifiedShortSignal( X121MarketConditions &mConditions, // double &sl, // Provided SL ... @@ -8871,184 +4135,30 @@ private: // bool result = false; - // - int curr = 0; - int prev = 1; - - // - bool isCSMHKSwitchedToBearish = - // - mConditions.cMarketConditions.smHKBars[curr].IsBearish() && - !mConditions.cMarketConditions.smHKBars[prev].IsBearish() - // - ; - - // - bool isCSMHKBearish = - // - mConditions.cMarketConditions.smHKBars[curr].IsBearish() && - mConditions.cMarketConditions.smHKBars[prev].IsBearish() && - !mConditions.bars[curr].open < mConditions.cMarketConditions.smHKBars[curr].GetDown() && - !mConditions.bars[prev].close < mConditions.cMarketConditions.smHKBars[prev].GetDown() - // - ; - - // - bool isSSMHKSwitchedToBearish = - // - mConditions.sMarketConditions.smHKBars[curr].IsBearish() && - !mConditions.sMarketConditions.smHKBars[prev].IsBearish() - // - ; - - // - bool isSSMHKBearish = - // - mConditions.sMarketConditions.smHKBars[curr].IsBearish() && - mConditions.sMarketConditions.smHKBars[prev].IsBearish() && - !mConditions.bars[curr].open < mConditions.sMarketConditions.smHKBars[curr].GetDown() && - !mConditions.bars[prev].close < mConditions.sMarketConditions.smHKBars[prev].GetDown() - // - ; - - // - bool isMSMHKSwitchedToBearish = - // - mConditions.mMarketConditions.smHKBars[curr].IsBearish() && - !mConditions.mMarketConditions.smHKBars[prev].IsBearish() - // - ; - - // - bool isMSMHKBearish = - // - mConditions.mMarketConditions.smHKBars[curr].IsBearish() && - mConditions.mMarketConditions.smHKBars[prev].IsBearish() && - !mConditions.bars[curr].open < mConditions.mMarketConditions.smHKBars[curr].GetDown() && - !mConditions.bars[prev].close < mConditions.mMarketConditions.smHKBars[prev].GetDown() - // - ; - - // - bool isLSMHKSwitchedToBearish = - // - mConditions.lMarketConditions.smHKBars[curr].IsBearish() && - !mConditions.lMarketConditions.smHKBars[prev].IsBearish() - // - ; - - // - bool isLSMHKBearish = - // - mConditions.lMarketConditions.smHKBars[curr].IsBearish() && - mConditions.lMarketConditions.smHKBars[prev].IsBearish() && - !mConditions.bars[curr].open < mConditions.lMarketConditions.smHKBars[curr].GetDown() && - !mConditions.bars[prev].close < mConditions.lMarketConditions.smHKBars[prev].GetDown() - // - ; - - // - bool isHSMHKSwitchedToBearish = - // - mConditions.hMarketConditions.smHKBars[curr].IsBearish() && - !mConditions.hMarketConditions.smHKBars[prev].IsBearish() - // - ; - - // - bool isHSMHKBearish = - // - mConditions.hMarketConditions.smHKBars[curr].IsBearish() && - mConditions.hMarketConditions.smHKBars[prev].IsBearish() && - !mConditions.bars[curr].open < mConditions.hMarketConditions.smHKBars[curr].GetDown() && - !mConditions.bars[prev].close < mConditions.hMarketConditions.smHKBars[prev].GetDown() - // - ; - - // - bool isCSMHKShort = - // - (isCSMHKSwitchedToBearish) && - isSSMHKBearish && - isMSMHKBearish && - isLSMHKBearish && - isHSMHKBearish - // - ; - - // - bool isSSMHKShort = - // - (isSSMHKSwitchedToBearish) && - isCSMHKBearish && - isMSMHKBearish && - isLSMHKBearish && - isHSMHKBearish - // - ; - - // - bool isMSMHKShort = - // - (isMSMHKSwitchedToBearish) && - isSSMHKBearish && - isCSMHKBearish && - isLSMHKBearish && - isHSMHKBearish - // - ; - - // - bool isLSMHKShort = - // - (isLSMHKSwitchedToBearish) && - isSSMHKBearish && - isCSMHKBearish && - isMSMHKBearish && - isHSMHKBearish - // - ; - - // - bool isHSMHKShort = - // - (isHSMHKSwitchedToBearish) && - isSSMHKBearish && - isCSMHKBearish && - isMSMHKBearish && - isLSMHKBearish - // - ; - - // - result = - // - // isCSMHKShort - // // - // || - // // - // isSSMHKShort - // // - // || - // - isMSMHKShort - // - || - // - isLSMHKShort - // - || - // - isHSMHKShort - // - ; - // return result; } // - // Use XMRB ... + // X128 ... + // TODO: Add Documentation Here ... + + // + bool X128HasSpecifiedLongSignal( + X121MarketConditions &mConditions, // + double &sl, // Provided SL ... + double &tp, // Provided TP ... + double &r2r // Risk Reward Ratio ... + ) + { + // + bool result = false; + + // + return result; + } + + // bool X128HasSpecifiedShortSignal( X121MarketConditions &mConditions, // double &sl, // Provided SL ... @@ -9059,1503 +4169,6 @@ private: // bool result = false; - // - // Current Cycle ... - - // - bool isCMRBFastUnderSlow = - // - mConditions.cMarketConditions.mrbFasts[1] < mConditions.cMarketConditions.mrbSlows[1] - // - ; - - // - bool isCMRBFastCrossedUnderSlow = - // - mConditions.cMarketConditions.mrbFasts[1] < mConditions.cMarketConditions.mrbSlows[1] && - mConditions.cMarketConditions.mrbFasts[2] >= mConditions.cMarketConditions.mrbSlows[2] - // - ; - - // - bool isCMRBClosedUnderFast = - // - mConditions.cMarketConditions.bars[1].close < mConditions.cMarketConditions.mrbFasts[1] - // - ; - - // - // Short Cycle ... - - // - bool isSMRBFastUnderSlow = - // - mConditions.sMarketConditions.mrbFasts[1] < mConditions.sMarketConditions.mrbSlows[1] - // - ; - - // - bool isSMRBFastCrossedUnderSlow = - // - mConditions.sMarketConditions.mrbFasts[1] < mConditions.sMarketConditions.mrbSlows[1] && - mConditions.sMarketConditions.mrbFasts[2] >= mConditions.sMarketConditions.mrbSlows[2] - // - ; - - // - bool isSMRBClosedUnderFast = - // - mConditions.sMarketConditions.bars[1].close < mConditions.sMarketConditions.mrbFasts[1] - // - ; - - // - // Medium Cycle ... - - // - bool isMMRBFastUnderSlow = - // - mConditions.mMarketConditions.mrbFasts[1] < mConditions.mMarketConditions.mrbSlows[1] - // - ; - - // - bool isMMRBFastCrossedUnderSlow = - // - mConditions.mMarketConditions.mrbFasts[1] < mConditions.mMarketConditions.mrbSlows[1] && - mConditions.mMarketConditions.mrbFasts[2] >= mConditions.mMarketConditions.mrbSlows[2] - // - ; - - // - bool isMMRBClosedUnderFast = - // - mConditions.mMarketConditions.bars[1].close < mConditions.mMarketConditions.mrbFasts[1] - // - ; - - // - // Long Cycle ... - - // - bool isLMRBFastUnderSlow = - // - mConditions.lMarketConditions.mrbFasts[1] < mConditions.lMarketConditions.mrbSlows[1] - // - ; - - // - bool isLMRBFastCrossedUnderSlow = - // - mConditions.lMarketConditions.mrbFasts[1] < mConditions.lMarketConditions.mrbSlows[1] && - mConditions.lMarketConditions.mrbFasts[2] >= mConditions.lMarketConditions.mrbSlows[2] - // - ; - - // - bool isLMRBClosedUnderFast = - // - mConditions.lMarketConditions.bars[1].close < mConditions.lMarketConditions.mrbFasts[1] - // - ; - - // - // Hind Cycle ... - - // - bool isHMRBFastUnderSlow = - // - mConditions.hMarketConditions.mrbFasts[1] < mConditions.hMarketConditions.mrbSlows[1] - // - ; - - // - bool isHMRBFastCrossedUnderSlow = - // - mConditions.hMarketConditions.mrbFasts[1] < mConditions.hMarketConditions.mrbSlows[1] && - mConditions.hMarketConditions.mrbFasts[2] >= mConditions.hMarketConditions.mrbSlows[2] - // - ; - - // - bool isHMRBClosedUnderFast = - // - mConditions.hMarketConditions.bars[1].close < mConditions.hMarketConditions.mrbFasts[1] - // - ; - - // - bool isMRBShortWeight = - // - ( - // - isCMRBFastUnderSlow && - isSMRBFastUnderSlow && - isMMRBFastUnderSlow && - isLMRBFastUnderSlow && - isHMRBFastUnderSlow - // - ) - // - || - // - ( - // - isCMRBFastUnderSlow && - (( - isSMRBFastUnderSlow && - isMMRBFastUnderSlow && - isLMRBFastUnderSlow) - // - || - // - ( - isSMRBFastUnderSlow && - isLMRBFastUnderSlow && - isHMRBFastUnderSlow) - // - || - // - ( - isMMRBFastUnderSlow && - isLMRBFastUnderSlow && - isHMRBFastUnderSlow)) - // - ) - // - ; - - // - bool isMBRCloseShort = - // - ( - // - isCMRBClosedUnderFast && - isSMRBClosedUnderFast && - isMMRBClosedUnderFast && - isLMRBClosedUnderFast && - isHMRBClosedUnderFast - // - ) - // - || - // - ( - // - isCMRBClosedUnderFast && - (( - isSMRBClosedUnderFast && - isMMRBClosedUnderFast) - // - || - // - ( - isSMRBClosedUnderFast && - isLMRBClosedUnderFast) - // - || - // - ( - isSMRBClosedUnderFast && - isHMRBClosedUnderFast) - // - || - // - ( - isMMRBClosedUnderFast && - isLMRBClosedUnderFast) - // - || - // - ( - isLMRBClosedUnderFast && - isHMRBClosedUnderFast) - // - || - // - ( - isMMRBClosedUnderFast && - isHMRBClosedUnderFast) - // - || - // - ( - isSMRBClosedUnderFast && - isMMRBClosedUnderFast && - isLMRBClosedUnderFast) - // - || - // - ( - isSMRBClosedUnderFast && - isLMRBClosedUnderFast && - isHMRBClosedUnderFast) - // - || - // - ( - isMMRBClosedUnderFast && - isLMRBClosedUnderFast && - isHMRBClosedUnderFast)) - // - ) - // - ; - - // - bool isCMRBShort = - // - (isCMRBFastUnderSlow || - isCMRBFastCrossedUnderSlow) - // - && - // - isCMRBClosedUnderFast && - // - isMRBShortWeight && - // - isMBRCloseShort - // - ; - - // - bool isSMRBShort = - // - (isSMRBFastUnderSlow || - isSMRBFastCrossedUnderSlow) - // - && - // - isSMRBClosedUnderFast && - // - isMRBShortWeight && - // - isMBRCloseShort - // - ; - - // - bool isMMRBShort = - // - (isMMRBFastUnderSlow || - isMMRBFastCrossedUnderSlow) - // - && - // - isMMRBClosedUnderFast && - // - isMRBShortWeight && - // - isMBRCloseShort - // - ; - - // - bool isLMRBShort = - // - (isLMRBFastUnderSlow || - isLMRBFastCrossedUnderSlow) - // - && - // - isLMRBClosedUnderFast && - // - isMRBShortWeight && - // - isMBRCloseShort - // - ; - - // - bool isHMRBShort = - // - (isHMRBFastUnderSlow || - isHMRBFastCrossedUnderSlow) - // - && - // - isHMRBClosedUnderFast && - // - isMRBShortWeight && - // - isMBRCloseShort - // - ; - - // - result = - // - // isCMRBShort - // // - // || - // // - // isSMRBShort - // // - // || - // - isMMRBShort - // - || - // - isLMRBShort - // - || - // - isHMRBShort - // - ; - - // - return result; - } - - // - // XTD ... - bool XTDHasSpecifiedShortSignal( - X121MarketConditions &mConditions, // - double &sl, // Provided SL ... - double &tp, // Provided TP ... - double &r2r // Risk Reward Ratio ... - ) - { - // - bool result = false; - - // - result = - // - false - // - ; - - // - return result; - } - - // - // XTAM ... - bool XTAMHasSpecifiedShortSignal( - X121MarketConditions &mConditions, // - double &sl, // Provided SL ... - double &tp, // Provided TP ... - double &r2r // Risk Reward Ratio ... - ) - { - // - bool result = false; - - // - result = - // - false - // - ; - - // - return result; - } - - // - // XSI ... - bool XSIHasSpecifiedShortSignal( - X121MarketConditions &mConditions, // - double &sl, // Provided SL ... - double &tp, // Provided TP ... - double &r2r // Risk Reward Ratio ... - ) - { - // - bool result = false; - - // - result = - // - false - // - ; - - // - return result; - } - - // - // XTSFI ... - bool XTSFIHasSpecifiedShortSignal( - X121MarketConditions &mConditions, // - double &sl, // Provided SL ... - double &tp, // Provided TP ... - double &r2r // Risk Reward Ratio ... - ) - { - // - bool result = false; - - // - result = - // - false - // - ; - - // - return result; - } - - // - // XOBDLH ... - bool XOBDLHHasSpecifiedShortSignal( - X121MarketConditions &mConditions, // - double &sl, // Provided SL ... - double &tp, // Provided TP ... - double &r2r // Risk Reward Ratio ... - ) - { - // - bool result = false; - - // - result = - // - false - // - ; - - // - return result; - } - - // - // XCHMACC ... - bool XCHMACCHasSpecifiedShortSignal( - X121MarketConditions &mConditions, // - double &sl, // Provided SL ... - double &tp, // Provided TP ... - double &r2r // Risk Reward Ratio ... - ) - { - // - bool result = false; - - // - result = - // - false - // - ; - - // - return result; - } - - // - // XCHMAMN ... - bool XCHMAMNHasSpecifiedShortSignal( - X121MarketConditions &mConditions, // - double &sl, // Provided SL ... - double &tp, // Provided TP ... - double &r2r // Risk Reward Ratio ... - ) - { - // - bool result = false; - - // - result = - // - false - // - ; - - // - return result; - } - - // - // XCHMAMX ... - bool XCHMAMXHasSpecifiedShortSignal( - X121MarketConditions &mConditions, // - double &sl, // Provided SL ... - double &tp, // Provided TP ... - double &r2r // Risk Reward Ratio ... - ) - { - // - bool result = false; - - // - result = - // - false - // - ; - - // - return result; - } - - // - // Base Signals ... - // Common Conditions ... - - // - bool HasBaseLongConditions( - X121MarketConditions &mConditions, - int &pusher // - ) - { - // - bool result = false; - - // - int count = 0; - - // - bool hasXTDConditions = XTDHasLongConditions(mConditions); - if (hasXTDConditions) - { - count++; - } - bool hasXTAMConditions = XTAMHasLongConditions(mConditions); - if (hasXTAMConditions) - { - count++; - } - bool hasXSIConditions = XSIHasLongConditions(mConditions); - if (hasXSIConditions) - { - count++; - } - bool hasXTSFIConditions = XTSFIHasLongConditions(mConditions); - if (hasXTSFIConditions) - { - count++; - } - bool hasXOBDLHConditions = XOBDLHHasLongConditions(mConditions); - if (hasXOBDLHConditions) - { - count++; - } - bool hasXCHMACCConditions = XCHMACCHasLongConditions(mConditions); - if (hasXCHMACCConditions) - { - count++; - } - bool hasXCHMAMNConditions = XCHMAMNHasLongConditions(mConditions); - if (hasXCHMAMNConditions) - { - count++; - } - bool hasXCHMAMXConditions = XCHMAMXHasLongConditions(mConditions); - if (hasXCHMAMXConditions) - { - count++; - } - - // - result = count >= 1; - pusher = count; - - // - return result; - } - - // - bool HasBaseShortConditions( - X121MarketConditions &mConditions, - int &pusher // - ) - { - // - bool result = false; - - // - int count = 0; - - // - bool hasXTDConditions = XTDHasShortConditions(mConditions); - if (hasXTDConditions) - { - count++; - } - bool hasXTAMConditions = XTAMHasShortConditions(mConditions); - if (hasXTAMConditions) - { - count++; - } - bool hasXSIConditions = XSIHasShortConditions(mConditions); - if (hasXSIConditions) - { - count++; - } - bool hasXTSFIConditions = XTSFIHasShortConditions(mConditions); - if (hasXTSFIConditions) - { - count++; - } - bool hasXOBDLHConditions = XOBDLHHasShortConditions(mConditions); - if (hasXOBDLHConditions) - { - count++; - } - bool hasXCHMACCConditions = XCHMACCHasShortConditions(mConditions); - if (hasXCHMACCConditions) - { - count++; - } - bool hasXCHMAMNConditions = XCHMAMNHasShortConditions(mConditions); - if (hasXCHMAMNConditions) - { - count++; - } - bool hasXCHMAMXConditions = XCHMAMXHasShortConditions(mConditions); - if (hasXCHMAMXConditions) - { - count++; - } - - // - result = count >= 1; - pusher = count; - - // - return result; - } - - // - // XTD ... - - // - bool XTDHasLongConditions( - X121MarketConditions &mConditions // - ) - { - // - bool result = false; - - // - // Start Analysing Market based On Conditions ... - result = - // - // Base Condition: - // each Strategy must has a Base Conditions, which they are usually common combinations - // of Market Properties that must be happens to lookup for signals ... - ( - // - mConditions.isXTDSignalCrossedOverBear - // - ) - // - && - // - // Next Step is combine sorts of Conditions which make our choice - // so Exact in Market ... - ( - // - IsReadyForLong(mConditions) - // - ) - // - ; - - // - return result; - } - - // - bool XTDHasShortConditions( - X121MarketConditions &mConditions // - ) - { - // - bool result = false; - - // - // Start Analysing Market based On Conditions ... - result = - // - // Base Condition: - // each Strategy must has a Base Conditions, which they are usually common combinations - // of Market Properties that must be happens to lookup for signals ... - ( - // - mConditions.isXTDSignalCrossedUnderBear - // - ) - // - && - // - // Next Step is combine sorts of Conditions which make our choice - // so Exact in Market ... - ( - // - IsReadyForShort(mConditions) - // - ) - // - ; - - // - return result; - } - - // - // XTAM ... - - // - bool XTAMHasLongConditions( - X121MarketConditions &mConditions // - ) - { - // - bool result = false; - - // - // Start Analysing Market based On Conditions ... - result = - // - // Base Condition: - // each Strategy must has a Base Conditions, which they are usually common combinations - // of Market Properties that must be happens to lookup for signals ... - ( - // - (mConditions.amas[1] > mConditions.tms[1] && - mConditions.amas[2] > mConditions.tms[2]) - // - && - // - !(mConditions.amas[2] > mConditions.tms[2] && - mConditions.amas[3] > mConditions.tms[3]) - // - ) - // - && - // - // Next Step is combine sorts of Conditions which make our choice - // so Exact in Market ... - ( - // - IsReadyForLong(mConditions) - // - ) - // - ; - - // - return result; - } - - // - bool XTAMHasShortConditions( - X121MarketConditions &mConditions // - ) - { - // - bool result = false; - - // - // Start Analysing Market based On Conditions ... - result = - // - // Base Condition: - // each Strategy must has a Base Conditions, which they are usually common combinations - // of Market Properties that must be happens to lookup for signals ... - ( - // - (mConditions.amas[1] < mConditions.amas[1] && - mConditions.amas[2] < mConditions.amas[2]) - // - && - // - !(mConditions.amas[2] < mConditions.amas[2] && - mConditions.amas[3] < mConditions.amas[3]) - // - ) - // - && - // - // Next Step is combine sorts of Conditions which make our choice - // so Exact in Market ... - ( - // - IsReadyForShort(mConditions) - // - ) - // - ; - - // - return result; - } - - // - // XSI ... - - // - bool XSIHasLongConditions( - X121MarketConditions &mConditions // - ) - { - // - bool result = false; - - // - // Start Analysing Market based On Conditions ... - result = - // - // Base Condition: - // each Strategy must has a Base Conditions, which they are usually common combinations - // of Market Properties that must be happens to lookup for signals ... - ( - // - mConditions.isXRSICrossedOverLongEntry && - mConditions.rsis[3] < mInputs.rsiInputs.longEntryValue - // - ) - // - && - // - // Next Step is combine sorts of Conditions which make our choice - // so Exact in Market ... - ( - // - IsReadyForLong( - mConditions, - true, // XCHMA Min - true, // XCHMA Max - true, // XCHMA Cycles - true, // XCHMA Peaks - false, // XCHMA Trend Powers - true, // XOBD - true // XTS - ) - // - ) - // - ; - - // - return result; - } - - // - bool XSIHasShortConditions( - X121MarketConditions &mConditions // - ) - { - // - bool result = false; - - // - // Start Analysing Market based On Conditions ... - result = - // - // Base Condition: - // each Strategy must has a Base Conditions, which they are usually common combinations - // of Market Properties that must be happens to lookup for signals ... - ( - // - mConditions.isXRSICrossedUnderShortEntry && - mConditions.rsis[3] > mInputs.rsiInputs.shortEntryValue - // - ) - // - && - // - // Next Step is combine sorts of Conditions which make our choice - // so Exact in Market ... - ( - // - IsReadyForShort( - mConditions, - true, // XCHMA Min - true, // XCHMA Max - true, // XCHMA Cycles - true, // XCHMA Peaks - false, // XCHMA Trend Powers - true, // XOBD - true // XTS - ) - // - ) - // - ; - - // - return result; - } - - // - // XTSFI ... - - // - bool XTSFIHasLongConditions( - X121MarketConditions &mConditions // - ) - { - // - bool result = false; - - // - double tsValues[] = { - mConditions.tsCurrents[1], - mConditions.tsNearests[1], - mConditions.tsMediests[1], - mConditions.tsFarests[1], - }; - - // - double tsMin = GetMin(tsValues); - - // - // Start Analysing Market based On Conditions ... - result = - // - // Base Condition: - // each Strategy must has a Base Conditions, which they are usually common combinations - // of Market Properties that must be happens to lookup for signals ... - ( - // - tsMin == mConditions.tsFarests[1] && - (mConditions.isXTSCurrentOverFarest || - mConditions.isXTSCurrentCrossedOverFarest) && - (mConditions.tsCurrents[1] < mConditions.tsNearests[1] || - mConditions.tsCurrents[1] < mConditions.tsMediests[1]) && - !(mConditions.isXTSCurrentUnderNearest || - mConditions.isXTSCurrentCrossedUnderNearest) - // - ) - // - && - // - // Next Step is combine sorts of Conditions which make our choice - // so Exact in Market ... - ( - // - IsReadyForLong(mConditions) - // - ) - // - ; - - // - return result; - } - - // - bool XTSFIHasShortConditions( - X121MarketConditions &mConditions // - ) - { - // - bool result = false; - - // - double tsValues[] = { - mConditions.tsCurrents[1], - mConditions.tsNearests[1], - mConditions.tsMediests[1], - mConditions.tsFarests[1], - }; - - // - double tsMax = GetMax(tsValues); - - // - // Start Analysing Market based On Conditions ... - result = - // - // Base Condition: - // each Strategy must has a Base Conditions, which they are usually common combinations - // of Market Properties that must be happens to lookup for signals ... - ( - // - tsMax == mConditions.tsFarests[1] && - (mConditions.isXTSCurrentUnderFarest || - mConditions.isXTSCurrentCrossedUnderFarest) && - (mConditions.tsCurrents[1] > mConditions.tsNearests[1] || - mConditions.tsCurrents[1] > mConditions.tsMediests[1]) && - !(mConditions.isXTSCurrentOverNearest || - mConditions.isXTSCurrentCrossedOverNearest) - // - ) - // - && - // - // Next Step is combine sorts of Conditions which make our choice - // so Exact in Market ... - ( - // - IsReadyForShort(mConditions) - // - ) - // - ; - - // - return result; - } - - // - // XOBDLH ... - - // - bool XOBDLHHasLongConditions( - X121MarketConditions &mConditions // - ) - { - // - bool result = false; - - // - X121MarketConditions mConditions2; - GetMarketConditions( - mConditions, - 2 // - ); - - // - // Start Analysing Market based On Conditions ... - result = - // - // Base Condition: - // each Strategy must has a Base Conditions, which they are usually common combinations - // of Market Properties that must be happens to lookup for signals ... - ( - // - mConditions2.isXOBDSwingLow && - mConditions2.isXLHLowAttachedLL && - mConditions.lhLls[1] >= mConditions.lhLls[2] - // - ) - // - && - // - // Next Step is combine sorts of Conditions which make our choice - // so Exact in Market ... - ( - // - IsReadyForLong( - mConditions, - true, // XCHMA Min - true, // XCHMA Max - false, // XCHMA Cycles - false, // XCHMA Peaks - false, // XCHMA Trend Powers - false, // XOBD - false // XTS - ) - // - ) - // - ; - - // - return result; - } - - // - bool XOBDLHHasShortConditions( - X121MarketConditions &mConditions // - ) - { - // - bool result = false; - - // - X121MarketConditions mConditions2; - GetMarketConditions( - mConditions, - 2 // - ); - - // - // Start Analysing Market based On Conditions ... - result = - // - // Base Condition: - // each Strategy must has a Base Conditions, which they are usually common combinations - // of Market Properties that must be happens to lookup for signals ... - ( - // - mConditions2.isXOBDSwingHigh && - mConditions2.isXLHHighAttachedHH && - mConditions.lhHhs[1] <= mConditions.lhHhs[2] - // - ) - // - && - // - // Next Step is combine sorts of Conditions which make our choice - // so Exact in Market ... - ( - // - IsReadyForShort( - mConditions, - true, // XCHMA Min - true, // XCHMA Max - false, // XCHMA Cycles - false, // XCHMA Peaks - false, // XCHMA Trend Powers - false, // XOBD - false // XTS - ) - // - ) - // - ; - - // - return result; - } - - // - // XCHMACC ... - - // - bool XCHMACCHasLongConditions( - X121MarketConditions &mConditions // - ) - { - // - bool result = false; - - // - // Start Analysing Market based On Conditions ... - result = - // - // Base Condition: - // each Strategy must has a Base Conditions, which they are usually common combinations - // of Market Properties that must be happens to lookup for signals ... - ( - // - mConditions.chmaScFasts[1] > mConditions.chmaScSlows[1] && - mConditions.chmaMcFasts[1] > mConditions.chmaMcSlows[1] && - mConditions.chmaLcFasts[1] > mConditions.chmaLcSlows[1] && - // - mConditions.chmaScFasts[2] > mConditions.chmaScSlows[2] && - mConditions.chmaMcFasts[2] > mConditions.chmaMcSlows[2] && - mConditions.chmaLcFasts[2] > mConditions.chmaLcSlows[2] && - // - !( - // - mConditions.chmaScFasts[3] > mConditions.chmaScSlows[3] && - mConditions.chmaMcFasts[3] > mConditions.chmaMcSlows[3] && - mConditions.chmaLcFasts[3] > mConditions.chmaLcSlows[3] - // - ) - // - ) - // - && - // - // Next Step is combine sorts of Conditions which make our choice - // so Exact in Market ... - ( - // - IsReadyForLong(mConditions) - // - ) - // - ; - - // - return result; - } - - // - bool XCHMACCHasShortConditions( - X121MarketConditions &mConditions // - ) - { - // - bool result = false; - - // - // Start Analysing Market based On Conditions ... - result = - // - // Base Condition: - // each Strategy must has a Base Conditions, which they are usually common combinations - // of Market Properties that must be happens to lookup for signals ... - ( - // - mConditions.chmaScFasts[1] < mConditions.chmaScSlows[1] && - mConditions.chmaMcFasts[1] < mConditions.chmaMcSlows[1] && - mConditions.chmaLcFasts[1] < mConditions.chmaLcSlows[1] && - // - mConditions.chmaScFasts[2] < mConditions.chmaScSlows[2] && - mConditions.chmaMcFasts[2] < mConditions.chmaMcSlows[2] && - mConditions.chmaLcFasts[2] < mConditions.chmaLcSlows[2] && - // - !( - // - mConditions.chmaScFasts[3] < mConditions.chmaScSlows[3] && - mConditions.chmaMcFasts[3] < mConditions.chmaMcSlows[3] && - mConditions.chmaLcFasts[3] < mConditions.chmaLcSlows[3] - // - ) - // - ) - // - && - // - // Next Step is combine sorts of Conditions which make our choice - // so Exact in Market ... - ( - // - IsReadyForLong(mConditions) - // - ) - // - ; - - // - return result; - } - - // - // XCHMAMN ... - - // - bool XCHMAMNHasLongConditions( - X121MarketConditions &mConditions // - ) - { - // - bool result = false; - - // - double nonSC2[] = { - mConditions.chmaMcFasts[2], - mConditions.chmaMcSlows[2], - mConditions.chmaLcFasts[2], - mConditions.chmaLcSlows[2], - }; - - // - double nonSCMax2 = GetMax(nonSC2); - double nonSCMin2 = GetMax(nonSC2); - - // - // Start Analysing Market based On Conditions ... - result = - // - // Base Condition: - // each Strategy must has a Base Conditions, which they are usually common combinations - // of Market Properties that must be happens to lookup for signals ... - ( - // - mConditions.isXCHMASCCrossedOverMin && - mConditions.chmaScFasts[2] < nonSCMin2 && - mConditions.chmaScSlows[2] < nonSCMin2 - // - ) - // - && - // - // Next Step is combine sorts of Conditions which make our choice - // so Exact in Market ... - ( - // - IsReadyForLong( - mConditions, - true, // XCHMA Min - true, // XCHMA Max - false, // XCHMA Cycles - false, // XCHMA Peaks - false, // XCHMA Trend Powers - true, // XOBD - true // XTS - ) - // - ) - // - ; - - // - return result; - } - - // - bool XCHMAMNHasShortConditions( - X121MarketConditions &mConditions // - ) - { - // - bool result = false; - - // - double nonSC2[] = { - mConditions.chmaMcFasts[2], - mConditions.chmaMcSlows[2], - mConditions.chmaLcFasts[2], - mConditions.chmaLcSlows[2], - }; - - // - double nonSCMax2 = GetMax(nonSC2); - double nonSCMin2 = GetMax(nonSC2); - - // - // Start Analysing Market based On Conditions ... - result = - // - // Base Condition: - // each Strategy must has a Base Conditions, which they are usually common combinations - // of Market Properties that must be happens to lookup for signals ... - ( - // - mConditions.isXCHMASCCrossedUnderMin && - mConditions.chmaScFasts[2] > nonSCMin2 && - mConditions.chmaScSlows[2] > nonSCMin2 - // - ) - // - && - // - // Next Step is combine sorts of Conditions which make our choice - // so Exact in Market ... - ( - // - IsReadyForLong( - mConditions, - true, // XCHMA Min - true, // XCHMA Max - false, // XCHMA Cycles - false, // XCHMA Peaks - false, // XCHMA Trend Powers - true, // XOBD - true // XTS - ) - // - ) - // - ; - // - return result; - } - - // - // XCHMAMX ... - - // - bool XCHMAMXHasLongConditions( - X121MarketConditions &mConditions // - ) - { - // - bool result = false; - - // - double nonSC2[] = { - mConditions.chmaMcFasts[2], - mConditions.chmaMcSlows[2], - mConditions.chmaLcFasts[2], - mConditions.chmaLcSlows[2], - }; - - // - double nonSCMax2 = GetMax(nonSC2); - double nonSCMin2 = GetMax(nonSC2); - - // - // Start Analysing Market based On Conditions ... - result = - // - // Base Condition: - // each Strategy must has a Base Conditions, which they are usually common combinations - // of Market Properties that must be happens to lookup for signals ... - ( - // - mConditions.isXCHMASCCrossedOverMax && - mConditions.chmaScFasts[2] < nonSCMax2 && - mConditions.chmaScSlows[2] < nonSCMax2 && - MathAbs(nonSCMax2 - mConditions.chmaScFasts[2]) > MathAbs(mConditions.chmaScFasts[2] - mConditions.chmaScSlows[2]) && - MathAbs(nonSCMax2 - mConditions.chmaScSlows[2]) > MathAbs(mConditions.chmaScFasts[2] - mConditions.chmaScSlows[2]) - // - ) - // - && - // - // Next Step is combine sorts of Conditions which make our choice - // so Exact in Market ... - ( - // - IsReadyForLong( - mConditions, - true, // XCHMA Min - true, // XCHMA Max - false, // XCHMA Cycles - false, // XCHMA Peaks - false, // XCHMA Trend Powers - true, // XOBD - true // XTS - ) - // - ) - // - ; - - // - return result; - } - - // - bool XCHMAMXHasShortConditions( - X121MarketConditions &mConditions // - ) - { - // - bool result = false; - - // - double nonSC2[] = { - mConditions.chmaMcFasts[2], - mConditions.chmaMcSlows[2], - mConditions.chmaLcFasts[2], - mConditions.chmaLcSlows[2], - }; - - // - double nonSCMax2 = GetMax(nonSC2); - double nonSCMin2 = GetMax(nonSC2); - - // - // Start Analysing Market based On Conditions ... - result = - // - // Base Condition: - // each Strategy must has a Base Conditions, which they are usually common combinations - // of Market Properties that must be happens to lookup for signals ... - ( - // - mConditions.isXCHMASCCrossedUnderMax && - mConditions.chmaScFasts[2] > nonSCMax2 && - mConditions.chmaScSlows[2] > nonSCMax2 - // - ) - // - && - // - // Next Step is combine sorts of Conditions which make our choice - // so Exact in Market ... - ( - // - IsReadyForShort( - mConditions, - true, // XCHMA Min - true, // XCHMA Max - false, // XCHMA Cycles - false, // XCHMA Peaks - false, // XCHMA Trend Powers - true, // XOBD - true // XTS - ) - // - ) - // - ; - // return result; } @@ -10802,14 +4415,6 @@ void GetAllX121SignalProviders(ENUM_X121_SIGNAL_PROVIDERS &result[]) Add(X110, result); Add(X92, result); Add(X128, result); - Add(XTD, result); - Add(XTAM, result); - Add(XSI, result); - Add(XTSFI, result); - Add(XOBDLH, result); - Add(XCHMACC, result); - Add(XCHMAMN, result); - Add(XCHMAMX, result); } // @@ -10863,38 +4468,6 @@ ENUM_X121_SIGNAL_PROVIDERS ToX121SignalProvider(string content) { result = X128; } - else if (content == ToString(XTD)) - { - result = XTD; - } - else if (content == ToString(XTAM)) - { - result = XTAM; - } - else if (content == ToString(XSI)) - { - result = XSI; - } - else if (content == ToString(XTSFI)) - { - result = XTSFI; - } - else if (content == ToString(XOBDLH)) - { - result = XOBDLH; - } - else if (content == ToString(XCHMACC)) - { - result = XCHMACC; - } - else if (content == ToString(XCHMAMN)) - { - result = XCHMAMN; - } - else if (content == ToString(XCHMAMX)) - { - result = XCHMAMX; - } // return result; diff --git a/Classes/x-saherelm.x121.xmcycle.class.mq5 b/Classes/x-saherelm.x121.xmcycle.class.mq5 index 54cbd946..65549663 100644 --- a/Classes/x-saherelm.x121.xmcycle.class.mq5 +++ b/Classes/x-saherelm.x121.xmcycle.class.mq5 @@ -47,7 +47,7 @@ // // X121 Specified Market Cycle Structure ... -class X121MCycleInputs : public XSCBaseProviderInpts +class X121MCycleInputs : public XSCBase { // // Public ... @@ -401,19 +401,24 @@ public: // // Specific Market Sense Based on Specified Bar Index on Host Period ... -class X121MCycleConditions : public XSCBaseProviderMarketConditions +class X121MCycleConditions : public XSCBase { // // Public ... public: // // Props ... + datetime time; // Time + string symbol; // Symbol + ENUM_TIMEFRAMES period; // Period // - // Common ... - string prefix; // Cycle Prefix ... - ENUM_TIMEFRAMES hostPeriod; // Hosting Time Frame ... - ENUM_X_MARKET_CYCLES cycle; // Init Cycle ... + string prefix; // Cycle Prefix + ENUM_X_MARKET_CYCLES cycle; // Init Cycle + ENUM_TIMEFRAMES hostPeriod; // Hosting Time Frame + + // + XOHCL bars[]; // Number of Bars // // Candlestic Conditions ... diff --git a/Classes/x-saherelm.xea.class.mq5 b/Classes/x-saherelm.xea.class.mq5 index d85c6ece..38136a76 100644 --- a/Classes/x-saherelm.xea.class.mq5 +++ b/Classes/x-saherelm.xea.class.mq5 @@ -22,7 +22,6 @@ // // Imports ... #include -#include "../Classes/x-saherelm.base.class.mq5" #include "../Classes/x-saherelm.xalert.class.mq5" #include "../Classes/x-saherelm.xtrade.class.mq5" @@ -2133,7 +2132,7 @@ private: // // Class Definition ... -class XSCBaseEA : public XSCBase +class XSCBaseEA : public XSCBaseAlert { // // Public ... @@ -2245,18 +2244,6 @@ public: mTrader.AddOnTradeStateChangedEventHandler(mOnTradeStateChangedHandler); } - // - // Instantiate Alert Class ... - mAlert = new XSCAlert( - GetTag(), - enableAlerts, - logAlerts, - terminalAlerts, - mailAlerts, - pushAlerts - // - ); - // // Instantiate XPositionTracker Class ... mPositionTracker = new XSCPositionTracker(); @@ -2276,7 +2263,6 @@ public: { // delete mTrader; - delete mAlert; delete mPositionTracker; } @@ -2426,126 +2412,6 @@ public: return result; } - // - // Alert ... - - // - bool GetLogAlerts() - { - return mAlert.GetLogAlerts(); - } - - // - void SetLogAlerts(bool value) - { - mAlert.SetLogAlerts(value); - } - - // - bool GetEnableAlerts() - { - return mAlert.GetEnableAlerts(); - } - - // - void SetEnableAlerts(bool value) - { - mAlert.SetEnableAlerts(value); - } - - // - bool GetPushAlerts() - { - return mAlert.GetPushAlerts(); - } - - // - void SetPushAlerts(bool value) - { - mAlert.SetPushAlerts(value); - } - - // - bool GetMailAlerts() - { - return mAlert.GetMailAlerts(); - } - - // - void SetMailAlerts(bool value) - { - mAlert.SetMailAlerts(value); - } - - // - bool GetTerminalAlerts() - { - return mAlert.GetTerminalAlerts(); - } - - // - void SetTerminalAlerts(bool value) - { - mAlert.SetTerminalAlerts(value); - } - - // - void SetAlertPrefix(string value) - { - mAlert.SetPrefix(value); - } - - // - // Event Listeners ... - void AddOnSignalEventHandler(TOnSignal listener) - { - // - Add( - listener, - mOnSignalEventHandlers - // - ); - } - - // - // Alert Functions ... - - // - // Logging an Alert ... - void LogAlert(string message) - { - mAlert.LogAlert(message); - } - - // - // Terminal Alert ... - void TerminalAlert(string message) - { - mAlert.TerminalAlert(message); - } - - // - // Mail Alert ... - void MailAlert(string message) - { - mAlert.MailAlert(message); - } - - // - // Send Push Notification ... - void PushAlert(string message) - { - mAlert.PushAlert(message); - } - - // - // Send an Alert by Handling all Different Specified - // type's of Alert's if they are Enabled ... - void Alert(string message) - { - mAlert.Alert(message); - } - // // Overrides ... @@ -2933,7 +2799,6 @@ protected: // // Trade Class Instance ... XSCTrade *mTrader; - XSCAlert *mAlert; XSCPositionTracker *mPositionTracker; // diff --git a/Classes/x-saherelm.xprovider.class.mq5 b/Classes/x-saherelm.xprovider.class.mq5 index 753864d5..46a94374 100644 --- a/Classes/x-saherelm.xprovider.class.mq5 +++ b/Classes/x-saherelm.xprovider.class.mq5 @@ -22,82 +22,15 @@ // // Includes ... -#include "../Classes/x-saherelm.base.class.mq5" +#include "../Classes/x-saherelm.xalert.class.mq5" #include "../Libraries/x-saherelm.xtrade.lib.mq5" -// -// Definitions ... - -// -// Base Provider Inputs ... -class XSCBaseProviderInpts : public XSCBase -{ - // - // Public ... -public: - // - // Validate Input ... - virtual bool IsValid(); - - // - // Cleanup ... - virtual void Clean(); - - // - // Default ... - virtual void Default(); - - // - // Max ... - virtual int Max(); -}; - -// -// Base Market Conditions Class ... -class XSCBaseProviderMarketConditions : public XSCBase -{ - // - // Public ... -public: - // - // Props ... - string symbol; // Symbol - ENUM_TIMEFRAMES period; // Period - datetime time; // Time - - // - XOHCL bars[]; // Number of Bars ... - - // - // Buffers ... - - // - // Conditions ... - - // - // Generate Score ... - virtual void GenerateScore( - double &bullishScore, // Bullish Score - double &bearishScore, // Bearish Score - double multiplier = 1 // Score Multiplier - ); - - // - // Generate Summary ... - virtual string GenerateSummary( - const bool onlySummary = false, // Only Generate Conditions Summary - double multiplier = 1, // Score Multiplier - const string separator = "\n", // Separator - const bool ignoreFalseConditions = true // Ignore False Conditions - ); -}; - // // Class ... // // Base Provider Class ... -class XSCBaseProvider : public XSCBase +class XSCBaseProvider : public XSCBaseAlert { // // Public ... @@ -139,39 +72,10 @@ public: // // Properties Gettr(s) / Setter(s) ... - // - // Inheritance ... - - // - // Init all Requirements ... - virtual bool Init(XSCBaseProviderInpts &inputs); - - // - // Get Inputs ... - virtual void GetInputs(XSCBaseProviderInpts &inputs); - - // - // Set Inputs and Reinitial ... - virtual bool setInputs(XSCBaseProviderInpts &inputs); - // // DeInit all Requirements ... virtual void DeInit(); - // - virtual void GetMarketConditions( - XSCBaseProviderMarketConditions &conditions, // Market Conditions Result - int barIndex = 0 // Specified Bar Index - ); - - // - // Check Market For Signal ... - virtual bool HasSignal( - int barIndex, - XSignal &signal, // Hold's Signal if Exists ... - XSCBaseProviderMarketConditions &conditions // Hold's Market Conditions ... - ); - // // Functions ... diff --git a/Classes/x-saherelm.xtrade.class.mq5 b/Classes/x-saherelm.xtrade.class.mq5 index 4f8ae10b..1554dada 100644 --- a/Classes/x-saherelm.xtrade.class.mq5 +++ b/Classes/x-saherelm.xtrade.class.mq5 @@ -1094,17 +1094,6 @@ public: ); bool isLong = IsLong(mSignal.type); - // - // Select SL and TP ... - - // - double selectedSL = 0; - mSignal.RegularSL(selectedSL); - - // - double selectedTP = 0; - mSignal.RegularTP(selectedTP); - // if (!mSignal.IsValid()) { @@ -1142,8 +1131,8 @@ public: mSignal.period, mSignal.volume, mSignal.entry, - selectedSL, - selectedTP, + mSignal.sl, + mSignal.tp, mSignal.comment // ); @@ -1156,8 +1145,8 @@ public: mSignal.period, mSignal.volume, mSignal.entry, - selectedSL, - selectedTP, + mSignal.sl, + mSignal.tp, mSignal.comment // ); @@ -1194,8 +1183,8 @@ public: mSignal.period, mSignal.volume, mSignal.entry, - selectedSL, - selectedTP, + mSignal.sl, + mSignal.tp, lifetime, expiration, mSignal.comment @@ -1210,8 +1199,8 @@ public: mSignal.period, mSignal.volume, mSignal.entry, - selectedSL, - selectedTP, + mSignal.sl, + mSignal.tp, lifetime, expiration, mSignal.comment @@ -1248,8 +1237,8 @@ public: mSignal.period, mSignal.volume, mSignal.entry, - selectedSL, - selectedTP, + mSignal.sl, + mSignal.tp, lifetime, expiration, mSignal.comment @@ -1264,8 +1253,8 @@ public: mSignal.period, mSignal.volume, mSignal.entry, - selectedSL, - selectedTP, + mSignal.sl, + mSignal.tp, lifetime, expiration, mSignal.comment diff --git a/Documents/Templates/XProvider/x-template.mq5 b/Documents/Templates/XProvider/x-template.mq5 new file mode 100644 index 00000000..26f4afab --- /dev/null +++ b/Documents/Templates/XProvider/x-template.mq5 @@ -0,0 +1,105 @@ + +// +// Definitions ... + +// +// Base Provider Inputs ... +// class XSCBaseProviderInpts : public XSCBase +// { +// // +// // Public ... +// public: +// // +// // Validate Input ... +// virtual bool IsValid(); + +// // +// // Cleanup ... +// virtual void Clean(); + +// // +// // Default ... +// virtual void Default(); + +// // +// // Max ... +// virtual int Max(); +// }; + +// +// Base Market Conditions Class ... +// class XSCBaseProviderMarketConditions : public XSCBase +// { +// // +// // Public ... +// public: +// // +// // Props ... +// string symbol; // Symbol +// ENUM_TIMEFRAMES period; // Period +// datetime time; // Time + +// // +// XOHCL bars[]; // Number of Bars ... + +// // +// // Buffers ... + +// // +// // Conditions ... + +// // +// // Generate Score ... +// virtual void GenerateScore( +// double &bullishScore, // Bullish Score +// double &bearishScore, // Bearish Score +// double multiplier = 1 // Score Multiplier +// ); + +// // +// // Generate Summary ... +// virtual string GenerateSummary( +// const bool onlySummary = false, // Only Generate Conditions Summary +// double multiplier = 1, // Score Multiplier +// const string separator = "\n", // Separator +// const bool ignoreFalseConditions = true // Ignore False Conditions +// ); +// }; + + + + + + +/////////////////////////////////////////////////////////////////////////////// +//// Class Implementation Method ... +/////////////////////////////////////////////////////////////////////////////// + + // + // Inheritance ... + + // + // Init all Requirements ... + // virtual bool Init(XSCBaseProviderInpts &inputs); + + // + // Get Inputs ... + // virtual void GetInputs(XSCBaseProviderInpts &inputs); + + // + // Set Inputs and Reinitial ... + // virtual bool setInputs(XSCBaseProviderInpts &inputs); + + // + // virtual void GetMarketConditions( + // XSCBaseProviderMarketConditions &conditions, // Market Conditions Result + // int barIndex = 0 // Specified Bar Index + // ); + + // + // Check Market For Signal ... + // virtual bool HasSignal( + // int barIndex, + // XSignal &signal, // Hold's Signal if Exists ... + // XSCBaseProviderMarketConditions &conditions // Hold's Market Conditions ... + // ); diff --git a/Experts/x-test.x121ea.mq5 b/Experts/x-test.x121ea.mq5 index 20dbe060..fe7c1631 100644 --- a/Experts/x-test.x121ea.mq5 +++ b/Experts/x-test.x121ea.mq5 @@ -298,14 +298,6 @@ void ConfigureDescriptor( X121ProviderDescriptor &iDescriptor // ) { - // - // XHK ... - iDescriptor.inputs.tmInputs.showLine = false; - - // - // XAMA ... - iDescriptor.inputs.amaInputs.showLine = false; - // // XHK ... iDescriptor.inputs.hkInputs.drawHikenAshi = false; diff --git a/Helpers/x-saherelm.xchlh.helper.mq5 b/Helpers/x-saherelm.xchlh.helper.mq5 deleted file mode 100644 index f67f9022..00000000 --- a/Helpers/x-saherelm.xchlh.helper.mq5 +++ /dev/null @@ -1,967 +0,0 @@ -/////////////////////////////////////////////////////// -// -// SaherElm IT Center MQL5 Helper Class Library -// ---------------------------------------------- -// Name: XSCXCHLHHelper -// Description: provides all Indicator -// Helper requirements ... -// -// -// Maintainer: -// ------------ -// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) -// -////////////////////////////////////////////////////// -// -// Global Properties ... -#property library -#property copyright "Copyright 2023, SaherElm IT Center" -#property link "https://www.saherelm.ir" -#property version "1.00" -#property strict - -// -// Imports ... -#include "../Classes/x-saherelm.xhelper.class.mq5" - -// -// Definitions ... - -// -enum ENUM_XCHLH_BUFFERS -{ - // - // LC ... - XCHLH_LC_HH_LINE = 0, - XCHLH_LC_LL_LINE = 1, - // - // MC ... - XCHLH_MC_HH_LINE = 2, - XCHLH_MC_LL_LINE = 3, - // - // SC ... - XCHLH_SC_HH_LINE = 4, - XCHLH_SC_LL_LINE = 5, - // - // Hot State ... - XCHLH_HOT_STATE_LINE = 6 -}; - -// -// Input Models ... -struct XCHLHInputs -{ - // - // Props ... - - // - // Hot Areas ... - bool drawHotAreas; // Draw Hot Areas Symbol - uchar hotHHArrowCode; // Hot HH Arrow Code - color hotHHArrowColor; // Hot HH Arrow Color - uchar hotLLArrowCode; // Hot LL Arrow Code - color hotLLArrowColor; // Hot LL Arrow Color - - // - // Long Cycle ... - // LC Market ... - int lcLength; // Length - double lcThresholdInPips; // Threshold In Pips - ENUM_SERIESMODE lcHHMode; // Highest High Calculation Method - ENUM_SERIESMODE lcLLMode; // Lowest Low Calculation Method - // - // LC Style ... - int lcDrawWidth; // Draw Width - ENUM_DRAW_TYPE lcDrawType; // Draw Type - ENUM_LINE_STYLE lcDrawStyle; // Draw Style - color lcHHColor; // Highest High Color - color lcLLColor; // Lowest Low Color - // LC Drawings ... - bool lcDrawHH; // Draw Highest High - bool lcDrawLL; // Draw Lowest Low - - // - // Medium Cycle ... - // MC Market ... - int mcLength; // Length - double mcThresholdInPips; // Threshold In Pips - ENUM_SERIESMODE mcHHMode; // Highest High Calculation Method - ENUM_SERIESMODE mcLLMode; // Lowest Low Calculation Method - // MC Style ... - int mcDrawWidth; // Draw Width - ENUM_DRAW_TYPE mcDrawType; // Draw Type - ENUM_LINE_STYLE mcDrawStyle; // Draw Style - color mcHHColor; // Highest High Color - color mcLLColor; // Lowest Low Color - // MC Drawings ... - bool mcDrawHH; // Draw Highest High - bool mcDrawLL; // Draw Lowest Low - - // - // Short Cycle ... - // SC Market ... - int scLength; // Length - double scThresholdInPips; // Threshold In Pips - ENUM_SERIESMODE scHHMode; // Highest High Calculation Method - ENUM_SERIESMODE scLLMode; // Lowest Low Calculation Method - // SC Style ... - int scDrawWidth; // Draw Width - ENUM_DRAW_TYPE scDrawType; // Draw Type - ENUM_LINE_STYLE scDrawStyle; // Draw Style - color scHHColor; // Highest High Color - color scLLColor; // Lowest Low Color - // SC Drawings ... - bool scDrawHH; // Draw Highest High - bool scDrawLL; // Draw Lowest Low - - // - // Constructor(s) ... - XCHLHInputs() - { - // - Clean(); - } - - // - // Tools ... - - // - // Clean ... - void Clean() - { - // - // Hot Areas ... - drawHotAreas = false; - hotHHArrowCode = 234; - hotHHArrowColor = CLR_NONE; - hotLLArrowCode = 233; - hotLLArrowColor = CLR_NONE; - - // - // Long Cycle ... - // LC Market ... - lcLength = 0; - lcThresholdInPips = 0; - lcHHMode = MODE_HIGH; - lcLLMode = MODE_LOW; - // - // LC Style ... - lcDrawWidth = 1; - lcDrawType = DRAW_NONE; - lcDrawStyle = STYLE_DOT; - lcHHColor = CLR_NONE; - lcLLColor = CLR_NONE; - // LC Drawings ... - lcDrawHH = false; - lcDrawLL = false; - - // - // Medium Cycle ... - // MC Market ... - mcLength = 0; - mcThresholdInPips = 0; - mcHHMode = MODE_HIGH; - mcLLMode = MODE_LOW; - // MC Style ... - mcDrawWidth = 1; - mcDrawType = DRAW_NONE; - mcDrawStyle = STYLE_DOT; - mcHHColor = CLR_NONE; - mcLLColor = CLR_NONE; - // MC Drawings ... - mcDrawHH = false; - mcDrawLL = false; - - // - // Short Cycle ... - // SC Market ... - scLength = 0; - scThresholdInPips = 0; - scHHMode = MODE_HIGH; - scLLMode = MODE_LOW; - // SC Style ... - scDrawWidth = 1; - scDrawType = DRAW_NONE; - scDrawStyle = STYLE_DOT; - scHHColor = CLR_NONE; - scLLColor = CLR_NONE; - // SC Drawings ... - scDrawHH = false; - scDrawLL = false; - } - - // - // Default ... - void Default() - { - // - // Hot Areas ... - drawHotAreas = false; - hotHHArrowCode = 234; - hotHHArrowColor = CLR_NONE; - hotLLArrowCode = 233; - hotLLArrowColor = CLR_NONE; - - // - // Long Cycle ... - // LC Market ... - lcLength = 28; - lcThresholdInPips = 0.3; - lcHHMode = MODE_HIGH; - lcLLMode = MODE_LOW; - // - // LC Style ... - lcDrawWidth = 1; - lcDrawType = DRAW_LINE; - lcDrawStyle = STYLE_DOT; - lcHHColor = clrAqua; - lcLLColor = clrFuchsia; - // LC Drawings ... - lcDrawHH = false; - lcDrawLL = false; - - // - // Medium Cycle ... - // MC Market ... - mcLength = 14; - mcThresholdInPips = 0.3; - mcHHMode = MODE_HIGH; - mcLLMode = MODE_LOW; - // MC Style ... - mcDrawWidth = 1; - mcDrawType = DRAW_LINE; - mcDrawStyle = STYLE_DOT; - mcHHColor = clrLime; - mcLLColor = clrRed; - // MC Drawings ... - mcDrawHH = false; - mcDrawLL = false; - - // - // Short Cycle ... - // SC Market ... - scLength = 7; - scThresholdInPips = 0.3; - scHHMode = MODE_HIGH; - scLLMode = MODE_LOW; - // SC Style ... - scDrawWidth = 1; - scDrawType = DRAW_LINE; - scDrawStyle = STYLE_DOT; - scHHColor = clrLightBlue; - scLLColor = clrLightSalmon; - // SC Drawings ... - scDrawHH = false; - scDrawLL = false; - } - - // - // Validate ... - bool IsValid() - { - // - bool result = false; - - // - result = - // - // LC ... - (lcLength >= 4 && - lcLength > mcLength && - lcLength > scLength) - // - && - // - // MC ... - (mcLength >= 4 && - mcLength > scLength && - mcLength < lcLength) - // - && - // - // SC ... - (scLength >= 4 && - scLength < mcLength && - scLength < lcLength) - // - ; - - // - return result; - } - - // - // Retrieve MAx Length ... - int Max() - { - // - int result = 0; - - // - result = MathMax(lcLength, mcLength); - result = MathMax(result, scLength); - - // - return result; - } -}; - -// -// Class ... -class XSCXCHLHHelper : public XSCBaseHelper -{ - // - // Public ... -public: - // - // Props ... - - // - // Constructors ... - XSCXCHLHHelper() : XSCBaseHelper(_Symbol, _Period) - { - } - - // - // Deconstructor ... - ~XSCXCHLHHelper() {} - - // - // Tools ... - bool Init( - string symbol, // Trading Symbol - ENUM_TIMEFRAMES period, // Trading Period - XCHLHInputs &inputs // Inputs - ) - { - // - bool result = false; - - // - mSymbol = symbol; - mPeriod = period; - - // - result = inputs.IsValid(); - if (!result) - { - return result; - } - - // - mInputs = inputs; - - // - ArraySetAsSeries(scHHBuffer, true); - ArraySetAsSeries(scLLBuffer, true); - ArraySetAsSeries(mcHHBuffer, true); - ArraySetAsSeries(mcLLBuffer, true); - ArraySetAsSeries(lcHHBuffer, true); - ArraySetAsSeries(lcLLBuffer, true); - ArraySetAsSeries(hotStateBuffer, true); - - // - mHandler = iCustom( - mSymbol, - mPeriod, - "x-saherelm.xchlh", - // - // Inputs ... - // - // Hot Areas ... - "", - // - mInputs.drawHotAreas, // Draw Hot Areas Symbol - mInputs.hotHHArrowCode, // Hot HH Arrow Code - mInputs.hotHHArrowColor, // Hot HH Arrow Color - mInputs.hotLLArrowCode, // Hot LL Arrow Code - mInputs.hotLLArrowColor, // Hot LL Arrow Color - // - // Long Cycle ... - "", - // LC Market ... - "", - // - mInputs.lcLength, // Length - mInputs.lcThresholdInPips, // Threshold In Pips - mInputs.lcHHMode, // Highest High Calculation Method - mInputs.lcLLMode, // Lowest Low Calculation Method - // - // LC Style ... - "", - // - mInputs.lcDrawWidth, // Draw Width - mInputs.lcDrawType, // Draw Type - mInputs.lcDrawStyle, // Draw Style - mInputs.lcHHColor, // Highest High Color - mInputs.lcLLColor, // Lowest Low Color - // - // LC Drawings ... - "", - mInputs.lcDrawHH, // Draw Highest High - mInputs.lcDrawLL, // Draw Lowest Low - // - // Medium Cycle ... - "", - // MC Market ... - "", - // - mInputs.mcLength, // Length - mInputs.mcThresholdInPips, // Threshold In Pips - mInputs.mcHHMode, // Highest High Calculation Method - mInputs.mcLLMode, // Lowest Low Calculation Method - // - // MC Style ... - "", - // - mInputs.mcDrawWidth, // Draw Width - mInputs.mcDrawType, // Draw Type - mInputs.mcDrawStyle, // Draw Style - mInputs.mcHHColor, // Highest High Color - mInputs.mcLLColor, // Lowest Low Color - // - // MC Drawings ... - "", - mInputs.mcDrawHH, // Draw Highest High - mInputs.mcDrawLL, // Draw Lowest Low - // - // Short Cycle ... - "", - // SC Market ... - "", - // - mInputs.scLength, // Length - mInputs.scThresholdInPips, // Threshold In Pips - mInputs.scHHMode, // Highest High Calculation Method - mInputs.scLLMode, // Lowest Low Calculation Method - // - // SC Style ... - "", - // - mInputs.scDrawWidth, // Draw Width - mInputs.scDrawType, // Draw Type - mInputs.scDrawStyle, // Draw Style - mInputs.scHHColor, // Highest High Color - mInputs.scLLColor, // Lowest Low Color - // - // SC Drawings ... - "", - mInputs.scDrawHH, // Draw Highest High - mInputs.scDrawLL // Draw Lowest Low - // - ); - result = mHandler != INVALID_HANDLE; - if (!result) - { - return result; - } - - // - return result; - } - - // - // Inputs ... - - // - XCHLHInputs GetInputs() - { - return mInputs; - } - - // - bool SetInputs( - XCHLHInputs &inputs // Configs - ) - { - // - return Init( - mSymbol, - mPeriod, - inputs - // - ); - } - - // - // Buffers ... - - // - // Short ... - - // - double GetSCHH( - int barIndex // Bar Index - ) - { - // - if (barIndex < 0) - { - barIndex = 0; - } - - // - Calculate(); - - // - int count = ArraySize(scHHBuffer); - if (barIndex >= count) - { - barIndex = count - 1; - } - - // - return scHHBuffer[barIndex]; - } - - // - // Copy Required Items ... - int CopySCHH( - int start, // Start - int count, // Number of Items for read - double &buffer[], // Dest Buffer - bool forceClean = true // Force To Clean buffer - ) - { - // - // Update Calculations ... - Calculate(); - - // - // Copy Items ... - return Copy( - start, - count, - scHHBuffer, - buffer, - forceClean - // - ); - } - - // - double GetSCLL( - int barIndex // Bar Index - ) - { - // - if (barIndex < 0) - { - barIndex = 0; - } - - // - Calculate(); - - // - int count = ArraySize(scLLBuffer); - if (barIndex >= count) - { - barIndex = count - 1; - } - - // - return scLLBuffer[barIndex]; - } - - // - // Copy Required Items ... - int CopySCLL( - int start, // Start - int count, // Number of Items for read - double &buffer[], // Dest Buffer - bool forceClean = true // Force To Clean buffer - ) - { - // - // Update Calculations ... - Calculate(); - - // - // Copy Items ... - return Copy( - start, - count, - scLLBuffer, - buffer, - forceClean - // - ); - } - - // - // Medium ... - - // - double GetMCHH( - int barIndex // Bar Index - ) - { - // - if (barIndex < 0) - { - barIndex = 0; - } - - // - Calculate(); - - // - int count = ArraySize(mcHHBuffer); - if (barIndex >= count) - { - barIndex = count - 1; - } - - // - return mcHHBuffer[barIndex]; - } - - // - // Copy Required Items ... - int CopyMCHH( - int start, // Start - int count, // Number of Items for read - double &buffer[], // Dest Buffer - bool forceClean = true // Force To Clean buffer - ) - { - // - // Update Calculations ... - Calculate(); - - // - // Copy Items ... - return Copy( - start, - count, - mcHHBuffer, - buffer, - forceClean - // - ); - } - - // - double GetMCLL( - int barIndex // Bar Index - ) - { - // - if (barIndex < 0) - { - barIndex = 0; - } - - // - Calculate(); - - // - int count = ArraySize(mcLLBuffer); - if (barIndex >= count) - { - barIndex = count - 1; - } - - // - return mcLLBuffer[barIndex]; - } - - // - // Copy Required Items ... - int CopyMCLL( - int start, // Start - int count, // Number of Items for read - double &buffer[], // Dest Buffer - bool forceClean = true // Force To Clean buffer - ) - { - // - // Update Calculations ... - Calculate(); - - // - // Copy Items ... - return Copy( - start, - count, - mcLLBuffer, - buffer, - forceClean - // - ); - } - - // - // Long ... - - // - double GetLCHH( - int barIndex // Bar Index - ) - { - // - if (barIndex < 0) - { - barIndex = 0; - } - - // - Calculate(); - - // - int count = ArraySize(lcHHBuffer); - if (barIndex >= count) - { - barIndex = count - 1; - } - - // - return lcHHBuffer[barIndex]; - } - - // - // Copy Required Items ... - int CopyLCHH( - int start, // Start - int count, // Number of Items for read - double &buffer[], // Dest Buffer - bool forceClean = true // Force To Clean buffer - ) - { - // - // Update Calculations ... - Calculate(); - - // - // Copy Items ... - return Copy( - start, - count, - lcHHBuffer, - buffer, - forceClean - // - ); - } - - // - double GetLCLL( - int barIndex // Bar Index - ) - { - // - if (barIndex < 0) - { - barIndex = 0; - } - - // - Calculate(); - - // - int count = ArraySize(lcLLBuffer); - if (barIndex >= count) - { - barIndex = count - 1; - } - - // - return lcLLBuffer[barIndex]; - } - - // - // Copy Required Items ... - int CopyLCLL( - int start, // Start - int count, // Number of Items for read - double &buffer[], // Dest Buffer - bool forceClean = true // Force To Clean buffer - ) - { - // - // Update Calculations ... - Calculate(); - - // - // Copy Items ... - return Copy( - start, - count, - lcLLBuffer, - buffer, - forceClean - // - ); - } - - // - double GetHotState( - int barIndex // Bar Index - ) - { - // - if (barIndex < 0) - { - barIndex = 0; - } - - // - Calculate(); - - // - int count = ArraySize(hotStateBuffer); - if (barIndex >= count) - { - barIndex = count - 1; - } - - // - return hotStateBuffer[barIndex]; - } - - // - // Copy Required Items ... - int CopyHotState( - int start, // Start - int count, // Number of Items for read - double &buffer[], // Dest Buffer - bool forceClean = true // Force To Clean buffer - ) - { - // - // Update Calculations ... - Calculate(); - - // - // Copy Items ... - return Copy( - start, - count, - hotStateBuffer, - buffer, - forceClean - // - ); - } - - // - // Protected ... -protected: - // - // Private ... -private: - // - // Props ... - XCHLHInputs mInputs; // Inputs ... - - // - // Buffers ... - double scHHBuffer[]; - double scLLBuffer[]; - double mcHHBuffer[]; - double mcLLBuffer[]; - double lcHHBuffer[]; - double lcLLBuffer[]; - double hotStateBuffer[]; - - // - // Tools ... - - // - // Calculate Values Until Now ... - void Calculate() - { - // - int totalBars = CountBars(); - - // - // Short Cycle ... - - // - // HH ... - CopyBuffer( - mHandler, - XCHLH_SC_HH_LINE, - 0, - totalBars, - scHHBuffer - // - ); - - // - // LL ... - CopyBuffer( - mHandler, - XCHLH_SC_LL_LINE, - 0, - totalBars, - scLLBuffer - // - ); - - // - // Medium Cycle ... - - // - // HH ... - CopyBuffer( - mHandler, - XCHLH_MC_HH_LINE, - 0, - totalBars, - mcHHBuffer - // - ); - - // - // LL ... - CopyBuffer( - mHandler, - XCHLH_MC_LL_LINE, - 0, - totalBars, - mcLLBuffer - // - ); - - // - // Long Cycle ... - - // - // HH ... - CopyBuffer( - mHandler, - XCHLH_LC_HH_LINE, - 0, - totalBars, - lcHHBuffer - // - ); - - // - // LL ... - CopyBuffer( - mHandler, - XCHLH_LC_LL_LINE, - 0, - totalBars, - lcLLBuffer - // - ); - - // - // Hot State ... - CopyBuffer( - mHandler, - XCHLH_HOT_STATE_LINE, - 0, - totalBars, - hotStateBuffer - // - ); - } -}; - -// -// Tools ... \ No newline at end of file diff --git a/Helpers/x-saherelm.xchma.helper.mq5 b/Helpers/x-saherelm.xchma.helper.mq5 deleted file mode 100644 index b18120a5..00000000 --- a/Helpers/x-saherelm.xchma.helper.mq5 +++ /dev/null @@ -1,960 +0,0 @@ -/////////////////////////////////////////////////////// -// -// SaherElm IT Center MQL5 Helper Class Library -// ---------------------------------------------- -// Name: XSCXCHMAHelper -// Description: provides all Indicator -// Helper requirements ... -// -// -// Maintainer: -// ------------ -// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) -// -////////////////////////////////////////////////////// -// -// Global Properties ... -#property library -#property copyright "Copyright 2023, SaherElm IT Center" -#property link "https://www.saherelm.ir" -#property version "1.00" -#property strict - -// -// Imports ... -#include "../Classes/x-saherelm.xhelper.class.mq5" - -// -// Definitions ... - -// -enum ENUM_XCHMA_BUFFERS -{ - // - // LC ... - XCHMA_LC_FAST_LINE = 0, - XCHMA_LC_SLOW_LINE = 1, - // - // MC ... - XCHMA_MC_FAST_LINE = 2, - XCHMA_MC_SLOW_LINE = 3, - // - // SC ... - XCHMA_SC_FAST_LINE = 4, - XCHMA_SC_SLOW_LINE = 5, - // - XCHMA_HOT_STATE_LINE = 6, -}; - -// -// Input Models ... -struct XCHMAInputs -{ - // - // Props ... - // - // Hot Areas ... - bool drawHotAreas; // Draw Hot Areas Symbol - uchar hotBullishArrowCode; // Hot Bullish Arrow Code - color hotBullishArrowColor; // Hot Bullish Arrow Color - uchar hotBearishArrowCode; // Hot Bearish Arrow Code - color hotBearishArrowColor; // Hot Bearish Arrow Color - - // - // Long Cycle ... - // LC Market ... - int lcFastLength; // Fast Length - int lcSlowLength; // Slow Length - ENUM_MA_METHOD lcMethod; // Calculation Method - ENUM_APPLIED_PRICE lcAppliedTo; // Applied To - // LC Style ... - int lcDrawWidth; // Draw Width - ENUM_DRAW_TYPE lcDrawType; // Draw Type - ENUM_LINE_STYLE lcDrawStyle; // Draw Style - color lcFastColor; // Fast Color - color lcSlowColor; // Slow Color - // LC Drawings ... - bool lcDrawFast; // Draw Fast - bool lcDrawSlow; // Draw Slow - bool lcDrawCrosses; // Draw Cross Lines - - // - // Medium Cycle ... - // MC Market ... - int mcFastLength; // Fast Length - int mcSlowLength; // Slow Length - ENUM_MA_METHOD mcMethod; // Calculation Method - ENUM_APPLIED_PRICE mcAppliedTo; // Applied To - // MC Style ... - int mcDrawWidth; // Draw Width - ENUM_DRAW_TYPE mcDrawType; // Draw Type - ENUM_LINE_STYLE mcDrawStyle; // Draw Style - color mcFastColor; // Fast Color - color mcSlowColor; // Slow Color - // MC Drawings ... - bool mcDrawFast; // Draw Fast - bool mcDrawSlow; // Draw Slow - bool mcDrawCrosses; // Draw Cross Lines - - // - // Short Cycle ... - // SC Market ... - int scFastLength; // Fast Length - int scSlowLength; // Slow Length - ENUM_MA_METHOD scMethod; // Calculation Method - ENUM_APPLIED_PRICE scAppliedTo; // Applied To - // SC Style ... - int scDrawWidth; // Draw Width - ENUM_DRAW_TYPE scDrawType; // Draw Type - ENUM_LINE_STYLE scDrawStyle; // Draw Style - color scFastColor; // Fast Color - color scSlowColor; // Slow Color - // SC Drawings ... - bool scDrawFast; // Draw Fast - bool scDrawSlow; // Draw Slow - bool scDrawCrosses; // Draw Cross Lines - - // - // Constructor(s) ... - XCHMAInputs() - { - // - Clean(); - } - - // - // Tools ... - - // - // Clean ... - void Clean() - { - // - // Hot Areas ... - drawHotAreas = false; - hotBullishArrowCode = 228; - hotBullishArrowColor = CLR_NONE; - hotBearishArrowCode = 230; - hotBearishArrowColor = CLR_NONE; - - // - // Long Cycle ... - // LC Market ... - lcFastLength = 20; - lcSlowLength = 50; - lcMethod = MODE_EMA; - lcAppliedTo = PRICE_CLOSE; - // LC Style ... - lcDrawWidth = 1; - lcDrawType = DRAW_NONE; - lcDrawStyle = STYLE_DOT; - lcFastColor = CLR_NONE; - lcSlowColor = CLR_NONE; - // LC Drawings ... - lcDrawFast = false; - lcDrawSlow = false; - lcDrawCrosses = false; - - // - // Medium Cycle ... - // MC Market ... - mcFastLength = 10; - mcSlowLength = 30; - mcMethod = MODE_EMA; - mcAppliedTo = PRICE_CLOSE; - // MC Style ... - mcDrawWidth = 1; - mcDrawType = DRAW_NONE; - mcDrawStyle = STYLE_DOT; - mcFastColor = CLR_NONE; - mcSlowColor = CLR_NONE; - // MC Drawings ... - mcDrawFast = false; - mcDrawSlow = false; - mcDrawCrosses = false; - - // - // Short Cycle ... - // SC Market ... - scFastLength = 7; - scSlowLength = 14; - scMethod = MODE_EMA; - scAppliedTo = PRICE_CLOSE; - // SC Style ... - scDrawWidth = 1; - scDrawType = DRAW_NONE; - scDrawStyle = STYLE_SOLID; - scFastColor = CLR_NONE; - scSlowColor = CLR_NONE; - // SC Drawings ... - scDrawFast = false; - scDrawSlow = false; - scDrawCrosses = false; - } - - // - // Default ... - void Default() - { - // - // Hot Areas ... - drawHotAreas = false; - hotBullishArrowCode = 228; - hotBullishArrowColor = CLR_NONE; - hotBearishArrowCode = 230; - hotBearishArrowColor = CLR_NONE; - - // - // Long Cycle ... - // LC Market ... - lcFastLength = 20; - lcSlowLength = 50; - lcMethod = MODE_EMA; - lcAppliedTo = PRICE_CLOSE; - // LC Style ... - lcDrawWidth = 1; - lcDrawType = DRAW_LINE; - lcDrawStyle = STYLE_DOT; - lcFastColor = clrAqua; - lcSlowColor = clrFuchsia; - // LC Drawings ... - lcDrawFast = false; - lcDrawSlow = false; - lcDrawCrosses = false; - - // - // Medium Cycle ... - // MC Market ... - mcFastLength = 10; - mcSlowLength = 30; - mcMethod = MODE_EMA; - mcAppliedTo = PRICE_CLOSE; - // MC Style ... - mcDrawWidth = 1; - mcDrawType = DRAW_LINE; - mcDrawStyle = STYLE_DOT; - mcFastColor = clrLime; - mcSlowColor = clrRed; - // MC Drawings ... - mcDrawFast = false; - mcDrawSlow = false; - mcDrawCrosses = false; - - // - // Short Cycle ... - // SC Market ... - scFastLength = 7; - scSlowLength = 14; - scMethod = MODE_EMA; - scAppliedTo = PRICE_CLOSE; - // SC Style ... - scDrawWidth = 1; - scDrawType = DRAW_LINE; - scDrawStyle = STYLE_SOLID; - scFastColor = clrLightBlue; - scSlowColor = clrLightSalmon; - // SC Drawings ... - scDrawFast = false; - scDrawSlow = false; - scDrawCrosses = false; - } - - // - // Validate ... - bool IsValid() - { - // - bool result = false; - - // - result = - // - (lcFastLength >= 4 && lcSlowLength > lcFastLength) && - (mcFastLength >= 4 && mcSlowLength > mcFastLength) && - (scFastLength >= 4 && scSlowLength > scFastLength) && - (lcFastLength > mcFastLength && - mcFastLength > scFastLength) - // - ; - - // - return result; - } - - // - // Retrieve MAx Length ... - int Max() - { - // - int result = 0; - - // - result = MathMax(scFastLength, scSlowLength); - result = MathMax(result, lcFastLength); - result = MathMax(result, lcSlowLength); - result = MathMax(result, mcFastLength); - result = MathMax(result, mcSlowLength); - - // - return result; - } -}; - -// -// Class ... -class XSCXCHMAHelper : public XSCBaseHelper -{ - // - // Public ... -public: - // - // Props ... - - // - // Constructors ... - XSCXCHMAHelper() : XSCBaseHelper(_Symbol, _Period) - { - } - - // - // Deconstructor ... - ~XSCXCHMAHelper() {} - - // - // Tools ... - bool Init( - string symbol, // Trading Symbol - ENUM_TIMEFRAMES period, // Trading Period - XCHMAInputs &inputs // Inputs - ) - { - // - bool result = false; - - // - mSymbol = symbol; - mPeriod = period; - - // - result = inputs.IsValid(); - if (!result) - { - return result; - } - - // - mInputs = inputs; - - // - ArraySetAsSeries(scFastBuffer, true); - ArraySetAsSeries(scSlowBuffer, true); - ArraySetAsSeries(mcFastBuffer, true); - ArraySetAsSeries(mcSlowBuffer, true); - ArraySetAsSeries(lcFastBuffer, true); - ArraySetAsSeries(lcSlowBuffer, true); - ArraySetAsSeries(hotStateBuffer, true); - - // - mHandler = iCustom( - mSymbol, - mPeriod, - "x-saherelm.xchma", - // - // Inputs ... - // - // Hot Areas ... - "", - mInputs.drawHotAreas, // Draw Hot Areas Symbol - mInputs.hotBullishArrowCode, // Hot Bullish Arrow Code - mInputs.hotBullishArrowColor, // Hot Bullish Arrow Color - mInputs.hotBearishArrowCode, // Hot Bearish Arrow Code - mInputs.hotBearishArrowColor, // Hot Bearish Arrow Color - // - // Long Cycle ... - "", - // - // LC Market ... - "", - mInputs.lcFastLength, // Fast Length - mInputs.lcSlowLength, // Slow Length - mInputs.lcMethod, // Calculation Method - mInputs.lcAppliedTo, // Applied To - // - // LC Style ... - "", - mInputs.lcDrawWidth, // Draw Width - mInputs.lcDrawType, // Draw Type - mInputs.lcDrawStyle, // Draw Style - mInputs.lcFastColor, // Fast Color - mInputs.lcSlowColor, // Slow Color - // - // LC Drawings ... - "", - mInputs.lcDrawFast, // Draw Fast - mInputs.lcDrawSlow, // Draw Slow - mInputs.lcDrawCrosses, // Draw Cross Lines - // - // Medium Cycle ... - "", - // - // MC Market ... - "", - mInputs.mcFastLength, // Fast Length - mInputs.mcSlowLength, // Slow Length - mInputs.mcMethod, // Calculation Method - mInputs.mcAppliedTo, // Applied To - // - // MC Style ... - "", - mInputs.mcDrawWidth, // Draw Width - mInputs.mcDrawType, // Draw Type - mInputs.mcDrawStyle, // Draw Style - mInputs.mcFastColor, // Fast Color - mInputs.mcSlowColor, // Slow Color - // - // MC Drawings ... - "", - mInputs.mcDrawFast, // Draw Fast - mInputs.mcDrawSlow, // Draw Slow - mInputs.mcDrawCrosses, // Draw Cross Lines - // - // Short Cycle ... - "", - // - // SC Market ... - "", - mInputs.scFastLength, // Fast Length - mInputs.scSlowLength, // Slow Length - mInputs.scMethod, // Calculation Method - mInputs.scAppliedTo, // Applied To - // - // SC Style ... - "", - mInputs.scDrawWidth, // Draw Width - mInputs.scDrawType, // Draw Type - mInputs.scDrawStyle, // Draw Style - mInputs.scFastColor, // Fast Color - mInputs.scSlowColor, // Slow Color - // - // SC Drawings ... - "", - mInputs.scDrawFast, // Draw Fast - mInputs.scDrawSlow, // Draw Slow - mInputs.scDrawCrosses // Draw Cross Lines - // - ); - result = mHandler != INVALID_HANDLE; - if (!result) - { - return result; - } - - // - return result; - } - - // - // Inputs ... - - // - XCHMAInputs GetInputs() - { - return mInputs; - } - - // - bool SetInputs( - XCHMAInputs &inputs // Configs - ) - { - // - return Init( - mSymbol, - mPeriod, - inputs - // - ); - } - - // - // Buffers ... - - // - // Short ... - - // - double GetSCFast( - int barIndex // Bar Index - ) - { - // - if (barIndex < 0) - { - barIndex = 0; - } - - // - Calculate(); - - // - int count = ArraySize(scFastBuffer); - if (barIndex >= count) - { - barIndex = count - 1; - } - - // - return scFastBuffer[barIndex]; - } - - // - // Copy Required Items ... - int CopySCFast( - int start, // Start - int count, // Number of Items for read - double &buffer[], // Dest Buffer - bool forceClean = true // Force To Clean buffer - ) - { - // - // Update Calculations ... - Calculate(); - - // - // Copy Items ... - return Copy( - start, - count, - scFastBuffer, - buffer, - forceClean - // - ); - } - - // - double GetSCSlow( - int barIndex // Bar Index - ) - { - // - if (barIndex < 0) - { - barIndex = 0; - } - - // - Calculate(); - - // - int count = ArraySize(scSlowBuffer); - if (barIndex >= count) - { - barIndex = count - 1; - } - - // - return scSlowBuffer[barIndex]; - } - - // - // Copy Required Items ... - int CopySCSlow( - int start, // Start - int count, // Number of Items for read - double &buffer[], // Dest Buffer - bool forceClean = true // Force To Clean buffer - ) - { - // - // Update Calculations ... - Calculate(); - - // - // Copy Items ... - return Copy( - start, - count, - scSlowBuffer, - buffer, - forceClean - // - ); - } - - // - // Medium ... - - // - double GetMCFast( - int barIndex // Bar Index - ) - { - // - if (barIndex < 0) - { - barIndex = 0; - } - - // - Calculate(); - - // - int count = ArraySize(mcFastBuffer); - if (barIndex >= count) - { - barIndex = count - 1; - } - - // - return mcFastBuffer[barIndex]; - } - - // - // Copy Required Items ... - int CopyMCFast( - int start, // Start - int count, // Number of Items for read - double &buffer[], // Dest Buffer - bool forceClean = true // Force To Clean buffer - ) - { - // - // Update Calculations ... - Calculate(); - - // - // Copy Items ... - return Copy( - start, - count, - mcFastBuffer, - buffer, - forceClean - // - ); - } - - // - double GetMCSlow( - int barIndex // Bar Index - ) - { - // - if (barIndex < 0) - { - barIndex = 0; - } - - // - Calculate(); - - // - int count = ArraySize(mcSlowBuffer); - if (barIndex >= count) - { - barIndex = count - 1; - } - - // - return mcSlowBuffer[barIndex]; - } - - // - // Copy Required Items ... - int CopyMCSlow( - int start, // Start - int count, // Number of Items for read - double &buffer[], // Dest Buffer - bool forceClean = true // Force To Clean buffer - ) - { - // - // Update Calculations ... - Calculate(); - - // - // Copy Items ... - return Copy( - start, - count, - mcSlowBuffer, - buffer, - forceClean - // - ); - } - - // - // Long ... - - // - double GetLCFast( - int barIndex // Bar Index - ) - { - // - if (barIndex < 0) - { - barIndex = 0; - } - - // - Calculate(); - - // - int count = ArraySize(lcFastBuffer); - if (barIndex >= count) - { - barIndex = count - 1; - } - - // - return lcFastBuffer[barIndex]; - } - - // - // Copy Required Items ... - int CopyLCFast( - int start, // Start - int count, // Number of Items for read - double &buffer[], // Dest Buffer - bool forceClean = true // Force To Clean buffer - ) - { - // - // Update Calculations ... - Calculate(); - - // - // Copy Items ... - return Copy( - start, - count, - lcFastBuffer, - buffer, - forceClean - // - ); - } - - // - double GetLCSlow( - int barIndex // Bar Index - ) - { - // - if (barIndex < 0) - { - barIndex = 0; - } - - // - Calculate(); - - // - int count = ArraySize(lcSlowBuffer); - if (barIndex >= count) - { - barIndex = count - 1; - } - - // - return lcSlowBuffer[barIndex]; - } - - // - // Copy Required Items ... - int CopyLCSlow( - int start, // Start - int count, // Number of Items for read - double &buffer[], // Dest Buffer - bool forceClean = true // Force To Clean buffer - ) - { - // - // Update Calculations ... - Calculate(); - - // - // Copy Items ... - return Copy( - start, - count, - lcSlowBuffer, - buffer, - forceClean - // - ); - } - - // - double GetHotState( - int barIndex // Bar Index - ) - { - // - if (barIndex < 0) - { - barIndex = 0; - } - - // - Calculate(); - - // - int count = ArraySize(hotStateBuffer); - if (barIndex >= count) - { - barIndex = count - 1; - } - - // - return hotStateBuffer[barIndex]; - } - - // - // Copy Required Items ... - int CopyHotState( - int start, // Start - int count, // Number of Items for read - double &buffer[], // Dest Buffer - bool forceClean = true // Force To Clean buffer - ) - { - // - // Update Calculations ... - Calculate(); - - // - // Copy Items ... - return Copy( - start, - count, - hotStateBuffer, - buffer, - forceClean - // - ); - } - - // - // Protected ... -protected: - // - // Private ... -private: - // - // Props ... - XCHMAInputs mInputs; // Inputs ... - - // - // Buffers ... - double scFastBuffer[]; - double scSlowBuffer[]; - double mcFastBuffer[]; - double mcSlowBuffer[]; - double lcFastBuffer[]; - double lcSlowBuffer[]; - double hotStateBuffer[]; - - // - // Tools ... - - // - // Calculate Values Until Now ... - void Calculate() - { - // - int totalBars = CountBars(); - - // - // Short Cycle ... - - // - // Fast ... - CopyBuffer( - mHandler, - XCHMA_SC_FAST_LINE, - 0, - totalBars, - scFastBuffer - // - ); - - // - // Slow ... - CopyBuffer( - mHandler, - XCHMA_SC_SLOW_LINE, - 0, - totalBars, - scSlowBuffer - // - ); - - // - // Medium Cycle ... - - // - // Fast ... - CopyBuffer( - mHandler, - XCHMA_MC_FAST_LINE, - 0, - totalBars, - mcFastBuffer - // - ); - - // - // Slow ... - CopyBuffer( - mHandler, - XCHMA_MC_SLOW_LINE, - 0, - totalBars, - mcSlowBuffer - // - ); - - // - // Long Cycle ... - - // - // Fast ... - CopyBuffer( - mHandler, - XCHMA_LC_FAST_LINE, - 0, - totalBars, - lcFastBuffer - // - ); - - // - // Slow ... - CopyBuffer( - mHandler, - XCHMA_LC_SLOW_LINE, - 0, - totalBars, - lcSlowBuffer - // - ); - - // - // Hot State ... - CopyBuffer( - mHandler, - XCHMA_HOT_STATE_LINE, - 0, - totalBars, - hotStateBuffer - // - ); - } -}; - -// -// Tools ... \ No newline at end of file diff --git a/Helpers/x-saherelm.xfi.helper.mq5 b/Helpers/x-saherelm.xfi.helper.mq5 deleted file mode 100644 index c636da6d..00000000 --- a/Helpers/x-saherelm.xfi.helper.mq5 +++ /dev/null @@ -1,292 +0,0 @@ -/////////////////////////////////////////////////////// -// -// SaherElm IT Center MQL5 Helper Class Library -// ---------------------------------------------- -// Name: XSCXFIHelper -// Description: provides all Indicator -// Helper requirements ... -// -// -// Maintainer: -// ------------ -// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) -// -////////////////////////////////////////////////////// -// -// Global Properties ... -#property library -#property copyright "Copyright 2023, SaherElm IT Center" -#property link "https://www.saherelm.ir" -#property version "1.00" -#property strict - -// -// Imports ... -#include "../Classes/x-saherelm.xhelper.class.mq5" - -// -// Definitions ... - -// -enum ENUM_XFI_BUFFERS -{ - XFI_MAIN_LINE = 0 -}; - -// -// Input Models ... -struct XFIInputs -{ - // - // Props ... - int length; // Length - ENUM_MA_METHOD method; // MA Method - ENUM_APPLIED_VOLUME appliedTo; // Applied To - - // - // Constructor(s) ... - XFIInputs() - { - // - Clean(); - } - - // - // Tools ... - - // - // Clean ... - void Clean() - { - // - length = 0; - method = MODE_SMA; - appliedTo = VOLUME_TICK; - } - - // - // Default ... - void Default() - { - // - length = 18; - method = MODE_SMA; - appliedTo = VOLUME_TICK; - } - - // - // Validate ... - bool IsValid() - { - // - bool result = false; - - // - result = - // - length >= 2 - // - ; - - // - return result; - } - - // - // Retrieve MAx Length ... - int Max() - { - // - int result = 0; - - // - result = MathMax(result, length); - - // - return result; - } -}; - -// -// Class ... -class XSCXFIHelper : public XSCBaseHelper -{ - // - // Public ... -public: - // - // Props ... - - // - // Constructors ... - XSCXFIHelper() : XSCBaseHelper(_Symbol, _Period) - { - } - - // - // Deconstructor ... - ~XSCXFIHelper() {} - - // - // Tools ... - bool Init( - string symbol, // Trading Symbol - ENUM_TIMEFRAMES period, // Trading Period - XFIInputs &inputs // Inputs - ) - { - // - bool result = false; - - // - mSymbol = symbol; - mPeriod = period; - - // - result = inputs.IsValid(); - if (!result) - { - return result; - } - - // - mInputs = inputs; - - // - ArraySetAsSeries(mainBuffer, true); - mHandler = iCustom( - mSymbol, - mPeriod, - "x-saherelm.xfi", - // - // Inputs ... - mInputs.length, // Length - mInputs.method, // MA Method - mInputs.appliedTo // Applied To - // - ); - result = mHandler != INVALID_HANDLE; - if (!result) - { - return result; - } - - // - return result; - } - - // - // Inputs ... - - // - XFIInputs GetInputs() - { - return mInputs; - } - - // - bool SetInputs( - XFIInputs &inputs // Configs - ) - { - // - return Init( - mSymbol, - mPeriod, - inputs - // - ); - } - - // - // Buffers ... - - // - double GetMain( - int barIndex // Bar Index - ) - { - // - if (barIndex < 0) - { - barIndex = 0; - } - - // - Calculate(); - - // - int count = ArraySize(mainBuffer); - if (barIndex >= count) - { - barIndex = count - 1; - } - - // - return mainBuffer[barIndex]; - } - - // - // Copy Required Items ... - int CopyMain( - int start, // Start - int count, // Number of Items for read - double &buffer[], // Dest Buffer - bool forceClean = true // Force To Clean buffer - ) - { - // - // Update Calculations ... - Calculate(); - - // - // Copy Items ... - return Copy( - start, - count, - mainBuffer, - buffer, - forceClean - // - ); - } - - // - // Protected ... -protected: - // - // Private ... -private: - // - // Props ... - XFIInputs mInputs; // Inputs ... - - // - // Buffers ... - double mainBuffer[]; - - // - // Tools ... - - // - // Calculate Values Until Now ... - void Calculate() - { - // - int totalBars = CountBars(); - - // - // Short Exit 2 ... - CopyBuffer( - mHandler, - XFI_MAIN_LINE, - 0, - totalBars, - mainBuffer - // - ); - } -}; - -// -// Tools ... \ No newline at end of file diff --git a/Helpers/x-saherelm.xlh.helper.mq5 b/Helpers/x-saherelm.xlh.helper.mq5 deleted file mode 100644 index 400407a3..00000000 --- a/Helpers/x-saherelm.xlh.helper.mq5 +++ /dev/null @@ -1,422 +0,0 @@ -/////////////////////////////////////////////////////// -// -// SaherElm IT Center MQL5 Helper Class Library -// ---------------------------------------------- -// Name: XSCXLHHelper -// Description: provides all Indicator -// Helper requirements ... -// -// -// Maintainer: -// ------------ -// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) -// -////////////////////////////////////////////////////// -// -// Global Properties ... -#property library -#property copyright "Copyright 2023, SaherElm IT Center" -#property link "https://www.saherelm.ir" -#property version "1.00" -#property strict - -// -// Imports ... -#include "../Classes/x-saherelm.xhelper.class.mq5" - -// -// Definitions ... - -// -enum ENUM_XLH_BUFFERS -{ - XLH_HH_LINE = 0, - XLH_LL_LINE = 1, - XLH_SIGNAL_LINE = 2, -}; - -// -// Input Models ... -struct XLHInputs -{ - // - // Props ... - int length; // Length - ENUM_SERIESMODE hhMode; // Highest High Calculation Method - ENUM_SERIESMODE llMode; // Lowest Low Calculation Method - - // - // Constructor(s) ... - XLHInputs() - { - // - Clean(); - } - - // - // Tools ... - - // - // Clean ... - void Clean() - { - // - length = 0; - hhMode = MODE_HIGH; - llMode = MODE_LOW; - } - - // - // Default ... - void Default() - { - // - length = 14; - hhMode = MODE_HIGH; - llMode = MODE_LOW; - } - - // - // Validate ... - bool IsValid() - { - // - bool result = false; - - // - result = - // - length >= 2 - // - ; - - // - return result; - } - - // - // Retrieve MAx Length ... - int Max() - { - // - int result = 0; - - // - result = MathMax(result, length); - - // - return result; - } -}; - -// -// Class ... -class XSCXLHHelper : public XSCBaseHelper -{ - // - // Public ... -public: - // - // Props ... - - // - // Constructors ... - XSCXLHHelper() : XSCBaseHelper(_Symbol, _Period) - { - } - - // - // Deconstructor ... - ~XSCXLHHelper() {} - - // - // Tools ... - bool Init( - string symbol, // Trading Symbol - ENUM_TIMEFRAMES period, // Trading Period - XLHInputs &inputs // Inputs - ) - { - // - bool result = false; - - // - mSymbol = symbol; - mPeriod = period; - - // - result = inputs.IsValid(); - if (!result) - { - return result; - } - - // - mInputs = inputs; - - // - ArraySetAsSeries(hhBuffer, true); - ArraySetAsSeries(llBuffer, true); - ArraySetAsSeries(signalBuffer, true); - - // - mHandler = iCustom( - mSymbol, - mPeriod, - "x-saherelm.xlh", - // - // Inputs ... - mInputs.length, // Length - mInputs.hhMode, // Highest High Calculation Method - mInputs.llMode // Lowest Low Calculation Method - // - ); - result = mHandler != INVALID_HANDLE; - if (!result) - { - return result; - } - - // - return result; - } - - // - // Inputs ... - - // - XLHInputs GetInputs() - { - return mInputs; - } - - // - bool SetInputs( - XLHInputs &inputs // Configs - ) - { - // - return Init( - mSymbol, - mPeriod, - inputs - // - ); - } - - // - // Buffers ... - - // - double GetHH( - int barIndex // Bar Index - ) - { - // - if (barIndex < 0) - { - barIndex = 0; - } - - // - Calculate(); - - // - int count = ArraySize(hhBuffer); - if (barIndex >= count) - { - barIndex = count - 1; - } - - // - return hhBuffer[barIndex]; - } - - // - // Copy Required Items ... - int CopyHH( - int start, // Start - int count, // Number of Items for read - double &buffer[], // Dest Buffer - bool forceClean = true // Force To Clean buffer - ) - { - // - // Update Calculations ... - Calculate(); - - // - // Copy Items ... - return Copy( - start, - count, - hhBuffer, - buffer, - forceClean - // - ); - } - - // - double GetLL( - int barIndex // Bar Index - ) - { - // - if (barIndex < 0) - { - barIndex = 0; - } - - // - Calculate(); - - // - int count = ArraySize(llBuffer); - if (barIndex >= count) - { - barIndex = count - 1; - } - - // - return llBuffer[barIndex]; - } - - // - // Copy Required Items ... - int CopyLL( - int start, // Start - int count, // Number of Items for read - double &buffer[], // Dest Buffer - bool forceClean = true // Force To Clean buffer - ) - { - // - // Update Calculations ... - Calculate(); - - // - // Copy Items ... - return Copy( - start, - count, - llBuffer, - buffer, - forceClean - // - ); - } - - // - double GetSignal( - int barIndex // Bar Index - ) - { - // - if (barIndex < 0) - { - barIndex = 0; - } - - // - Calculate(); - - // - int count = ArraySize(signalBuffer); - if (barIndex >= count) - { - barIndex = count - 1; - } - - // - return signalBuffer[barIndex]; - } - - // - // Copy Required Items ... - int CopySignal( - int start, // Start - int count, // Number of Items for read - double &buffer[], // Dest Buffer - bool forceClean = true // Force To Clean buffer - ) - { - // - // Update Calculations ... - Calculate(); - - // - // Copy Items ... - return Copy( - start, - count, - signalBuffer, - buffer, - forceClean - // - ); - } - - // - // Protected ... -protected: - // - // Private ... -private: - // - // Props ... - XLHInputs mInputs; // Inputs ... - - // - // Buffers ... - double hhBuffer[]; - double llBuffer[]; - double signalBuffer[]; - - // - // Tools ... - - // - // Calculate Values Until Now ... - void Calculate() - { - // - int totalBars = CountBars(); - - // - // HH ... - CopyBuffer( - mHandler, - XLH_HH_LINE, - 0, - totalBars, - hhBuffer - // - ); - - // - // LL ... - CopyBuffer( - mHandler, - XLH_LL_LINE, - 0, - totalBars, - llBuffer - // - ); - - // - // Signal ... - CopyBuffer( - mHandler, - XLH_SIGNAL_LINE, - 0, - totalBars, - signalBuffer - // - ); - } -}; - -// -// Tools ... \ No newline at end of file diff --git a/Helpers/x-saherelm.xobd.helper.mq5 b/Helpers/x-saherelm.xobd.helper.mq5 deleted file mode 100644 index 03957cb5..00000000 --- a/Helpers/x-saherelm.xobd.helper.mq5 +++ /dev/null @@ -1,306 +0,0 @@ -/////////////////////////////////////////////////////// -// -// SaherElm IT Center MQL5 Helper Class Library -// ---------------------------------------------- -// Name: XSCXOBDHelper -// Description: provides all Indicator -// Helper requirements ... -// -// -// Maintainer: -// ------------ -// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) -// -////////////////////////////////////////////////////// -// -// Global Properties ... -#property library -#property copyright "Copyright 2023, SaherElm IT Center" -#property link "https://www.saherelm.ir" -#property version "1.00" -#property strict - -// -// Imports ... -#include "../Classes/x-saherelm.xhelper.class.mq5" - -// -// Definitions ... - -// -enum ENUM_XOBD_BUFFERS -{ - XOBD_MAIN_LINE = 0 -}; - -// -// Input Models ... -struct XOBDInputs -{ - // - // Props ... - - // - int length; // Swing Length - - // - uchar swingHighArrowCode; // Swing High Arrow Code - color swingHighArrowColor; // Swing High Arrow Color - - // - uchar swingLowArrowCode; // Swing Low Arrow Code - color swingLowArrowColor; // Swing Low Arrow Color - - // - // Constructor(s) ... - XOBDInputs() - { - // - Clean(); - } - - // - // Tools ... - - // - // Clean ... - void Clean() - { - // - length = 0; - swingHighArrowCode = 0; - swingHighArrowColor = CLR_NONE; - swingLowArrowCode = 0; - swingLowArrowColor = CLR_NONE; - } - - // - // Default ... - void Default() - { - // - length = 5; - swingHighArrowCode = 0; - swingHighArrowColor = CLR_NONE; - swingLowArrowCode = 0; - swingLowArrowColor = CLR_NONE; - } - - // - // Validate ... - bool IsValid() - { - // - bool result = false; - - // - result = - // - length >= 3 - // - ; - - // - return result; - } - - // - // Retrieve MAx Length ... - int Max() - { - // - int result = 0; - - // - result = MathMax(result, length); - - // - return result; - } -}; - -// -// Class ... -class XSCXOBDHelper : public XSCBaseHelper -{ - // - // Public ... -public: - // - // Props ... - - // - // Constructors ... - XSCXOBDHelper() : XSCBaseHelper(_Symbol, _Period) - { - } - - // - // Deconstructor ... - ~XSCXOBDHelper() {} - - // - // Tools ... - bool Init( - string symbol, // Trading Symbol - ENUM_TIMEFRAMES period, // Trading Period - XOBDInputs &inputs // Inputs - ) - { - // - bool result = false; - - // - mSymbol = symbol; - mPeriod = period; - - // - result = inputs.IsValid(); - if (!result) - { - return result; - } - - // - mInputs = inputs; - - // - ArraySetAsSeries(mainBuffer, true); - mHandler = iCustom( - mSymbol, - mPeriod, - "x-saherelm.xobd", - // - // Inputs ... - mInputs.length, // Swing Length - mInputs.swingHighArrowCode, // Swing High Arrow Code - mInputs.swingHighArrowColor, // Swing High Arrow Color - mInputs.swingLowArrowCode, // Swing Low Arrow Code - mInputs.swingLowArrowColor // Swing Low Arrow Color - // - ); - result = mHandler != INVALID_HANDLE; - if (!result) - { - return result; - } - - // - return result; - } - - // - // Inputs ... - - // - XOBDInputs GetInputs() - { - return mInputs; - } - - // - bool SetInputs( - XOBDInputs &inputs // Configs - ) - { - // - return Init( - mSymbol, - mPeriod, - inputs - // - ); - } - - // - // Buffers ... - - // - double GetMain( - int barIndex // Bar Index - ) - { - // - if (barIndex < 0) - { - barIndex = 0; - } - - // - Calculate(); - - // - int count = ArraySize(mainBuffer); - if (barIndex >= count) - { - barIndex = count - 1; - } - - // - return mainBuffer[barIndex]; - } - - // - // Copy Required Items ... - int CopyMain( - int start, // Start - int count, // Number of Items for read - double &buffer[], // Dest Buffer - bool forceClean = true // Force To Clean buffer - ) - { - // - // Update Calculations ... - Calculate(); - - // - // Copy Items ... - return Copy( - start, - count, - mainBuffer, - buffer, - forceClean - // - ); - } - - // - // Protected ... -protected: - // - // Private ... -private: - // - // Props ... - XOBDInputs mInputs; // Inputs ... - - // - // Buffers ... - double mainBuffer[]; - - // - // Tools ... - - // - // Calculate Values Until Now ... - void Calculate() - { - // - int totalBars = CountBars(); - - // - // Main ... - CopyBuffer( - mHandler, - XOBD_MAIN_LINE, - 0, - totalBars, - mainBuffer - // - ); - } -}; - -// -// Tools ... \ No newline at end of file diff --git a/Helpers/x-saherelm.xrsi.helper.mq5 b/Helpers/x-saherelm.xrsi.helper.mq5 deleted file mode 100644 index 804cf355..00000000 --- a/Helpers/x-saherelm.xrsi.helper.mq5 +++ /dev/null @@ -1,392 +0,0 @@ -/////////////////////////////////////////////////////// -// -// SaherElm IT Center MQL5 Helper Class Library -// ---------------------------------------------- -// Name: XSCXRSIHelper -// Description: provides all Indicator -// Helper requirements ... -// -// -// Maintainer: -// ------------ -// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) -// -////////////////////////////////////////////////////// -// -// Global Properties ... -#property library -#property copyright "Copyright 2023, SaherElm IT Center" -#property link "https://www.saherelm.ir" -#property version "1.00" -#property strict - -// -// Imports ... -#include "../Classes/x-saherelm.xhelper.class.mq5" - -// -// Definitions ... - -// -enum ENUM_XRSI_BUFFERS -{ - XRSI_MAIN_LINE = 0 -}; - -// -// Input Models ... -struct XRSIInputs -{ - // - // Props ... - - // - // Market ... - int length; // Market Length - ENUM_APPLIED_PRICE appliedTo; // Applied To - - // - // Short Entry ... - double shortEntryValue; // Short Entry Level - color shortEntryColor; // Short Entry Level Color - ENUM_LINE_STYLE shortEntryLineStyle; // Short Entry Style - - // - // Short Exit ... - double shortExitValue; // Short Exit Level - color shortExitColor; // Short Exit Level Color - ENUM_LINE_STYLE shortExitLineStyle; // Short Exit Style - - // - // Long Entry ... - double longEntryValue; // Long Entry Level - color longEntryColor; // Long Entry Level Color - ENUM_LINE_STYLE longEntryLineStyle; // Long Entry Style - - // - // Long Exit ... - double longExitValue; // Long Exit Level - color longExitColor; // Long Exit Level Color - ENUM_LINE_STYLE longExitLineStyle; // Long Exit Style - - // - // Constructor(s) ... - XRSIInputs() - { - // - Clean(); - } - - // - // Tools ... - - // - // Clean ... - void Clean() - { - // - // Market ... - length = 0; - appliedTo = PRICE_CLOSE; - - // - // Short Entry ... - shortEntryValue = 0; - shortEntryColor = CLR_NONE; - shortEntryLineStyle = STYLE_DOT; - - // - // Short Exit ... - shortExitValue = 0; - shortExitColor = CLR_NONE; - shortExitLineStyle = STYLE_DOT; - - // - // Long Entry ... - longEntryValue = 0; - longEntryColor = CLR_NONE; - longEntryLineStyle = STYLE_DOT; - - // - // Long Exit ... - longExitValue = 0; - longExitColor = CLR_NONE; - longExitLineStyle = STYLE_DOT; - } - - // - // Default ... - void Default() - { - // - // Market ... - length = 14; - appliedTo = PRICE_CLOSE; - - // - // Short Entry ... - shortEntryValue = 70; - shortEntryColor = CLR_NONE; - shortEntryLineStyle = STYLE_DOT; - - // - // Short Exit ... - shortExitValue = 40; - shortExitColor = CLR_NONE; - shortExitLineStyle = STYLE_DOT; - - // - // Long Entry ... - longEntryValue = 30; - longEntryColor = CLR_NONE; - longEntryLineStyle = STYLE_DOT; - - // - // Long Exit ... - longExitValue = 60; - longExitColor = CLR_NONE; - longExitLineStyle = STYLE_DOT; - } - - // - // Validate ... - bool IsValid() - { - // - bool result = false; - - // - result = - // - length >= 2 - // - ; - - // - return result; - } - - // - // Retrieve MAx Length ... - int Max() - { - // - int result = 0; - - // - result = MathMax(result, length); - - // - return result; - } -}; - -// -// Class ... -class XSCXRSIHelper : public XSCBaseHelper -{ - // - // Public ... -public: - // - // Props ... - - // - // Constructors ... - XSCXRSIHelper() : XSCBaseHelper(_Symbol, _Period) - { - } - - // - // Deconstructor ... - ~XSCXRSIHelper() {} - - // - // Tools ... - bool Init( - string symbol, // Trading Symbol - ENUM_TIMEFRAMES period, // Trading Period - XRSIInputs &inputs // Inputs - ) - { - // - bool result = false; - - // - mSymbol = symbol; - mPeriod = period; - - // - result = inputs.IsValid(); - if (!result) - { - return result; - } - - // - mInputs = inputs; - - // - ArraySetAsSeries(mainBuffer, true); - mHandler = iCustom( - mSymbol, - mPeriod, - "x-saherelm.xrsi", - // - // Inputs ... - // - // Market ... - "", - mInputs.length, // Market Length - mInputs.appliedTo, // Applied To - // - // Short Entry ... - "", - mInputs.shortEntryValue, // Short Entry Level - mInputs.shortEntryColor, // Short Entry Level Color - mInputs.shortEntryLineStyle, // Short Entry Style - // - // Short Exit ... - "", - mInputs.shortExitValue, // Short Exit Level - mInputs.shortExitColor, // Short Exit Level Color - mInputs.shortExitLineStyle, // Short Exit Style - // - // Long Entry ... - "", - mInputs.longEntryValue, // Long Entry Level - mInputs.longEntryColor, // Long Entry Level Color - mInputs.longEntryLineStyle, // Long Entry Style - // - // Long Exit ... - "", - mInputs.longExitValue, // Long Exit Level - mInputs.longExitColor, // Long Exit Level Color - mInputs.longExitLineStyle // Long Exit Style - // - ); - result = mHandler != INVALID_HANDLE; - if (!result) - { - return result; - } - - // - return result; - } - - // - // Inputs ... - - // - XRSIInputs GetInputs() - { - return mInputs; - } - - // - bool SetInputs( - XRSIInputs &inputs // Configs - ) - { - // - return Init( - mSymbol, - mPeriod, - inputs - // - ); - } - - // - // Buffers ... - - // - double GetMain( - int barIndex // Bar Index - ) - { - // - if (barIndex < 0) - { - barIndex = 0; - } - - // - Calculate(); - - // - int count = ArraySize(mainBuffer); - if (barIndex >= count) - { - barIndex = count - 1; - } - - // - return mainBuffer[barIndex]; - } - - // - // Copy Required Items ... - int CopyMain( - int start, // Start - int count, // Number of Items for read - double &buffer[], // Dest Buffer - bool forceClean = true // Force To Clean buffer - ) - { - // - // Update Calculations ... - Calculate(); - - // - // Copy Items ... - return Copy( - start, - count, - mainBuffer, - buffer, - forceClean - // - ); - } - - // - // Protected ... -protected: - // - // Private ... -private: - // - // Props ... - XRSIInputs mInputs; // Inputs ... - - // - // Buffers ... - double mainBuffer[]; - - // - // Tools ... - - // - // Calculate Values Until Now ... - void Calculate() - { - // - int totalBars = CountBars(); - - // - // Main ... - CopyBuffer( - mHandler, - XRSI_MAIN_LINE, - 0, - totalBars, - mainBuffer - // - ); - } -}; - -// -// Tools ... \ No newline at end of file diff --git a/Helpers/x-saherelm.xts.helper.mq5 b/Helpers/x-saherelm.xts.helper.mq5 deleted file mode 100644 index 72eb4255..00000000 --- a/Helpers/x-saherelm.xts.helper.mq5 +++ /dev/null @@ -1,550 +0,0 @@ -/////////////////////////////////////////////////////// -// -// SaherElm IT Center MQL5 Helper Class Library -// ---------------------------------------------- -// Name: XSCXTSHelper -// Description: provides all Indicator -// Helper requirements ... -// -// -// Maintainer: -// ------------ -// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) -// -////////////////////////////////////////////////////// -// -// Global Properties ... -#property library -#property copyright "Copyright 2023, SaherElm IT Center" -#property link "https://www.saherelm.ir" -#property version "1.00" -#property strict - -// -// Imports ... -#include "../Classes/x-saherelm.xhelper.class.mq5" - -// -// Definitions ... - -// -enum ENUM_XTS_BUFFERS -{ - XTS_CURRENT_LINE = 0, - XTS_NEAREST_LINE = 1, - XTS_MEDIEST_LINE = 2, - XTS_FAREST_LINE = 3, -}; - -// -// Input Models ... -struct XTSInputs -{ - // - // Props ... - // - // Current Period ... - ENUM_APPLIED_PRICE currentAppliedTo; // Current Applied To - // - // Nearest Period ... - ENUM_X_PERIOD_METHOD nearestMethod; // How to Find Nearest Period - ENUM_TIMEFRAMES nearestPeriod; // Nearest Time Frame - ENUM_APPLIED_PRICE nearestAppliedTo; // Nearest Applied To - // - // Mediest Period ... - ENUM_X_PERIOD_METHOD mediestMethod; // How to Find Mediest Period - ENUM_TIMEFRAMES mediestPeriod; // Mediest Time Frame - ENUM_APPLIED_PRICE mediestAppliedTo; // Mediest Applied To - // - // Farest Period ... - ENUM_X_PERIOD_METHOD farestMethod; // How to Find Farest Period - ENUM_TIMEFRAMES farestPeriod; // Farest Time Frame - ENUM_APPLIED_PRICE farestAppliedTo; // Farest Applied To - - // - // Constructor(s) ... - XTSInputs() - { - // - Clean(); - } - - // - // Tools ... - - // - // Clean ... - void Clean() - { - // - // Current Period ... - currentAppliedTo = PRICE_CLOSE; - // - // Nearest Period ... - nearestMethod = X_PERIOD_NOTHING; - nearestPeriod = NULL; - nearestAppliedTo = PRICE_CLOSE; - // - // Mediest Period ... - mediestMethod = X_PERIOD_NOTHING; - mediestPeriod = NULL; - mediestAppliedTo = PRICE_CLOSE; - // - // Farest Period ... - farestMethod = X_PERIOD_NOTHING; - farestPeriod = NULL; - farestAppliedTo = PRICE_CLOSE; - } - - // - // Default ... - void Default() - { - // - // Current Period ... - currentAppliedTo = PRICE_CLOSE; - // - // Nearest Period ... - nearestMethod = X_PERIOD_AUTO; - nearestPeriod = NULL; - nearestAppliedTo = PRICE_CLOSE; - // - // Mediest Period ... - mediestMethod = X_PERIOD_AUTO; - mediestPeriod = NULL; - mediestAppliedTo = PRICE_CLOSE; - // - // Farest Period ... - farestMethod = X_PERIOD_AUTO; - farestPeriod = NULL; - farestAppliedTo = PRICE_CLOSE; - } - - // - // Validate ... - bool IsValid() - { - // - bool result = false; - - // - result = - // - IsValid(nearestMethod, nearestPeriod) && - IsValid(mediestMethod, mediestPeriod) && - IsValid(farestMethod, farestPeriod) - // - ; - - // - return result; - } - - // - // Retrieve MAx Length ... - int Max() - { - // - int result = 0; - - // - result = MathMax(result, 0); - - // - return result; - } -}; - -// -// Class ... -class XSCXTSHelper : public XSCBaseHelper -{ - // - // Public ... -public: - // - // Props ... - - // - // Constructors ... - XSCXTSHelper() : XSCBaseHelper(_Symbol, _Period) - { - } - - // - // Deconstructor ... - ~XSCXTSHelper() {} - - // - // Tools ... - bool Init( - string symbol, // Trading Symbol - ENUM_TIMEFRAMES period, // Trading Period - XTSInputs &inputs // Inputs - ) - { - // - bool result = false; - - // - mSymbol = symbol; - mPeriod = period; - - // - result = inputs.IsValid(); - if (!result) - { - return result; - } - - // - mInputs = inputs; - - // - ArraySetAsSeries(currentBuffer, true); - ArraySetAsSeries(nearestBuffer, true); - ArraySetAsSeries(mediestBuffer, true); - ArraySetAsSeries(farestBuffer, true); - - // - mHandler = iCustom( - mSymbol, - mPeriod, - "x-saherelm.xts", - // - // Inputs ... - // - // Current Period ... - "", - mInputs.currentAppliedTo, // Current Applied To - // - // Nearest Period ... - "", - mInputs.nearestMethod, // How to Find Nearest Period - mInputs.nearestPeriod, // Nearest Time Frame - mInputs.nearestAppliedTo, // Nearest Applied To - // - // Mediest Period ... - "", - mInputs.mediestMethod, // How to Find Mediest Period - mInputs.mediestPeriod, // Mediest Time Frame - mInputs.mediestAppliedTo, // Mediest Applied To - // - // Farest Period ... - "", - mInputs.farestMethod, // How to Find Farest Period - mInputs.farestPeriod, // Farest Time Frame - mInputs.farestAppliedTo // Farest Applied To - // - ); - result = mHandler != INVALID_HANDLE; - if (!result) - { - return result; - } - - // - return result; - } - - // - // Inputs ... - - // - XTSInputs GetInputs() - { - return mInputs; - } - - // - bool SetInputs( - XTSInputs &inputs // Configs - ) - { - // - return Init( - mSymbol, - mPeriod, - inputs - // - ); - } - - // - // Buffers ... - - // - double GetCurrent( - int barIndex // Bar Index - ) - { - // - if (barIndex < 0) - { - barIndex = 0; - } - - // - Calculate(); - - // - int count = ArraySize(currentBuffer); - if (barIndex >= count) - { - barIndex = count - 1; - } - - // - return currentBuffer[barIndex]; - } - - // - // Copy Required Items ... - int CopyCurrent( - int start, // Start - int count, // Number of Items for read - double &buffer[], // Dest Buffer - bool forceClean = true // Force To Clean buffer - ) - { - // - // Update Calculations ... - Calculate(); - - // - // Copy Items ... - return Copy( - start, - count, - currentBuffer, - buffer, - forceClean - // - ); - } - - // - double GetNearest( - int barIndex // Bar Index - ) - { - // - if (barIndex < 0) - { - barIndex = 0; - } - - // - Calculate(); - - // - int count = ArraySize(nearestBuffer); - if (barIndex >= count) - { - barIndex = count - 1; - } - - // - return nearestBuffer[barIndex]; - } - - // - // Copy Required Items ... - int CopyNearest( - int start, // Start - int count, // Number of Items for read - double &buffer[], // Dest Buffer - bool forceClean = true // Force To Clean buffer - ) - { - // - // Update Calculations ... - Calculate(); - - // - // Copy Items ... - return Copy( - start, - count, - nearestBuffer, - buffer, - forceClean - // - ); - } - - // - double GetMediest( - int barIndex // Bar Index - ) - { - // - if (barIndex < 0) - { - barIndex = 0; - } - - // - Calculate(); - - // - int count = ArraySize(mediestBuffer); - if (barIndex >= count) - { - barIndex = count - 1; - } - - // - return mediestBuffer[barIndex]; - } - - // - // Copy Required Items ... - int CopyMediest( - int start, // Start - int count, // Number of Items for read - double &buffer[], // Dest Buffer - bool forceClean = true // Force To Clean buffer - ) - { - // - // Update Calculations ... - Calculate(); - - // - // Copy Items ... - return Copy( - start, - count, - mediestBuffer, - buffer, - forceClean - // - ); - } - - // - double GetFarest( - int barIndex // Bar Index - ) - { - // - if (barIndex < 0) - { - barIndex = 0; - } - - // - Calculate(); - - // - int count = ArraySize(farestBuffer); - if (barIndex >= count) - { - barIndex = count - 1; - } - - // - return farestBuffer[barIndex]; - } - - // - // Copy Required Items ... - int CopyFarest( - int start, // Start - int count, // Number of Items for read - double &buffer[], // Dest Buffer - bool forceClean = true // Force To Clean buffer - ) - { - // - // Update Calculations ... - Calculate(); - - // - // Copy Items ... - return Copy( - start, - count, - farestBuffer, - buffer, - forceClean - // - ); - } - - // - // Protected ... -protected: - // - // Private ... -private: - // - // Props ... - XTSInputs mInputs; // Inputs ... - - // - // Buffers ... - double currentBuffer[]; - double nearestBuffer[]; - double mediestBuffer[]; - double farestBuffer[]; - - // - // Tools ... - - // - // Calculate Values Until Now ... - void Calculate() - { - // - int totalBars = CountBars(); - - // - // Current ... - CopyBuffer( - mHandler, - XTS_CURRENT_LINE, - 0, - totalBars, - currentBuffer - // - ); - - // - // Nearest ... - CopyBuffer( - mHandler, - XTS_NEAREST_LINE, - 0, - totalBars, - nearestBuffer - // - ); - - // - // Mediest ... - CopyBuffer( - mHandler, - XTS_MEDIEST_LINE, - 0, - totalBars, - mediestBuffer - // - ); - - // - // Farest ... - CopyBuffer( - mHandler, - XTS_FAREST_LINE, - 0, - totalBars, - farestBuffer - // - ); - } -}; - -// -// Tools ... \ No newline at end of file diff --git a/Indicators/vp-v6.mq5 b/Indicators/vp-v6.mq5 new file mode 100644 index 0000000000000000000000000000000000000000..34b439daa8475616123ef0e5192165171f42e9a9 GIT binary patch literal 84834 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 PQX{ZB`@3k_+UfrXe;=`( literal 0 HcmV?d00001 diff --git a/Indicators/x-saherelm.xchlh.mq5 b/Indicators/x-saherelm.xchlh.mq5 deleted file mode 100644 index 3df87f02..00000000 --- a/Indicators/x-saherelm.xchlh.mq5 +++ /dev/null @@ -1,816 +0,0 @@ -////////////////////////////////////////////////////// -// -// SaherElm IT Center MQL5 Cycle Channel LH Oscillator -// --------------------------------------------------- -// Name: XCHLH -// Description: detecting HH and LL based on cycles ... -// -// -// Maintainer: -// ------------ -// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) -// -////////////////////////////////////////////////////// -// -// Global Properties ... -#property copyright "Copyright 2023, SaherElm IT Center" -#property link "https://saherelm.ir" -#property version "1.00" -#property description "SaherElm XCHLH Oscillator" -#property strict - -// -// START Constants ... -// -#define ShortName "XCHLH" - -// -// XCHLH Hot States ... -enum ENUM_X_XCHLH_HOT_STATES -{ - X_XCHLH_HOT_HH = 1, - X_XCHLH_NEUTURAL = 0, - X_XCHLH_HOT_LL = -1, -}; - -// -// END Constants ... -// - -// -// START Inputs ... -// - -// -// Common ... -input group "Hot Areas"; -input bool drawHotAreas = true; // Draw Hot Areas Symbol -input uchar hotHHArrowCode = 234; // Hot HH Arrow Code -input color hotHHArrowColor = clrAqua; // Hot HH Arrow Color -input uchar hotLLArrowCode = 233; // Hot LL Arrow Code -input color hotLLArrowColor = clrFuchsia; // Hot LL Arrow Color - -// -// LC Inputs ... -input group "Long Cycle"; -input group "LC Market"; -input int lcLength = 28; // Length -input double lcThresholdInPips = 0.3; // Threshold In Pips -input ENUM_SERIESMODE lcHHMode = MODE_HIGH; // Highest High Calculation Method -input ENUM_SERIESMODE lcLLMode = MODE_LOW; // Lowest Low Calculation Method -input group "LC Style"; -input int lcDrawWidth = 1; // Draw Width -input ENUM_DRAW_TYPE lcDrawType = DRAW_LINE; // Draw Type -input ENUM_LINE_STYLE lcDrawStyle = STYLE_DOT; // Draw Style -input color lcHHColor = clrAqua; // Highest High Color -input color lcLLColor = clrFuchsia; // Lowest Low Color -input group "LC Drawings"; -input bool lcDrawHH = true; // Draw Highest High -input bool lcDrawLL = true; // Draw Lowest Low - -// -// MC Inputs ... -input group "Medium Cycle"; -input group "MC Market"; -input int mcLength = 14; // Length -input double mcThresholdInPips = 0.3; // Threshold In Pips -input ENUM_SERIESMODE mcHHMode = MODE_HIGH; // Highest High Calculation Method -input ENUM_SERIESMODE mcLLMode = MODE_LOW; // Lowest Low Calculation Method -input group "MC Style"; -input int mcDrawWidth = 1; // Draw Width -input ENUM_DRAW_TYPE mcDrawType = DRAW_LINE; // Draw Type -input ENUM_LINE_STYLE mcDrawStyle = STYLE_DOT; // Draw Style -input color mcHHColor = clrLime; // Highest High Color -input color mcLLColor = clrRed; // Lowest Low Color -input group "MC Drawings"; -input bool mcDrawHH = true; // Draw Highest High -input bool mcDrawLL = true; // Draw Lowest Low - -// -// SC Inputs ... -input group "Short Cycle"; -input group "SC Market"; -input int scLength = 7; // Length -input double scThresholdInPips = 0.3; // Threshold In Pips -input ENUM_SERIESMODE scHHMode = MODE_HIGH; // Highest High Calculation Method -input ENUM_SERIESMODE scLLMode = MODE_LOW; // Lowest Low Calculation Method -input group "SC Style"; -input int scDrawWidth = 1; // Draw Width -input ENUM_DRAW_TYPE scDrawType = DRAW_LINE; // Draw Type -input ENUM_LINE_STYLE scDrawStyle = STYLE_DOT; // Draw Style -input color scHHColor = clrLightBlue; // Highest High Color -input color scLLColor = clrLightSalmon; // Lowest Low Color -input group "SC Drawings"; -input bool scDrawHH = true; // Draw Highest High -input bool scDrawLL = true; // Draw Lowest Low -// -// END Inputs ... -// - -// -// Includes Common Library ... -#include "../Libraries/x-saherelm.common.lib.mq5"; - -// -// Includes Draw Library ... -#include "../Libraries/x-saherelm.draw.lib.mq5"; - -// -// START Buffers ... -// -// #property indicator_separate_window -#property indicator_chart_window - -// -#property indicator_buffers 7 -// #property indicator_plots 6 -#property indicator_plots 0 - -// -// LC ... -#define lcHHBufferIndex 0 -#define lcLLBufferIndex 1 - -// -double lcHHBuffer[]; -double lcLLBuffer[]; - -// -// MC ... -#define mcHHBufferIndex 2 -#define mcLLBufferIndex 3 - -// -double mcHHBuffer[]; -double mcLLBuffer[]; - -// -// SC ... -#define scHHBufferIndex 4 -#define scLLBufferIndex 5 - -// -double scHHBuffer[]; -double scLLBuffer[]; - -// -// Hot State ... -// -#define hotStateBufferIndex 6 - -// -double hotStateBuffer[]; -// -// END Buffers ... -// - -// -// START Global Definitions: Variables, Properties and etc ... -// -// -// END Global Definitions: Variables, Properties and etc ... -// - -// -// START Event Handlers ... -// -// -// Initialization ... -int OnInit() -{ - // - // Validate Inputs ... - if (!ValidateInputs()) - { - return INIT_PARAMETERS_INCORRECT; - } - - // - drawPrefix = ShortName; - - // - // Define Index Buffers ... - DefineBuffers(); - - // - // Set Indicator ShortName ... - SetIndicatorName(); - - // - // Init Succeed ... - return INIT_SUCCEEDED; -} - -// -// DeInitialization ... -void OnDeinit(const int reason) -{ - // - // REASON_PROGRAM 0 The EA has stopped working calling the ExpertRemove() function - // REASON_REMOVE 1 Program removed from a chart - // REASON_RECOMPILE 2 Program recompiled - // REASON_CHARTCHANGE 3 A symbol or a chart period is changed - // REASON_CHARTCLOSE 4 Chart closed - // REASON_PARAMETERS 5 Inputs changed by a user - // REASON_ACCOUNT 6 Another account has been activated or reconnection to the trade server has occurred due to changes in the account settings - // REASON_TEMPLATE 7 Another chart template applied - // REASON_INITFAILED 8 The OnInit() handler returned a non-zero value - // REASON_CLOSE 9 Terminal closed - - // - // Here we can handle De Initialization Reasons ... - - // - // ReDraw Chart ... - ChartRedraw(); - - // - Comment(""); -} - -// -// Calculations ... -// -// 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[]) -{ - // - // Prepare Buffers ... - ArraySetAsSeries(time, true); - ArraySetAsSeries(open, true); - ArraySetAsSeries(high, true); - ArraySetAsSeries(low, true); - ArraySetAsSeries(close, true); - ArraySetAsSeries(tick_volume, true); - ArraySetAsSeries(volume, true); - ArraySetAsSeries(spread, true); - - // - // this counts Available Bars ... - int limit; - - // - // because in some cases we may have more than one input for - // calculation and we must prevent any calculation - // untill we pass the biggest input length, here we get max Input length - // and then wait until pass it ... - int maxLength = MathMax(lcLength, mcLength); - maxLength = MathMax(maxLength, scLength); - - // - limit = prev_calculated < maxLength ? rates_total - (maxLength + 1) : rates_total - prev_calculated; - - // - // Main Loop ... - for (int i = limit; i >= 0 && !IsStopped(); i--) - { - // - CalculateBuffers(i); - } - - // - return rates_total; -} -// -// END Event Handlers ... -// - -// -// START Functions ... -// -// -// Validate Input Args for Initialization ... -bool ValidateInputs() -{ - // - bool result = false; - - // - // Validate Args ... - bool isLCInputsValid = - lcLength >= 4 && - lcLength > mcLength && - lcLength > scLength; - bool isMCInputsValid = - mcLength >= 4 && - mcLength > scLength && - mcLength < lcLength; - bool isSCInputsValid = - scLength >= 4 && - scLength < mcLength && - scLength < lcLength; - if ( - isLCInputsValid && - isMCInputsValid && - isSCInputsValid) - { - result = true; - } - - // - return result; -} - -// -// Define Indexes and Styles ... -void DefineBuffers() -{ - // - // LC ... - LCDefineBuffers(); - - // - // MC ... - MCDefineBuffers(); - - // - // SC ... - SCDefineBuffers(); - - // - // Hot State Buffer ... - HotStateDefineBuffers(); -} - -// -// Set Indicator Short Name and also we can define Buffers Labels ... -void SetIndicatorName() -{ - // - string indicatorShortName = ""; - StringConcatenate(indicatorShortName, ShortName, ""); - - // - IndicatorSetString(INDICATOR_SHORTNAME, indicatorShortName); -} - -// -// Calculate Buffers ... -void CalculateBuffers( - int bar_index // Current Candle Index ... -) -{ - // - // LC ... - LCCalculateBuffers(bar_index); - - // - // MC ... - MCCalculateBuffers(bar_index); - - // - // SC ... - SCCalculateBuffers(bar_index); - - // - // SIGNAL ... - SignalCalculateBuffers(bar_index); - - // - // HOT State Buffer ... - HotStateCalculateBuffers(bar_index); - - // - // After all Calculations we are ready to Draw what we want ... - DrawBuffers(bar_index); -} - -// -// LC Buffers Definitions ... -void LCDefineBuffers() -{ - // - // LC HH Buffer ... - string lcHHBufferLabel = ShortName + " LC HH (" + (string)lcLength + ")"; - ENUM_DRAW_TYPE lcHHDrawType = lcDrawHH ? lcDrawType : DRAW_NONE; - ArraySetAsSeries(lcHHBuffer, true); - SetIndexBuffer(lcHHBufferIndex, lcHHBuffer, INDICATOR_CALCULATIONS); - // SetIndexBuffer(lcHHBufferIndex, lcHHBuffer, INDICATOR_DATA); - // PlotIndexSetInteger(lcHHBufferIndex, PLOT_DRAW_BEGIN, lcLength); - // PlotIndexSetString(lcHHBufferIndex, PLOT_LABEL, lcHHBufferLabel); - // PlotIndexSetInteger(lcHHBufferIndex, PLOT_LINE_COLOR, lcHHColor); - // PlotIndexSetInteger(lcHHBufferIndex, PLOT_LINE_STYLE, lcDrawStyle); - // PlotIndexSetInteger(lcHHBufferIndex, PLOT_LINE_WIDTH, lcDrawWidth); - // PlotIndexSetInteger(lcHHBufferIndex, PLOT_DRAW_TYPE, lcHHDrawType); - - // - // LC LL Buffer ... - string lcLLBufferLabel = ShortName + " LC LL (" + (string)lcLength + ")"; - ENUM_DRAW_TYPE lcLLDrawType = lcDrawLL ? lcDrawType : DRAW_NONE; - ArraySetAsSeries(lcLLBuffer, true); - SetIndexBuffer(lcLLBufferIndex, lcLLBuffer, INDICATOR_CALCULATIONS); - // SetIndexBuffer(lcLLBufferIndex, lcLLBuffer, INDICATOR_DATA); - // PlotIndexSetInteger(lcLLBufferIndex, PLOT_DRAW_BEGIN, lcLength); - // PlotIndexSetString(lcLLBufferIndex, PLOT_LABEL, lcLLBufferLabel); - // PlotIndexSetInteger(lcLLBufferIndex, PLOT_LINE_COLOR, lcLLColor); - // PlotIndexSetInteger(lcLLBufferIndex, PLOT_LINE_STYLE, lcDrawStyle); - // PlotIndexSetInteger(lcLLBufferIndex, PLOT_LINE_WIDTH, lcDrawWidth); - // PlotIndexSetInteger(lcLLBufferIndex, PLOT_DRAW_TYPE, lcLLDrawType); -} - -// -// MC Buffers Definitions ... -void MCDefineBuffers() -{ - // - // MC HH Buffer ... - string mcHHBufferLabel = ShortName + " MC HH (" + (string)mcLength + ")"; - ENUM_DRAW_TYPE mcHHDrawType = mcDrawHH ? lcDrawType : DRAW_NONE; - ArraySetAsSeries(mcHHBuffer, true); - SetIndexBuffer(mcHHBufferIndex, mcHHBuffer, INDICATOR_CALCULATIONS); - // SetIndexBuffer(mcHHBufferIndex, mcHHBuffer, INDICATOR_DATA); - // PlotIndexSetInteger(mcHHBufferIndex, PLOT_DRAW_BEGIN, mcLength); - // PlotIndexSetString(mcHHBufferIndex, PLOT_LABEL, mcHHBufferLabel); - // PlotIndexSetInteger(mcHHBufferIndex, PLOT_LINE_COLOR, mcHHColor); - // PlotIndexSetInteger(mcHHBufferIndex, PLOT_LINE_STYLE, mcDrawStyle); - // PlotIndexSetInteger(mcHHBufferIndex, PLOT_LINE_WIDTH, mcDrawWidth); - // PlotIndexSetInteger(mcHHBufferIndex, PLOT_DRAW_TYPE, mcHHDrawType); - - // - // MC LL Buffer ... - string mcLLBufferLabel = ShortName + " MC LL (" + (string)mcLength + ")"; - ENUM_DRAW_TYPE mcLLDrawType = mcDrawLL ? lcDrawType : DRAW_NONE; - ArraySetAsSeries(mcLLBuffer, true); - SetIndexBuffer(mcLLBufferIndex, mcLLBuffer, INDICATOR_CALCULATIONS); - // SetIndexBuffer(mcLLBufferIndex, mcLLBuffer, INDICATOR_DATA); - // PlotIndexSetInteger(mcLLBufferIndex, PLOT_DRAW_BEGIN, mcLength); - // PlotIndexSetString(mcLLBufferIndex, PLOT_LABEL, mcLLBufferLabel); - // PlotIndexSetInteger(mcLLBufferIndex, PLOT_LINE_COLOR, mcLLColor); - // PlotIndexSetInteger(mcLLBufferIndex, PLOT_LINE_STYLE, mcDrawStyle); - // PlotIndexSetInteger(mcLLBufferIndex, PLOT_LINE_WIDTH, mcDrawWidth); - // PlotIndexSetInteger(mcLLBufferIndex, PLOT_DRAW_TYPE, mcLLDrawType); -} - -// -// SC Buffers Definitions ... -void SCDefineBuffers() -{ - // - // SC HH Buffer ... - string scHHBufferLabel = ShortName + " SC HH (" + (string)scLength + ")"; - ENUM_DRAW_TYPE scHHDrawType = scDrawHH ? lcDrawType : DRAW_NONE; - ArraySetAsSeries(scHHBuffer, true); - SetIndexBuffer(scHHBufferIndex, scHHBuffer, INDICATOR_CALCULATIONS); - // SetIndexBuffer(scHHBufferIndex, scHHBuffer, INDICATOR_DATA); - // PlotIndexSetInteger(scHHBufferIndex, PLOT_DRAW_BEGIN, scLength); - // PlotIndexSetString(scHHBufferIndex, PLOT_LABEL, scHHBufferLabel); - // PlotIndexSetInteger(scHHBufferIndex, PLOT_LINE_COLOR, scHHColor); - // PlotIndexSetInteger(scHHBufferIndex, PLOT_LINE_STYLE, scDrawStyle); - // PlotIndexSetInteger(scHHBufferIndex, PLOT_LINE_WIDTH, scDrawWidth); - // PlotIndexSetInteger(scHHBufferIndex, PLOT_DRAW_TYPE, scHHDrawType); - - // - // SC LL Buffer ... - string scLLBufferLabel = ShortName + " SC LL (" + (string)scLength + ")"; - ENUM_DRAW_TYPE scLLDrawType = scDrawLL ? lcDrawType : DRAW_NONE; - ArraySetAsSeries(scLLBuffer, true); - SetIndexBuffer(scLLBufferIndex, scLLBuffer, INDICATOR_CALCULATIONS); - // SetIndexBuffer(scLLBufferIndex, scLLBuffer, INDICATOR_DATA); - // PlotIndexSetInteger(scLLBufferIndex, PLOT_DRAW_BEGIN, scLength); - // PlotIndexSetString(scLLBufferIndex, PLOT_LABEL, scLLBufferLabel); - // PlotIndexSetInteger(scLLBufferIndex, PLOT_LINE_COLOR, scLLColor); - // PlotIndexSetInteger(scLLBufferIndex, PLOT_LINE_STYLE, scDrawStyle); - // PlotIndexSetInteger(scLLBufferIndex, PLOT_LINE_WIDTH, scDrawWidth); - // PlotIndexSetInteger(scLLBufferIndex, PLOT_DRAW_TYPE, scLLDrawType); -} - -// -// Hot State Buffer ... -void HotStateDefineBuffers() -{ - // - // Hot State Buffer ... - ArraySetAsSeries(hotStateBuffer, true); - SetIndexBuffer(hotStateBufferIndex, hotStateBuffer, INDICATOR_CALCULATIONS); -} - -// -// LC Calculations ... -void LCCalculateBuffers( - int bar_index // Current Candle Index ... -) -{ - // - // Detect Cycle HH and LL ... - int length = lcLength; - ENUM_SERIESMODE hhMode = lcHHMode; - ENUM_SERIESMODE llMode = lcLLMode; - double threshold = PipsToPrice(lcThresholdInPips); - - // - int hhIdx = iHighest( - _Symbol, - _Period, - hhMode, - length, - bar_index - // - ); - double hh = iHigh( - _Symbol, - _Period, - hhIdx); - double hhValue = hh + threshold; - - // - int llIdx = iLowest( - _Symbol, - _Period, - llMode, - length, - bar_index - // - ); - double ll = iLow( - _Symbol, - _Period, - llIdx); - double llValue = ll - threshold; - - // - lcHHBuffer[bar_index] = hhValue; - lcLLBuffer[bar_index] = llValue; -} - -// -// MC Calculations ... -void MCCalculateBuffers( - int bar_index // Current Candle Index ... -) -{ - // - // Detect Cycle HH and LL ... - int length = mcLength; - ENUM_SERIESMODE hhMode = mcHHMode; - ENUM_SERIESMODE llMode = mcLLMode; - double threshold = PipsToPrice(mcThresholdInPips); - - // - int hhIdx = iHighest( - _Symbol, - _Period, - hhMode, - length, - bar_index - // - ); - double hh = iHigh( - _Symbol, - _Period, - hhIdx); - double hhValue = hh + threshold; - - // - int llIdx = iLowest( - _Symbol, - _Period, - llMode, - length, - bar_index - // - ); - double ll = iLow( - _Symbol, - _Period, - llIdx); - double llValue = ll - threshold; - - // - mcHHBuffer[bar_index] = hhValue; - mcLLBuffer[bar_index] = llValue; -} - -// -// SC Calculations ... -void SCCalculateBuffers( - int bar_index // Current Candle Index ... -) -{ - // - // Detect Cycle HH and LL ... - int length = scLength; - ENUM_SERIESMODE hhMode = scHHMode; - ENUM_SERIESMODE llMode = scLLMode; - double threshold = PipsToPrice(scThresholdInPips); - - // - int hhIdx = iHighest( - _Symbol, - _Period, - hhMode, - length, - bar_index - // - ); - double hh = iHigh( - _Symbol, - _Period, - hhIdx); - double hhValue = hh + threshold; - - // - int llIdx = iLowest( - _Symbol, - _Period, - llMode, - length, - bar_index - // - ); - double ll = iLow( - _Symbol, - _Period, - llIdx); - double llValue = ll - threshold; - - // - scHHBuffer[bar_index] = hhValue; - scLLBuffer[bar_index] = llValue; -} - -// -// SIGNAL Calculations ... -void SignalCalculateBuffers( - int bar_index // Current Candle Index ... -) -{ - // - // LC Values ... - double lcHH = lcHHBuffer[bar_index]; - double lcLL = lcLLBuffer[bar_index]; - double lcDelta = lcHH - lcLL; - double lcAvg = lcDelta / 2; - - // - // MC Values ... - double mcHH = mcHHBuffer[bar_index]; - double mcLL = mcLLBuffer[bar_index]; - double mcDelta = mcHH - mcLL; - double mcAvg = mcDelta / 2; - - // - // SC Values ... - double scHH = scHHBuffer[bar_index]; - double scLL = scLLBuffer[bar_index]; - double scDelta = scHH - scLL; - double scAvg = scDelta / 2; - - // - // Min Value ... - double minValue = MathMin( - scLL, mcLL); - minValue = MathMin( - lcLL, minValue); - - // - // Max Value ... - double maxValue = MathMin( - scHH, mcHH); - maxValue = MathMin( - lcHH, maxValue); -} - -// -// HOT State Calculate Buffers ... -void HotStateCalculateBuffers( - int bar_index // Current Candle Index ... -) -{ - // - // LC ... - double lcHH = lcHHBuffer[bar_index]; - double lcLL = lcLLBuffer[bar_index]; - // - double lcHH1 = lcHHBuffer[bar_index + 1]; - double lcLL1 = lcLLBuffer[bar_index + 1]; - - // - // MC ... - double mcHH = mcHHBuffer[bar_index]; - double mcLL = mcLLBuffer[bar_index]; - // - double mcHH1 = mcHHBuffer[bar_index + 1]; - double mcLL1 = mcLLBuffer[bar_index + 1]; - - // - // SC ... - double scHH = scHHBuffer[bar_index]; - double scLL = scLLBuffer[bar_index]; - // - double scHH1 = scHHBuffer[bar_index + 1]; - double scLL1 = scLLBuffer[bar_index + 1]; - - // - bool isHotLLState = scLL == mcLL && mcLL == lcLL; - bool isHotLLState1 = scLL1 == mcLL1 && mcLL1 == lcLL1; - // - bool isHotHHState = scHH == mcHH && mcHH == lcHH; - bool isHotHHState1 = scHH1 == mcHH1 && mcHH1 == lcHH1; - - // - bool isHotLL = isHotLLState && !isHotLLState1; - bool isHotHH = isHotHHState && !isHotHHState1; - - // - double hotStateValue = X_XCHLH_NEUTURAL; - if (isHotHH) - { - hotStateValue = X_XCHLH_HOT_HH; - } - else if (isHotLL) - { - hotStateValue = X_XCHLH_HOT_LL; - } - - // - hotStateBuffer[bar_index] = hotStateValue; -} - -// -// Draw Buffers ... -void DrawBuffers( - int bar_index // Current Candle Index ... -) -{ - // - // General Requirements ... - - // - // Retrieve Candle Model ... - XOHCL candle; - candle.Init( - _Symbol, - _Period, - bar_index - // - ); - datetime time = iTime(_Symbol, _Period, bar_index); - - // - // Draw Arrow on Hot Areas ... - if (drawHotAreas) - { - // - double hotStateValue = hotStateBuffer[bar_index]; - bool isHotHHArea = hotStateValue == 1; - bool isHotLLArea = hotStateValue == -1; - if (isHotHHArea || isHotLLArea) - { - // - bool isHH = isHotHHArea; - - // - double price = isHH ? candle.high : candle.low; - ENUM_ARROW_ANCHOR anchor = isHH ? ANCHOR_BOTTOM : ANCHOR_TOP; - color clr = isHH ? hotHHArrowColor : hotLLArrowColor; - uchar arrowCode = isHH ? hotHHArrowCode : hotLLArrowCode; - string name = "HOT " + (isHH ? "HH" : "LL") + "_" + (string)price + "_" + (string)time; - - // - DrawArrow( - 0, - name, - 0, - time, - price, - arrowCode, - anchor, - clr, - STYLE_SOLID, - 1); - } - } -} -// -// END Functions ... -// diff --git a/Indicators/x-saherelm.xchma.mq5 b/Indicators/x-saherelm.xchma.mq5 deleted file mode 100644 index e59bc430..00000000 --- a/Indicators/x-saherelm.xchma.mq5 +++ /dev/null @@ -1,1134 +0,0 @@ -/////////////////////////////////////////////////////////////////// -// -// SaherElm IT Center MQL5 Cycle Channel Moving Averages Oscillator -// ---------------------------------------------------------------- -// Name: XCHMA -// Description: trend detecting based on cycles ... -// -// -// Maintainer: -// ------------ -// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) -// -////////////////////////////////////////////////////// -// -// Global Properties ... -#property copyright "Copyright 2023, SaherElm IT Center" -#property link "https://saherelm.ir" -#property version "1.00" -#property description "SaherElm XCHMA Oscillator" -#property strict - -// -// START Constants ... -// -#define ShortName "XCHMA" - -// -// XCHMA Oscillator Cycles State Presentation ... -enum ENUM_XCHMA_CYCLE_STATES -{ - X_XCHMA_FAST_CROSSED_OVER_SLOW = 2, - X_XCHMA_FAST_OVER_SLOW = 1, - X_XCHMA_NEUTURAL = 0, - X_XCHMA_FAST_UNDER_SLOW = -1, - X_XCHMA_FAST_CROSSED_UNDER_SLOW = -2, -}; -// -// END Constants ... -// - -// -// START Inputs ... -// -// -// Common ... -input group "Hot Areas"; -input bool drawHotAreas = true; // Draw Hot Areas Symbol -input uchar hotBullishArrowCode = 228; // Hot Bullish Arrow Code -input color hotBullishArrowColor = clrAqua; // Hot Bullish Arrow Color -input uchar hotBearishArrowCode = 230; // Hot Bearish Arrow Code -input color hotBearishArrowColor = clrFuchsia; // Hot Bearish Arrow Color - -// -// LC Inputs ... -input group "Long Cycle"; -input group "LC Market"; -input int lcFastLength = 20; // Fast Length -input int lcSlowLength = 50; // Slow Length -input ENUM_MA_METHOD lcMethod = MODE_EMA; // Calculation Method -input ENUM_APPLIED_PRICE lcAppliedTo = PRICE_CLOSE; // Applied To -input group "LC Style"; -input int lcDrawWidth = 1; // Draw Width -input ENUM_DRAW_TYPE lcDrawType = DRAW_LINE; // Draw Type -input ENUM_LINE_STYLE lcDrawStyle = STYLE_DOT; // Draw Style -input color lcFastColor = clrAqua; // Fast Color -input color lcSlowColor = clrFuchsia; // Slow Color -input group "LC Drawings"; -input bool lcDrawFast = true; // Draw Fast -input bool lcDrawSlow = true; // Draw Slow -input bool lcDrawCrosses = true; // Draw Cross Lines - -// -// MC Inputs ... -input group "Medium Cycle"; -input group "MC Market"; -input int mcFastLength = 10; // Fast Length -input int mcSlowLength = 30; // Slow Length -input ENUM_MA_METHOD mcMethod = MODE_EMA; // Calculation Method -input ENUM_APPLIED_PRICE mcAppliedTo = PRICE_CLOSE; // Applied To -input group "MC Style"; -input int mcDrawWidth = 1; // Draw Width -input ENUM_DRAW_TYPE mcDrawType = DRAW_LINE; // Draw Type -input ENUM_LINE_STYLE mcDrawStyle = STYLE_DOT; // Draw Style -input color mcFastColor = clrLime; // Fast Color -input color mcSlowColor = clrRed; // Slow Color -input group "MC Drawings"; -input bool mcDrawFast = true; // Draw Fast -input bool mcDrawSlow = true; // Draw Slow -input bool mcDrawCrosses = false; // Draw Cross Lines - -// -// SC Inputs ... -input group "Short Cycle"; -input group "SC Market"; -input int scFastLength = 7; // Fast Length -input int scSlowLength = 14; // Slow Length -input ENUM_MA_METHOD scMethod = MODE_EMA; // Calculation Method -input ENUM_APPLIED_PRICE scAppliedTo = PRICE_CLOSE; // Applied To -input group "SC Style"; -input int scDrawWidth = 1; // Draw Width -input ENUM_DRAW_TYPE scDrawType = DRAW_LINE; // Draw Type -input ENUM_LINE_STYLE scDrawStyle = STYLE_SOLID; // Draw Style -input color scFastColor = clrLightBlue; // Fast Color -input color scSlowColor = clrLightSalmon; // Slow Color -input group "SC Drawings"; -input bool scDrawFast = true; // Draw Fast -input bool scDrawSlow = true; // Draw Slow -input bool scDrawCrosses = false; // Draw Cross Lines -// -// END Inputs ... -// - -// -// Includes Common Library ... -#include "../Libraries/x-saherelm.common.lib.mq5" - -// -// Includes Draw Library ... -#include "../Libraries/x-saherelm.draw.lib.mq5" - -// -// START Buffers ... -// -// #property indicator_separate_window -#property indicator_chart_window - -// -#property indicator_buffers 7 -// #property indicator_plots 6 -#property indicator_plots 0 - -// -// LC ... -#define lcFastBufferIndex 0 -#define lcSlowBufferIndex 1 - -// -double lcFastBuffer[]; -double lcSlowBuffer[]; - -// -// MC ... -#define mcFastBufferIndex 2 -#define mcSlowBufferIndex 3 - -// -double mcFastBuffer[]; -double mcSlowBuffer[]; - -// -// SC ... -#define scFastBufferIndex 4 -#define scSlowBufferIndex 5 - -// -double scFastBuffer[]; -double scSlowBuffer[]; - -// -// Hot State ... -// -#define hotStateBufferIndex 6 - -// -double hotStateBuffer[]; -// -// END Buffers ... -// - -// -// START Global Definitions: Variables, Properties and etc ... -// -// -// LC ... -int lcFastHandler = INVALID_HANDLE; -int lcSlowHandler = INVALID_HANDLE; - -// -// MC ... -int mcFastHandler = INVALID_HANDLE; -int mcSlowHandler = INVALID_HANDLE; - -// -// SC ... -int scFastHandler = INVALID_HANDLE; -int scSlowHandler = INVALID_HANDLE; -// -// END Global Definitions: Variables, Properties and etc ... -// - -// -// START Event Handlers ... -// -// -// Initialization ... -int OnInit() -{ - // - // Validate Inputs ... - if (!ValidateInputs()) - { - return INIT_PARAMETERS_INCORRECT; - } - - // - drawPrefix = ShortName; - - // - // Define Index Buffers ... - DefineBuffers(); - - // - // Set Indicator ShortName ... - SetIndicatorName(); - - // - // Init All Required Handlers ... - if (!InitHandlers()) - { - return INIT_FAILED; - } - - // - // Init Succeed ... - return INIT_SUCCEEDED; -} - -// -// DeInitialization ... -void OnDeinit(const int reason) -{ - // - // REASON_PROGRAM 0 The EA has stopped working calling the ExpertRemove() function - // REASON_REMOVE 1 Program removed from a chart - // REASON_RECOMPILE 2 Program recompiled - // REASON_CHARTCHANGE 3 A symbol or a chart period is changed - // REASON_CHARTCLOSE 4 Chart closed - // REASON_PARAMETERS 5 Inputs changed by a user - // REASON_ACCOUNT 6 Another account has been activated or reconnection to the trade server has occurred due to changes in the account settings - // REASON_TEMPLATE 7 Another chart template applied - // REASON_INITFAILED 8 The OnInit() handler returned a non-zero value - // REASON_CLOSE 9 Terminal closed - - // - // Here we can handle De Initialization Reasons ... - - // - // ReDraw Chart ... - ChartRedraw(); - - // - Comment(""); -} - -// -// Calculations ... -// -// 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[]) -{ - // - // Prepare Buffers ... - ArraySetAsSeries(time, true); - ArraySetAsSeries(open, true); - ArraySetAsSeries(high, true); - ArraySetAsSeries(low, true); - ArraySetAsSeries(close, true); - ArraySetAsSeries(tick_volume, true); - ArraySetAsSeries(volume, true); - ArraySetAsSeries(spread, true); - - // - // this counts Available Bars ... - int limit; - - // - // because in some cases we may have more than one input for - // calculation and we must prevent any calculation - // untill we pass the biggest input length, here we get max Input length - // and then wait until pass it ... - int maxLength = MathMax(lcFastLength, lcSlowLength); - - // - // Get Retrieved Values from indicators ... - // - // LC ... - int lcFastCalculatedBars = BarsCalculated(lcFastHandler); - int lcSlowCalculatedBars = BarsCalculated(lcSlowHandler); - - // - // MC ... - int mcFastCalculatedBars = BarsCalculated(mcFastHandler); - int mcSlowCalculatedBars = BarsCalculated(mcSlowHandler); - - // - // SC ... - int scFastCalculatedBars = BarsCalculated(scFastHandler); - int scSlowCalculatedBars = BarsCalculated(scSlowHandler); - - // - // Check Calculated Bars ... - if ( - // - // LC ... - lcFastCalculatedBars < maxLength || - lcSlowCalculatedBars < maxLength || - // - // MC ... - mcFastCalculatedBars < maxLength || - mcSlowCalculatedBars < maxLength || - // - // SC ... - scFastCalculatedBars < maxLength || - scSlowCalculatedBars < maxLength) - { - return prev_calculated; - } - - // - limit = prev_calculated < maxLength ? rates_total - (maxLength + 1) : rates_total - prev_calculated; - - // - // Copy Buffers from indicators ... - // - // LC ... - int lcFastCopiedItems = CopyBuffer(lcFastHandler, 0, 0, limit + 1, lcFastBuffer); - int lcSlowCopiedItems = CopyBuffer(lcSlowHandler, 0, 0, limit + 1, lcSlowBuffer); - - // - // MC ... - int mcFastCopiedItems = CopyBuffer(mcFastHandler, 0, 0, limit + 1, mcFastBuffer); - int mcSlowCopiedItems = CopyBuffer(mcSlowHandler, 0, 0, limit + 1, mcSlowBuffer); - - // - // SC ... - int scFastCopiedItems = CopyBuffer(scFastHandler, 0, 0, limit + 1, scFastBuffer); - int scSlowCopiedItems = CopyBuffer(scSlowHandler, 0, 0, limit + 1, scSlowBuffer); - - // - // Check Copied Items Number ... - if ( - // - // LC ... - lcFastCopiedItems <= 0 || - lcSlowCopiedItems <= 0 || - // - // MC ... - mcFastCopiedItems <= 0 || - mcSlowCopiedItems <= 0 || - // - // MC ... - mcFastCopiedItems <= 0 || - mcSlowCopiedItems <= 0) - { - return prev_calculated; - } - - // - // Main Loop ... - for (int i = limit; i >= 0 && !IsStopped(); i--) - { - // - CalculateBuffers(i); - } - - // - return rates_total; -} -// -// END Event Handlers ... -// - -// -// START Functions ... -// -// -// Validate Input Args for Initialization ... -bool ValidateInputs() -{ - // - bool result = false; - - // - // Validate Args ... - bool isLCInputsValid = lcFastLength >= 4 && lcSlowLength > lcFastLength; - bool isMCInputsValid = mcFastLength >= 4 && mcSlowLength > mcFastLength; - bool isSCInputsValid = scFastLength >= 4 && scSlowLength > scFastLength; - if ( - isLCInputsValid && - isMCInputsValid && - isSCInputsValid && - lcFastLength > mcFastLength && - mcFastLength > scFastLength) - { - result = true; - } - - // - return result; -} - -// -// Define Indexes and Styles ... -void DefineBuffers() -{ - // - // LC ... - LCDefineBuffers(); - - // - // MC ... - MCDefineBuffers(); - - // - // SC ... - SCDefineBuffers(); - - // - // Hot State Buffer ... - HotStateDefineBuffers(); -} - -// -// Init Handlers ... -bool InitHandlers() -{ - // - bool result = false; - - // - // LC ... - result = LCInitHandlers(); - if (!result) - { - return result; - } - - // - // MC ... - result = MCInitHandlers(); - if (!result) - { - return result; - } - - // - // SC ... - result = SCInitHandlers(); - if (!result) - { - return result; - } - - // - return result; -} - -// -// Set Indicator Short Name and also we can define Buffers Labels ... -void SetIndicatorName() -{ - // - string indicatorShortName = ""; - StringConcatenate(indicatorShortName, ShortName, ""); - - // - IndicatorSetString(INDICATOR_SHORTNAME, indicatorShortName); -} - -// -// Calculate Buffers ... -void CalculateBuffers( - int bar_index // Current Candle Index ... -) -{ - // - // HOT State Buffer ... - HotStateCalculateBuffers(bar_index); - - // - // After all Calculations we are ready to Draw what we want ... - DrawBuffers(bar_index); -} - -// -// LC Buffers Definitions ... -void LCDefineBuffers() -{ - // - // LC Fast Buffer ... - string lcFastBufferLabel = ShortName + " LC Fast (" + (string)lcFastLength + ")"; - ENUM_DRAW_TYPE lcFastDrawType = lcDrawFast ? lcDrawType : DRAW_NONE; - ArraySetAsSeries(lcFastBuffer, true); - SetIndexBuffer(lcFastBufferIndex, lcFastBuffer, INDICATOR_CALCULATIONS); - // SetIndexBuffer(lcFastBufferIndex, lcFastBuffer, INDICATOR_DATA); - // PlotIndexSetString(lcFastBufferIndex, PLOT_LABEL, lcFastBufferLabel); - // PlotIndexSetInteger(lcFastBufferIndex, PLOT_LINE_COLOR, lcFastColor); - // PlotIndexSetInteger(lcFastBufferIndex, PLOT_LINE_STYLE, lcDrawStyle); - // PlotIndexSetInteger(lcFastBufferIndex, PLOT_LINE_WIDTH, lcDrawWidth); - // PlotIndexSetInteger(lcFastBufferIndex, PLOT_DRAW_BEGIN, lcFastLength); - // PlotIndexSetInteger(lcFastBufferIndex, PLOT_DRAW_TYPE, lcFastDrawType); - - // - // LC Slow Buffer ... - string lcSlowBufferLabel = ShortName + " LC Slow (" + (string)lcSlowLength + ")"; - ENUM_DRAW_TYPE lcSlowDrawType = lcDrawSlow ? lcDrawType : DRAW_NONE; - ArraySetAsSeries(lcSlowBuffer, true); - SetIndexBuffer(lcSlowBufferIndex, lcSlowBuffer, INDICATOR_CALCULATIONS); - // SetIndexBuffer(lcSlowBufferIndex, lcSlowBuffer, INDICATOR_DATA); - // PlotIndexSetString(lcSlowBufferIndex, PLOT_LABEL, lcSlowBufferLabel); - // PlotIndexSetInteger(lcSlowBufferIndex, PLOT_LINE_COLOR, lcSlowColor); - // PlotIndexSetInteger(lcSlowBufferIndex, PLOT_LINE_STYLE, lcDrawStyle); - // PlotIndexSetInteger(lcSlowBufferIndex, PLOT_LINE_WIDTH, lcDrawWidth); - // PlotIndexSetInteger(lcSlowBufferIndex, PLOT_DRAW_BEGIN, lcSlowLength); - // PlotIndexSetInteger(lcSlowBufferIndex, PLOT_DRAW_TYPE, lcSlowDrawType); -} - -// -// MC Buffers Definitions ... -void MCDefineBuffers() -{ - // - // MC Fast Buffer ... - string mcFastBufferLabel = ShortName + " MC Fast (" + (string)mcFastLength + ")"; - ENUM_DRAW_TYPE mcFastDrawType = mcDrawFast ? lcDrawType : DRAW_NONE; - ArraySetAsSeries(mcFastBuffer, true); - SetIndexBuffer(mcFastBufferIndex, mcFastBuffer, INDICATOR_CALCULATIONS); - // SetIndexBuffer(mcFastBufferIndex, mcFastBuffer, INDICATOR_DATA); - // PlotIndexSetString(mcFastBufferIndex, PLOT_LABEL, mcFastBufferLabel); - // PlotIndexSetInteger(mcFastBufferIndex, PLOT_LINE_COLOR, mcFastColor); - // PlotIndexSetInteger(mcFastBufferIndex, PLOT_LINE_STYLE, mcDrawStyle); - // PlotIndexSetInteger(mcFastBufferIndex, PLOT_LINE_WIDTH, mcDrawWidth); - // PlotIndexSetInteger(mcFastBufferIndex, PLOT_DRAW_BEGIN, mcFastLength); - // PlotIndexSetInteger(mcFastBufferIndex, PLOT_DRAW_TYPE, mcFastDrawType); - - // - // MC Slow Buffer ... - string mcSlowBufferLabel = ShortName + " MC Slow (" + (string)mcSlowLength + ")"; - ENUM_DRAW_TYPE mcSlowDrawType = mcDrawSlow ? lcDrawType : DRAW_NONE; - ArraySetAsSeries(mcSlowBuffer, true); - SetIndexBuffer(mcSlowBufferIndex, mcSlowBuffer, INDICATOR_CALCULATIONS); - // SetIndexBuffer(mcSlowBufferIndex, mcSlowBuffer, INDICATOR_DATA); - // PlotIndexSetString(mcSlowBufferIndex, PLOT_LABEL, mcSlowBufferLabel); - // PlotIndexSetInteger(mcSlowBufferIndex, PLOT_LINE_COLOR, mcSlowColor); - // PlotIndexSetInteger(mcSlowBufferIndex, PLOT_LINE_STYLE, mcDrawStyle); - // PlotIndexSetInteger(mcSlowBufferIndex, PLOT_LINE_WIDTH, mcDrawWidth); - // PlotIndexSetInteger(mcSlowBufferIndex, PLOT_DRAW_BEGIN, mcSlowLength); - // PlotIndexSetInteger(mcSlowBufferIndex, PLOT_DRAW_TYPE, mcSlowDrawType); -} - -// -// SC Buffers Definitions ... -void SCDefineBuffers() -{ - // - // SC Fast Buffer ... - string scFastBufferLabel = ShortName + " SC Fast (" + (string)scFastLength + ")"; - ENUM_DRAW_TYPE scFastDrawType = scDrawFast ? lcDrawType : DRAW_NONE; - ArraySetAsSeries(scFastBuffer, true); - SetIndexBuffer(scFastBufferIndex, scFastBuffer, INDICATOR_CALCULATIONS); - // SetIndexBuffer(scFastBufferIndex, scFastBuffer, INDICATOR_DATA); - // PlotIndexSetString(scFastBufferIndex, PLOT_LABEL, scFastBufferLabel); - // PlotIndexSetInteger(scFastBufferIndex, PLOT_LINE_COLOR, scFastColor); - // PlotIndexSetInteger(scFastBufferIndex, PLOT_LINE_STYLE, scDrawStyle); - // PlotIndexSetInteger(scFastBufferIndex, PLOT_LINE_WIDTH, scDrawWidth); - // PlotIndexSetInteger(scFastBufferIndex, PLOT_DRAW_BEGIN, scFastLength); - // PlotIndexSetInteger(scFastBufferIndex, PLOT_DRAW_TYPE, scFastDrawType); - - // - // SC Slow Buffer ... - string scSlowBufferLabel = ShortName + " SC Slow (" + (string)scSlowLength + ")"; - ENUM_DRAW_TYPE scSlowDrawType = scDrawSlow ? lcDrawType : DRAW_NONE; - ArraySetAsSeries(scSlowBuffer, true); - SetIndexBuffer(scSlowBufferIndex, scSlowBuffer, INDICATOR_CALCULATIONS); - // SetIndexBuffer(scSlowBufferIndex, scSlowBuffer, INDICATOR_DATA); - // PlotIndexSetString(scSlowBufferIndex, PLOT_LABEL, scSlowBufferLabel); - // PlotIndexSetInteger(scSlowBufferIndex, PLOT_LINE_COLOR, scSlowColor); - // PlotIndexSetInteger(scSlowBufferIndex, PLOT_LINE_STYLE, scDrawStyle); - // PlotIndexSetInteger(scSlowBufferIndex, PLOT_LINE_WIDTH, scDrawWidth); - // PlotIndexSetInteger(scSlowBufferIndex, PLOT_DRAW_BEGIN, scSlowLength); - // PlotIndexSetInteger(scSlowBufferIndex, PLOT_DRAW_TYPE, scSlowDrawType); -} - -// -// Hot State Buffer ... -void HotStateDefineBuffers() -{ - // - // Hot State Buffer ... - ArraySetAsSeries(hotStateBuffer, true); - SetIndexBuffer(hotStateBufferIndex, hotStateBuffer, INDICATOR_CALCULATIONS); -} - -// -// LC Init Handlers ... -bool LCInitHandlers() -{ - // - ResetLastError(); - - // - // LC Fast Handler ... - lcFastHandler = iMA( - _Symbol, - _Period, - lcFastLength, - 0, - lcMethod, - lcAppliedTo); - if (lcFastHandler == INVALID_HANDLE) - { - return false; - } - - // - // LC Slow Handler ... - lcSlowHandler = iMA( - _Symbol, - _Period, - lcSlowLength, - 0, - lcMethod, - lcAppliedTo); - if (lcSlowHandler == INVALID_HANDLE) - { - return false; - } - - // - return true; -} - -// -// MC Init Handlers ... -bool MCInitHandlers() -{ - // - ResetLastError(); - - // - // MC Fast Handler ... - mcFastHandler = iMA( - _Symbol, - _Period, - mcFastLength, - 0, - mcMethod, - mcAppliedTo); - if (mcFastHandler == INVALID_HANDLE) - { - return false; - } - - // - // MC Slow Handler ... - mcSlowHandler = iMA( - _Symbol, - _Period, - mcSlowLength, - 0, - mcMethod, - mcAppliedTo); - if (mcSlowHandler == INVALID_HANDLE) - { - return false; - } - - // - return true; -} - -// -// SC Init Handlers ... -bool SCInitHandlers() -{ - // - ResetLastError(); - - // - // SC Fast Handler ... - scFastHandler = iMA( - _Symbol, - _Period, - scFastLength, - 0, - scMethod, - scAppliedTo); - if (scFastHandler == INVALID_HANDLE) - { - return false; - } - - // - // SC Slow Handler ... - scSlowHandler = iMA( - _Symbol, - _Period, - scSlowLength, - 0, - scMethod, - scAppliedTo); - if (scSlowHandler == INVALID_HANDLE) - { - return false; - } - - // - return true; -} - -// -// LC State ... -double GetLCState( - int bar_index // Current Candle Index ... -) -{ - // - // Fast Cross Over Slow Detection ... - bool isFastCrossedOverSlow = IsCrossedOver( - lcFastBuffer, - lcSlowBuffer, - bar_index); - - // - // Fast Over Slow Detection ... - bool isFastOverSlow = IsOver( - lcFastBuffer, - lcSlowBuffer, - bar_index); - - // - // Fast Cross Under Slow Detection ... - bool isFastCrossedUnderSlow = IsCrossedUnder( - lcFastBuffer, - lcSlowBuffer, - bar_index); - - // - // Fast Under Slow Detection ... - bool isFastUnderSlow = IsUnder( - lcFastBuffer, - lcSlowBuffer, - bar_index); - - // - // Generate state value which represent curren bar index - // state between fast and slow lines ... - double result = X_XCHMA_NEUTURAL; - - // - // Filling state value based on Market Conditions ... - if (isFastCrossedOverSlow) - { - result = X_XCHMA_FAST_CROSSED_OVER_SLOW; - } - else if (isFastCrossedUnderSlow) - { - result = X_XCHMA_FAST_CROSSED_UNDER_SLOW; - } - else if (isFastOverSlow) - { - result = X_XCHMA_FAST_OVER_SLOW; - } - else if (isFastUnderSlow) - { - result = X_XCHMA_FAST_UNDER_SLOW; - } - - // - return result; -} - -// -// MC State ... -double GetMCState( - int bar_index // Current Candle Index ... -) -{ - // - // Fast Cross Over Slow Detection ... - bool isFastCrossedOverSlow = IsCrossedOver( - mcFastBuffer, - mcSlowBuffer, - bar_index); - - // - // Fast Over Slow Detection ... - bool isFastOverSlow = IsOver( - mcFastBuffer, - mcSlowBuffer, - bar_index); - - // - // Fast Cross Under Slow Detection ... - bool isFastCrossedUnderSlow = IsCrossedUnder( - mcFastBuffer, - mcSlowBuffer, - bar_index); - - // - // Fast Under Slow Detection ... - bool isFastUnderSlow = IsUnder( - mcFastBuffer, - mcSlowBuffer, - bar_index); - - // - // Generate state value which represent curren bar index - // state between fast and slow lines ... - double result = X_XCHMA_NEUTURAL; - - // - // Filling state value based on Market Conditions ... - if (isFastCrossedOverSlow) - { - result = X_XCHMA_FAST_CROSSED_OVER_SLOW; - } - else if (isFastCrossedUnderSlow) - { - result = X_XCHMA_FAST_CROSSED_UNDER_SLOW; - } - else if (isFastOverSlow) - { - result = X_XCHMA_FAST_OVER_SLOW; - } - else if (isFastUnderSlow) - { - result = X_XCHMA_FAST_UNDER_SLOW; - } - - // - return result; -} - -// -// SC State ... -double GetSCState( - int bar_index // Current Candle Index ... -) -{ - // - // Fast Cross Over Slow Detection ... - bool isFastCrossedOverSlow = IsCrossedOver( - scFastBuffer, - scSlowBuffer, - bar_index); - - // - // Fast Over Slow Detection ... - bool isFastOverSlow = IsOver( - scFastBuffer, - scSlowBuffer, - bar_index); - - // - // Fast Cross Under Slow Detection ... - bool isFastCrossedUnderSlow = IsCrossedUnder( - scFastBuffer, - scSlowBuffer, - bar_index); - - // - // Fast Under Slow Detection ... - bool isFastUnderSlow = IsUnder( - scFastBuffer, - scSlowBuffer, - bar_index); - - // - // Generate state value which represent curren bar index - // state between fast and slow lines ... - double result = X_XCHMA_NEUTURAL; - - // - // Filling state value based on Market Conditions ... - if (isFastCrossedOverSlow) - { - result = X_XCHMA_FAST_CROSSED_OVER_SLOW; - } - else if (isFastCrossedUnderSlow) - { - result = X_XCHMA_FAST_CROSSED_UNDER_SLOW; - } - else if (isFastOverSlow) - { - result = X_XCHMA_FAST_OVER_SLOW; - } - else if (isFastUnderSlow) - { - result = X_XCHMA_FAST_UNDER_SLOW; - } - - // - return result; -} - -// -// HOT State Calculate Buffers ... -void HotStateCalculateBuffers( - int bar_index // Current Candle Index ... -) -{ - // - // LC ... - double lcFast = lcFastBuffer[bar_index]; - double lcSlow = lcSlowBuffer[bar_index]; - // - double lcFastPrev = lcFastBuffer[bar_index + 1]; - double lcSlowPrev = lcSlowBuffer[bar_index + 1]; - // - double lcState = GetLCState(bar_index); - - // - // MC ... - double mcFast = mcFastBuffer[bar_index]; - double mcSlow = mcSlowBuffer[bar_index]; - // - double mcFastPrev = mcFastBuffer[bar_index + 1]; - double mcSlowPrev = mcSlowBuffer[bar_index + 1]; - // - double mcState = GetMCState(bar_index); - - // - // SC ... - double scFast = scFastBuffer[bar_index]; - double scSlow = scSlowBuffer[bar_index]; - // - double scFastPrev = scFastBuffer[bar_index + 1]; - double scSlowPrev = scSlowBuffer[bar_index + 1]; - // - double scState = GetSCState(bar_index); - - // - // Detect HOT Bearish Area ... - bool isHotBearishArea = - lcFast < lcSlow && - mcFast < mcSlow && - scFast < scSlow; - // - bool isPrevHotBearishArea = - lcFastPrev < lcSlowPrev && - mcFastPrev < mcSlowPrev && - scFastPrev < scSlowPrev; - - // - // Detect HOT Bearish Area ... - bool isHotBullishArea = - lcFast > lcSlow && - mcFast > mcSlow && - scFast > scSlow; - // - bool isPrevHotBullishArea = - lcFastPrev > lcSlowPrev && - mcFastPrev > mcSlowPrev && - scFastPrev > scSlowPrev; - - // - // Generate HotState Value ... - double hotStateValue = - isHotBullishArea && !isPrevHotBullishArea - ? 1 - : isHotBearishArea && !isPrevHotBearishArea - ? -1 - : 0; - hotStateBuffer[bar_index] = hotStateValue; -} - -// -// Draw Buffers ... -void DrawBuffers( - int bar_index // Current Candle Index ... -) -{ - // - // General Requirements ... - - // - // Retrieve Candle Model ... - XOHCL candle; - candle.Init( - _Symbol, - _Period, - bar_index - // - ); - datetime time = iTime(_Symbol, _Period, bar_index); - - // - // Draw Arrow on Hot Areas ... - if (drawHotAreas) - { - // - double hotStateValue = hotStateBuffer[bar_index]; - bool isHotBullishArea = hotStateValue == 1; - bool isHotBearishArea = hotStateValue == -1; - if (isHotBullishArea || isHotBearishArea) - { - // - bool isBull = isHotBullishArea; - - // - double price = isBull ? candle.low : candle.high; - ENUM_ARROW_ANCHOR anchor = isBull ? ANCHOR_TOP : ANCHOR_BOTTOM; - color clr = isBull ? hotBullishArrowColor : hotBearishArrowColor; - uchar arrowCode = isBull ? hotBullishArrowCode : hotBearishArrowCode; - string name = "HOT " + (isBull ? "Bullish" : "Bearish") + "_" + (string)price + "_" + (string)time; - - // - DrawArrow( - 0, - name, - 0, - time, - price, - arrowCode, - anchor, - clr); - } - } - - // - // Draw LC Crosses ... - if (lcDrawCrosses) - { - // - double lcStateValue = GetLCState(bar_index); - bool isLcFastCrossedOverSlow = lcStateValue == X_XCHMA_FAST_CROSSED_OVER_SLOW; - bool isLcFastCrossedUnderSlow = lcStateValue == X_XCHMA_FAST_CROSSED_UNDER_SLOW; - if (isLcFastCrossedOverSlow || isLcFastCrossedUnderSlow) - { - // - bool isBull = isLcFastCrossedOverSlow; - - // - color clr = isBull ? lcFastColor : lcSlowColor; - string name = "LC Fast Cross " + (isBull ? "Over" : "Under") + "_" + (string)time; - - // - DrawVerticalLine( - 0, - name, - 0, - time, - clr); - } - } - - // - // Draw MC Crosses ... - if (mcDrawCrosses) - { - // - double mcStateValue = GetMCState(bar_index); - bool isMcFastCrossedOverSlow = mcStateValue == X_XCHMA_FAST_CROSSED_OVER_SLOW; - bool isMcFastCrossedUnderSlow = mcStateValue == X_XCHMA_FAST_CROSSED_UNDER_SLOW; - if (isMcFastCrossedOverSlow || isMcFastCrossedUnderSlow) - { - // - bool isBull = isMcFastCrossedOverSlow; - - // - color clr = isBull ? mcFastColor : mcSlowColor; - string name = "MC Fast Cross " + (isBull ? "Over" : "Under") + "_" + (string)time; - - // - DrawVerticalLine( - 0, - name, - 0, - time, - clr); - } - } - - // - // Draw SC Crosses ... - if (scDrawCrosses) - { - // - double scStateValue = GetSCState(bar_index); - bool isScFastCrossedOverSlow = scStateValue == X_XCHMA_FAST_CROSSED_OVER_SLOW; - bool isScFastCrossedUnderSlow = scStateValue == X_XCHMA_FAST_CROSSED_UNDER_SLOW; - if (isScFastCrossedOverSlow || isScFastCrossedUnderSlow) - { - // - bool isBull = isScFastCrossedOverSlow; - - // - color clr = isBull ? scFastColor : scSlowColor; - string name = "SC Fast Cross " + (isBull ? "Over" : "Under") + "_" + (string)time; - - // - DrawVerticalLine( - 0, - name, - 0, - time, - clr); - } - } -} -// -// END Functions ... -// diff --git a/Indicators/x-saherelm.xfi.mq5 b/Indicators/x-saherelm.xfi.mq5 deleted file mode 100644 index 44f2c4d6..00000000 --- a/Indicators/x-saherelm.xfi.mq5 +++ /dev/null @@ -1,309 +0,0 @@ -/////////////////////////////////////////////////////// -// -// SaherElm IT Center MQL5 XFI Oscillator -// --------------------------------------------- -// Name: XFI -// Description: Price Momentum Power Detection -// Market Analysor ... -// -// -// Maintainer: -// ------------ -// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) -// -////////////////////////////////////////////////////// -// -// Global Properties ... -#property copyright "Copyright 2023, SaherElm IT Center" -#property link "https://saherelm.ir" -#property version "1.00" -#property description "SaherElm XFI Oscillator" -#property strict - -// -// START Constants ... -// -#define ShortName "XFI" -// -// END Constants ... -// - -// -// START Inputs ... -// -input int length = 18; // Length -input ENUM_MA_METHOD method = MODE_SMA; // MA Method -input ENUM_APPLIED_VOLUME appliedTo = VOLUME_TICK; // Applied To -// -// END Inputs ... -// - -// -// Includes Common Library ... -#include "../Libraries/x-saherelm.common.lib.mq5" - -// -// START Buffers ... -// -// #property indicator_separate_window -#property indicator_chart_window - -// -#property indicator_buffers 2 -// #property indicator_plots 1 -#property indicator_plots 0 - -// -// FI Buffer ... -#define fiBufferIndex 0 -#define fiColorBufferIndex 1 - -// -double fiBuffer[]; -double fiColorBuffer[]; - -// -// #property indicator_label1 "XFI" -// #property indicator_type1 DRAW_COLOR_LINE -// #property indicator_color1 clrAqua, clrGray, clrFuchsia -// #property indicator_style1 STYLE_DOT -// #property indicator_width1 1 -// -// END Buffers ... -// - -// -// START Global Definitions: Variables, Properties and etc ... -// -int fiHandler = INVALID_HANDLE; -// -// END Global Definitions: Variables, Properties and etc ... -// - -// -// START Event Handlers ... -// -// -// Initialization ... -int OnInit() -{ - // - // Validate Inputs ... - if (!ValidateInputs()) - { - return INIT_PARAMETERS_INCORRECT; - } - - // - fiHandler = iForce( - _Symbol, - _Period, - length, - method, - appliedTo); - if (fiHandler == INVALID_HANDLE) - { - return INIT_FAILED; - } - - // - // Define Index Buffers ... - DefineBuffers(); - - // - // Set Indicator ShortName ... - SetIndicatorName(); - - // - // Init Succeed ... - return INIT_SUCCEEDED; -} - -// -// DeInitialization ... -void OnDeinit(const int reason) -{ - // - // REASON_PROGRAM 0 The EA has stopped working calling the ExpertRemove() function - // REASON_REMOVE 1 Program removed from a chart - // REASON_RECOMPILE 2 Program recompiled - // REASON_CHARTCHANGE 3 A symbol or a chart period is changed - // REASON_CHARTCLOSE 4 Chart closed - // REASON_PARAMETERS 5 Inputs changed by a user - // REASON_ACCOUNT 6 Another account has been activated or reconnection to the trade server has occurred due to changes in the account settings - // REASON_TEMPLATE 7 Another chart template applied - // REASON_INITFAILED 8 The OnInit() handler returned a non-zero value - // REASON_CLOSE 9 Terminal closed - - // - // Here we can handle De Initialization Reasons ... - IndicatorRelease(fiHandler); -} - -// -// Calculations ... -// -// 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[]) -{ - // - // Prepare Buffers ... - ArraySetAsSeries(time, true); - ArraySetAsSeries(open, true); - ArraySetAsSeries(high, true); - ArraySetAsSeries(low, true); - ArraySetAsSeries(close, true); - ArraySetAsSeries(tick_volume, true); - ArraySetAsSeries(volume, true); - ArraySetAsSeries(spread, true); - - // - // this counts Available Bars ... - int limit; - - // - // because in some cases we may have more than one input for - // calculation and we must prevent any calculation - // untill we pass the biggest input length, here we get max Input length - // and then wait until pass it ... - int maxLength = MathMax(0, length); - - // - // Check Calculated Bars ... - int fiCalculatedBars = BarsCalculated(fiHandler); - if (fiCalculatedBars < maxLength) - { - return prev_calculated; - } - - // - limit = (prev_calculated > rates_total || prev_calculated <= 0) ? rates_total : (rates_total - prev_calculated) + 1; - - // - // Buffers Copy ... - int copiedFis = CopyBuffer(fiHandler, 0, 0, limit, fiBuffer); - if (copiedFis <= 0) - { - return prev_calculated; - } - - // - // Main Loop ... - for (int i = 0; i < limit && !IsStopped(); i++) - { - // - CalculateBuffers(i); - } - - // - return rates_total; -} -// -// END Event Handlers ... -// - -// -// START Functions ... -// -// -// Validate Input Args for Initialization ... -bool ValidateInputs() -{ - // - bool result = false; - - // - // Validate Args ... - if (length >= 2) - { - result = true; - } - - // - return result; -} - -// -// Define Indexes and Styles ... -void DefineBuffers() -{ - // - string fiBufferLabel = "XFI " + "(" + (string)length + ")"; - - // - // FI Buffer ... - ArraySetAsSeries(fiBuffer, true); - SetIndexBuffer(fiBufferIndex, fiBuffer, INDICATOR_CALCULATIONS); - // SetIndexBuffer(fiBufferIndex, fiBuffer, INDICATOR_DATA); - // PlotIndexSetString(fiBufferIndex, PLOT_LABEL, fiBufferLabel); - - // // - // // FI Color Buffer ... - ArraySetAsSeries(fiColorBuffer, true); - // SetIndexBuffer(fiColorBufferIndex, fiColorBuffer, INDICATOR_COLOR_INDEX); - SetIndexBuffer(fiColorBufferIndex, fiColorBuffer, INDICATOR_CALCULATIONS); -} - -// -// Set Indicator Short Name and also we can define Buffers Labels ... -void SetIndicatorName() -{ - // - string indicatorShortName = ""; - StringConcatenate(indicatorShortName, ShortName, ""); - - // - IndicatorSetString(INDICATOR_SHORTNAME, indicatorShortName); -} - -// -// Calculate Buffers ... -void CalculateBuffers( - int bar_index // Selected Bar Index -) -{ - // - double iValue = fiBuffer[bar_index]; - - // - double iColorIndex = - iValue > 0 ? 0 : iValue < 0 ? 2 - : 1; - - // - // Set Buffer Color Index ... - fiColorBuffer[bar_index] = iColorIndex; -} -// -// END Functions ... -// diff --git a/Indicators/x-saherelm.xfi.osc.mq5 b/Indicators/x-saherelm.xfi.osc.mq5 deleted file mode 100644 index 0e7edc54..00000000 --- a/Indicators/x-saherelm.xfi.osc.mq5 +++ /dev/null @@ -1,309 +0,0 @@ -/////////////////////////////////////////////////////// -// -// SaherElm IT Center MQL5 XFI Oscillator -// --------------------------------------------- -// Name: XFI -// Description: Price Momentum Power Detection -// Market Analysor ... -// -// -// Maintainer: -// ------------ -// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) -// -////////////////////////////////////////////////////// -// -// Global Properties ... -#property copyright "Copyright 2023, SaherElm IT Center" -#property link "https://saherelm.ir" -#property version "1.00" -#property description "SaherElm XFI Oscillator" -#property strict - -// -// START Constants ... -// -#define ShortName "XFI" -// -// END Constants ... -// - -// -// START Inputs ... -// -input int length = 18; // Length -input ENUM_MA_METHOD method = MODE_SMA; // MA Method -input ENUM_APPLIED_VOLUME appliedTo = VOLUME_TICK; // Applied To -// -// END Inputs ... -// - -// -// Includes Common Library ... -#include "../Libraries/x-saherelm.common.lib.mq5" - -// -// START Buffers ... -// -#property indicator_separate_window -// #property indicator_chart_window - -// -#property indicator_buffers 2 -#property indicator_plots 1 -// #property indicator_plots 0 - -// -// FI Buffer ... -#define fiBufferIndex 0 -#define fiColorBufferIndex 1 - -// -double fiBuffer[]; -double fiColorBuffer[]; - -// -#property indicator_label1 "XFI" -#property indicator_type1 DRAW_COLOR_LINE -#property indicator_color1 clrAqua, clrGray, clrFuchsia -#property indicator_style1 STYLE_DOT -#property indicator_width1 1 -// -// END Buffers ... -// - -// -// START Global Definitions: Variables, Properties and etc ... -// -int fiHandler = INVALID_HANDLE; -// -// END Global Definitions: Variables, Properties and etc ... -// - -// -// START Event Handlers ... -// -// -// Initialization ... -int OnInit() -{ - // - // Validate Inputs ... - if (!ValidateInputs()) - { - return INIT_PARAMETERS_INCORRECT; - } - - // - fiHandler = iForce( - _Symbol, - _Period, - length, - method, - appliedTo); - if (fiHandler == INVALID_HANDLE) - { - return INIT_FAILED; - } - - // - // Define Index Buffers ... - DefineBuffers(); - - // - // Set Indicator ShortName ... - SetIndicatorName(); - - // - // Init Succeed ... - return INIT_SUCCEEDED; -} - -// -// DeInitialization ... -void OnDeinit(const int reason) -{ - // - // REASON_PROGRAM 0 The EA has stopped working calling the ExpertRemove() function - // REASON_REMOVE 1 Program removed from a chart - // REASON_RECOMPILE 2 Program recompiled - // REASON_CHARTCHANGE 3 A symbol or a chart period is changed - // REASON_CHARTCLOSE 4 Chart closed - // REASON_PARAMETERS 5 Inputs changed by a user - // REASON_ACCOUNT 6 Another account has been activated or reconnection to the trade server has occurred due to changes in the account settings - // REASON_TEMPLATE 7 Another chart template applied - // REASON_INITFAILED 8 The OnInit() handler returned a non-zero value - // REASON_CLOSE 9 Terminal closed - - // - // Here we can handle De Initialization Reasons ... - IndicatorRelease(fiHandler); -} - -// -// Calculations ... -// -// 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[]) -{ - // - // Prepare Buffers ... - ArraySetAsSeries(time, true); - ArraySetAsSeries(open, true); - ArraySetAsSeries(high, true); - ArraySetAsSeries(low, true); - ArraySetAsSeries(close, true); - ArraySetAsSeries(tick_volume, true); - ArraySetAsSeries(volume, true); - ArraySetAsSeries(spread, true); - - // - // this counts Available Bars ... - int limit; - - // - // because in some cases we may have more than one input for - // calculation and we must prevent any calculation - // untill we pass the biggest input length, here we get max Input length - // and then wait until pass it ... - int maxLength = MathMax(0, length); - - // - // Check Calculated Bars ... - int fiCalculatedBars = BarsCalculated(fiHandler); - if (fiCalculatedBars < maxLength) - { - return prev_calculated; - } - - // - limit = (prev_calculated > rates_total || prev_calculated <= 0) ? rates_total : (rates_total - prev_calculated) + 1; - - // - // Buffers Copy ... - int copiedFis = CopyBuffer(fiHandler, 0, 0, limit, fiBuffer); - if (copiedFis <= 0) - { - return prev_calculated; - } - - // - // Main Loop ... - for (int i = 0; i < limit && !IsStopped(); i++) - { - // - CalculateBuffers(i); - } - - // - return rates_total; -} -// -// END Event Handlers ... -// - -// -// START Functions ... -// -// -// Validate Input Args for Initialization ... -bool ValidateInputs() -{ - // - bool result = false; - - // - // Validate Args ... - if (length >= 2) - { - result = true; - } - - // - return result; -} - -// -// Define Indexes and Styles ... -void DefineBuffers() -{ - // - string fiBufferLabel = "XFI " + "(" + (string)length + ")"; - - // - // FI Buffer ... - ArraySetAsSeries(fiBuffer, true); - // SetIndexBuffer(fiBufferIndex, fiBuffer, INDICATOR_CALCULATIONS); - SetIndexBuffer(fiBufferIndex, fiBuffer, INDICATOR_DATA); - PlotIndexSetString(fiBufferIndex, PLOT_LABEL, fiBufferLabel); - - // - // FI Color Buffer ... - ArraySetAsSeries(fiColorBuffer, true); - SetIndexBuffer(fiColorBufferIndex, fiColorBuffer, INDICATOR_COLOR_INDEX); - // SetIndexBuffer(fiColorBufferIndex, fiColorBuffer, INDICATOR_CALCULATIONS); -} - -// -// Set Indicator Short Name and also we can define Buffers Labels ... -void SetIndicatorName() -{ - // - string indicatorShortName = ""; - StringConcatenate(indicatorShortName, ShortName, ""); - - // - IndicatorSetString(INDICATOR_SHORTNAME, indicatorShortName); -} - -// -// Calculate Buffers ... -void CalculateBuffers( - int bar_index // Selected Bar Index -) -{ - // - double iValue = fiBuffer[bar_index]; - - // - double iColorIndex = - iValue > 0 ? 0 : iValue < 0 ? 2 - : 1; - - // - // Set Buffer Color Index ... - fiColorBuffer[bar_index] = iColorIndex; -} -// -// END Functions ... -// diff --git a/Indicators/x-saherelm.xlh.mq5 b/Indicators/x-saherelm.xlh.mq5 deleted file mode 100644 index e06de55a..00000000 --- a/Indicators/x-saherelm.xlh.mq5 +++ /dev/null @@ -1,352 +0,0 @@ -/////////////////////////////////////////////////////// -// -// SaherElm IT Center MQL5 XLH Indicator -// --------------------------------------------- -// Name: XLH -// Description: Moving Average Indicator -// Market Analysor ... -// -// -// Maintainer: -// ------------ -// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) -// -////////////////////////////////////////////////////// -// -// Global Properties ... -#property copyright "Copyright 2023, SaherElm IT Center" -#property link "https://saherelm.ir" -#property version "1.00" -#property description "SaherElm XLH Indicator" -#property strict - -// -// START Constants ... -// -#define ShortName "XLH" -// -// END Constants ... -// - -// -// START Inputs ... -// -input int length = 14; // Length -input ENUM_SERIESMODE hhMode = MODE_HIGH; // Highest High Calculation Method -input ENUM_SERIESMODE llMode = MODE_LOW; // Lowest Low Calculation Method -// -// END Inputs ... -// - -// -// Includes Common Library ... -#include "../Libraries/x-saherelm.common.lib.mq5" - -// -// START Buffers ... -// -#property indicator_chart_window - -// -#property indicator_buffers 3 -#property indicator_plots 3 - -// -// HH Buffer ... -#define hhBufferIndex 0 - -// -double hhBuffer[]; - -// -#property indicator_label1 "XLH HH" -#property indicator_type1 DRAW_LINE -#property indicator_color1 CLR_NONE, // clrAqua -#property indicator_style1 STYLE_DOT -#property indicator_width1 1 - -// -// LL Buffer ... -#define llBufferIndex 1 - -// -double llBuffer[]; - -// -#property indicator_label2 "XLH LL" -#property indicator_type2 DRAW_LINE -#property indicator_color2 CLR_NONE, // clrFuchsia -#property indicator_style2 STYLE_DOT -#property indicator_width2 1 - -// -// Signal Buffer ... -#define signalBufferIndex 2 - -// -double signalBuffer[]; - -// -#property indicator_label3 "XLH S" -#property indicator_type3 DRAW_LINE -#property indicator_color3 CLR_NONE, // clrGold -#property indicator_style3 STYLE_DOT -#property indicator_width3 1 -// -// END Buffers ... -// - -// -// START Global Definitions: Variables, Properties and etc ... -// -// -// END Global Definitions: Variables, Properties and etc ... -// - -// -// START Event Handlers ... -// -// -// Initialization ... -int OnInit() -{ - // - // Validate Inputs ... - if (!ValidateInputs()) - { - return INIT_PARAMETERS_INCORRECT; - } - - // - // Define Index Buffers ... - DefineBuffers(); - - // - // Set Indicator ShortName ... - SetIndicatorName(); - - // - // Init Succeed ... - return INIT_SUCCEEDED; -} - -// -// DeInitialization ... -void OnDeinit(const int reason) -{ - // - // REASON_PROGRAM 0 The EA has stopped working calling the ExpertRemove() function - // REASON_REMOVE 1 Program removed from a chart - // REASON_RECOMPILE 2 Program recompiled - // REASON_CHARTCHANGE 3 A symbol or a chart period is changed - // REASON_CHARTCLOSE 4 Chart closed - // REASON_PARAMETERS 5 Inputs changed by a user - // REASON_ACCOUNT 6 Another account has been activated or reconnection to the trade server has occurred due to changes in the account settings - // REASON_TEMPLATE 7 Another chart template applied - // REASON_INITFAILED 8 The OnInit() handler returned a non-zero value - // REASON_CLOSE 9 Terminal closed - - // - // Here we can handle De Initialization Reasons ... -} - -// -// Calculations ... -// -// 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[]) -{ - // - // Prepare Buffers ... - ArraySetAsSeries(time, true); - ArraySetAsSeries(open, true); - ArraySetAsSeries(high, true); - ArraySetAsSeries(low, true); - ArraySetAsSeries(close, true); - ArraySetAsSeries(tick_volume, true); - ArraySetAsSeries(volume, true); - ArraySetAsSeries(spread, true); - - // - // this counts Available Bars ... - int limit; - - // - // because in some cases we may have more than one input for - // calculation and we must prevent any calculation - // untill we pass the biggest input length, here we get max Input length - // and then wait until pass it ... - int maxLength = MathMax(0, length); - - // - limit = (prev_calculated > rates_total || prev_calculated <= 0) ? rates_total : (rates_total - prev_calculated) + 1; - - // - // Main Loop ... - for (int i = limit - 1; i >= 0 && !IsStopped(); i--) - { - // - CalculateBuffers(i); - } - - // - return rates_total; -} -// -// END Event Handlers ... -// - -// -// START Functions ... -// -// -// Validate Input Args for Initialization ... -bool ValidateInputs() -{ - // - bool result = false; - - // - // Validate Args ... - if (length >= 2) - { - result = true; - } - - // - return result; -} - -// -// Define Indexes and Styles ... -void DefineBuffers() -{ - // - // HH Buffer ... - string hhBufferLabel = ShortName + " HH " + "(" + (string)length + ")"; - ArraySetAsSeries(hhBuffer, true); - SetIndexBuffer(hhBufferIndex, hhBuffer, INDICATOR_DATA); - PlotIndexSetInteger(hhBufferIndex, PLOT_DRAW_BEGIN, length); - PlotIndexSetString(hhBufferIndex, PLOT_LABEL, hhBufferLabel); - - // - // LL Buffer ... - string llBufferLabel = ShortName + " LL " + "(" + (string)length + ")"; - ArraySetAsSeries(llBuffer, true); - SetIndexBuffer(llBufferIndex, llBuffer, INDICATOR_DATA); - PlotIndexSetInteger(llBufferIndex, PLOT_DRAW_BEGIN, length); - PlotIndexSetString(llBufferIndex, PLOT_LABEL, llBufferLabel); - - // - // Signal Buffer ... - string signalBufferLabel = ShortName + " S " + "(" + (string)length + ")"; - ArraySetAsSeries(signalBuffer, true); - SetIndexBuffer(signalBufferIndex, signalBuffer, INDICATOR_DATA); - PlotIndexSetInteger(signalBufferIndex, PLOT_DRAW_BEGIN, length); - PlotIndexSetString(signalBufferIndex, PLOT_LABEL, signalBufferLabel); -} - -// -// Set Indicator Short Name and also we can define Buffers Labels ... -void SetIndicatorName() -{ - // - string indicatorShortName = ""; - StringConcatenate(indicatorShortName, ShortName, ""); - - // - IndicatorSetString(INDICATOR_SHORTNAME, indicatorShortName); -} - -// -// Calculate Buffers ... -void CalculateBuffers( - int bar_index // Selected Bar Index -) -{ - // - // Calculate Threshold ... - // - // HH Buffer ... - int hhIndex = iHighest( - _Symbol, - _Period, - hhMode, - length, - bar_index - // - ); - XOHCL hhBar; - hhBar.Init( - _Symbol, - _Period, - hhIndex - // - ); - double hhValue = hhBar.GetPrice(hhMode); - - // - hhBuffer[bar_index] = hhValue; - - // - // LL Buffer ... - int llIndex = iLowest( - _Symbol, - _Period, - llMode, - length, - bar_index - // - ); - XOHCL llBar; - llBar.Init( - _Symbol, - _Period, - llIndex - // - ); - double llValue = llBar.GetPrice(llMode); - - // - llBuffer[bar_index] = llValue; - - // - double lhDiff = hhValue - llValue; - double signalValue = (lhDiff / 2); - - // - signalBuffer[bar_index] = (hhValue - signalValue); -} -// -// END Functions ... -// diff --git a/Indicators/x-saherelm.xmidtest.mq5 b/Indicators/x-saherelm.xmidtest.mq5 deleted file mode 100644 index 1f563527..00000000 --- a/Indicators/x-saherelm.xmidtest.mq5 +++ /dev/null @@ -1,242 +0,0 @@ -/////////////////////////////////////////////////////// -// SaherElm IT Center MQL5 Indicator -// ------------------------------------------- -// Name: XMidTest -// Description: DONCHAIN Channel ... -// -// Maintainer: -// ------------ -// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) -// -////////////////////////////////////////////////////// -// -// Global Properties ... -#property copyright "Copyright 2023, SaherElm IT Center" -#property link "https://saherelm.ir" -#property version "1.00" -#property description "SaherElm XMidTest Indicator" -#property strict - -// -// Imports ... -#include "../Classes/Indicators/x-saherelm.mid.class.mq5" - -// -#define ShortName "XMidTest" - -// -#property indicator_chart_window - -// -#property indicator_buffers 1 -#property indicator_plots 1 - -// -// Variables ... -XSCMid *mMid; - -// -#property indicator_type1 DRAW_LINE -double mainBuffer[]; -double mainColorBuffer[]; - -// -// Initialization ... -int OnInit() -{ - // - // Initialize Indicator Class ... - bool isInited = InitIndicatorClass(); - if (!isInited) - { - return INIT_PARAMETERS_INCORRECT; - } - - // - // Define Index Buffers ... - DefineBuffers(); - - // - // Set Indicator ShortName ... - SetIndicatorName(); - - // - // Init Succeed ... - return INIT_SUCCEEDED; -} - -// -// DeInitialization ... -void OnDeinit(const int reason) -{ - // - // REASON_PROGRAM 0 The EA has stopped working calling the ExpertRemove() function - // REASON_REMOVE 1 Program removed from a chart - // REASON_RECOMPILE 2 Program recompiled - // REASON_CHARTCHANGE 3 A symbol or a chart period is changed - // REASON_CHARTCLOSE 4 Chart closed - // REASON_PARAMETERS 5 Inputs changed by a user - // REASON_ACCOUNT 6 Another account has been activated or reconnection to the trade server has occurred due to changes in the account settings - // REASON_TEMPLATE 7 Another chart template applied - // REASON_INITFAILED 8 The OnInit() handler returned a non-zero value - // REASON_CLOSE 9 Terminal closed - - // - mMid.DeInit(reason); - delete mMid; -} - -// -// Calculating what we want ... -int OnCalculate( - 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 ... -) -{ - // - // this counts Available Bars ... - int limit; - - // - // because in some cases we may have more than one input for - // calculation and we must prevent any calculation - // untill we pass the biggest input length, here we get max Input length - // and then wait until pass it ... - int maxLength = mMid.GetInputs().Max(); - - // - int midCalculatedBars = mMid.GetCalculatedBars(); - if (midCalculatedBars < 0) - { - return prev_calculated; - } - - // - limit = prev_calculated < maxLength ? rates_total - (maxLength + 1) : rates_total - prev_calculated; - - // - // Main Loop ... - for (int i = limit; i >= 0 && !IsStopped(); i--) - { - // - CalculateBuffers(i); - } - - // - return rates_total; -} - -// -// CUSTOM Functions ... - -// -// Validate Input Args for Initialization ... -bool InitIndicatorClass() -{ - // - bool result = false; - - // - // Initialize and Prepare - // Inputs of Indicator ... - XSCMidInputs inputs; - result = inputs.Init(2); - if (!result) - { - return result; - } - - // - // Instantiate Class ... - mMid = new XSCMid( - _Symbol, - _Period // - ); - - // - // Now Initialize Indicator Class using Given Inputs ... - result = mMid.Init( - inputs // - ); - - // - return result; -} - -// -// Define Indexes and Styles ... -void DefineBuffers() -{ - // - // Start Styling and Indexing Buffers ... - - // - int mainIDX = mMid.GetBufferIndex("XSCMid"); - XBuffer mainBufferStruct; - mMid.GetBuffer( - "XSCMid", - mainBufferStruct // - ); - - // - int bufferIndex = 0; - - // - int max = mMid.GetInputs().Max(); - - // - // mainBufferStruct.asSeries - // ArraySetAsSeries(mainBuffer, false); - - // - XBufferPlotStyle mainBufferStyle; - mainBufferStyle.clr = clrAqua; - mainBufferStyle.type = DRAW_LINE; - - // - SetIndexBuffer( - bufferIndex, - mainBuffer, - mainBufferStyle, - mainColorBuffer, - "XMID", - true, - 0, - max // - ); -} - -// -// Set Indicator Short Name and also we can define Buffers Labels ... -void SetIndicatorName() -{ - IndicatorSetString(INDICATOR_SHORTNAME, ShortName); -} - -// -void CalculateBuffers(int barIndex) -{ - // - double iValue = mMid.GetBufferValue( - "XSCMid", - barIndex // - ); - - // - // double iValue = iClose( - // _Symbol, - // _Period, - // barIndex // - // ); - - // - mainBuffer[barIndex] = iValue; -} \ No newline at end of file diff --git a/Indicators/x-saherelm.xobd.mq5 b/Indicators/x-saherelm.xobd.mq5 deleted file mode 100644 index 2865679a..00000000 --- a/Indicators/x-saherelm.xobd.mq5 +++ /dev/null @@ -1,392 +0,0 @@ -///////////////////////////////////////////////////////// -// -// SaherElm IT Center MQL5 OrderBlock Detector Indicator -// ----------------------------------------------------- -// Name: XOBD -// Description: detect Order Blocks based on Swings ... -// -// -// Maintainer: -// ------------ -// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) -// -////////////////////////////////////////////////////// -// -// Global Properties ... -#property copyright "Copyright 2023, SaherElm IT Center" -#property link "https://saherelm.ir" -#property version "1.00" -#property description "SaherElm XOBD Indicator" -#property strict - -// -// START Constants ... -// -#define ShortName "XOBD" -// -// END Constants ... -// - -// -// START Inputs ... -// -// -input int length = 5; // Swing Length - -// -input uchar swingHighArrowCode = 108; // Swing High Arrow Code -input color swingHighArrowColor = clrMagenta; // Swing High Arrow Color - -// -input uchar swingLowArrowCode = 108; // Swing Low Arrow Code -input color swingLowArrowColor = clrAqua; // Swing Low Arrow Color -// -// END Inputs ... -// - -// -// Include Common and Models Library ... -#include "../Libraries/x-saherelm.common.lib.mq5" - -// -// Include Draw Library ... -#include "../Libraries/x-saherelm.draw.lib.mq5" - -// -// START Buffers ... -// -#property indicator_chart_window - -// -#property indicator_buffers 1 -#property indicator_plots 0 - -// -#define swingBufferIndex 0 -double swingBuffer[]; -// -// END Buffers ... -// - -// -// START Global Definitions: Variables, Properties and etc ... -// -// -// END Global Definitions: Variables, Properties and etc ... -// - -// -// START Event Handlers ... -// -// -// Initialization ... -int OnInit() -{ - // - // Validate Inputs ... - if (!ValidateInputs()) - { - return INIT_PARAMETERS_INCORRECT; - } - - // - drawPrefix = ShortName; - - // - // Define Index Buffers ... - DefineBuffers(); - - // - // Set Indicator ShortName ... - SetIndicatorName(); - - // - // Init Succeed ... - return INIT_SUCCEEDED; -} - -// -// DeInitialization ... -void OnDeinit(const int reason) -{ - // - // REASON_PROGRAM 0 The EA has stopped working calling the ExpertRemove() function - // REASON_REMOVE 1 Program removed from a chart - // REASON_RECOMPILE 2 Program recompiled - // REASON_CHARTCHANGE 3 A symbol or a chart period is changed - // REASON_CHARTCLOSE 4 Chart closed - // REASON_PARAMETERS 5 Inputs changed by a user - // REASON_ACCOUNT 6 Another account has been activated or reconnection to the trade server has occurred due to changes in the account settings - // REASON_TEMPLATE 7 Another chart template applied - // REASON_INITFAILED 8 The OnInit() handler returned a non-zero value - // REASON_CLOSE 9 Terminal closed -} - -// -// Calculations ... -// -// 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[]) -{ - // - // Prepare Buffers ... - ArraySetAsSeries(time, true); - ArraySetAsSeries(open, true); - ArraySetAsSeries(high, true); - ArraySetAsSeries(low, true); - ArraySetAsSeries(close, true); - ArraySetAsSeries(tick_volume, true); - ArraySetAsSeries(volume, true); - ArraySetAsSeries(spread, true); - - // - // this counts Available Bars ... - int limit; - - // - // because in some cases we may have more than one input for - // calculation and we must prevent any calculation - // untill we pass the biggest input length, here we get max Input length - // and then wait until pass it ... - int maxLength = MathMax(0, length * 3); - - // - limit = prev_calculated < maxLength ? rates_total - (maxLength + 1) : rates_total - prev_calculated; - - // - // Main Loop ... - for (int i = limit; i >= 0 && !IsStopped(); i--) - { - // - CalculateBuffers(i); - } - - // - return rates_total; -} -// -// END Event Handlers ... -// - -// -// START Functions ... -// -// -// Validate Input Args for Initialization ... -bool ValidateInputs() -{ - // - bool result = false; - - // - // Validate Args ... - if (length >= 2) - { - result = true; - } - - // - return result; -} - -// -// Define Indexes and Styles ... -void DefineBuffers() -{ - // - ArraySetAsSeries(swingBuffer, true); - SetIndexBuffer(swingBufferIndex, swingBuffer, INDICATOR_CALCULATIONS); -} - -// -// Set Indicator Short Name and also we can define Buffers Labels ... -void SetIndicatorName() -{ - // - string indicatorShortName = ""; - StringConcatenate(indicatorShortName, ShortName, " ", "( ", length, " )"); - - // - IndicatorSetString(INDICATOR_SHORTNAME, indicatorShortName); -} - -// -// Calculate Buffers ... -void CalculateBuffers(int bar_index) -{ - // - // GetCandleSwing(bar_index); - ENUM_X_SWING_TYPE type = X_NO_SWING; - - // - // Try To Detect Order Blocks ... - bool isSwingLow = false; - bool isSwingHigh = false; - - // - // Reading Candles Data ... - int start = bar_index; - int count = (length * 2) + 2; - int end = start + count; - XOHCL bars[]; - GetBars( - bars, - _Symbol, - _Period, - start, - count - // - ); - - // - // Swing Low ... - isSwingLow = - // - bars[1].close > bars[2].close && - bars[2].close > bars[3].close && - // - bars[3].close < bars[4].close && - // - bars[5].close > bars[4].close && - bars[6].close > bars[5].close - // - ; - - // - if (isSwingLow) - { - type = X_SWING_LOW; - } - - // - if (!isSwingLow) - { - // - // Swing High ... - isSwingHigh = - // - bars[1].close < bars[2].close && - bars[2].close < bars[3].close && - // - bars[3].close > bars[4].close && - // - bars[5].close < bars[4].close && - bars[6].close < bars[5].close - // - ; - - // - if (isSwingHigh) - { - type = X_SWING_HIGH; - } - } - - // - switch (type) - { - // - // Swing High ... - case X_SWING_HIGH: - // - swingBuffer[bar_index] = type; - DrawSwingArrow(1, bar_index); - break; - - // - // Swinmg Low ... - case X_SWING_LOW: - // - swingBuffer[bar_index] = type; - DrawSwingArrow(0, bar_index); - break; - - // - // No Swing ... - default: - case X_NO_SWING: - // - swingBuffer[bar_index] = 0; - break; - } -} - -// -// Draw a Swing Arrow Shape ... -void DrawSwingArrow( - int type, // Swing Type: 0 - Low / 1 - High ... - int bar_index // -) -{ - // - bool isSwingHigh = type == 1; - - // - if ((isSwingHigh && swingHighArrowCode == 0) || - (!isSwingHigh && swingLowArrowCode == 0)) - { - return; - } - - XOHCL candle; - candle.Init( - _Symbol, - _Period, - bar_index + 3); - double arrowDistanceInPoint = 0; - - // - // Define Required Object Properties fro Draw an Arrow ... - datetime time = iTime(_Symbol, _Period, bar_index + 3); - double purePrice = isSwingHigh ? candle.high : candle.low; - color clr = isSwingHigh ? swingHighArrowColor : swingLowArrowColor; - ENUM_ARROW_ANCHOR anchor = isSwingHigh ? ANCHOR_BOTTOM : ANCHOR_TOP; - uchar arrowCode = uchar(isSwingHigh ? swingHighArrowCode : swingLowArrowCode); - double price = isSwingHigh ? purePrice + arrowDistanceInPoint : purePrice - arrowDistanceInPoint; - string name = "Swing " + (isSwingHigh ? "High" : "Low") + "_" + (string)time + "_" + (string)purePrice; - - // - // Draw desired Arrow ... - DrawArrow( - 0, - name, - 0, - time, - price, - arrowCode, - anchor, - clr); -} -// -// END Functions ... -// diff --git a/Indicators/x-saherelm.xrsi.mq5 b/Indicators/x-saherelm.xrsi.mq5 deleted file mode 100644 index f581113c..00000000 --- a/Indicators/x-saherelm.xrsi.mq5 +++ /dev/null @@ -1,394 +0,0 @@ -///////////////////////////////////////////////////////// -// -// SaherElm IT Center MQL5 OrderBlock Detector Oscillator -// ------------------------------------------------------ -// Name: XRSI -// Description: detect market conditions based on RSI ... -// -// -// Maintainer: -// ------------ -// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) -// -////////////////////////////////////////////////////// -// -// Global Properties ... -#property copyright "Copyright 2023, SaherElm IT Center" -#property link "https://saherelm.ir" -#property version "1.00" -#property description "SaherElm XRSI Oscillator" -#property strict - -// -// START Constants ... -// - -#define ShortName "XRSI" - -// -// END Constants ... -// - -// -// START Inputs ... -// - -// -input group "Market"; -input int length = 14; // Market Length -input ENUM_APPLIED_PRICE appliedTo = PRICE_CLOSE; // Applied To - -// -input group "Short Entry"; -input double shortEntryValue = 70; // Short Entry Level -input color shortEntryColor = clrRed; // Short Entry Level Color -input ENUM_LINE_STYLE shortEntryLineStyle = STYLE_DOT; // Short Entry Style - -// -input group "Short Exit"; -input double shortExitValue = 40; // Short Exit Level -input color shortExitColor = clrRed; // Short Exit Level Color -input ENUM_LINE_STYLE shortExitLineStyle = STYLE_DOT; // Short Exit Style - -// -input group "Long Entry"; -input double longEntryValue = 30; // Long Entry Level -input color longEntryColor = clrRed; // Long Entry Level Color -input ENUM_LINE_STYLE longEntryLineStyle = STYLE_DOT; // Long Entry Style - -// -input group "Long Exit"; -input double longExitValue = 60; // Long Exit Level -input color longExitColor = clrRed; // Long Exit Level Color -input ENUM_LINE_STYLE longExitLineStyle = STYLE_DOT; // Long Exit Style - -// -// START Inputs ... -// - -// -// Include Common and Models Library ... -#include "../Libraries/x-saherelm.common.lib.mq5" - -// -// START Buffers ... -// - -// -// #property indicator_separate_window -#property indicator_chart_window -#property indicator_buffers 2 -// #property indicator_plots 1 -#property indicator_plots 0 - -// -#define rsiBufferIndex 0 -#define rsiColorBufferIndex 1 - -// -double rsiBuffer[]; -double rsiColorBuffer[]; - -// -// #property indicator_label1 "XRSI" -// #property indicator_type1 DRAW_COLOR_LINE -// #property indicator_color1 clrAqua, clrGray, clrFuchsia -// #property indicator_style1 STYLE_DOT -// #property indicator_width1 1 - -// -// END Buffers ... -// - -// -// START Global Definitions: Variables, Properties and etc ... -// - -// -int rsiHandler = INVALID_HANDLE; - -// -// END Global Definitions: Variables, Properties and etc ... -// - -// -// START Event Handlers ... -// -// -// Initialization ... -int OnInit() -{ - // - // Validate Inputs ... - if (!ValidateInputs()) - { - return INIT_PARAMETERS_INCORRECT; - } - - // - rsiHandler = iRSI( - _Symbol, - _Period, - length, - appliedTo); - if (rsiHandler == INVALID_HANDLE) - { - return INIT_FAILED; - } - - // - // Define Index Buffers ... - DefineBuffers(); - - // - // Set Indicator ShortName ... - SetIndicatorName(); - - // - // Init Succeed ... - return INIT_SUCCEEDED; -} - -// -// DeInitialization ... -void OnDeinit(const int reason) -{ - // - // REASON_PROGRAM 0 The EA has stopped working calling the ExpertRemove() function - // REASON_REMOVE 1 Program removed from a chart - // REASON_RECOMPILE 2 Program recompiled - // REASON_CHARTCHANGE 3 A symbol or a chart period is changed - // REASON_CHARTCLOSE 4 Chart closed - // REASON_PARAMETERS 5 Inputs changed by a user - // REASON_ACCOUNT 6 Another account has been activated or reconnection to the trade server has occurred due to changes in the account settings - // REASON_TEMPLATE 7 Another chart template applied - // REASON_INITFAILED 8 The OnInit() handler returned a non-zero value - // REASON_CLOSE 9 Terminal closed - - // - // Here we can handle De Initialization Reasons ... - - // - IndicatorRelease(rsiHandler); -} - -// -// Calculations ... -// -// 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[]) -{ - // - // Prepare Buffers ... - ArraySetAsSeries(time, true); - ArraySetAsSeries(open, true); - ArraySetAsSeries(high, true); - ArraySetAsSeries(low, true); - ArraySetAsSeries(close, true); - ArraySetAsSeries(tick_volume, true); - ArraySetAsSeries(volume, true); - ArraySetAsSeries(spread, true); - - // - // this counts Available Bars ... - int limit; - - // - // because in some cases we may have more than one input for - // calculation and we must prevent any calculation - // untill we pass the biggest input length, here we get max Input length - // and then wait until pass it ... - int maxLength = MathMax(0, length); - - // - int rsiCalculatedBars = BarsCalculated(rsiHandler); - if (rsiCalculatedBars < maxLength) - { - return prev_calculated; - } - - // - limit = prev_calculated < maxLength ? rates_total - (maxLength + 1) : rates_total - prev_calculated; - - // - int rsiCopiedItems = CopyBuffer(rsiHandler, 0, 0, limit, rsiBuffer); - if (rsiCopiedItems <= 0) - { - return prev_calculated; - } - - // - // Main Loop ... - for (int i = limit - 1; i >= 0 && !IsStopped(); i--) - { - CalculateBuffers(i); - } - - // - return rates_total; -} -// -// END Event Handlers ... -// - -// -// START Functions ... -// -// -// Validate Input Args for Initialization ... -bool ValidateInputs() -{ - // - bool result = false; - - // - // Validate Args ... - if (length >= 2) - { - result = true; - } - - // - return result; -} - -// -// Define Indexes and Styles ... -void DefineBuffers() -{ - // - // RSI ... - string rsiBufferLabel = ShortName + " (" + (string)length + ")"; - ArraySetAsSeries(rsiBuffer, true); - SetIndexBuffer(rsiBufferIndex, rsiBuffer, INDICATOR_CALCULATIONS); - // SetIndexBuffer(rsiBufferIndex, rsiBuffer, INDICATOR_DATA); - // PlotIndexSetInteger(rsiBufferIndex, PLOT_DRAW_BEGIN, length); - // PlotIndexSetString(rsiBufferIndex, PLOT_LABEL, rsiBufferLabel); - - // // - // // RSI Color Buffer ... - ArraySetAsSeries(rsiColorBuffer, true); - SetIndexBuffer(rsiColorBufferIndex, rsiColorBuffer, INDICATOR_CALCULATIONS); - // SetIndexBuffer(rsiColorBufferIndex, rsiColorBuffer, INDICATOR_COLOR_INDEX); - - // - // Set Indicator Levels here ... - // OB, ExitLong, ExitShort, OS ... - IndicatorSetInteger(INDICATOR_LEVELS, 4); - - // - // SHORTENTRY ... - IndicatorSetDouble(INDICATOR_LEVELVALUE, 0, shortEntryValue); - IndicatorSetInteger(INDICATOR_LEVELCOLOR, 0, shortEntryColor); - IndicatorSetInteger(INDICATOR_LEVELSTYLE, 0, shortEntryLineStyle); - IndicatorSetString(INDICATOR_LEVELTEXT, 0, "Short Entry"); - - // - // LONGEXIT ... - IndicatorSetDouble(INDICATOR_LEVELVALUE, 1, longExitValue); - IndicatorSetInteger(INDICATOR_LEVELCOLOR, 1, longExitColor); - IndicatorSetInteger(INDICATOR_LEVELSTYLE, 1, shortExitLineStyle); - IndicatorSetString(INDICATOR_LEVELTEXT, 1, "Long Exit"); - - // - // SHORTEXIT ... - IndicatorSetDouble(INDICATOR_LEVELVALUE, 2, shortExitValue); - IndicatorSetInteger(INDICATOR_LEVELCOLOR, 2, shortExitColor); - IndicatorSetInteger(INDICATOR_LEVELSTYLE, 2, longEntryLineStyle); - IndicatorSetString(INDICATOR_LEVELTEXT, 2, "Short Exit"); - - // - // LONGENTRY ... - IndicatorSetDouble(INDICATOR_LEVELVALUE, 3, longEntryValue); - IndicatorSetInteger(INDICATOR_LEVELCOLOR, 3, longEntryColor); - IndicatorSetInteger(INDICATOR_LEVELSTYLE, 3, longExitLineStyle); - IndicatorSetString(INDICATOR_LEVELTEXT, 3, "Long Entry"); - - // - // Set Maximum and Minimum for subwindow - IndicatorSetInteger(INDICATOR_DIGITS, 2); - IndicatorSetDouble(INDICATOR_MINIMUM, 0); - IndicatorSetDouble(INDICATOR_MAXIMUM, 100); -} - -// -// Set Indicator Short Name and also we can define Buffers Labels ... -void SetIndicatorName() -{ - // - string indicatorShortName = ""; - StringConcatenate(indicatorShortName, ShortName, " ", "( ", length, " )"); - - // - IndicatorSetString(INDICATOR_SHORTNAME, indicatorShortName); -} - -// -// Calculate Buffers ... -void CalculateBuffers(int bar_index) -{ - // - double iValue = rsiBuffer[bar_index]; - - // - double iColorIndex = 0; - - // - if ( - iValue >= shortEntryValue || - iValue <= longEntryValue || - (iValue < longExitValue && - iValue > shortExitValue)) - { - iColorIndex = 0; - } - else if ( - iValue <= shortEntryValue && - iValue >= longExitValue) - { - iColorIndex = 2; - } - else if ( - iValue < shortExitValue && - iValue > longEntryValue) - { - iColorIndex = 1; - } - - // - rsiColorBuffer[bar_index] = iColorIndex; -} - -// -// END Functions ... -// diff --git a/Indicators/x-saherelm.xts.mq5 b/Indicators/x-saherelm.xts.mq5 deleted file mode 100644 index e4b7e3a5..00000000 --- a/Indicators/x-saherelm.xts.mq5 +++ /dev/null @@ -1,548 +0,0 @@ -/////////////////////////////////////////////////////// -// -// SaherElm IT Center MQL5 XTS Oscillator -// --------------------------------------------- -// Name: XTS -// Description: Time Sections Oscillator ... -// -// -// Maintainer: -// ------------ -// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com) -// -////////////////////////////////////////////////////// -// -// Global Properties ... -#property copyright "Copyright 2023, SaherElm IT Center" -#property link "https://saherelm.ir" -#property version "1.00" -#property description "SaherElm XTS Oscillator" -#property strict - -// -// START Constants ... -// - -// -#define ShortName "XTS" - -// -// Includes Draw Library ... -#include "../Libraries/x-saherelm.draw.lib.mq5" - -// -// Includes Common Library ... -#include "../Libraries/x-saherelm.common.lib.mq5" - -// -// END Constants ... -// - -// -// START Inputs ... -// -input group "Current Period"; -input ENUM_APPLIED_PRICE currentAppliedTo = PRICE_CLOSE; // Current Applied To -// -input group "Nearest Period"; -input ENUM_X_PERIOD_METHOD nearestMethod = X_PERIOD_AUTO; // How to Find Nearest Period -input ENUM_TIMEFRAMES nearestPeriod = NULL; // Nearest Time Frame -input ENUM_APPLIED_PRICE nearestAppliedTo = PRICE_CLOSE; // Nearest Applied To -// -input group "Mediest Period"; -input ENUM_X_PERIOD_METHOD mediestMethod = X_PERIOD_AUTO; // How to Find Mediest Period -input ENUM_TIMEFRAMES mediestPeriod = NULL; // Mediest Time Frame -input ENUM_APPLIED_PRICE mediestAppliedTo = PRICE_CLOSE; // Mediest Applied To -// -input group "Farest Period"; -input ENUM_X_PERIOD_METHOD farestMethod = X_PERIOD_AUTO; // How to Find Farest Period -input ENUM_TIMEFRAMES farestPeriod = NULL; // Farest Time Frame -input ENUM_APPLIED_PRICE farestAppliedTo = PRICE_CLOSE; // Farest Applied To - -// -// START Buffers ... -// -// #property indicator_separate_window -#property indicator_chart_window - -// -#property indicator_buffers 4 -// #property indicator_plots 4 -#property indicator_plots 0 - -// -// Current ... -#define currentBufferIndex 0 - -double currentBuffer[]; - -// #property indicator_label1 "XTS C" -// #property indicator_type1 DRAW_LINE -// #property indicator_color1 clrBrown -// #property indicator_style1 STYLE_SOLID -// #property indicator_width1 1 - -// -// Nearest ... -#define nearestBufferIndex 1 - -double nearestBuffer[]; - -// #property indicator_label2 "XTS N" -// #property indicator_type2 DRAW_LINE -// #property indicator_color2 clrAqua -// #property indicator_style2 STYLE_SOLID -// #property indicator_width2 1 - -// -// Mediest ... -#define mediestBufferIndex 2 - -double mediestBuffer[]; - -// #property indicator_label3 "XTS M" -// #property indicator_type3 DRAW_LINE -// #property indicator_color3 clrLime -// #property indicator_style3 STYLE_SOLID -// #property indicator_width3 1 - -// -// Farest ... -#define farestBufferIndex 3 - -double farestBuffer[]; - -// #property indicator_label4 "XTS F" -// #property indicator_type4 DRAW_LINE -// #property indicator_color4 clrLightBlue -// #property indicator_style4 STYLE_SOLID -// #property indicator_width4 1 - -// -// END Buffers ... -// - -// -// START Global Definitions: Variables, Properties and etc ... -// - -// -ENUM_TIMEFRAMES mNearestPeriod = NULL; -ENUM_TIMEFRAMES mMediestPeriod = NULL; -ENUM_TIMEFRAMES mFarestPeriod = NULL; - -// -// END Global Definitions: Variables, Properties and etc ... -// - -// -// START Event Handlers ... -// - -// -// Initialization ... -int OnInit() -{ - // - // Validate Inputs ... - if (!ValidateInputs()) - { - return INIT_PARAMETERS_INCORRECT; - } - - // - drawPrefix = ShortName; - - // - // Define Index Buffers ... - DefineBuffers(); - - // - // Set Oscillator ShortName ... - SetOscillatorName(); - - // - // Init Succeed ... - return INIT_SUCCEEDED; -} - -// -// DeInitialization ... -void OnDeinit(const int reason) -{ - // Comment(""); -} - -// -// Calculations ... -// -// 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[]) -{ - // - // Prepare Buffers ... - ArraySetAsSeries(time, true); - ArraySetAsSeries(open, true); - ArraySetAsSeries(high, true); - ArraySetAsSeries(low, true); - ArraySetAsSeries(close, true); - ArraySetAsSeries(tick_volume, true); - ArraySetAsSeries(volume, true); - ArraySetAsSeries(spread, true); - - // - // this counts Available Bars ... - int limit; - - // - // because in some cases we may have more than one input for - // calculation and we must prevent any calculation - // untill we pass the biggest input length, here we get max Input length - // and then wait until pass it ... - int maxLength = 30; - - // - limit = (prev_calculated > rates_total || prev_calculated <= 0) ? rates_total : (rates_total - prev_calculated) + 1; - - // - // Main Loop ... - for (int i = 0; i < limit && !IsStopped(); i++) - { - // - // Do Buffers Calculation ... - CalculateBuffers(i); - } - - // - return rates_total; -} - -// -// END Event Handlers ... -// - -// -// START Functions ... -// -// -// Validate Input Args for Initialization ... -bool ValidateInputs() -{ - // - bool result = true; - - // - return result; -} - -// -// Define Indexes and Styles ... -void DefineBuffers() -{ - // - int maxLength = 30; - - // - // Current ... - ArraySetAsSeries(currentBuffer, true); - SetIndexBuffer(currentBufferIndex, currentBuffer, INDICATOR_CALCULATIONS); - // SetIndexBuffer(currentBufferIndex, currentBuffer, INDICATOR_DATA); - // PlotIndexSetInteger(currentBufferIndex, PLOT_DRAW_BEGIN, maxLength); - - // - // Nearest ... - ArraySetAsSeries(nearestBuffer, true); - SetIndexBuffer(nearestBufferIndex, nearestBuffer, INDICATOR_CALCULATIONS); - // SetIndexBuffer(nearestBufferIndex, nearestBuffer, INDICATOR_DATA); - // PlotIndexSetInteger(nearestBufferIndex, PLOT_DRAW_BEGIN, maxLength); - - // - // Mediest ... - ArraySetAsSeries(mediestBuffer, true); - SetIndexBuffer(mediestBufferIndex, mediestBuffer, INDICATOR_CALCULATIONS); - // SetIndexBuffer(mediestBufferIndex, mediestBuffer, INDICATOR_DATA); - // PlotIndexSetInteger(mediestBufferIndex, PLOT_DRAW_BEGIN, maxLength); - - // - // Farest ... - ArraySetAsSeries(farestBuffer, true); - SetIndexBuffer(farestBufferIndex, farestBuffer, INDICATOR_CALCULATIONS); - // SetIndexBuffer(farestBufferIndex, farestBuffer, INDICATOR_DATA); - // PlotIndexSetInteger(farestBufferIndex, PLOT_DRAW_BEGIN, maxLength); -} - -// -// Set Oscillator Short Name and also we can define Buffers Labels ... -void SetOscillatorName() -{ - IndicatorSetString(INDICATOR_SHORTNAME, ShortName); -} - -// -// Calculate Buffers ... -void CalculateBuffers(int bar_index) -{ - // - // Current ... - CalculateCurrent(bar_index); - - // - // Nearest ... - CalculateNearest(bar_index); - - // - // Mediest ... - CalculateMediest(bar_index); - - // - // Farest ... - CalculateFarest(bar_index); - - // - // Commenting ... - // string comment = GenerateDescriptionComment(); - // Comment(comment); -} - -// -// Current ... -void CalculateCurrent(int bar_index) -{ - // - datetime barTime = iTime( - _Symbol, - _Period, - bar_index); - datetime startTime = GetPeriodStartTime( - _Symbol, - _Period, - barTime); - int startBarIndex = iBarShift( - _Symbol, - _Period, - startTime); - - // - XOHCL c; - c.Init( - _Symbol, - _Period, - startBarIndex - // - ); - - // - double value = c.GetPrice(currentAppliedTo); - - // - currentBuffer[bar_index] = value; -} - -// -// Nearest ... -void CalculateNearest(int bar_index) -{ - // - if (mNearestPeriod == NULL) - { - // - switch (nearestMethod) - { - // - case X_PERIOD_AUTO: - mNearestPeriod = GetNearestPeriod(_Period); - break; - - // - case X_PERIOD_NOTHING: - case X_PERIOD_MANUALLY: - mNearestPeriod = nearestPeriod; - break; - } - } - - // - datetime barTime = iTime( - _Symbol, - _Period, - bar_index); - datetime startTime = GetPeriodStartTime( - _Symbol, - mNearestPeriod, - barTime); - int startBarIndex = iBarShift( - _Symbol, - _Period, - startTime); - - // - XOHCL c; - c.Init( - _Symbol, - _Period, - startBarIndex - // - ); - - // - double value = c.GetPrice(nearestAppliedTo); - - // - nearestBuffer[bar_index] = value; -} - -// -// Mediest ... -void CalculateMediest(int bar_index) -{ - // - if (mMediestPeriod == NULL) - { - // - switch (mediestMethod) - { - // - case X_PERIOD_AUTO: - mMediestPeriod = GetMediestPeriod(_Period); - break; - - // - case X_PERIOD_NOTHING: - case X_PERIOD_MANUALLY: - mMediestPeriod = mediestPeriod; - break; - } - } - - // - datetime barTime = iTime( - _Symbol, - _Period, - bar_index); - datetime startTime = GetPeriodStartTime( - _Symbol, - mMediestPeriod, - barTime); - int startBarIndex = iBarShift( - _Symbol, - _Period, - startTime); - - // - XOHCL c; - c.Init( - _Symbol, - _Period, - startBarIndex - // - ); - - // - double value = c.GetPrice(mediestAppliedTo); - - // - mediestBuffer[bar_index] = value; -} - -// -// Farest ... -void CalculateFarest(int bar_index) -{ - // - if (mFarestPeriod == NULL) - { - // - switch (farestMethod) - { - // - case X_PERIOD_AUTO: - mFarestPeriod = GetLongestPeriod(_Period); - break; - - // - case X_PERIOD_NOTHING: - case X_PERIOD_MANUALLY: - mFarestPeriod = farestPeriod; - break; - } - } - - // - datetime barTime = iTime( - _Symbol, - _Period, - bar_index); - datetime startTime = GetPeriodStartTime( - _Symbol, - mFarestPeriod, - barTime); - int startBarIndex = iBarShift( - _Symbol, - _Period, - startTime); - - // - XOHCL c; - c.Init( - _Symbol, - _Period, - startBarIndex - // - ); - - // - double value = c.GetPrice(farestAppliedTo); - - // - farestBuffer[bar_index] = value; -} - -// -// Generate Comment ... -string GenerateDescriptionComment() -{ - // - string result = ""; - - // - result += "Nearest : " + EnumToString(mNearestPeriod) + "\n"; - result += "Mediest : " + EnumToString(mMediestPeriod) + "\n"; - result += "Farest : " + EnumToString(mFarestPeriod) + "\n"; - - // - return result; -} - -// -// END Functions ... -// diff --git a/Libraries/x-saherelm.xtrade.lib.mq5 b/Libraries/x-saherelm.xtrade.lib.mq5 index 4d82435a..c721199d 100644 --- a/Libraries/x-saherelm.xtrade.lib.mq5 +++ b/Libraries/x-saherelm.xtrade.lib.mq5 @@ -97,19 +97,6 @@ enum ENUM_X_SIGNAL_EXECUTION_RESULT X_SIGNAL_EXECUTION_FAILED_INVALID_PARAMS, // Invalid Params }; -// -// How to Manage Signal TP and SL ... -enum ENUM_X_SIGNAL_MANAGING_ACTIONS -{ - // - X_SIGNAL_USE_NOTHING, // Use 0 index if exists and ignore if not - X_SIGNAL_USE_MAX, // Use Max Value - X_SIGNAL_USE_MIN, // Use Min Value - X_SIGNAL_PARTIAL_CLOSE, // Use Max as Regular but Partial Close at each Step - X_SIGNAL_TRAIL, // Use 0 index as SL and Trail Stop on TP Levels - X_SIGNAL_PARTIAL_TRAIL, // Use 0 index as SL and Trail Stop on TP Levels and also Partial Close on TP Levels -}; - // // Available Guard Action ... enum ENUM_X_GUARD_ACTIONS @@ -387,6 +374,66 @@ struct XPosition return result; } + // + // Find Risk ... + double GetRisk() + { + // + double result = 0; + + // + if (!IsValid()) + { + return 0; + } + + // + result = MathAbs(entry - sl); + + // + return result; + } + + // + // Find Reward ... + double GetReward() + { + // + double result = 0; + + // + if (!IsValid()) + { + return result; + } + + // + result = MathAbs(tp - entry); + + // + return result; + } + + // + // Find Risk Reward Ratio ... + double GetRiskRewardRatio() + { + // + double result = 0; + + // + if (!IsValid()) + { + return result; + } + + // + result = GetReward() / GetRisk(); + + // + return result; + } + // // Calculate Age ... int GetAge( @@ -513,22 +560,20 @@ struct XSignal // ulong positionId; // if Executed this filled ... - double entry; // Exntry or Execution Price ... - double volume; // Position Volume ... // datetime time; // Issue Time ... // - ENUM_X_SIGNAL_MANAGING_ACTIONS action; // Signal Managing Action ... - - double tps[]; // a Collection of TP(s) ... - double sls[]; // a Collection of SL(s) ... + double tp; // Take Profit ... + double sl; // Stop Loss ... + double entry; // Exntry or Execution Price ... + double volume; // Position Volume ... // string symbol; // Trading Symbol ... - string provider; // Signaller ... string comment; // Comment ... + string provider; // Signaller ... // ENUM_TIMEFRAMES period; // Trading TimeFrame ... @@ -536,8 +581,7 @@ struct XSignal ENUM_X_ORDER_MODES mode; // Execution Mode ... // - XSignal supports[]; // a Collecion of Support Signals ... - XOHCLSupRes supportResistances; // Support and Resistances ... + XSignal supports[]; // a Collecion of Support Signals ... // // Constructor ... @@ -546,66 +590,17 @@ struct XSignal Clean(); } - // - // DO All Calculations and Normalizations ... - bool Normalize() - { - // - bool result = false; - - // - // Normalizations ... - symbol = NormalizeSymbol(symbol); - period = NormalizePeriod(period); - - // - entry = NormalizePrice(entry, symbol); - volume = NormalizeVolume(volume, symbol); - - // - time = NormalizeTime(time); - - // - int slsCount = ArraySize(sls); - if (slsCount > 0) - { - // - for (int i = 0; i < slsCount; i++) - { - sls[i] = NormalizePrice(sls[i], symbol); - } - } - - // - int tpsCount = ArraySize(tps); - if (tpsCount > 0) - { - // - for (int i = 0; i < tpsCount; i++) - { - tps[i] = NormalizePrice(tps[i], symbol); - } - } - - // - result = IsValid(); - - // - return result; - } - // bool Prepare( - string mSymbol, // Trading Symbol - string mProvider, // Signal Provider - ENUM_TIMEFRAMES mPeriod, // Trading TimeFrame - ENUM_POSITION_TYPE mType, // Long (Buy) or Short (Sell) - ENUM_X_ORDER_MODES mMode, // Execution Mode - double mEntry, // Entry Price - double mVolume, // Volume - ENUM_X_SIGNAL_MANAGING_ACTIONS mAction = X_SIGNAL_USE_NOTHING, // Signal Management Action - double sl = 0, // Stop Loss - double tp = 0 // Take Profit + string mSymbol, // Trading Symbol + string mProvider, // Signal Provider + ENUM_TIMEFRAMES mPeriod, // Trading TimeFrame + ENUM_POSITION_TYPE mType, // Long (Buy) or Short (Sell) + ENUM_X_ORDER_MODES mMode, // Execution Mode + double mEntry, // Entry Price + double mVolume, // Volume + double mSL = 0, // Stop Loss + double mTP = 0 // Take Profit ) { // @@ -628,21 +623,15 @@ struct XSignal } // - if (tp < 0) + if (mTP < 0) { - tp = 0; + mTP = 0; } // - if (sl < 0) + if (mSL < 0) { - sl = 0; - } - - // - if (tp == 0 && sl == 0) - { - action = X_SIGNAL_USE_NOTHING; + mSL = 0; } // @@ -654,8 +643,8 @@ struct XSignal // // Normalization Values ... - sl = NormalizePrice(sl, mSymbol); - tp = NormalizePrice(tp, mSymbol); + sl = NormalizePrice(mSL, mSymbol); + tp = NormalizePrice(mTP, mSymbol); mEntry = NormalizePrice(mEntry, mSymbol); mVolume = NormalizeVolume(mVolume, mSymbol); @@ -663,23 +652,6 @@ struct XSignal entry = mEntry; volume = mVolume; - // - action = mAction; - - // - Add( - sl, - sls - // - ); - - // - Add( - tp, - tps - // - ); - // result = Normalize(); @@ -689,15 +661,14 @@ struct XSignal // bool PrepareLong( - string mSymbol, // Trading Symbol - string mProvider, // Signal Provider - ENUM_TIMEFRAMES mPeriod, // Trading TimeFrame - ENUM_X_ORDER_MODES mMode, // Execution Mode - double mEntry, // Entry Price - double mVolume, // Volume - ENUM_X_SIGNAL_MANAGING_ACTIONS mAction = X_SIGNAL_USE_NOTHING, // Signal Management Action - double sl = 0, // Stop Loss - double tp = 0 // Take Profit + string mSymbol, // Trading Symbol + string mProvider, // Signal Provider + ENUM_TIMEFRAMES mPeriod, // Trading TimeFrame + ENUM_X_ORDER_MODES mMode, // Execution Mode + double mEntry, // Entry Price + double mVolume, // Volume + double mSL = 0, // Stop Loss + double mTP = 0 // Take Profit ) { // @@ -709,24 +680,22 @@ struct XSignal mMode, mEntry, mVolume, - mAction, - sl, - tp + mSL, + mTP // ); } // bool PrepareShort( - string mSymbol, // Trading Symbol - string mProvider, // Signal Provider - ENUM_TIMEFRAMES mPeriod, // Trading TimeFrame - ENUM_X_ORDER_MODES mMode, // Execution Mode - double mEntry, // Entry Price - double mVolume, // Volume - ENUM_X_SIGNAL_MANAGING_ACTIONS mAction = X_SIGNAL_USE_NOTHING, // Signal Management Action - double sl = 0, // Stop Loss - double tp = 0 // Take Profit + string mSymbol, // Trading Symbol + string mProvider, // Signal Provider + ENUM_TIMEFRAMES mPeriod, // Trading TimeFrame + ENUM_X_ORDER_MODES mMode, // Execution Mode + double mEntry, // Entry Price + double mVolume, // Volume + double mSL = 0, // Stop Loss + double mTP = 0 // Take Profit ) { // @@ -738,9 +707,8 @@ struct XSignal mMode, mEntry, mVolume, - mAction, - sl, - tp + mSL, + mTP // ); } @@ -750,14 +718,13 @@ struct XSignal // bool PrepareMarketLong( - string mSymbol, // Trading Symbol - string mProvider, // Signal Provider - ENUM_TIMEFRAMES mPeriod, // Trading TimeFrame - double mEntry, // Entry Price - double mVolume, // Volume - ENUM_X_SIGNAL_MANAGING_ACTIONS mAction = X_SIGNAL_USE_NOTHING, // Signal Management Action - double sl = 0, // Stop Loss - double tp = 0 // Take Profit + string mSymbol, // Trading Symbol + string mProvider, // Signal Provider + ENUM_TIMEFRAMES mPeriod, // Trading TimeFrame + double mEntry, // Entry Price + double mVolume, // Volume + double mSL = 0, // Stop Loss + double mTP = 0 // Take Profit ) { // @@ -768,23 +735,21 @@ struct XSignal X_ORDER_MODE_MARKET, mEntry, mVolume, - mAction, - sl, - tp + mSL, + mTP // ); } // bool PrepareMarketShort( - string mSymbol, // Trading Symbol - string mProvider, // Signal Provider - ENUM_TIMEFRAMES mPeriod, // Trading TimeFrame - double mEntry, // Entry Price - double mVolume, // Volume - ENUM_X_SIGNAL_MANAGING_ACTIONS mAction = X_SIGNAL_USE_NOTHING, // Signal Management Action - double sl = 0, // Stop Loss - double tp = 0 // Take Profit + string mSymbol, // Trading Symbol + string mProvider, // Signal Provider + ENUM_TIMEFRAMES mPeriod, // Trading TimeFrame + double mEntry, // Entry Price + double mVolume, // Volume + double mSL = 0, // Stop Loss + double mTP = 0 // Take Profit ) { // @@ -795,9 +760,8 @@ struct XSignal X_ORDER_MODE_MARKET, mEntry, mVolume, - mAction, - sl, - tp + mSL, + mTP // ); } @@ -807,14 +771,13 @@ struct XSignal // bool PrepareStopLong( - string mSymbol, // Trading Symbol - string mProvider, // Signal Provider - ENUM_TIMEFRAMES mPeriod, // Trading TimeFrame - double mEntry, // Entry Price - double mVolume, // Volume - ENUM_X_SIGNAL_MANAGING_ACTIONS mAction = X_SIGNAL_USE_NOTHING, // Signal Management Action - double sl = 0, // Stop Loss - double tp = 0 // Take Profit + string mSymbol, // Trading Symbol + string mProvider, // Signal Provider + ENUM_TIMEFRAMES mPeriod, // Trading TimeFrame + double mEntry, // Entry Price + double mVolume, // Volume + double mSL = 0, // Stop Loss + double mTP = 0 // Take Profit ) { // @@ -825,23 +788,21 @@ struct XSignal X_ORDER_MODE_STOP, mEntry, mVolume, - mAction, - sl, - tp + mSL, + mTP // ); } // bool PrepareStopShort( - string mSymbol, // Trading Symbol - string mProvider, // Signal Provider - ENUM_TIMEFRAMES mPeriod, // Trading TimeFrame - double mEntry, // Entry Price - double mVolume, // Volume - ENUM_X_SIGNAL_MANAGING_ACTIONS mAction = X_SIGNAL_USE_NOTHING, // Signal Management Action - double sl = 0, // Stop Loss - double tp = 0 // Take Profit + string mSymbol, // Trading Symbol + string mProvider, // Signal Provider + ENUM_TIMEFRAMES mPeriod, // Trading TimeFrame + double mEntry, // Entry Price + double mVolume, // Volume + double mSL = 0, // Stop Loss + double mTP = 0 // Take Profit ) { // @@ -852,9 +813,8 @@ struct XSignal X_ORDER_MODE_STOP, mEntry, mVolume, - mAction, - sl, - tp + mSL, + mTP // ); } @@ -864,14 +824,13 @@ struct XSignal // bool PrepareLimitLong( - string mSymbol, // Trading Symbol - string mProvider, // Signal Provider - ENUM_TIMEFRAMES mPeriod, // Trading TimeFrame - double mEntry, // Entry Price - double mVolume, // Volume - ENUM_X_SIGNAL_MANAGING_ACTIONS mAction = X_SIGNAL_USE_NOTHING, // Signal Management Action - double sl = 0, // Stop Loss - double tp = 0 // Take Profit + string mSymbol, // Trading Symbol + string mProvider, // Signal Provider + ENUM_TIMEFRAMES mPeriod, // Trading TimeFrame + double mEntry, // Entry Price + double mVolume, // Volume + double mSL = 0, // Stop Loss + double mTP = 0 // Take Profit ) { // @@ -882,23 +841,21 @@ struct XSignal X_ORDER_MODE_LIMIT, mEntry, mVolume, - mAction, - sl, - tp + mSL, + mTP // ); } // bool PrepareLimitShort( - string mSymbol, // Trading Symbol - string mProvider, // Signal Provider - ENUM_TIMEFRAMES mPeriod, // Trading TimeFrame - double mEntry, // Entry Price - double mVolume, // Volume - ENUM_X_SIGNAL_MANAGING_ACTIONS mAction = X_SIGNAL_USE_NOTHING, // Signal Management Action - double sl = 0, // Stop Loss - double tp = 0 // Take Profit + string mSymbol, // Trading Symbol + string mProvider, // Signal Provider + ENUM_TIMEFRAMES mPeriod, // Trading TimeFrame + double mEntry, // Entry Price + double mVolume, // Volume + double mSL = 0, // Stop Loss + double mTP = 0 // Take Profit ) { // @@ -909,112 +866,12 @@ struct XSignal X_ORDER_MODE_LIMIT, mEntry, mVolume, - mAction, - sl, - tp + mSL, + mTP // ); } - // - // here we Can Modify TP and SL and also Action ... - bool Modify( - ENUM_X_SIGNAL_MANAGING_ACTIONS mAction, - double &mTps[], - double &mSls[] - // - ) - { - // - bool result = false; - - // - result = IsValid(); - if (!result) - { - return result; - } - - // - // Only Position Manager works on Market Execution Positions ... - if (mAction != X_SIGNAL_USE_NOTHING && - mode != X_ORDER_MODE_MARKET) - { - return result; - } - - // - int mTpsCount = ArraySize(mTps); - int mSlsCount = ArraySize(mSls); - - // - if (mAction != X_SIGNAL_USE_NOTHING) - { - // - if (mAction == X_SIGNAL_USE_MAX || - mAction == X_SIGNAL_USE_MIN || - mAction == X_SIGNAL_PARTIAL_TRAIL) - { - result = mTpsCount > 0 || mSlsCount > 0; - } - else - { - result = mTpsCount > 0 && mSlsCount > 0; - } - } - - // - if (result) - { - // - double defaultValue = 0; - - // - Copy( - mTps, - tps - // - ); - if (ArraySize(tps) <= 0) - { - // - Add( - defaultValue, - tps - // - ); - } - - // - Copy( - mSls, - sls - // - ); - if (ArraySize(sls) <= 0) - { - // - Add( - defaultValue, - sls - // - ); - } - - // - action = mAction; - - // - result = IsValid(); - } - - // - return result; - } - - // - // Tools ... - // // Generate Opposit Direction ... bool GenerateOpposit( @@ -1038,31 +895,20 @@ struct XSignal // bool isLong = IsLong(mType); - // - double mTP = 0; - this.RegularTP(mTP); - - // - double mSL = 0; - this.RegularSL(mSL); - // // Calculate Risk Reward Ratio ... - double risk = MathAbs(this.entry - mSL); - double reward = MathAbs(this.entry - mTP); + double risk = GetRisk(); + double reward = GetReward(); // - double r2r = reward / risk; + double mSL = isLong + ? mEntry - risk + : mEntry + risk; // - mSL = isLong - ? mEntry - risk - : mEntry + risk; - - // - mTP = isLong - ? mEntry + reward - : mEntry - reward; + double mTP = isLong + ? mEntry + reward + : mEntry - reward; // result = mSignal.Prepare( @@ -1073,7 +919,6 @@ struct XSignal this.mode, mEntry, this.volume, - this.action, mSL, mTP // ); @@ -1099,8 +944,8 @@ struct XSignal bool isLong = IsLong(mType); // - double risk = MathAbs(source.entry - source.sl); - double reward = MathAbs(source.tp - source.entry); + double risk = source.GetRisk(); + double reward = source.GetReward(); // double mSL = isLong @@ -1121,7 +966,6 @@ struct XSignal X_ORDER_MODE_MARKET, mEntry, source.volume, - X_SIGNAL_USE_NOTHING, mSL, mTP // ); @@ -1133,6 +977,9 @@ struct XSignal return result; } + // + // Tools ... + // // Cleanup ... void Clean() @@ -1152,10 +999,7 @@ struct XSignal provider = NULL; // - Clean(tps); - Clean(sls); Clean(supports); - supportResistances.Clean(); } // @@ -1171,9 +1015,7 @@ struct XSignal IsValid(period) && IsValid(symbol) && NotEmpty(volume) && - NotEmpty(entry) && - (ArraySize(tps) > 0 || - ArraySize(sls) > 0) + NotEmpty(entry) // ; @@ -1184,40 +1026,32 @@ struct XSignal } // - // Validate Actions ... + return result; + } + + // + // DO All Calculations and Normalizations ... + bool Normalize() + { + // + bool result = false; // - // Only Position Manager works on Market Execution Positions ... - result = - // - !(action != X_SIGNAL_USE_NOTHING && - mode != X_ORDER_MODE_MARKET) - // - ; - if (!result) - { - return result; - } + // Normalizations ... + symbol = NormalizeSymbol(symbol); + period = NormalizePeriod(period); // - int tpsCount = ArraySize(tps); - int slsCount = ArraySize(sls); + time = NormalizeTime(time); // - if (action != X_SIGNAL_USE_NOTHING) - { - // - if (action == X_SIGNAL_USE_MAX || - action == X_SIGNAL_USE_MIN || - action == X_SIGNAL_PARTIAL_TRAIL) - { - result = tpsCount > 0 || slsCount > 0; - } - else - { - result = tpsCount > 0 && slsCount > 0; - } - } + sl = NormalizePrice(sl, symbol); + tp = NormalizePrice(tp, symbol); + entry = NormalizePrice(entry, symbol); + volume = NormalizeVolume(volume, symbol); + + // + result = IsValid(); // return result; @@ -1275,6 +1109,137 @@ struct XSignal return result; } + // + // Retrieve Entry Price ... + double GetEntry() + { + // + double result = 0; + + // + if (!IsValid()) + { + return result; + } + + // + result = GetEntry( + symbol, + type + // + ); + + // + return result; + } + + // + // Retrieve Exit ... + double GetExit() + { + // + double result = 0; + + // + if (!IsValid()) + { + return result; + } + + // + result = GetExit( + symbol, + type + // + ); + + // + return result; + } + + // + // Get Spread by Point ... + double GetSpread() + { + // + double result = 0; + + // + if (!IsValid()) + { + return result; + } + + // + result = PriceToPoint(GetSpread(symbol)); + + // + return result; + } + + // + // Find Risk ... + double GetRisk() + { + // + double result = 0; + + // + if (!IsValid()) + { + return 0; + } + + // + result = MathAbs(entry - sl); + + // + return result; + } + + // + // Find Reward ... + double GetReward() + { + // + double result = 0; + + // + if (!IsValid()) + { + return result; + } + + // + result = MathAbs(tp - entry); + + // + return result; + } + + // + // Find Risk Reward Ratio ... + double GetRiskRewardRatio() + { + // + double result = 0; + + // + if (!IsValid()) + { + return result; + } + + // + result = GetReward() / GetRisk(); + + // + return result; + } + + // + // Data Collecotr ... + // // Check this instance is Same os Given instance or not ... bool IsSameAs( @@ -1290,12 +1255,10 @@ struct XSignal type == value.type && mode == value.mode && entry == value.entry && - volume == value.volume && + period == value.period && symbol == value.symbol && provider == value.provider && - positionId == value.positionId && - ArraySize(sls) == ArraySize(value.sls) && - ArraySize(tps) == ArraySize(value.tps) + positionId == value.positionId // ; @@ -1425,28 +1388,17 @@ struct XSignal int iPeriodInt = (int)period; // - string periodStr = Surround(XPeriodToken, iPeriodInt); - string providerStr = Surround(XProviderToken, provider); + string tpsStr = Surround(XTPToken, tp); + string slsStr = Surround(XSLToken, sl); string typeStr = Surround(XTypeToken, type); string modeStr = Surround(XModeToken, mode); - string SymbolStr = Surround(XSymbolToken, symbol); - string positionIdStr = Surround(XIDToken, positionId); - string entryStr = Surround(XEntryToken, entry); - string volumeStr = Surround(XVolumeToken, volume); string timeStr = Surround(XTimeToken, time); - - // - string actionStr = Surround(XActionToken, action); - - // - // TP ... - string tpsContentStr = ToString(tps); - string tpsStr = Surround(XTPToken, tpsContentStr); - - // - // SL ... - string slsContentStr = ToString(sls); - string slsStr = Surround(XSLToken, slsContentStr); + string entryStr = Surround(XEntryToken, entry); + string SymbolStr = Surround(XSymbolToken, symbol); + string volumeStr = Surround(XVolumeToken, volume); + string positionIdStr = Surround(XIDToken, positionId); + string periodStr = Surround(XPeriodToken, iPeriodInt); + string providerStr = Surround(XProviderToken, provider); // result = @@ -1462,7 +1414,6 @@ struct XSignal positionIdStr + entryStr + volumeStr + - actionStr + tpsStr + slsStr + timeStr + @@ -1502,14 +1453,16 @@ struct XSignal // - PositionID; // - Entry; // - Volume; - // - TPS; - // - SLS; + // - TP; + // - SL; // - Issue Time; // + tp = ParseDoubleSurrounded(value, XTPToken); + sl = ParseDoubleSurrounded(value, XSLToken); + positionId = ParseLongSurrounded(value, XIDToken); entry = ParseDoubleSurrounded(value, XEntryToken); volume = ParseDoubleSurrounded(value, XVolumeToken); - positionId = ParseLongSurrounded(value, XIDToken); // time = ParseTimeSurrounded(value, XTimeToken); @@ -1519,27 +1472,6 @@ struct XSignal mode = ((ENUM_X_ORDER_MODES)ParseIntSurrounded(value, XModeToken)); period = ((ENUM_TIMEFRAMES)ParseIntSurrounded(value, XPeriodToken)); - // - action = ((ENUM_X_SIGNAL_MANAGING_ACTIONS)ParseIntSurrounded(value, XActionToken)); - - // - // TPS ... - ParseDoubleArraySurrounded( - tps, - value, - XTPToken - // - ); - - // - // SLS ... - ParseDoubleArraySurrounded( - sls, - value, - XSLToken - // - ); - // // Validate ... result = IsValid(); @@ -1548,154 +1480,6 @@ struct XSignal // return result; } - - // - // Select Regular SL ... - bool RegularSL(double &sl) - { - // - bool result = false; - - // - sl = 0; - int slsCount = ArraySize(sls); - - // - result = IsValid() && slsCount > 0; - if (!result) - { - return result; - } - - // - if ( - action == X_SIGNAL_TRAIL || - action == X_SIGNAL_USE_NOTHING || - action == X_SIGNAL_PARTIAL_TRAIL) - { - sl = sls[0]; - } - else if (action == X_SIGNAL_USE_MAX || - action == X_SIGNAL_PARTIAL_CLOSE) - { - sl = GetMin(sls); - } - else if (action == X_SIGNAL_USE_MIN) - { - sl = GetMax(sls); - } - - // - return result; - } - - // - // Select Regular TP ... - bool RegularTP(double &tp) - { - // - bool result = false; - - // - tp = 0; - int tpsCount = ArraySize(tps); - - // - result = IsValid() && tpsCount > 0; - if (!result) - { - return result; - } - - // - if ( - action == X_SIGNAL_TRAIL || - action == X_SIGNAL_USE_NOTHING || - action == X_SIGNAL_PARTIAL_TRAIL) - { - tp = tps[0]; - } - else if (action == X_SIGNAL_USE_MAX || - action == X_SIGNAL_PARTIAL_CLOSE) - { - tp = GetMax(tps); - } - else if (action == X_SIGNAL_USE_MIN) - { - tp = GetMin(tps); - } - - // - return result; - } - - // - // Retrieve Entry Price ... - double GetEntry() - { - // - double result = 0; - - // - if (!IsValid()) - { - return result; - } - - // - result = GetEntry( - symbol, - type - // - ); - - // - return result; - } - - // - // Retrieve Exit ... - double GetExit() - { - // - double result = 0; - - // - if (!IsValid()) - { - return result; - } - - // - result = GetExit( - symbol, - type - // - ); - - // - return result; - } - - // - // Get Spread by Point ... - double GetSpread() - { - // - double result = 0; - - // - if (!IsValid()) - { - return result; - } - - // - result = PriceToPoint(GetSpread(symbol)); - - // - return result; - } }; // @@ -4133,8 +3917,7 @@ int GenerateEQMOrders( XEQMSupportToken, position.period, iEntry, - position.volume, - X_SIGNAL_USE_NOTHING, + position.volume, iSL, iTP // ); @@ -4202,7 +3985,6 @@ int GenerateEQMOrders( position.period, iEntry, position.volume, - X_SIGNAL_USE_NOTHING, iSL, iTP // );