From 727628d2e7abca5bc0776a707c0a3e8b5f0c7593 Mon Sep 17 00:00:00 2001 From: Hadi Khazaee Asl Date: Sat, 18 May 2024 03:25:39 +0330 Subject: [PATCH] rename indicators, add temp of helpers class for each indicator ... --- Classes/x-saherelm.base.class.lib.mq5 | 36 - Classes/x-saherelm.base.class.mq5 | 87 + Classes/x-saherelm.provider.class.mq5 | 0 Classes/x-saherelm.provider.lib.mq5 | 4430 ----------------- Classes/x-saherelm.xhelper.class.mq5 | 148 + Helpers/x-saherelm.xama.helper.mq5 | 256 + Helpers/x-saherelm.xcc.helper.mq5 | 256 + Helpers/x-saherelm.xchlh.helper.mq5 | 256 + Helpers/x-saherelm.xchma.helper.mq5 | 256 + Helpers/x-saherelm.xfi.helper.mq5 | 256 + Helpers/x-saherelm.xlh.helper.mq5 | 256 + Helpers/x-saherelm.xobd.helper.mq5 | 256 + Helpers/x-saherelm.xrsi.helper.mq5 | 256 + Helpers/x-saherelm.xtd.helper.mq5 | 256 + Helpers/x-saherelm.xtm.helper.mq5 | 256 + Helpers/x-saherelm.xts.helper.mq5 | 256 + ...xama.indicator.mq5 => x-saherelm.xama.mq5} | 0 ...lh.oscillator.mq5 => x-saherelm.xchlh.mq5} | 0 ...ma.oscillator.mq5 => x-saherelm.xchma.mq5} | 0 ...m.xct.indicator.mq5 => x-saherelm.xct.mq5} | 0 ....xfi.oscillator.mq5 => x-saherelm.xfi.mq5} | 0 ...m.xlh.indicator.mq5 => x-saherelm.xlh.mq5} | 0 ...xobd.indicator.mq5 => x-saherelm.xobd.mq5} | 0 ...rsi.oscillator.mq5 => x-saherelm.xrsi.mq5} | 0 ....xtd.oscillator.mq5 => x-saherelm.xtd.mq5} | 0 ...m.xtm.indicator.mq5 => x-saherelm.xtm.mq5} | 0 ....xts.oscillator.mq5 => x-saherelm.xts.mq5} | 0 27 files changed, 3051 insertions(+), 4466 deletions(-) delete mode 100644 Classes/x-saherelm.base.class.lib.mq5 create mode 100644 Classes/x-saherelm.base.class.mq5 create mode 100644 Classes/x-saherelm.provider.class.mq5 delete mode 100644 Classes/x-saherelm.provider.lib.mq5 create mode 100644 Classes/x-saherelm.xhelper.class.mq5 create mode 100644 Helpers/x-saherelm.xama.helper.mq5 create mode 100644 Helpers/x-saherelm.xcc.helper.mq5 create mode 100644 Helpers/x-saherelm.xchlh.helper.mq5 create mode 100644 Helpers/x-saherelm.xchma.helper.mq5 create mode 100644 Helpers/x-saherelm.xfi.helper.mq5 create mode 100644 Helpers/x-saherelm.xlh.helper.mq5 create mode 100644 Helpers/x-saherelm.xobd.helper.mq5 create mode 100644 Helpers/x-saherelm.xrsi.helper.mq5 create mode 100644 Helpers/x-saherelm.xtd.helper.mq5 create mode 100644 Helpers/x-saherelm.xtm.helper.mq5 create mode 100644 Helpers/x-saherelm.xts.helper.mq5 rename Indicators/{x-saherelm.xama.indicator.mq5 => x-saherelm.xama.mq5} (100%) rename Indicators/{x-saherelm.xchlh.oscillator.mq5 => x-saherelm.xchlh.mq5} (100%) rename Indicators/{x-saherelm.xchma.oscillator.mq5 => x-saherelm.xchma.mq5} (100%) rename Indicators/{x-saherelm.xct.indicator.mq5 => x-saherelm.xct.mq5} (100%) rename Indicators/{x-saherelm.xfi.oscillator.mq5 => x-saherelm.xfi.mq5} (100%) rename Indicators/{x-saherelm.xlh.indicator.mq5 => x-saherelm.xlh.mq5} (100%) rename Indicators/{x-saherelm.xobd.indicator.mq5 => x-saherelm.xobd.mq5} (100%) rename Indicators/{x-saherelm.xrsi.oscillator.mq5 => x-saherelm.xrsi.mq5} (100%) rename Indicators/{x-saherelm.xtd.oscillator.mq5 => x-saherelm.xtd.mq5} (100%) rename Indicators/{x-saherelm.xtm.indicator.mq5 => x-saherelm.xtm.mq5} (100%) rename Indicators/{x-saherelm.xts.oscillator.mq5 => x-saherelm.xts.mq5} (100%) diff --git a/Classes/x-saherelm.base.class.lib.mq5 b/Classes/x-saherelm.base.class.lib.mq5 deleted file mode 100644 index 2b9bab48..00000000 --- a/Classes/x-saherelm.base.class.lib.mq5 +++ /dev/null @@ -1,36 +0,0 @@ -/////////////////////////////////////////////////////// -// -// SaherElm IT Center MQL5 Class Library -// -------------------------------------- -// Name: XBaseClass -// Description: provides all based classes for use ... -// -// -// 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 - -// -// XBase Class ... -class XCBase -{ - // - // Public ... -public: - // - // Protected ... -protected: - - // - // Private ... -private: -}; diff --git a/Classes/x-saherelm.base.class.mq5 b/Classes/x-saherelm.base.class.mq5 new file mode 100644 index 00000000..dde713e7 --- /dev/null +++ b/Classes/x-saherelm.base.class.mq5 @@ -0,0 +1,87 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL5 Class Library +// -------------------------------------- +// Name: XBaseClass +// Description: provides all based classes for use ... +// +// +// 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 + +// +#include "../Libraries/x-saherelm.common.lib.mq5" + +// +// XBase Class ... +class XSCBase +{ + // + // Public ... +public: + // + // Protected ... + + // + // Represent Basic Unique Tag ... + virtual string GetTag(); +protected: + // + // Retrieve Class Token ... + string GetToken() + { + // + string result = NULL; + + // + string mType = GetTypeName(this); + + // + result = mType; + + // + string parts[]; + int partsCount = SplitContent( + parts, + result, + " " + // + ); + if (partsCount <= 0) + { + // + result = mType; + return result; + } + + // + bool hasLastPart = GetLastItem( + result, + parts + // + ); + if (!hasLastPart) + { + // + result = mType; + return result; + } + + // + return result; + } + + // + // Private ... +private: +}; diff --git a/Classes/x-saherelm.provider.class.mq5 b/Classes/x-saherelm.provider.class.mq5 new file mode 100644 index 00000000..e69de29b diff --git a/Classes/x-saherelm.provider.lib.mq5 b/Classes/x-saherelm.provider.lib.mq5 deleted file mode 100644 index 9008879d..00000000 --- a/Classes/x-saherelm.provider.lib.mq5 +++ /dev/null @@ -1,4430 +0,0 @@ -/////////////////////////////////////////////////////// -// -// SaherElm IT Center MQL5 Class Library -// -------------------------------------- -// Name: XProvider -// Description: provides all indicators based provider classes for use ... -// -// -// 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 - -// -// START Define Enums ... -// - -// -enum ENUM_X_SIGNAL_PROVIDERS -{ - // - // XSP Expert Support Mechanism ... - XSP, - // - // XTD ... - XTD, - // - // XTAM ... - XTAM, - // - // XSI ... - XSI, - // - // XTSFI ... - XTSFI, - // - // XOBDLH ... - XOBDLH, - // - // XCHMACC ... - XCHMACC, - // - // XCHMACMN ... - XCHMAMN, - // - // XCHMACMX ... - XCHMAMX, -}; - -// -// Represent Market Conditions ... -struct XMarketConditions -{ - // - // 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; -}; - -// -// END Define Enums ... -// - -// -// START Includes Requirements ... -// - -// -// Includes Classes ... -#include "x-saherelm.base.class.lib.mq5" - -// -// Includes all Indicator's Helpers ... -#include "../Helpers/x-saherelm.xlh.indicator.helper.lib.mq5" -#include "../Helpers/x-saherelm.xtm.indicator.helper.lib.mq5" -#include "../Helpers/x-saherelm.xama.indicator.helper.lib.mq5" -#include "../Helpers/x-saherelm.xfi.oscillator.helper.lib.mq5" -#include "../Helpers/x-saherelm.xobd.indicator.helper.lib.mq5" -#include "../Helpers/x-saherelm.xts.oscillator.helper.lib.mq5" -#include "../Helpers/x-saherelm.xtd.oscillator.helper.lib.mq5" -#include "../Helpers/x-saherelm.xrsi.oscillator.helper.lib.mq5" -#include "../Helpers/x-saherelm.xchlh.oscillator.helper.lib.mq5" -#include "../Helpers/x-saherelm.xchma.oscillator.helper.lib.mq5" - -// -// END Includes Requirements ... -// - -// -class XCProvider : public XCBase -{ - // - // Public ... -public: - // - // Constructor ... - XCProvider( - // - // Common Requirements ... - string xSymbol, // Which Symbol is Used - ENUM_TIMEFRAMES xPeriod, // Which Period is Used - // - // Signallers Requirements ... - // - // XTD ... - bool xTDEnableSignaller, // Enable Signaller - bool xTDAllowLongSignals, // Allow Long Signals - bool xTDAllowShortSignals, // Allow Short Signals - // - // XTAM ... - bool xTAMEnableSignaller, // Enable Signaller - bool xTAMAllowLongSignals, // Allow Long Signals - bool xTAMAllowShortSignals, // Allow Short Signals - // - // XSI ... - bool xSIEnableSignaller, // Enable Signaller - bool xSIAllowLongSignals, // Allow Long Signals - bool xSIAllowShortSignals, // Allow Short Signals - // - // XTSFI ... - bool XTSFIEnableSignaller, // Enable Signaller - bool XTSFIAllowLongSignals, // Allow Long Signals - bool XTSFIAllowShortSignals, // Allow Short Signals - // - // XOBDLH ... - bool xOBDLHEnableSignaller, // Enable Signaller - bool xOBDLHAllowLongSignals, // Allow Long Signals - bool xOBDLHAllowShortSignals, // Allow Short Signals - // - // XCHMACC ... - bool xCHMACCEnableSignaller, // Enable Signaller - bool xCHMACCAllowLongSignals, // Allow Long Signals - bool xCHMACCAllowShortSignals, // Allow Short Signals - // - // XCHMAMX ... - bool xCHMACMXEnableSignaller, // Enable Signaller - bool xCHMACMXAllowLongSignals, // Allow Long Signals - bool xCHMACMXAllowShortSignals, // Allow Short Signals - // - // XCHMAMN ... - bool xCHMACMNEnableSignaller, // Enable Signaller - bool xCHMACMNAllowLongSignals, // Allow Long Signals - bool xCHMACMNAllowShortSignals // Allow Short Signals - // - ) - { - // - // XTD ... - mXTDEnableSignaller = xTDEnableSignaller; - mXTDAllowLongSignals = xTDAllowLongSignals; - mXTDAllowShortSignals = xTDAllowShortSignals; - - // - // XTAM ... - mXTAMEnableSignaller = xTAMEnableSignaller; - mXTAMAllowLongSignals = xTAMAllowLongSignals; - mXTAMAllowShortSignals = xTAMAllowShortSignals; - - // - // XSI ... - mXSIEnableSignaller = xSIEnableSignaller; - mXSIAllowLongSignals = xSIAllowLongSignals; - mXSIAllowShortSignals = xSIAllowShortSignals; - - // - // XTSFI ... - mXTSFIEnableSignaller = XTSFIEnableSignaller; - mXTSFIAllowLongSignals = XTSFIAllowLongSignals; - mXTSFIAllowShortSignals = XTSFIAllowShortSignals; - - // - // XOBDLH ... - mXOBDLHEnableSignaller = xOBDLHEnableSignaller; - mXOBDLHAllowLongSignals = xOBDLHAllowLongSignals; - mXOBDLHAllowShortSignals = xOBDLHAllowShortSignals; - - // - // XCHMACC ... - mXCHMACCEnableSignaller = xCHMACCEnableSignaller; - mXCHMACCAllowLongSignals = xCHMACCAllowLongSignals; - mXCHMACCAllowShortSignals = xCHMACCAllowShortSignals; - - // - // XCHMAMX ... - mXCHMAMXEnableSignaller = xCHMACMXEnableSignaller; - mXCHMAMXAllowLongSignals = xCHMACMXAllowLongSignals; - mXCHMAMXAllowShortSignals = xCHMACMXAllowShortSignals; - - // - // XCHMAMN ... - mXCHMAMNEnableSignaller = xCHMACMNEnableSignaller; - mXCHMAMNAllowLongSignals = xCHMACMNAllowLongSignals; - mXCHMAMNAllowShortSignals = xCHMACMNAllowShortSignals; - } - - // - // Deconstructor ... - ~XCProvider() {} - - // - // START Common Functions ... - // - - // - // Read All Globally Required Conditions ... - void ReadConditions() - { - // - ClearConditions(); - - // - mXConditions = GenerateMarketConditions(1); - } - - // - // Cleanup Conditions ... - void ClearConditions() - { - // - XMarketConditions mConditions = {}; - - // - mXConditions = mConditions; - } - - // - // Generate Merket Conditions for Specified Bar Index ... - XMarketConditions GenerateMarketConditions( - int bar_index = 1 // Specified Bar Index ... - ) - { - // - XMarketConditions mConditions = {}; - - // - // XTM ... - mConditions.isXTMPeak = XTMIsPeak(bar_index); - mConditions.isXTMVale = XTMIsVale(bar_index); - mConditions.isXTMBullish = XTMIsBullish(bar_index); - mConditions.isXTMBearish = XTMIsBearish(bar_index); - mConditions.isXTMNeutural = XTMIsNeutural(bar_index); - mConditions.isXTMEndBullish = XTMIsEndBullish(bar_index); - mConditions.isXTMEndBearish = XTMIsEndBearish(bar_index); - mConditions.isXTMStartBullish = XTMIsStartBullish(bar_index); - mConditions.isXTMStartBearish = XTMIsStartBearish(bar_index); - mConditions.isXTMEndBullishByNeutural = XTMIsEndBullishByNeutural(bar_index); - mConditions.isXTMEndBearishByNeutural = XTMIsEndBearishByNeutural(bar_index); - mConditions.isXTMStartBullishAfterNeutural = XTMIsStartBullishAfterNeutural(bar_index); - mConditions.isXTMStartBearishAfterNeutural = XTMIsStartBearishAfterNeutural(bar_index); - - // - // XAMA ... - mConditions.isXAMAPeak = XAMAIsPeak(bar_index); - mConditions.isXAMAVale = XAMAIsVale(bar_index); - mConditions.isXAMABullish = XAMAIsBullish(bar_index); - mConditions.isXAMABearish = XAMAIsBearish(bar_index); - mConditions.isXAMANeutural = XAMAIsNeutural(bar_index); - mConditions.isXAMAEndBullish = XAMAIsEndBullish(bar_index); - mConditions.isXAMAEndBearish = XAMAIsEndBearish(bar_index); - mConditions.isXAMAStartBullish = XAMAIsStartBullish(bar_index); - mConditions.isXAMAStartBearish = XAMAIsStartBearish(bar_index); - mConditions.isXAMAEndBullishByNeutural = XAMAIsEndBullishByNeutural(bar_index); - mConditions.isXAMAEndBearishByNeutural = XAMAIsEndBearishByNeutural(bar_index); - mConditions.isXAMAStartBullishAfterNeutural = XAMAIsStartBullishAfterNeutural(bar_index); - mConditions.isXAMAStartBearishAfterNeutural = XAMAIsStartBearishAfterNeutural(bar_index); - - // - // XLH ... - mConditions.isXLHHHIncreased = XLHIsHHIncreased(bar_index); - mConditions.isXLHHHDecreased = XLHIsHHDecreased(bar_index); - mConditions.isXLHLLIncreased = XLHIsLLIncreased(bar_index); - mConditions.isXLHLLDecreased = XLHIsLLDecreased(bar_index); - mConditions.isXLHLowAttachedLL = XLHIsLowAttachedLL(bar_index); - mConditions.isXLHHighAttachedHH = XLHIsHighAttachedHH(bar_index); - mConditions.isXLHHHSameInLength = XLHIsHHSameInLength(bar_index); - mConditions.isXLHLLSameInLength = XLHIsLLSameInLength(bar_index); - mConditions.isXLHPriceOverSignal = XLHIsPriceOverSignal(bar_index); - mConditions.isXLHPriceUnderSignal = XLHIsPriceUnderSignal(bar_index); - mConditions.isXLHPriceInSignalRange = XLHIsPriceInSignalRange(bar_index); - mConditions.isXLHPriceCrossedOverSignal = XLHIsPriceCrossedOverSignal(bar_index); - mConditions.isXLHPriceCrossedUnderSignal = XLHIsPriceCrossedUnderSignal(bar_index); - - // - // XTD ... - mConditions.isXTDSignalPeak = XTDIsSignalPeak(bar_index); - mConditions.isXTDSignalVale = XTDIsSignalVale(bar_index); - mConditions.isXTDBullishPeak = XTDIsBullishPeak(bar_index); - mConditions.isXTDBullishVale = XTDIsBullishVale(bar_index); - mConditions.isXTDBearishPeak = XTDIsBearishPeak(bar_index); - mConditions.isXTDBearishVale = XTDIsBearishVale(bar_index); - mConditions.isXTDBullOverBear = XTDIsBullOverBear(bar_index); - mConditions.isXTDBullUnderBear = XTDIsBullUnderBear(bar_index); - mConditions.isXTDSignalOverBear = XTDIsSignalOverBear(bar_index); - mConditions.isXTDSignalUnderBear = XTDIsSignalUnderBear(bar_index); - mConditions.isXTDBullCrossedOverBear = XTDIsBullCrossedOverBear(bar_index); - mConditions.isXTDBullCrossedUnderBear = XTDIsBullCrossedUnderBear(bar_index); - mConditions.isXTDSignalCrossedOverBear = XTDIsSignalCrossedOverBear(bar_index); - mConditions.isXTDSignalCrossedUnderBear = XTDIsSignalCrossedUnderBear(bar_index); - - // - // XFI ... - mConditions.isXFIPeak = XFIIsPeak(bar_index); - mConditions.isXFIVale = XFIIsVale(bar_index); - mConditions.isXFIOverZero = XFIIsOverZero(bar_index); - mConditions.isXFIUnderZero = XFIIsUnderZero(bar_index); - mConditions.isXFICrossedOverZero = XFIIsCrossedOverZero(bar_index); - mConditions.isXFICrossedUnderZero = XFIIsCrossedUnderZero(bar_index); - - // - // XTS ... - mConditions.isXTSAllSame = XTSIsAllSame(bar_index); - mConditions.isXTSCurrentMin = XTSIsCurrentMin(bar_index); - mConditions.isXTSCurrentMax = XTSIsCurrentMax(bar_index); - mConditions.isXTSCurrentOverFarest = XTSIsCurrentOverFarest(bar_index); - mConditions.isXTSCurrentOverNearest = XTSIsCurrentOverNearest(bar_index); - mConditions.isXTSCurrentOverMediest = XTSIsCurrentOverMediest(bar_index); - mConditions.isXTSCurrentUnderFarest = XTSIsCurrentUnderFarest(bar_index); - mConditions.isXTSCurrentUnderNearest = XTSIsCurrentUnderNearest(bar_index); - mConditions.isXTSCurrentUnderMediest = XTSIsCurrentUnderMediest(bar_index); - mConditions.isXTSCurrentCrossedOverFarest = XTSIsCurrentCrossedOverFarest(bar_index); - mConditions.isXTSCurrentCrossedOverNearest = XTSIsCurrentCrossedOverNearest(bar_index); - mConditions.isXTSCurrentCrossedOverMediest = XTSIsCurrentCrossedOverMediest(bar_index); - mConditions.isXTSCurrentCrossedUnderFarest = XTSIsCurrentCrossedUnderFarest(bar_index); - mConditions.isXTSCurrentCrossedUnderNearest = XTSIsCurrentCrossedUnderNearest(bar_index); - mConditions.isXTSCurrentCrossedUnderMediest = XTSIsCurrentCrossedUnderMediest(bar_index); - - // - // XRSI ... - mConditions.isXRSIPeak = XRSIIsPeak(bar_index); - mConditions.isXRSIVale = XRSIIsVale(bar_index); - mConditions.isXRSICrossedOverLongExit = XRSIIsCrossedOverLongExit(bar_index); - mConditions.isXRSICrossedOverLongEntry = XRSIIsCrossedOverLongEntry(bar_index); - mConditions.isXRSICrossedUnderShortExit = XRSIIsCrossedUnderShortExit(bar_index); - mConditions.isXRSICrossedUnderShortEntry = XRSIIsCrossedUnderShortEntry(bar_index); - - // - // XOBD ... - mConditions.isXOBDSwingLow = XOBDIsSwingLow(bar_index); - mConditions.isXOBDSwingHigh = XOBDIsSwingHigh(bar_index); - - // - // XCHLH ... - // - mConditions.isXCHLHSameHHs = XCHLHIsSameHHs(bar_index); - mConditions.isXCHLHSameLLs = XCHLHIsSameLLs(bar_index); - // - mConditions.isXCHLHSCMCHHSame = XCHLHIsMCSCHasSameHH(bar_index); - mConditions.isXCHLHSCMCLLSame = XCHLHIsMCSCHasSameLL(bar_index); - // - mConditions.isXCHLHSCLCHHSame = XCHLHIsLCSCHasSameHH(bar_index); - mConditions.isXCHLHSCLCLLSame = XCHLHIsLCSCHasSameLL(bar_index); - // - mConditions.isXCHLHMCLCHHSame = XCHLHIsLCMCHasSameHH(bar_index); - mConditions.isXCHLHMCLCLLSame = XCHLHIsLCMCHasSameLL(bar_index); - // - mConditions.isXCHLHMCOnTopOfLC = XCHLHIsMCOnTopOfLC(bar_index); - mConditions.isXCHLHMCInBottomOfLC = XCHLHIsMCInBottomOfLC(bar_index); - - // - // XCHMA ... - // - mConditions.isXCHMASCOverMax = XCHMAIsSCOverMax(bar_index); - mConditions.isXCHMASCOverMin = XCHMAIsSCOverMin(bar_index); - mConditions.isXCHMASCUnderMax = XCHMAIsSCUnderMax(bar_index); - mConditions.isXCHMASCUnderMin = XCHMAIsSCUnderMin(bar_index); - // - mConditions.isXCHMASCCrossedOverMax = XCHMAIsSCCrossedOverMax(bar_index); - mConditions.isXCHMASCCrossedUnderMax = XCHMAIsSCCrossedUnderMax(bar_index); - mConditions.isXCHMASCCrossedOverMin = XCHMAIsSCCrossedOverMin(bar_index); - mConditions.isXCHMASCCrossedUnderMin = XCHMAIsSCCrossedUnderMin(bar_index); - // - mConditions.isXCHMASCPeak = XCHMAIsSCPeak(bar_index); - mConditions.isXCHMASCVale = XCHMAIsSCVale(bar_index); - mConditions.isXCHMASCTrendsUp = XCHMAIsSCTrendsUp(bar_index); - mConditions.isXCHMASCTrendsDown = XCHMAIsSCTrendsDown(bar_index); - mConditions.isXCHMASCFastOverSlow = XCHMAIsSCFastOverSlow(bar_index); - mConditions.isXCHMASCFastUnderSlow = XCHMAIsSCFastUnderSlow(bar_index); - mConditions.isXCHMASCFastCrossedOverSlow = XCHMAIsSCFastCrossedOverSlow(bar_index); - mConditions.isXCHMASCFastCrossedUnderSlow = XCHMAIsSCFastCrossedUnderSlow(bar_index); - // - mConditions.isXCHMAMCPeak = XCHMAIsMCPeak(bar_index); - mConditions.isXCHMAMCVale = XCHMAIsMCVale(bar_index); - mConditions.isXCHMAMCTrendsUp = XCHMAIsMCTrendsUp(bar_index); - mConditions.isXCHMAMCTrendsDown = XCHMAIsMCTrendsDown(bar_index); - mConditions.isXCHMAMCFastOverSlow = XCHMAIsMCFastOverSlow(bar_index); - mConditions.isXCHMAMCFastUnderSlow = XCHMAIsMCFastUnderSlow(bar_index); - mConditions.isXCHMAMCFastCrossedOverSlow = XCHMAIsMCFastCrossedOverSlow(bar_index); - mConditions.isXCHMAMCFastCrossedUnderSlow = XCHMAIsMCFastCrossedUnderSlow(bar_index); - // - mConditions.isXCHMALCPeak = XCHMAIsLCPeak(bar_index); - mConditions.isXCHMALCVale = XCHMAIsLCVale(bar_index); - mConditions.isXCHMALCTrendsUp = XCHMAIsLCTrendsUp(bar_index); - mConditions.isXCHMALCTrendsDown = XCHMAIsLCTrendsDown(bar_index); - mConditions.isXCHMALCFastOverSlow = XCHMAIsLCFastOverSlow(bar_index); - mConditions.isXCHMALCFastUnderSlow = XCHMAIsLCFastUnderSlow(bar_index); - mConditions.isXCHMALCFastCrossedOverSlow = XCHMAIsLCFastCrossedOverSlow(bar_index); - mConditions.isXCHMALCFastCrossedUnderSlow = XCHMAIsLCFastCrossedUnderSlow(bar_index); - - // - return mConditions; - } - - // - // Access Last Readed Market Conditions ... - XMarketConditions GetLastMarketCondition() - { - // - XMarketConditions result = {}; - - // - result = mXConditions; - - // - return result; - } - - // - // Check Market Conditions is Ready for Long Signals or not ... - bool IsReadyForLong( - 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 ... - !( - // - (mXConditions.isXCHMASCOverMin || - mXConditions.isXCHMASCCrossedOverMin) && - (mXConditions.isXCHMASCUnderMin || - mXConditions.isXCHMASCCrossedUnderMin) - // - ); - } - - // - if (checkXCHMAMax && result) - { - // - result = - // - // XCHMA MAX ... - !( - // - (mXConditions.isXCHMASCOverMax || - mXConditions.isXCHMASCCrossedOverMax) && - (mXConditions.isXCHMASCUnderMax || - mXConditions.isXCHMASCCrossedUnderMax) - // - ) - // - ; - } - - // - if (checkXCHMACycles && result) - { - // - result = - // - // Check XCHMA Trend Bullish ... - ( - // - // All Cycles Bullish ... - ( - // - // SC ... - (mXConditions.isXCHMASCFastOverSlow || - mXConditions.isXCHMASCFastCrossedOverSlow) - // - && - // - // MC ... - (mXConditions.isXCHMAMCFastOverSlow || - mXConditions.isXCHMAMCFastCrossedOverSlow) - // - && - // - // LC ... - (mXConditions.isXCHMALCFastOverSlow || - mXConditions.isXCHMALCFastCrossedOverSlow) - // - ) - // - || - // - // Two Cycle Fully Bullish ... - ( - // - // SC and MC ... - ( - // - // SC ... - (mXConditions.isXCHMASCFastOverSlow || - mXConditions.isXCHMASCFastCrossedOverSlow) - // - && - // - // MC ... - (mXConditions.isXCHMAMCFastOverSlow || - mXConditions.isXCHMAMCFastCrossedOverSlow) - // - ) - // - || - // - // SC and LC ... - ( - // - // SC ... - (mXConditions.isXCHMASCFastOverSlow || - mXConditions.isXCHMASCFastCrossedOverSlow) - // - && - // - // LC ... - (mXConditions.isXCHMALCFastOverSlow || - mXConditions.isXCHMALCFastCrossedOverSlow) - // - ) - // - || - // - // MC and LC ... - ( - // - // MC ... - (mXConditions.isXCHMAMCFastOverSlow || - mXConditions.isXCHMAMCFastCrossedOverSlow) - // - && - // - // LC ... - (mXConditions.isXCHMALCFastOverSlow || - mXConditions.isXCHMALCFastCrossedOverSlow) - // - ) - // - ) - // - ) - // - ; - } - - // - if (checkXCHMAPeaks && result) - { - // - result = - // - // XCHMA Check Peaks ... - !( - // - // All Cycles Peak ... - (mXConditions.isXCHMASCPeak && - mXConditions.isXCHMAMCPeak && - mXConditions.isXCHMALCPeak) - // - || - // - ( - // - // SC MC ... - (mXConditions.isXCHMASCPeak && - mXConditions.isXCHMAMCPeak) - // - || - // - // SC LC ... - (mXConditions.isXCHMASCPeak && - mXConditions.isXCHMALCPeak) - // - || - // - // MC LC ... - (mXConditions.isXCHMAMCPeak && - mXConditions.isXCHMALCPeak) - // - ) - // - ) - // - ; - } - - // - if (checkXCHMATrendPowers && result) - { - // - result = - // - // XCHMA Check Trends Power ... - !( - // - // All Trends Down ... - (mXConditions.isXCHMASCTrendsDown && - mXConditions.isXCHMAMCTrendsDown && - mXConditions.isXCHMALCTrendsDown) - // - || - // - // Twisted pairs ... - ( - // - (mXConditions.isXCHMASCTrendsDown && - mXConditions.isXCHMAMCTrendsDown) - // - || - // - (mXConditions.isXCHMASCTrendsDown && - mXConditions.isXCHMALCTrendsDown) - // - || - // - (mXConditions.isXCHMAMCTrendsDown && - mXConditions.isXCHMALCTrendsDown) - // - ) - // - ) - // - ; - } - - // - if (checkXOBD && result) - { - // - result = - // - // XOBD Check Swings ... - !mXConditions.isXOBDSwingLow - // - ; - } - - // - if (checkXTS && result) - { - result = - // - // XTS Check ... - !( - // - mXConditions.isXTSCurrentMin && - // - ( - // - // All Under ... - ( - (mXConditions.isXTSCurrentUnderNearest || - mXConditions.isXTSCurrentCrossedUnderNearest) && - (mXConditions.isXTSCurrentUnderMediest || - mXConditions.isXTSCurrentCrossedUnderMediest) && - (mXConditions.isXTSCurrentUnderFarest || - mXConditions.isXTSCurrentCrossedUnderFarest)) - // - || - // - // Pairs ... - ( - // - ((mXConditions.isXTSCurrentUnderNearest || - mXConditions.isXTSCurrentCrossedUnderNearest) && - (mXConditions.isXTSCurrentUnderMediest || - mXConditions.isXTSCurrentCrossedUnderMediest)) - // - || - // - ((mXConditions.isXTSCurrentUnderNearest || - mXConditions.isXTSCurrentCrossedUnderNearest) && - (mXConditions.isXTSCurrentUnderFarest || - mXConditions.isXTSCurrentCrossedUnderFarest)) - // - || - // - ((mXConditions.isXTSCurrentUnderMediest || - mXConditions.isXTSCurrentCrossedUnderMediest) && - (mXConditions.isXTSCurrentUnderFarest || - mXConditions.isXTSCurrentCrossedUnderFarest)) - // - ) - // - ) - // - ) - // - ; - } - - // - return result; - } - - // - // Check Market Conditions is Ready for Short Signals or not ... - bool IsReadyForShort( - 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 ... - !( - // - (mXConditions.isXCHMASCOverMin || - mXConditions.isXCHMASCCrossedOverMin) && - (mXConditions.isXCHMASCUnderMin || - mXConditions.isXCHMASCCrossedUnderMin) - // - ); - } - - // - if (checkXCHMAMax && result) - { - // - result = - // - // XCHMA MAX ... - !( - // - (mXConditions.isXCHMASCOverMax || - mXConditions.isXCHMASCCrossedOverMax) && - (mXConditions.isXCHMASCUnderMax || - mXConditions.isXCHMASCCrossedUnderMax) - // - ) - // - ; - } - - // - if (checkXCHMACycles && result) - { - // - result = - // - // Check XCHMA Trend Bullish ... - ( - // - // All Cycles Bullish ... - ( - // - // SC ... - (mXConditions.isXCHMASCFastUnderSlow || - mXConditions.isXCHMASCFastCrossedUnderSlow) - // - && - // - // MC ... - (mXConditions.isXCHMAMCFastUnderSlow || - mXConditions.isXCHMAMCFastCrossedUnderSlow) - // - && - // - // LC ... - (mXConditions.isXCHMALCFastUnderSlow || - mXConditions.isXCHMALCFastCrossedUnderSlow) - // - ) - // - || - // - // Two Cycle Fully Bullish ... - ( - // - // SC and MC ... - ( - // - // SC ... - (mXConditions.isXCHMASCFastUnderSlow || - mXConditions.isXCHMASCFastCrossedOverSlow) - // - && - // - // MC ... - (mXConditions.isXCHMAMCFastUnderSlow || - mXConditions.isXCHMAMCFastCrossedOverSlow) - // - ) - // - || - // - // SC and LC ... - ( - // - // SC ... - (mXConditions.isXCHMASCFastUnderSlow || - mXConditions.isXCHMASCFastCrossedUnderSlow) - // - && - // - // LC ... - (mXConditions.isXCHMALCFastUnderSlow || - mXConditions.isXCHMALCFastCrossedUnderSlow) - // - ) - // - || - // - // MC and LC ... - ( - // - // MC ... - (mXConditions.isXCHMAMCFastUnderSlow || - mXConditions.isXCHMAMCFastCrossedOverSlow) - // - && - // - // LC ... - (mXConditions.isXCHMALCFastUnderSlow || - mXConditions.isXCHMALCFastCrossedOverSlow) - // - ) - // - ) - // - ) - // - ; - } - - // - if (checkXCHMAVales && result) - { - // - result = - // - // XCHMA Check Vales ... - !( - // - // All Cycles Vale ... - (mXConditions.isXCHMASCVale && - mXConditions.isXCHMAMCVale && - mXConditions.isXCHMALCVale) - // - || - // - ( - // - // SC MC ... - (mXConditions.isXCHMASCVale && - mXConditions.isXCHMAMCVale) - // - || - // - // SC LC ... - (mXConditions.isXCHMASCVale && - mXConditions.isXCHMALCVale) - // - || - // - // MC LC ... - (mXConditions.isXCHMAMCVale && - mXConditions.isXCHMALCVale) - // - ) - // - ) - // - ; - } - - // - if (checkXCHMATrendPowers && result) - { - // - result = - // - // XCHMA Check Trends Power ... - !( - // - // All Trends Down ... - (mXConditions.isXCHMASCTrendsDown && - mXConditions.isXCHMAMCTrendsDown && - mXConditions.isXCHMALCTrendsDown) - // - || - // - // Twisted pairs ... - ( - // - (mXConditions.isXCHMASCTrendsDown && - mXConditions.isXCHMAMCTrendsDown) - // - || - // - (mXConditions.isXCHMASCTrendsDown && - mXConditions.isXCHMALCTrendsDown) - // - || - // - (mXConditions.isXCHMAMCTrendsDown && - mXConditions.isXCHMALCTrendsDown) - // - ) - // - ) - // - ; - } - - // - if (checkXOBD && result) - { - // - result = - // - // XOBD Check Swings ... - !mXConditions.isXOBDSwingHigh - // - ; - } - - // - if (checkXTS && result) - { - // - result = - // - // XTS Check ... - !( - // - mXConditions.isXTSCurrentMax && - // - ( - // - // All Over ... - ( - (mXConditions.isXTSCurrentOverNearest || - mXConditions.isXTSCurrentCrossedOverNearest) && - (mXConditions.isXTSCurrentOverMediest || - mXConditions.isXTSCurrentCrossedOverMediest) && - (mXConditions.isXTSCurrentOverFarest || - mXConditions.isXTSCurrentCrossedOverFarest)) - // - || - // - // Pairs ... - ( - // - ((mXConditions.isXTSCurrentOverNearest || - mXConditions.isXTSCurrentCrossedOverNearest) && - (mXConditions.isXTSCurrentOverMediest || - mXConditions.isXTSCurrentCrossedOverMediest)) - // - || - // - ((mXConditions.isXTSCurrentOverNearest || - mXConditions.isXTSCurrentCrossedOverNearest) && - (mXConditions.isXTSCurrentOverFarest || - mXConditions.isXTSCurrentCrossedOverFarest)) - // - || - // - ((mXConditions.isXTSCurrentOverMediest || - mXConditions.isXTSCurrentCrossedOverMediest) && - (mXConditions.isXTSCurrentOverFarest || - mXConditions.isXTSCurrentCrossedOverFarest)) - // - ) - // - ) - // - ) - // - ; - } - - // - return result; - } - - // - // Converts Market Conditions to Specific String Representation ... - string GenerateConditionsString( - XMarketConditions &condition, // Specify Conditiond - string separator = "\n", // Specify Separator - bool ignoreFalses = true // Ignore False Conditions - ) - { - // - XMarketConditions mConditions = {}; - - // - mConditions = condition; - - // - string result = "\n"; - - // - // XOBD ... - result += - "| XOBD |" + separator; - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXOBDSwingLow)) - { - result += "isXOBDSwingLow: " + (string)mConditions.isXOBDSwingLow + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXOBDSwingHigh)) - { - result += "isXOBDSwingHigh: " + (string)mConditions.isXOBDSwingHigh + separator; - } - - // - // Separator ... - result += separator; - - // - // XTM ... - result += - "| XTM |" + separator; - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXTMPeak)) - { - result += "isXTMPeak: " + (string)mConditions.isXTMPeak + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXTMVale)) - { - result += "isXTMVale: " + (string)mConditions.isXTMVale + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXTMStartBullish)) - { - result += "isXTMStartBullish: " + (string)mConditions.isXTMStartBullish + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXTMStartBullishAfterNeutural)) - { - result += "isXTMStartBullishAfterNeutural: " + (string)mConditions.isXTMStartBullishAfterNeutural + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXTMBullish)) - { - result += "isXTMBullish: " + (string)mConditions.isXTMBullish + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXTMEndBullish)) - { - result += "isXTMEndBullish: " + (string)mConditions.isXTMEndBullish + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXTMEndBullishByNeutural)) - { - result += "isXTMEndBullishByNeutural: " + (string)mConditions.isXTMEndBullishByNeutural + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXTMStartBearish)) - { - result += "isXTMStartBearish: " + (string)mConditions.isXTMStartBearish + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXTMStartBearishAfterNeutural)) - { - result += "isXTMStartBearishAfterNeutural: " + (string)mConditions.isXTMStartBearishAfterNeutural + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXTMBearish)) - { - result += "isXTMBearish: " + (string)mConditions.isXTMBearish + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXTMEndBearish)) - { - result += "isXTMEndBearish: " + (string)mConditions.isXTMEndBearish + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXTMEndBearishByNeutural)) - { - result += "isXTMEndBearishByNeutural: " + (string)mConditions.isXTMEndBearishByNeutural + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXTMNeutural)) - { - result += "isXTMNeutural: " + (string)mConditions.isXTMNeutural + separator; - } - - // - // Separator ... - result += separator; - - // - // XAMA ... - result += - "| XAMA |" + separator; - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXAMAPeak)) - { - result += "isXAMAPeak: " + (string)mConditions.isXAMAPeak + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXAMAVale)) - { - result += "isXAMAVale: " + (string)mConditions.isXAMAVale + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXAMAStartBullish)) - { - result += "isXAMAStartBullish: " + (string)mConditions.isXAMAStartBullish + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXAMAStartBullishAfterNeutural)) - { - result += "isXAMAStartBullishAfterNeutural: " + (string)mConditions.isXAMAStartBullishAfterNeutural + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXAMABullish)) - { - result += "isXAMABullish: " + (string)mConditions.isXAMABullish + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXAMAEndBullish)) - { - result += "isXAMAEndBullish: " + (string)mConditions.isXAMAEndBullish + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXAMAEndBullishByNeutural)) - { - result += "isXAMAEndBullishByNeutural: " + (string)mConditions.isXAMAEndBullishByNeutural + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXAMAStartBearish)) - { - result += "isXAMAStartBearish: " + (string)mConditions.isXAMAStartBearish + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXAMAStartBearishAfterNeutural)) - { - result += "isXAMAStartBearishAfterNeutural: " + (string)mConditions.isXAMAStartBearishAfterNeutural + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXAMABearish)) - { - result += "isXAMABearish: " + (string)mConditions.isXAMABearish + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXAMAEndBearish)) - { - result += "isXAMAEndBearish: " + (string)mConditions.isXAMAEndBearish + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXAMAEndBearishByNeutural)) - { - result += "isXAMAEndBearishByNeutural: " + (string)mConditions.isXAMAEndBearishByNeutural + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXAMANeutural)) - { - result += "isXAMANeutural: " + (string)mConditions.isXAMANeutural + separator; - } - - // - // Separator ... - result += separator; - - // - // XTD ... - result += - "| XTD |" + separator; - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXTDSignalPeak)) - { - result += "isXTDSignalPeak: " + (string)mConditions.isXTDSignalPeak + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXTDSignalVale)) - { - result += "isXTDSignalVale: " + (string)mConditions.isXTDSignalVale + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXTDBullishPeak)) - { - result += "isXTDBullishPeak: " + (string)mConditions.isXTDBullishPeak + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXTDBullishVale)) - { - result += "isXTDBullishVale: " + (string)mConditions.isXTDBullishVale + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXTDBearishPeak)) - { - result += "isXTDBearishPeak: " + (string)mConditions.isXTDBearishPeak + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXTDBearishVale)) - { - result += "isXTDBearishVale: " + (string)mConditions.isXTDBearishVale + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXTDBullOverBear)) - { - result += "isXTDBullOverBear: " + (string)mConditions.isXTDBullOverBear + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXTDBullUnderBear)) - { - result += "isXTDBullUnderBear: " + (string)mConditions.isXTDBullUnderBear + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXTDSignalOverBear)) - { - result += "isXTDSignalOverBear: " + (string)mConditions.isXTDSignalOverBear + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXTDSignalUnderBear)) - { - result += "isXTDSignalUnderBear: " + (string)mConditions.isXTDSignalUnderBear + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXTDBullCrossedOverBear)) - { - result += "isXTDBullCrossedOverBear: " + (string)mConditions.isXTDBullCrossedOverBear + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXTDBullCrossedUnderBear)) - { - result += "isXTDBullCrossedUnderBear: " + (string)mConditions.isXTDBullCrossedUnderBear + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXTDSignalCrossedOverBear)) - { - result += "isXTDSignalCrossedOverBear: " + (string)mConditions.isXTDSignalCrossedOverBear + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXTDSignalCrossedUnderBear)) - { - result += "isXTDSignalCrossedUnderBear: " + (string)mConditions.isXTDSignalCrossedUnderBear + separator; - } - - // - // Separator ... - result += separator; - - // - // XFI ... - result += - "| XFI |" + separator; - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXFIPeak)) - { - result += "isXFIPeak: " + (string)mConditions.isXFIPeak + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXFIVale)) - { - result += "isXFIVale: " + (string)mConditions.isXFIVale + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXFIOverZero)) - { - result += "isXFIOverZero: " + (string)mConditions.isXFIOverZero + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXFIUnderZero)) - { - result += "isXFIUnderZero: " + (string)mConditions.isXFIUnderZero + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXFICrossedOverZero)) - { - result += "isXFICrossedOverZero: " + (string)mConditions.isXFICrossedOverZero + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXFICrossedUnderZero)) - { - result += "isXFICrossedUnderZero: " + (string)mConditions.isXFICrossedUnderZero + separator; - } - - // - // Separator ... - result += separator; - - // - // XTS ... - result += - "| XTS |" + separator; - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXTSAllSame)) - { - result += "isXTSAllSame: " + (string)mConditions.isXTSAllSame + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXTSCurrentMin)) - { - result += "isXTSCurrentMin: " + (string)mConditions.isXTSCurrentMin + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXTSCurrentMax)) - { - result += "isXTSCurrentMax: " + (string)mConditions.isXTSCurrentMax + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXTSCurrentOverFarest)) - { - result += "isXTSCurrentOverFarest: " + (string)mConditions.isXTSCurrentOverFarest + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXTSCurrentOverNearest)) - { - result += "isXTSCurrentOverNearest: " + (string)mConditions.isXTSCurrentOverNearest + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXTSCurrentOverMediest)) - { - result += "isXTSCurrentOverMediest: " + (string)mConditions.isXTSCurrentOverMediest + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXTSCurrentUnderFarest)) - { - result += "isXTSCurrentUnderFarest: " + (string)mConditions.isXTSCurrentUnderFarest + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXTSCurrentUnderNearest)) - { - result += "isXTSCurrentUnderNearest: " + (string)mConditions.isXTSCurrentUnderNearest + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXTSCurrentUnderMediest)) - { - result += "isXTSCurrentUnderMediest: " + (string)mConditions.isXTSCurrentUnderMediest + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXTSCurrentCrossedOverFarest)) - { - result += "isXTSCurrentCrossedOverFarest: " + (string)mConditions.isXTSCurrentCrossedOverFarest + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXTSCurrentCrossedOverNearest)) - { - result += "isXTSCurrentCrossedOverNearest: " + (string)mConditions.isXTSCurrentCrossedOverNearest + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXTSCurrentCrossedOverMediest)) - { - result += "isXTSCurrentCrossedOverMediest: " + (string)mConditions.isXTSCurrentCrossedOverMediest + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXTSCurrentCrossedUnderFarest)) - { - result += "isXTSCurrentCrossedUnderFarest: " + (string)mConditions.isXTSCurrentCrossedUnderFarest + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXTSCurrentCrossedUnderNearest)) - { - result += "isXTSCurrentCrossedUnderNearest: " + (string)mConditions.isXTSCurrentCrossedUnderNearest + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXTSCurrentCrossedUnderMediest)) - { - result += "isXTSCurrentCrossedUnderMediest: " + (string)mConditions.isXTSCurrentCrossedUnderMediest + separator; - } - - // - // Separator ... - result += separator; - - // - // XLH ... - result += - "| XLH |" + separator; - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXLHHHIncreased)) - { - result += "isXLHHHIncreased: " + (string)mConditions.isXLHHHIncreased + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXLHHHDecreased)) - { - result += "isXLHHHDecreased: " + (string)mConditions.isXLHHHDecreased + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXLHLLIncreased)) - { - result += "isXLHLLIncreased: " + (string)mConditions.isXLHLLIncreased + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXLHLLDecreased)) - { - result += "isXLHLLDecreased: " + (string)mConditions.isXLHLLDecreased + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXLHHighAttachedHH)) - { - result += "isXLHHighAttachedHH: " + (string)mConditions.isXLHHighAttachedHH + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXLHLowAttachedLL)) - { - result += "isXLHLowAttachedLL: " + (string)mConditions.isXLHLowAttachedLL + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXLHHHSameInLength)) - { - result += "isXLHHHSameInLength: " + (string)mConditions.isXLHHHSameInLength + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXLHLLSameInLength)) - { - result += "isXLHLLSameInLength: " + (string)mConditions.isXLHLLSameInLength + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXLHPriceCrossedOverSignal)) - { - result += "isXLHPriceCrossedOverSignal: " + (string)mConditions.isXLHPriceCrossedOverSignal + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXLHPriceOverSignal)) - { - result += "isXLHPriceOverSignal: " + (string)mConditions.isXLHPriceOverSignal + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXLHPriceCrossedUnderSignal)) - { - result += "isXLHPriceCrossedUnderSignal: " + (string)mConditions.isXLHPriceCrossedUnderSignal + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXLHPriceUnderSignal)) - { - result += "isXLHPriceUnderSignal: " + (string)mConditions.isXLHPriceUnderSignal + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXLHPriceInSignalRange)) - { - result += "isXLHPriceInSignalRange: " + (string)mConditions.isXLHPriceInSignalRange + separator; - } - - // - // Separator ... - result += separator; - - // - // XRSI ... - result += - "| XRSI |" + separator; - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXRSIPeak)) - { - result += "isXRSIPeak: " + (string)mConditions.isXRSIPeak + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXRSIVale)) - { - result += "isXRSIVale: " + (string)mConditions.isXRSIVale + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXRSICrossedOverLongExit)) - { - result += "isXRSICrossedOverLongExit: " + (string)mConditions.isXRSICrossedOverLongExit + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXRSICrossedOverLongEntry)) - { - result += "isXRSICrossedOverLongEntry: " + (string)mConditions.isXRSICrossedOverLongEntry + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXRSICrossedUnderShortExit)) - { - result += "isXRSICrossedUnderShortExit: " + (string)mConditions.isXRSICrossedUnderShortExit + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXRSICrossedUnderShortEntry)) - { - result += "isXRSICrossedUnderShortEntry: " + (string)mConditions.isXRSICrossedUnderShortEntry + separator; - } - - // - // Separator ... - result += separator; - - // - // XCHLH ... - result += - "| XCHLH |" + separator; - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXCHLHSameHHs)) - { - result += "isXCHLHSameHHs: " + (string)mConditions.isXCHLHSameHHs + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXCHLHSameLLs)) - { - result += "isXCHLHSameLLs: " + (string)mConditions.isXCHLHSameLLs + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXCHLHSCMCHHSame)) - { - result += "isXCHLHSCMCHHSame: " + (string)mConditions.isXCHLHSCMCHHSame + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXCHLHSCMCLLSame)) - { - result += "isXCHLHSCMCLLSame: " + (string)mConditions.isXCHLHSCMCLLSame + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXCHLHSCLCHHSame)) - { - result += "isXCHLHSCLCHHSame: " + (string)mConditions.isXCHLHSCLCHHSame + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXCHLHSCLCLLSame)) - { - result += "isXCHLHSCLCLLSame: " + (string)mConditions.isXCHLHSCLCLLSame + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXCHLHMCLCHHSame)) - { - result += "isXCHLHMCLCHHSame: " + (string)mConditions.isXCHLHMCLCHHSame + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXCHLHMCLCLLSame)) - { - result += "isXCHLHMCLCLLSame: " + (string)mConditions.isXCHLHMCLCLLSame + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXCHLHMCOnTopOfLC)) - { - result += "isXCHLHMCOnTopOfLC: " + (string)mConditions.isXCHLHMCOnTopOfLC + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXCHLHMCInBottomOfLC)) - { - result += "isXCHLHMCInBottomOfLC: " + (string)mConditions.isXCHLHMCInBottomOfLC + separator; - } - - // - // Separator ... - result += separator; - - // - // XCHMA ... - result += - "| XCHMA |" + separator; - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXCHMASCOverMax)) - { - result += "isXCHMASCOverMax: " + (string)mConditions.isXCHMASCOverMax + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXCHMASCOverMin)) - { - result += "isXCHMASCOverMin: " + (string)mConditions.isXCHMASCOverMin + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXCHMASCUnderMax)) - { - result += "isXCHMASCUnderMax: " + (string)mConditions.isXCHMASCUnderMax + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXCHMASCUnderMin)) - { - result += "isXCHMASCUnderMin: " + (string)mConditions.isXCHMASCUnderMin + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXCHMASCCrossedOverMax)) - { - result += "isXCHMASCCrossedOverMax: " + (string)mConditions.isXCHMASCCrossedOverMax + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXCHMASCCrossedUnderMax)) - { - result += "isXCHMASCCrossedUnderMax: " + (string)mConditions.isXCHMASCCrossedUnderMax + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXCHMASCCrossedOverMin)) - { - result += "isXCHMASCCrossedOverMin: " + (string)mConditions.isXCHMASCCrossedOverMin + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXCHMASCCrossedUnderMin)) - { - result += "isXCHMASCCrossedUnderMin: " + (string)mConditions.isXCHMASCCrossedUnderMin + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXCHMASCPeak)) - { - result += "isXCHMASCPeak: " + (string)mConditions.isXCHMASCPeak + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXCHMASCVale)) - { - result += "isXCHMASCVale: " + (string)mConditions.isXCHMASCVale + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXCHMASCTrendsUp)) - { - result += "isXCHMASCTrendsUp: " + (string)mConditions.isXCHMASCTrendsUp + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXCHMASCTrendsDown)) - { - result += "isXCHMASCTrendsDown: " + (string)mConditions.isXCHMASCTrendsDown + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXCHMASCFastOverSlow)) - { - result += "isXCHMASCFastOverSlow: " + (string)mConditions.isXCHMASCFastOverSlow + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXCHMASCFastUnderSlow)) - { - result += "isXCHMASCFastUnderSlow: " + (string)mConditions.isXCHMASCFastUnderSlow + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXCHMASCFastCrossedOverSlow)) - { - result += "isXCHMASCFastCrossedOverSlow: " + (string)mConditions.isXCHMASCFastCrossedOverSlow + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXCHMASCFastCrossedUnderSlow)) - { - result += "isXCHMASCFastCrossedUnderSlow: " + (string)mConditions.isXCHMASCFastCrossedUnderSlow + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXCHMAMCPeak)) - { - result += "isXCHMAMCPeak: " + (string)mConditions.isXCHMAMCPeak + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXCHMAMCVale)) - { - result += "isXCHMAMCVale: " + (string)mConditions.isXCHMAMCVale + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXCHMAMCTrendsUp)) - { - result += "isXCHMAMCTrendsUp: " + (string)mConditions.isXCHMAMCTrendsUp + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXCHMAMCTrendsDown)) - { - result += "isXCHMAMCTrendsDown: " + (string)mConditions.isXCHMAMCTrendsDown + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXCHMAMCFastOverSlow)) - { - result += "isXCHMAMCFastOverSlow: " + (string)mConditions.isXCHMAMCFastOverSlow + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXCHMAMCFastUnderSlow)) - { - result += "isXCHMAMCFastUnderSlow: " + (string)mConditions.isXCHMAMCFastUnderSlow + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXCHMAMCFastCrossedOverSlow)) - { - result += "isXCHMAMCFastCrossedOverSlow: " + (string)mConditions.isXCHMAMCFastCrossedOverSlow + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXCHMAMCFastCrossedUnderSlow)) - { - result += "isXCHMAMCFastCrossedUnderSlow: " + (string)mConditions.isXCHMAMCFastCrossedUnderSlow + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXCHMALCPeak)) - { - result += "isXCHMALCPeak: " + (string)mConditions.isXCHMALCPeak + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXCHMALCVale)) - { - result += "isXCHMALCVale: " + (string)mConditions.isXCHMALCVale + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXCHMALCTrendsUp)) - { - result += "isXCHMALCTrendsUp: " + (string)mConditions.isXCHMALCTrendsUp + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXCHMALCTrendsDown)) - { - result += "isXCHMALCTrendsDown: " + (string)mConditions.isXCHMALCTrendsDown + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXCHMALCFastOverSlow)) - { - result += "isXCHMALCFastOverSlow: " + (string)mConditions.isXCHMALCFastOverSlow + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXCHMALCFastUnderSlow)) - { - result += "isXCHMALCFastUnderSlow: " + (string)mConditions.isXCHMALCFastUnderSlow + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXCHMALCFastCrossedOverSlow)) - { - result += "isXCHMALCFastCrossedOverSlow: " + (string)mConditions.isXCHMALCFastCrossedOverSlow + separator; - } - - // - if ( - !ignoreFalses || - (ignoreFalses && mConditions.isXCHMALCFastCrossedUnderSlow)) - { - result += "isXCHMALCFastCrossedUnderSlow: " + (string)mConditions.isXCHMALCFastCrossedUnderSlow + separator; - } - - // - // Separator ... - result += separator; - - // - return result; - } - - // - // END Common Functions ... - // - - // - // START Actions Based On Signallers ... - // - - // - // START XTD Signaller ... - // - - // - // Enable Signaller ... - bool EnableSXTDignaller() - { - // - bool result = false; - - // - // Validate Args ... - if (mXTDEnableSignaller) - { - return result; - } - - // - result = true; - mXTDEnableSignaller = true; - - // - return result; - } - - // - // Disable Signaller ... - bool DisbaleXTDSignaller() - { - // - bool result = false; - - // - // Validate Args ... - if (!mXTDEnableSignaller) - { - return result; - } - - // - result = true; - mXTDEnableSignaller = false; - - // - return result; - } - - // - // Allow Sginaller to Issue Long Signals ... - bool EnableXTDLongs() - { - // - bool result = false; - - // - // Validate Args ... - if ( - !mXTDEnableSignaller || - mXTDAllowLongSignals) - { - return result; - } - - // - result = true; - mXTDAllowLongSignals = true; - - // - return result; - } - - // - // Disallow Signaller to Issue Long Signals ... - bool DisbaleXTDLongs() - { - // - bool result = false; - - // - // Validate Args ... - if ( - !mXTDEnableSignaller || - !mXTDAllowLongSignals) - { - return result; - } - - // - result = true; - mXTDAllowLongSignals = false; - - // - return result; - } - - // - // Allow Signaller to Issue Short Sginals ... - bool EnableXTDShorts() - { - // - bool result = false; - - // - // Validate Args ... - if ( - !mXTDEnableSignaller || - mXTDAllowShortSignals) - { - return result; - } - - // - result = true; - mXTDAllowShortSignals = true; - - // - return result; - } - - // - // Disallow Signaller to Issue Short Signals ... - bool DisableXTDShorts() - { - // - bool result = false; - - // - // Validate Args ... - if ( - !mXTDEnableSignaller || - !mXTDAllowShortSignals) - { - return result; - } - - // - result = true; - mXTDAllowShortSignals = false; - - // - return result; - } - - // - // Check Market Base Conditions for Long Signals ... - bool XTDHasLongConditions() - { - // - bool result = false; - - // - // Validate Args ... - if ( - !mXTDEnableSignaller || - !mXTDAllowLongSignals) - { - return result; - } - - // - // 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 ... - ( - // - mXConditions.isXTDSignalCrossedOverBear - // - ) - // - && - // - // Next Step is combine sorts of Conditions which make our choice - // so Exact in Market ... - ( - // - IsReadyForLong() - // - ) - // - ; - - // - return result; - } - - // - // Check Market Base Conditions for Short Signals ... - bool XTDHasShortConditions() - { - // - bool result = false; - - // - // Validate Args ... - if ( - !mXTDEnableSignaller || - !mXTDAllowShortSignals) - { - return result; - } - - // - // 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 ... - ( - // - mXConditions.isXTDSignalCrossedUnderBear - // - ) - // - && - // - // Next Step is combine sorts of Conditions which make our choice - // so Exact in Market ... - ( - // - IsReadyForShort() - // - ) - // - ; - - // - return result; - } - - // - // END XTD Signaller ... - // - - // - // START XTAM Signaller ... - // - - // - // Enable Signaller ... - bool EnableSXTAMignaller() - { - // - bool result = false; - - // - // Validate Args ... - if (mXTAMEnableSignaller) - { - return result; - } - - // - result = true; - mXTAMEnableSignaller = true; - - // - return result; - } - - // - // Disable Signaller ... - bool DisbaleXTAMSignaller() - { - // - bool result = false; - - // - // Validate Args ... - if (!mXTAMEnableSignaller) - { - return result; - } - - // - result = true; - mXTAMEnableSignaller = false; - - // - return result; - } - - // - // Allow Sginaller to Issue Long Signals ... - bool EnableXTAMLongs() - { - // - bool result = false; - - // - // Validate Args ... - if ( - !mXTAMEnableSignaller || - mXTAMAllowLongSignals) - { - return result; - } - - // - result = true; - mXTAMAllowLongSignals = true; - - // - return result; - } - - // - // Disallow Signaller to Issue Long Signals ... - bool DisbaleXTAMLongs() - { - // - bool result = false; - - // - // Validate Args ... - if ( - !mXTAMEnableSignaller || - !mXTAMAllowLongSignals) - { - return result; - } - - // - result = true; - mXTAMAllowLongSignals = false; - - // - return result; - } - - // - // Allow Signaller to Issue Short Sginals ... - bool EnableXTAMShorts() - { - // - bool result = false; - - // - // Validate Args ... - if ( - !mXTAMEnableSignaller || - mXTAMAllowShortSignals) - { - return result; - } - - // - result = true; - mXTAMAllowShortSignals = true; - - // - return result; - } - - // - // Disallow Signaller to Issue Short Signals ... - bool DisableXTAMShorts() - { - // - bool result = false; - - // - // Validate Args ... - if ( - !mXTAMEnableSignaller || - !mXTAMAllowShortSignals) - { - return result; - } - - // - result = true; - mXTAMAllowShortSignals = false; - - // - return result; - } - - // - // Check Market Base Conditions for Long Signals ... - bool XTAMHasLongConditions() - { - // - bool result = false; - - // - // Validate Args ... - if ( - !mXTAMEnableSignaller || - !mXTAMAllowLongSignals) - { - return result; - } - - // - // 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 ... - ( - // - (xAMAMaBuffer[1] > xTMMaBuffer[1] && - xAMAMaBuffer[2] > xTMMaBuffer[2]) - // - && - // - !(xAMAMaBuffer[2] > xTMMaBuffer[2] && - xAMAMaBuffer[3] > xTMMaBuffer[3]) - // - ) - // - && - // - // Next Step is combine sorts of Conditions which make our choice - // so Exact in Market ... - ( - // - IsReadyForLong() - // - ) - // - ; - - // - return result; - } - - // - // Check Market Base Conditions for Short Signals ... - bool XTAMHasShortConditions() - { - // - bool result = false; - - // - // Validate Args ... - if ( - !mXTAMEnableSignaller || - !mXTAMAllowShortSignals) - { - return result; - } - - // - // 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 ... - ( - // - (xAMAMaBuffer[1] < xTMMaBuffer[1] && - xAMAMaBuffer[2] < xTMMaBuffer[2]) - // - && - // - !(xAMAMaBuffer[2] < xTMMaBuffer[2] && - xAMAMaBuffer[3] < xTMMaBuffer[3]) - // - ) - // - && - // - // Next Step is combine sorts of Conditions which make our choice - // so Exact in Market ... - ( - // - IsReadyForShort() - // - ) - // - ; - - // - return result; - } - - // - // END XTAM Signaller ... - // - - // - // START XSI Signaller ... - // - - // - // Enable Signaller ... - bool EnableSXSIignaller() - { - // - bool result = false; - - // - // Validate Args ... - if (mXSIEnableSignaller) - { - return result; - } - - // - result = true; - mXSIEnableSignaller = true; - - // - return result; - } - - // - // Disable Signaller ... - bool DisbaleXSISignaller() - { - // - bool result = false; - - // - // Validate Args ... - if (!mXSIEnableSignaller) - { - return result; - } - - // - result = true; - mXSIEnableSignaller = false; - - // - return result; - } - - // - // Allow Sginaller to Issue Long Signals ... - bool EnableXSILongs() - { - // - bool result = false; - - // - // Validate Args ... - if ( - !mXSIEnableSignaller || - mXSIAllowLongSignals) - { - return result; - } - - // - result = true; - mXSIAllowLongSignals = true; - - // - return result; - } - - // - // Disallow Signaller to Issue Long Signals ... - bool DisbaleXSILongs() - { - // - bool result = false; - - // - // Validate Args ... - if ( - !mXSIEnableSignaller || - !mXSIAllowLongSignals) - { - return result; - } - - // - result = true; - mXSIAllowLongSignals = false; - - // - return result; - } - - // - // Allow Signaller to Issue Short Sginals ... - bool EnableXSIShorts() - { - // - bool result = false; - - // - // Validate Args ... - if ( - !mXSIEnableSignaller || - mXSIAllowShortSignals) - { - return result; - } - - // - result = true; - mXSIAllowShortSignals = true; - - // - return result; - } - - // - // Disallow Signaller to Issue Short Signals ... - bool DisableXSIShorts() - { - // - bool result = false; - - // - // Validate Args ... - if ( - !mXSIEnableSignaller || - !mXSIAllowShortSignals) - { - return result; - } - - // - result = true; - mXSIAllowShortSignals = false; - - // - return result; - } - - // - // Check Market Base Conditions for Long Signals ... - bool XSIHasLongConditions() - { - // - bool result = false; - - // - // Validate Args ... - if ( - !mXSIEnableSignaller || - !mXSIAllowLongSignals) - { - return result; - } - - // - // 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 ... - ( - // - mXConditions.isXRSICrossedOverLongEntry && - xRSIBuffer[3] < xRSILongEntryValue - // - ) - // - && - // - // Next Step is combine sorts of Conditions which make our choice - // so Exact in Market ... - ( - // - IsReadyForLong( - true, // XCHMA Min - true, // XCHMA Max - true, // XCHMA Cycles - true, // XCHMA Peaks - false, // XCHMA Trend Powers - true, // XOBD - true // XTS - ) - // - ) - // - ; - - // - return result; - } - - // - // Check Market Base Conditions for Short Signals ... - bool XSIHasShortConditions() - { - // - bool result = false; - - // - // Validate Args ... - if ( - !mXSIEnableSignaller || - !mXSIAllowShortSignals) - { - return result; - } - - // - // 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 ... - ( - // - mXConditions.isXRSICrossedUnderShortEntry && - xRSIBuffer[3] > xRSIShortEntryValue - // - ) - // - && - // - // Next Step is combine sorts of Conditions which make our choice - // so Exact in Market ... - ( - // - IsReadyForShort( - true, // XCHMA Min - true, // XCHMA Max - true, // XCHMA Cycles - true, // XCHMA Peaks - false, // XCHMA Trend Powers - true, // XOBD - true // XTS - ) - // - ) - // - ; - - // - return result; - } - - // - // END XSI Signaller ... - // - - // - // START XTSFI Signaller ... - // - - // - // Enable Signaller ... - bool EnableSXTSFIignaller() - { - // - bool result = false; - - // - // Validate Args ... - if (mXTSFIEnableSignaller) - { - return result; - } - - // - result = true; - mXTSFIEnableSignaller = true; - - // - return result; - } - - // - // Disable Signaller ... - bool DisbaleXTSFISignaller() - { - // - bool result = false; - - // - // Validate Args ... - if (!mXTSFIEnableSignaller) - { - return result; - } - - // - result = true; - mXTSFIEnableSignaller = false; - - // - return result; - } - - // - // Allow Sginaller to Issue Long Signals ... - bool EnableXTSFILongs() - { - // - bool result = false; - - // - // Validate Args ... - if ( - !mXTSFIEnableSignaller || - mXTSFIAllowLongSignals) - { - return result; - } - - // - result = true; - mXTSFIAllowLongSignals = true; - - // - return result; - } - - // - // Disallow Signaller to Issue Long Signals ... - bool DisbaleXTSFILongs() - { - // - bool result = false; - - // - // Validate Args ... - if ( - !mXTSFIEnableSignaller || - !mXTSFIAllowLongSignals) - { - return result; - } - - // - result = true; - mXTSFIAllowLongSignals = false; - - // - return result; - } - - // - // Allow Signaller to Issue Short Sginals ... - bool EnableXTSFIShorts() - { - // - bool result = false; - - // - // Validate Args ... - if ( - !mXTSFIEnableSignaller || - mXTSFIAllowShortSignals) - { - return result; - } - - // - result = true; - mXTSFIAllowShortSignals = true; - - // - return result; - } - - // - // Disallow Signaller to Issue Short Signals ... - bool DisableXTSFIShorts() - { - // - bool result = false; - - // - // Validate Args ... - if ( - !mXTSFIEnableSignaller || - !mXTSFIAllowShortSignals) - { - return result; - } - - // - result = true; - mXTSFIAllowShortSignals = false; - - // - return result; - } - - // - // Check Market Base Conditions for Long Signals ... - bool XTSFIHasLongConditions() - { - // - bool result = false; - - // - // Validate Args ... - if ( - !mXTSFIEnableSignaller || - !mXTSFIAllowLongSignals) - { - return result; - } - - // - // 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 ... - ( - // - XTSGetMinValue(1) == xTSFarestBuffer[1] && - (mXConditions.isXTSCurrentOverFarest || - mXConditions.isXTSCurrentCrossedOverFarest) && - (xTSCurrentBuffer[1] < xTSNearestBuffer[1] || - xTSCurrentBuffer[1] < xTSMediestBuffer[1]) && - !(mXConditions.isXTSCurrentUnderNearest || - mXConditions.isXTSCurrentCrossedUnderNearest) - // - ) - // - && - // - // Next Step is combine sorts of Conditions which make our choice - // so Exact in Market ... - ( - // - IsReadyForLong() - // - ) - // - ; - - // - return result; - } - - // - // Check Market Base Conditions for Short Signals ... - bool XTSFIHasShortConditions() - { - // - bool result = false; - - // - // Validate Args ... - if ( - !mXTSFIEnableSignaller || - !mXTSFIAllowShortSignals) - { - return result; - } - - // - // 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 ... - ( - // - XTSGetMaxValue(1) == xTSFarestBuffer[1] && - (mXConditions.isXTSCurrentUnderFarest || - mXConditions.isXTSCurrentCrossedUnderFarest) && - (xTSCurrentBuffer[1] > xTSNearestBuffer[1] || - xTSCurrentBuffer[1] > xTSMediestBuffer[1]) && - !(mXConditions.isXTSCurrentOverNearest || - mXConditions.isXTSCurrentCrossedOverNearest) - // - ) - // - && - // - // Next Step is combine sorts of Conditions which make our choice - // so Exact in Market ... - ( - // - IsReadyForShort() - // - ) - // - ; - - // - return result; - } - - // - // END XTSFI Signaller ... - // - - // - // START XOBDLH Signaller ... - // - - // - // Enable Signaller ... - bool EnableSXOBDLHignaller() - { - // - bool result = false; - - // - // Validate Args ... - if (mXOBDLHEnableSignaller) - { - return result; - } - - // - result = true; - mXOBDLHEnableSignaller = true; - - // - return result; - } - - // - // Disable Signaller ... - bool DisbaleXOBDLHSignaller() - { - // - bool result = false; - - // - // Validate Args ... - if (!mXOBDLHEnableSignaller) - { - return result; - } - - // - result = true; - mXOBDLHEnableSignaller = false; - - // - return result; - } - - // - // Allow Sginaller to Issue Long Signals ... - bool EnableXOBDLHLongs() - { - // - bool result = false; - - // - // Validate Args ... - if ( - !mXOBDLHEnableSignaller || - mXOBDLHAllowLongSignals) - { - return result; - } - - // - result = true; - mXOBDLHAllowLongSignals = true; - - // - return result; - } - - // - // Disallow Signaller to Issue Long Signals ... - bool DisbaleXOBDLHLongs() - { - // - bool result = false; - - // - // Validate Args ... - if ( - !mXOBDLHEnableSignaller || - !mXOBDLHAllowLongSignals) - { - return result; - } - - // - result = true; - mXOBDLHAllowLongSignals = false; - - // - return result; - } - - // - // Allow Signaller to Issue Short Sginals ... - bool EnableXOBDLHShorts() - { - // - bool result = false; - - // - // Validate Args ... - if ( - !mXOBDLHEnableSignaller || - mXOBDLHAllowShortSignals) - { - return result; - } - - // - result = true; - mXOBDLHAllowShortSignals = true; - - // - return result; - } - - // - // Disallow Signaller to Issue Short Signals ... - bool DisableXOBDLHShorts() - { - // - bool result = false; - - // - // Validate Args ... - if ( - !mXOBDLHEnableSignaller || - !mXOBDLHAllowShortSignals) - { - return result; - } - - // - result = true; - mXOBDLHAllowShortSignals = false; - - // - return result; - } - - // - // Check Market Base Conditions for Long Signals ... - bool XOBDLHHasLongConditions() - { - // - bool result = false; - - // - // Validate Args ... - if ( - !mXOBDLHEnableSignaller || - !mXOBDLHAllowLongSignals) - { - return result; - } - - // - XMarketConditions xConditions2 = GenerateMarketConditions(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 ... - ( - // - xConditions2.isXOBDSwingLow && - xConditions2.isXLHLowAttachedLL && - xLHLLBuffer[1] >= xLHLLBuffer[2] - // - ) - // - && - // - // Next Step is combine sorts of Conditions which make our choice - // so Exact in Market ... - ( - // - IsReadyForLong( - true, // XCHMA Min - true, // XCHMA Max - false, // XCHMA Cycles - false, // XCHMA Peaks - false, // XCHMA Trend Powers - false, // XOBD - false // XTS - ) - // - ) - // - ; - - // - return result; - } - - // - // Check Market Base Conditions for Short Signals ... - bool XOBDLHHasShortConditions() - { - // - bool result = false; - - // - // Validate Args ... - if ( - !mXOBDLHEnableSignaller || - !mXOBDLHAllowShortSignals) - { - return result; - } - - // - XMarketConditions xConditions2 = GenerateMarketConditions(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 ... - ( - // - xConditions2.isXOBDSwingHigh && - xConditions2.isXLHHighAttachedHH && - xLHHHBuffer[1] <= xLHHHBuffer[2] - // - ) - // - && - // - // Next Step is combine sorts of Conditions which make our choice - // so Exact in Market ... - ( - // - IsReadyForShort( - true, // XCHMA Min - true, // XCHMA Max - false, // XCHMA Cycles - false, // XCHMA Peaks - false, // XCHMA Trend Powers - false, // XOBD - false // XTS - ) - // - ) - // - ; - - // - return result; - } - - // - // END XOBDLH Signaller ... - // - - // - // START XCHMACC Signaller ... - // - - // - // Enable Signaller ... - bool EnableSXCHMACCignaller() - { - // - bool result = false; - - // - // Validate Args ... - if (mXCHMACCEnableSignaller) - { - return result; - } - - // - result = true; - mXCHMACCEnableSignaller = true; - - // - return result; - } - - // - // Disable Signaller ... - bool DisbaleXCHMACCSignaller() - { - // - bool result = false; - - // - // Validate Args ... - if (!mXCHMACCEnableSignaller) - { - return result; - } - - // - result = true; - mXCHMACCEnableSignaller = false; - - // - return result; - } - - // - // Allow Sginaller to Issue Long Signals ... - bool EnableXCHMACCLongs() - { - // - bool result = false; - - // - // Validate Args ... - if ( - !mXCHMACCEnableSignaller || - mXCHMACCAllowLongSignals) - { - return result; - } - - // - result = true; - mXCHMACCAllowLongSignals = true; - - // - return result; - } - - // - // Disallow Signaller to Issue Long Signals ... - bool DisbaleXCHMACCLongs() - { - // - bool result = false; - - // - // Validate Args ... - if ( - !mXCHMACCEnableSignaller || - !mXCHMACCAllowLongSignals) - { - return result; - } - - // - result = true; - mXCHMACCAllowLongSignals = false; - - // - return result; - } - - // - // Allow Signaller to Issue Short Sginals ... - bool EnableXCHMACCShorts() - { - // - bool result = false; - - // - // Validate Args ... - if ( - !mXCHMACCEnableSignaller || - mXCHMACCAllowShortSignals) - { - return result; - } - - // - result = true; - mXCHMACCAllowShortSignals = true; - - // - return result; - } - - // - // Disallow Signaller to Issue Short Signals ... - bool DisableXCHMACCShorts() - { - // - bool result = false; - - // - // Validate Args ... - if ( - !mXCHMACCEnableSignaller || - !mXCHMACCAllowShortSignals) - { - return result; - } - - // - result = true; - mXCHMACCAllowShortSignals = false; - - // - return result; - } - - // - // Check Market Base Conditions for Long Signals ... - bool XCHMACCHasLongConditions() - { - // - bool result = false; - - // - // Validate Args ... - if ( - !mXCHMACCEnableSignaller || - !mXCHMACCAllowLongSignals) - { - return result; - } - - // - // 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 ... - ( - // - xCHMAScFastBuffer[1] > xCHMAScSlowBuffer[1] && - xCHMAMcFastBuffer[1] > xCHMAMcSlowBuffer[1] && - xCHMALcFastBuffer[1] > xCHMALcSlowBuffer[1] && - // - xCHMAScFastBuffer[2] > xCHMAScSlowBuffer[2] && - xCHMAMcFastBuffer[2] > xCHMAMcSlowBuffer[2] && - xCHMALcFastBuffer[2] > xCHMALcSlowBuffer[2] && - // - !( - // - xCHMAScFastBuffer[3] > xCHMAScSlowBuffer[3] && - xCHMAMcFastBuffer[3] > xCHMAMcSlowBuffer[3] && - xCHMALcFastBuffer[3] > xCHMALcSlowBuffer[3] - // - ) - // - ) - // - && - // - // Next Step is combine sorts of Conditions which make our choice - // so Exact in Market ... - ( - // - IsReadyForLong() - // - ) - // - ; - - // - return result; - } - - // - // Check Market Base Conditions for Short Signals ... - bool XCHMACCHasShortConditions() - { - // - bool result = false; - - // - // Validate Args ... - if ( - !mXCHMACCEnableSignaller || - !mXCHMACCAllowShortSignals) - { - return result; - } - - // - // 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 ... - ( - // - xCHMAScFastBuffer[1] < xCHMAScSlowBuffer[1] && - xCHMAMcFastBuffer[1] < xCHMAMcSlowBuffer[1] && - xCHMALcFastBuffer[1] < xCHMALcSlowBuffer[1] && - // - xCHMAScFastBuffer[2] < xCHMAScSlowBuffer[2] && - xCHMAMcFastBuffer[2] < xCHMAMcSlowBuffer[2] && - xCHMALcFastBuffer[2] < xCHMALcSlowBuffer[2] && - // - !( - // - xCHMAScFastBuffer[3] < xCHMAScSlowBuffer[3] && - xCHMAMcFastBuffer[3] < xCHMAMcSlowBuffer[3] && - xCHMALcFastBuffer[3] < xCHMALcSlowBuffer[3] - // - ) - // - ) - // - && - // - // Next Step is combine sorts of Conditions which make our choice - // so Exact in Market ... - ( - // - IsReadyForShort() - // - ) - // - ; - - // - return result; - } - - // - // END XCHMACC Signaller ... - // - - // - // START XCHMAMX Signaller ... - // - - // - // Enable Signaller ... - bool EnableSXCHMAMXignaller() - { - // - bool result = false; - - // - // Validate Args ... - if (mXCHMAMXEnableSignaller) - { - return result; - } - - // - result = true; - mXCHMAMXEnableSignaller = true; - - // - return result; - } - - // - // Disable Signaller ... - bool DisbaleXCHMAMXSignaller() - { - // - bool result = false; - - // - // Validate Args ... - if (!mXCHMAMXEnableSignaller) - { - return result; - } - - // - result = true; - mXCHMAMXEnableSignaller = false; - - // - return result; - } - - // - // Allow Sginaller to Issue Long Signals ... - bool EnableXCHMAMXLongs() - { - // - bool result = false; - - // - // Validate Args ... - if ( - !mXCHMAMXEnableSignaller || - mXCHMAMXAllowLongSignals) - { - return result; - } - - // - result = true; - mXCHMAMXAllowLongSignals = true; - - // - return result; - } - - // - // Disallow Signaller to Issue Long Signals ... - bool DisbaleXCHMAMXLongs() - { - // - bool result = false; - - // - // Validate Args ... - if ( - !mXCHMAMXEnableSignaller || - !mXCHMAMXAllowLongSignals) - { - return result; - } - - // - result = true; - mXCHMAMXAllowLongSignals = false; - - // - return result; - } - - // - // Allow Signaller to Issue Short Sginals ... - bool EnableXCHMAMXShorts() - { - // - bool result = false; - - // - // Validate Args ... - if ( - !mXCHMAMXEnableSignaller || - mXCHMAMXAllowShortSignals) - { - return result; - } - - // - result = true; - mXCHMAMXAllowShortSignals = true; - - // - return result; - } - - // - // Disallow Signaller to Issue Short Signals ... - bool DisableXCHMAMXShorts() - { - // - bool result = false; - - // - // Validate Args ... - if ( - !mXCHMAMXEnableSignaller || - !mXCHMAMXAllowShortSignals) - { - return result; - } - - // - result = true; - mXCHMAMXAllowShortSignals = false; - - // - return result; - } - - // - // Check Market Base Conditions for Long Signals ... - bool XCHMAMXHasLongConditions() - { - // - bool result = false; - - // - // Validate Args ... - if ( - !mXCHMAMXEnableSignaller || - !mXCHMAMXAllowLongSignals) - { - return result; - } - - // - ENUM_XCHMA_CYCLES cycles[]; - Add( - X_XCHMA_CYCLE_MEDIUM, - cycles); - Add( - X_XCHMA_CYCLE_LONG, - cycles); - - // - double xCHMANonSCMax2 = XCHMAGetCyclesMaxValue(2, cycles); - - // - // 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 ... - ( - // - mXConditions.isXCHMASCCrossedOverMax && - xCHMAScFastBuffer[2] < xCHMANonSCMax2 && - xCHMAScSlowBuffer[2] < xCHMANonSCMax2 && - MathAbs(xCHMANonSCMax2 - xCHMAScFastBuffer[2]) > MathAbs(xCHMAScFastBuffer[2] - xCHMAScSlowBuffer[2]) && - MathAbs(xCHMANonSCMax2 - xCHMAScSlowBuffer[2]) > MathAbs(xCHMAScFastBuffer[2] - xCHMAScSlowBuffer[2]) - // - ) - // - && - // - // Next Step is combine sorts of Conditions which make our choice - // so Exact in Market ... - ( - // - IsReadyForLong( - true, // XCHMA Min - true, // XCHMA Max - false, // XCHMA Cycles - false, // XCHMA Peaks - false, // XCHMA Trend Powers - true, // XOBD - true // XTS - ) - // - ) - // - ; - - // - return result; - } - - // - // Check Market Base Conditions for Short Signals ... - bool XCHMAMXHasShortConditions() - { - // - bool result = false; - - // - // Validate Args ... - if ( - !mXCHMAMXEnableSignaller || - !mXCHMAMXAllowShortSignals) - { - return result; - } - - // - ENUM_XCHMA_CYCLES cycles[]; - Add( - X_XCHMA_CYCLE_MEDIUM, - cycles); - Add( - X_XCHMA_CYCLE_LONG, - cycles); - - // - double xCHMANonSCMax2 = XCHMAGetCyclesMaxValue(2, cycles); - - // - // 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 ... - ( - // - mXConditions.isXCHMASCCrossedUnderMax && - xCHMAScFastBuffer[2] > xCHMANonSCMax2 && - xCHMAScSlowBuffer[2] > xCHMANonSCMax2 - // - ) - // - && - // - // Next Step is combine sorts of Conditions which make our choice - // so Exact in Market ... - ( - // - IsReadyForShort( - true, // XCHMA Min - true, // XCHMA Max - false, // XCHMA Cycles - false, // XCHMA Peaks - false, // XCHMA Trend Powers - true, // XOBD - true // XTS - ) - // - ) - // - ; - // - return result; - } - - // - // END XCHMAMX Signaller ... - // - - // - // START XCHMAMN Signaller ... - // - - // - // Enable Signaller ... - bool EnableSXCHMAMNignaller() - { - // - bool result = false; - - // - // Validate Args ... - if (mXCHMAMNEnableSignaller) - { - return result; - } - - // - result = true; - mXCHMAMNEnableSignaller = true; - - // - return result; - } - - // - // Disable Signaller ... - bool DisbaleXCHMAMNSignaller() - { - // - bool result = false; - - // - // Validate Args ... - if (!mXCHMAMNEnableSignaller) - { - return result; - } - - // - result = true; - mXCHMAMNEnableSignaller = false; - - // - return result; - } - - // - // Allow Sginaller to Issue Long Signals ... - bool EnableXCHMAMNLongs() - { - // - bool result = false; - - // - // Validate Args ... - if ( - !mXCHMAMNEnableSignaller || - mXCHMAMNAllowLongSignals) - { - return result; - } - - // - result = true; - mXCHMAMNAllowLongSignals = true; - - // - return result; - } - - // - // Disallow Signaller to Issue Long Signals ... - bool DisbaleXCHMAMNLongs() - { - // - bool result = false; - - // - // Validate Args ... - if ( - !mXCHMAMNEnableSignaller || - !mXCHMAMNAllowLongSignals) - { - return result; - } - - // - result = true; - mXCHMAMNAllowLongSignals = false; - - // - return result; - } - - // - // Allow Signaller to Issue Short Sginals ... - bool EnableXCHMAMNShorts() - { - // - bool result = false; - - // - // Validate Args ... - if ( - !mXCHMAMNEnableSignaller || - mXCHMAMNAllowShortSignals) - { - return result; - } - - // - result = true; - mXCHMAMNAllowShortSignals = true; - - // - return result; - } - - // - // Disallow Signaller to Issue Short Signals ... - bool DisableXCHMAMNShorts() - { - // - bool result = false; - - // - // Validate Args ... - if ( - !mXCHMAMNEnableSignaller || - !mXCHMAMNAllowShortSignals) - { - return result; - } - - // - result = true; - mXCHMAMNAllowShortSignals = false; - - // - return result; - } - - // - // Check Market Base Conditions for Long Signals ... - bool XCHMAMNHasLongConditions() - { - // - bool result = false; - - // - // Validate Args ... - if ( - !mXCHMAMNEnableSignaller || - !mXCHMAMNAllowLongSignals) - { - return result; - } - - // - ENUM_XCHMA_CYCLES cycles[]; - Add( - X_XCHMA_CYCLE_MEDIUM, - cycles); - Add( - X_XCHMA_CYCLE_LONG, - cycles); - - // - double xCHMANonSCMin2 = XCHMAGetCyclesMinValue(2, cycles); - - // - // 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 ... - ( - // - mXConditions.isXCHMASCCrossedOverMin && - xCHMAScFastBuffer[2] < xCHMANonSCMin2 && - xCHMAScSlowBuffer[2] < xCHMANonSCMin2 - // - ) - // - && - // - // Next Step is combine sorts of Conditions which make our choice - // so Exact in Market ... - ( - // - IsReadyForLong( - true, // XCHMA Min - true, // XCHMA Max - false, // XCHMA Cycles - false, // XCHMA Peaks - false, // XCHMA Trend Powers - true, // XOBD - true // XTS - ) - // - ) - // - ; - - // - return result; - } - - // - // Check Market Base Conditions for Short Signals ... - bool XCHMAMNHasShortConditions() - { - // - bool result = false; - - // - // Validate Args ... - if ( - !mXCHMAMNEnableSignaller || - !mXCHMAMNAllowShortSignals) - { - return result; - } - - // - ENUM_XCHMA_CYCLES cycles[]; - Add( - X_XCHMA_CYCLE_MEDIUM, - cycles); - Add( - X_XCHMA_CYCLE_LONG, - cycles); - - // - double xCHMANonSCMin2 = XCHMAGetCyclesMinValue(2, cycles); - - // - // 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 ... - ( - // - mXConditions.isXCHMASCCrossedUnderMin && - xCHMAScFastBuffer[2] > xCHMANonSCMin2 && - xCHMAScSlowBuffer[2] > xCHMANonSCMin2 - // - ) - // - && - // - // Next Step is combine sorts of Conditions which make our choice - // so Exact in Market ... - ( - // - IsReadyForLong( - true, // XCHMA Min - true, // XCHMA Max - false, // XCHMA Cycles - false, // XCHMA Peaks - false, // XCHMA Trend Powers - true, // XOBD - true // XTS - ) - // - ) - // - ; - // - return result; - } - - // - // END XCHMAMN Signaller ... - // - - // - // END Actions Based On Signallers ... - // - - // - // Protected ... -protected: - // - // Private ... -private: - // - // XTD ... - bool mXTDEnableSignaller; - bool mXTDAllowLongSignals; - bool mXTDAllowShortSignals; - - // - // XTAM ... - bool mXTAMEnableSignaller; - bool mXTAMAllowLongSignals; - bool mXTAMAllowShortSignals; - - // - // XSI ... - bool mXSIEnableSignaller; - bool mXSIAllowLongSignals; - bool mXSIAllowShortSignals; - - // - // XTSFI ... - bool mXTSFIEnableSignaller; - bool mXTSFIAllowLongSignals; - bool mXTSFIAllowShortSignals; - - // - // XOBDLH ... - bool mXOBDLHEnableSignaller; - bool mXOBDLHAllowLongSignals; - bool mXOBDLHAllowShortSignals; - - // - // XCHMACC ... - bool mXCHMACCEnableSignaller; - bool mXCHMACCAllowLongSignals; - bool mXCHMACCAllowShortSignals; - - // - // XCHMAMX ... - bool mXCHMAMXEnableSignaller; - bool mXCHMAMXAllowLongSignals; - bool mXCHMAMXAllowShortSignals; - - // - // XCHMAMN ... - bool mXCHMAMNEnableSignaller; - bool mXCHMAMNAllowLongSignals; - bool mXCHMAMNAllowShortSignals; - - // - // Here we Define some Global Market Variables to Analyse MArket Conditions - // using them at each time ... - XMarketConditions mXConditions; -}; \ No newline at end of file diff --git a/Classes/x-saherelm.xhelper.class.mq5 b/Classes/x-saherelm.xhelper.class.mq5 new file mode 100644 index 00000000..966eb8d9 --- /dev/null +++ b/Classes/x-saherelm.xhelper.class.mq5 @@ -0,0 +1,148 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL5 Class Library +// ---------------------------------------------- +// Name: XSCBaseHelper +// Description: provides all Base 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 + +// +// Includes ... +#include "../Classes/x-saherelm.base.class.mq5" + +// +// Definitions ... + +// +// a Class for Handle base requirements ... +// for indicators ... +class XSCBaseHelper : public XSCBase +{ + // + // Public ... +public: + // + // Constructor ... + void XSCBaseHelper( + string symbol, // Trading Symbol + ENUM_TIMEFRAMES period // Trading Time Frame + ) + { + // + mSymbol = symbol; + mPeriod = period; + } + + // + // Deconstructor ... + void ~XSCBaseHelper() + { + // + IndicatorRelease(mHandler); + } + + // + // Setter(s) / Getter(s) ... + + // + // Symbol ... + string GetSymbol() + { + return mSymbol; + } + + // + // Period ... + ENUM_TIMEFRAMES GetPeriod() + { + return mPeriod; + } + + // + // Retrieve Bars ... + int CountBars() + { + // + int result = + Bars( + mSymbol, + mPeriod + // + ); + + // + return result; + } + + // + // Retrieve Indicator Calculated Bars ... + int CountCalculatedBars() + { + return BarsCalculated(mHandler); + } + + // + // Generate Tag ... + virtual string GetTag() + { + // + string result = NULL; + + // + result = + // + GetToken() + + "[" + + GetSymbol() + "|" + + ToString(GetPeriod()) + + "]" + // + ; + + // + return result; + } + + // + // Functions ... + + // + // Protected ... +protected: + // + // Props ... + + // + // Symbol ... + string mSymbol; + + // + // Period ... + ENUM_TIMEFRAMES mPeriod; + + // + // Indicator Handler ... + int mHandler; + + // + // Private ... +private: + // +}; + +// +// Tools .... \ No newline at end of file diff --git a/Helpers/x-saherelm.xama.helper.mq5 b/Helpers/x-saherelm.xama.helper.mq5 new file mode 100644 index 00000000..2c2dbbea --- /dev/null +++ b/Helpers/x-saherelm.xama.helper.mq5 @@ -0,0 +1,256 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL5 Helper Class Library +// ---------------------------------------------- +// Name: XSCXAMAHelper +// 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_XAMA_BUFFERS +{ + XAMA_MAIN_LINE = 0 +}; + +// +// Input Models ... +struct XXAMAInputs +{ + // + // Props ... + string tmp; + + // + // Constructor(s) ... + XXAMAInputs() + { + // + Clean(); + } + + // + // Tools ... + + // + // Clean ... + void Clean() + { + // + } + + // + // Default ... + void Default() + { + // + } + + // + // Validate ... + bool IsValid() + { + // + bool result = false; + + // + result = + // + false + // + ; + + // + return result; + } + + // + // Retrieve MAx Length ... + int Max() + { + // + int result = 0; + + // + result = MathMax(0, 0); + + // + return result; + } +}; + +// +// Class ... +class XSCXAMAHelper : public XSCBaseHelper +{ + // + // Public ... +public: + // + // Props ... + + // + // Constructors ... + XSCXAMAHelper() : XSCBaseHelper(_Symbol, _Period) + { + } + + // + // Deconstructor ... + ~XSCXAMAHelper() {} + + // + // Tools ... + bool Init( + string symbol, // Trading Symbol + ENUM_TIMEFRAMES period, // Trading Period + XXAMAInputs &inputs // Inputs + ) + { + // + bool result = false; + + // + mSymbol = symbol; + mPeriod = period; + + // + result = inputs.IsValid(); + if (!result) + { + return result; + } + + // + mInputs = inputs; + + // // + // // ArraySetAsSeries(shortExit2Buffer, true); + // mHandler = iCustom( + // mSymbol, + // mPeriod, + // "x-saherelm.x", + // // + // // Inputs ... + // // + // ); + // result = mHandler != INVALID_HANDLE; + // if (!result) + // { + // return result; + // } + + // + return result; + } + + // + // Inputs ... + + // + XXAMAInputs GetInputs() + { + return mInputs; + } + + // + bool SetInputs( + XXAMAInputs &inputs // Configs + ) + { + // + return Init( + mSymbol, + mPeriod, + inputs + // + ); + } + + // + // Buffers ... + + // // + // // Copy Required Long Exits 2 ... + // int CopyLongExit2( + // 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, + // longExit2Buffer, + // buffer, + // forceClean + // // + // ); + // } + + // + // Protected ... +protected: + // + // Private ... +private: + // + // Props ... + XXAMAInputs mInputs; // Inputs ... + + // + // Buffers ... + // double longExit1Buffer[]; + + // + // Tools ... + + // + // Calculate Values Until Now ... + void Calculate() + { + // + int totalBars = CountBars(); + + // // + // // Short Exit 2 ... + // CopyBuffer( + // mHandler, + // X_CHE_SHORT_EXIT_2_LINE, + // 0, + // totalBars, + // shortExit2Buffer + // // + // ); + } +} + +// +// Tools ... \ No newline at end of file diff --git a/Helpers/x-saherelm.xcc.helper.mq5 b/Helpers/x-saherelm.xcc.helper.mq5 new file mode 100644 index 00000000..125162e5 --- /dev/null +++ b/Helpers/x-saherelm.xcc.helper.mq5 @@ -0,0 +1,256 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL5 Helper Class Library +// ---------------------------------------------- +// Name: XSCXCCHelper +// 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_XCC_BUFFERS +{ + XCC_MAIN_LINE = 0 +}; + +// +// Input Models ... +struct XXCCInputs +{ + // + // Props ... + string tmp; + + // + // Constructor(s) ... + XXCCInputs() + { + // + Clean(); + } + + // + // Tools ... + + // + // Clean ... + void Clean() + { + // + } + + // + // Default ... + void Default() + { + // + } + + // + // Validate ... + bool IsValid() + { + // + bool result = false; + + // + result = + // + false + // + ; + + // + return result; + } + + // + // Retrieve MAx Length ... + int Max() + { + // + int result = 0; + + // + result = MathMax(0, 0); + + // + return result; + } +}; + +// +// Class ... +class XSCXCCHelper : public XSCBaseHelper +{ + // + // Public ... +public: + // + // Props ... + + // + // Constructors ... + XSCXCCHelper() : XSCBaseHelper(_Symbol, _Period) + { + } + + // + // Deconstructor ... + ~XSCXCCHelper() {} + + // + // Tools ... + bool Init( + string symbol, // Trading Symbol + ENUM_TIMEFRAMES period, // Trading Period + XXCCInputs &inputs // Inputs + ) + { + // + bool result = false; + + // + mSymbol = symbol; + mPeriod = period; + + // + result = inputs.IsValid(); + if (!result) + { + return result; + } + + // + mInputs = inputs; + + // // + // // ArraySetAsSeries(shortExit2Buffer, true); + // mHandler = iCustom( + // mSymbol, + // mPeriod, + // "x-saherelm.x", + // // + // // Inputs ... + // // + // ); + // result = mHandler != INVALID_HANDLE; + // if (!result) + // { + // return result; + // } + + // + return result; + } + + // + // Inputs ... + + // + XXCCInputs GetInputs() + { + return mInputs; + } + + // + bool SetInputs( + XXCCInputs &inputs // Configs + ) + { + // + return Init( + mSymbol, + mPeriod, + inputs + // + ); + } + + // + // Buffers ... + + // // + // // Copy Required Long Exits 2 ... + // int CopyLongExit2( + // 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, + // longExit2Buffer, + // buffer, + // forceClean + // // + // ); + // } + + // + // Protected ... +protected: + // + // Private ... +private: + // + // Props ... + XXCCInputs mInputs; // Inputs ... + + // + // Buffers ... + // double longExit1Buffer[]; + + // + // Tools ... + + // + // Calculate Values Until Now ... + void Calculate() + { + // + int totalBars = CountBars(); + + // // + // // Short Exit 2 ... + // CopyBuffer( + // mHandler, + // X_CHE_SHORT_EXIT_2_LINE, + // 0, + // totalBars, + // shortExit2Buffer + // // + // ); + } +} + +// +// Tools ... \ No newline at end of file diff --git a/Helpers/x-saherelm.xchlh.helper.mq5 b/Helpers/x-saherelm.xchlh.helper.mq5 new file mode 100644 index 00000000..db2a241e --- /dev/null +++ b/Helpers/x-saherelm.xchlh.helper.mq5 @@ -0,0 +1,256 @@ +/////////////////////////////////////////////////////// +// +// 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 +{ + XCHLH_MAIN_LINE = 0 +}; + +// +// Input Models ... +struct XXCHLHInputs +{ + // + // Props ... + string tmp; + + // + // Constructor(s) ... + XXCHLHInputs() + { + // + Clean(); + } + + // + // Tools ... + + // + // Clean ... + void Clean() + { + // + } + + // + // Default ... + void Default() + { + // + } + + // + // Validate ... + bool IsValid() + { + // + bool result = false; + + // + result = + // + false + // + ; + + // + return result; + } + + // + // Retrieve MAx Length ... + int Max() + { + // + int result = 0; + + // + result = MathMax(0, 0); + + // + 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 + XXCHLHInputs &inputs // Inputs + ) + { + // + bool result = false; + + // + mSymbol = symbol; + mPeriod = period; + + // + result = inputs.IsValid(); + if (!result) + { + return result; + } + + // + mInputs = inputs; + + // // + // // ArraySetAsSeries(shortExit2Buffer, true); + // mHandler = iCustom( + // mSymbol, + // mPeriod, + // "x-saherelm.x", + // // + // // Inputs ... + // // + // ); + // result = mHandler != INVALID_HANDLE; + // if (!result) + // { + // return result; + // } + + // + return result; + } + + // + // Inputs ... + + // + XXCHLHInputs GetInputs() + { + return mInputs; + } + + // + bool SetInputs( + XXCHLHInputs &inputs // Configs + ) + { + // + return Init( + mSymbol, + mPeriod, + inputs + // + ); + } + + // + // Buffers ... + + // // + // // Copy Required Long Exits 2 ... + // int CopyLongExit2( + // 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, + // longExit2Buffer, + // buffer, + // forceClean + // // + // ); + // } + + // + // Protected ... +protected: + // + // Private ... +private: + // + // Props ... + XXCHLHInputs mInputs; // Inputs ... + + // + // Buffers ... + // double longExit1Buffer[]; + + // + // Tools ... + + // + // Calculate Values Until Now ... + void Calculate() + { + // + int totalBars = CountBars(); + + // // + // // Short Exit 2 ... + // CopyBuffer( + // mHandler, + // X_CHE_SHORT_EXIT_2_LINE, + // 0, + // totalBars, + // shortExit2Buffer + // // + // ); + } +} + +// +// Tools ... \ No newline at end of file diff --git a/Helpers/x-saherelm.xchma.helper.mq5 b/Helpers/x-saherelm.xchma.helper.mq5 new file mode 100644 index 00000000..1237da18 --- /dev/null +++ b/Helpers/x-saherelm.xchma.helper.mq5 @@ -0,0 +1,256 @@ +/////////////////////////////////////////////////////// +// +// 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 +{ + XCHMA_MAIN_LINE = 0 +}; + +// +// Input Models ... +struct XXCHMAInputs +{ + // + // Props ... + string tmp; + + // + // Constructor(s) ... + XXCHMAInputs() + { + // + Clean(); + } + + // + // Tools ... + + // + // Clean ... + void Clean() + { + // + } + + // + // Default ... + void Default() + { + // + } + + // + // Validate ... + bool IsValid() + { + // + bool result = false; + + // + result = + // + false + // + ; + + // + return result; + } + + // + // Retrieve MAx Length ... + int Max() + { + // + int result = 0; + + // + result = MathMax(0, 0); + + // + 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 + XXCHMAInputs &inputs // Inputs + ) + { + // + bool result = false; + + // + mSymbol = symbol; + mPeriod = period; + + // + result = inputs.IsValid(); + if (!result) + { + return result; + } + + // + mInputs = inputs; + + // // + // // ArraySetAsSeries(shortExit2Buffer, true); + // mHandler = iCustom( + // mSymbol, + // mPeriod, + // "x-saherelm.x", + // // + // // Inputs ... + // // + // ); + // result = mHandler != INVALID_HANDLE; + // if (!result) + // { + // return result; + // } + + // + return result; + } + + // + // Inputs ... + + // + XXCHMAInputs GetInputs() + { + return mInputs; + } + + // + bool SetInputs( + XXCHMAInputs &inputs // Configs + ) + { + // + return Init( + mSymbol, + mPeriod, + inputs + // + ); + } + + // + // Buffers ... + + // // + // // Copy Required Long Exits 2 ... + // int CopyLongExit2( + // 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, + // longExit2Buffer, + // buffer, + // forceClean + // // + // ); + // } + + // + // Protected ... +protected: + // + // Private ... +private: + // + // Props ... + XXCHMAInputs mInputs; // Inputs ... + + // + // Buffers ... + // double longExit1Buffer[]; + + // + // Tools ... + + // + // Calculate Values Until Now ... + void Calculate() + { + // + int totalBars = CountBars(); + + // // + // // Short Exit 2 ... + // CopyBuffer( + // mHandler, + // X_CHE_SHORT_EXIT_2_LINE, + // 0, + // totalBars, + // shortExit2Buffer + // // + // ); + } +} + +// +// Tools ... \ No newline at end of file diff --git a/Helpers/x-saherelm.xfi.helper.mq5 b/Helpers/x-saherelm.xfi.helper.mq5 new file mode 100644 index 00000000..13e8c04e --- /dev/null +++ b/Helpers/x-saherelm.xfi.helper.mq5 @@ -0,0 +1,256 @@ +/////////////////////////////////////////////////////// +// +// 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 XXFIInputs +{ + // + // Props ... + string tmp; + + // + // Constructor(s) ... + XXFIInputs() + { + // + Clean(); + } + + // + // Tools ... + + // + // Clean ... + void Clean() + { + // + } + + // + // Default ... + void Default() + { + // + } + + // + // Validate ... + bool IsValid() + { + // + bool result = false; + + // + result = + // + false + // + ; + + // + return result; + } + + // + // Retrieve MAx Length ... + int Max() + { + // + int result = 0; + + // + result = MathMax(0, 0); + + // + 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 + XXFIInputs &inputs // Inputs + ) + { + // + bool result = false; + + // + mSymbol = symbol; + mPeriod = period; + + // + result = inputs.IsValid(); + if (!result) + { + return result; + } + + // + mInputs = inputs; + + // // + // // ArraySetAsSeries(shortExit2Buffer, true); + // mHandler = iCustom( + // mSymbol, + // mPeriod, + // "x-saherelm.x", + // // + // // Inputs ... + // // + // ); + // result = mHandler != INVALID_HANDLE; + // if (!result) + // { + // return result; + // } + + // + return result; + } + + // + // Inputs ... + + // + XXFIInputs GetInputs() + { + return mInputs; + } + + // + bool SetInputs( + XXFIInputs &inputs // Configs + ) + { + // + return Init( + mSymbol, + mPeriod, + inputs + // + ); + } + + // + // Buffers ... + + // // + // // Copy Required Long Exits 2 ... + // int CopyLongExit2( + // 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, + // longExit2Buffer, + // buffer, + // forceClean + // // + // ); + // } + + // + // Protected ... +protected: + // + // Private ... +private: + // + // Props ... + XXFIInputs mInputs; // Inputs ... + + // + // Buffers ... + // double longExit1Buffer[]; + + // + // Tools ... + + // + // Calculate Values Until Now ... + void Calculate() + { + // + int totalBars = CountBars(); + + // // + // // Short Exit 2 ... + // CopyBuffer( + // mHandler, + // X_CHE_SHORT_EXIT_2_LINE, + // 0, + // totalBars, + // shortExit2Buffer + // // + // ); + } +} + +// +// Tools ... \ No newline at end of file diff --git a/Helpers/x-saherelm.xlh.helper.mq5 b/Helpers/x-saherelm.xlh.helper.mq5 new file mode 100644 index 00000000..d8bd0665 --- /dev/null +++ b/Helpers/x-saherelm.xlh.helper.mq5 @@ -0,0 +1,256 @@ +/////////////////////////////////////////////////////// +// +// 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_MAIN_LINE = 0 +}; + +// +// Input Models ... +struct XXLHInputs +{ + // + // Props ... + string tmp; + + // + // Constructor(s) ... + XXLHInputs() + { + // + Clean(); + } + + // + // Tools ... + + // + // Clean ... + void Clean() + { + // + } + + // + // Default ... + void Default() + { + // + } + + // + // Validate ... + bool IsValid() + { + // + bool result = false; + + // + result = + // + false + // + ; + + // + return result; + } + + // + // Retrieve MAx Length ... + int Max() + { + // + int result = 0; + + // + result = MathMax(0, 0); + + // + 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 + XXLHInputs &inputs // Inputs + ) + { + // + bool result = false; + + // + mSymbol = symbol; + mPeriod = period; + + // + result = inputs.IsValid(); + if (!result) + { + return result; + } + + // + mInputs = inputs; + + // // + // // ArraySetAsSeries(shortExit2Buffer, true); + // mHandler = iCustom( + // mSymbol, + // mPeriod, + // "x-saherelm.x", + // // + // // Inputs ... + // // + // ); + // result = mHandler != INVALID_HANDLE; + // if (!result) + // { + // return result; + // } + + // + return result; + } + + // + // Inputs ... + + // + XXLHInputs GetInputs() + { + return mInputs; + } + + // + bool SetInputs( + XXLHInputs &inputs // Configs + ) + { + // + return Init( + mSymbol, + mPeriod, + inputs + // + ); + } + + // + // Buffers ... + + // // + // // Copy Required Long Exits 2 ... + // int CopyLongExit2( + // 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, + // longExit2Buffer, + // buffer, + // forceClean + // // + // ); + // } + + // + // Protected ... +protected: + // + // Private ... +private: + // + // Props ... + XXLHInputs mInputs; // Inputs ... + + // + // Buffers ... + // double longExit1Buffer[]; + + // + // Tools ... + + // + // Calculate Values Until Now ... + void Calculate() + { + // + int totalBars = CountBars(); + + // // + // // Short Exit 2 ... + // CopyBuffer( + // mHandler, + // X_CHE_SHORT_EXIT_2_LINE, + // 0, + // totalBars, + // shortExit2Buffer + // // + // ); + } +} + +// +// Tools ... \ No newline at end of file diff --git a/Helpers/x-saherelm.xobd.helper.mq5 b/Helpers/x-saherelm.xobd.helper.mq5 new file mode 100644 index 00000000..dc6c58f4 --- /dev/null +++ b/Helpers/x-saherelm.xobd.helper.mq5 @@ -0,0 +1,256 @@ +/////////////////////////////////////////////////////// +// +// 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 XXOBDInputs +{ + // + // Props ... + string tmp; + + // + // Constructor(s) ... + XXOBDInputs() + { + // + Clean(); + } + + // + // Tools ... + + // + // Clean ... + void Clean() + { + // + } + + // + // Default ... + void Default() + { + // + } + + // + // Validate ... + bool IsValid() + { + // + bool result = false; + + // + result = + // + false + // + ; + + // + return result; + } + + // + // Retrieve MAx Length ... + int Max() + { + // + int result = 0; + + // + result = MathMax(0, 0); + + // + 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 + XXOBDInputs &inputs // Inputs + ) + { + // + bool result = false; + + // + mSymbol = symbol; + mPeriod = period; + + // + result = inputs.IsValid(); + if (!result) + { + return result; + } + + // + mInputs = inputs; + + // // + // // ArraySetAsSeries(shortExit2Buffer, true); + // mHandler = iCustom( + // mSymbol, + // mPeriod, + // "x-saherelm.x", + // // + // // Inputs ... + // // + // ); + // result = mHandler != INVALID_HANDLE; + // if (!result) + // { + // return result; + // } + + // + return result; + } + + // + // Inputs ... + + // + XXOBDInputs GetInputs() + { + return mInputs; + } + + // + bool SetInputs( + XXOBDInputs &inputs // Configs + ) + { + // + return Init( + mSymbol, + mPeriod, + inputs + // + ); + } + + // + // Buffers ... + + // // + // // Copy Required Long Exits 2 ... + // int CopyLongExit2( + // 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, + // longExit2Buffer, + // buffer, + // forceClean + // // + // ); + // } + + // + // Protected ... +protected: + // + // Private ... +private: + // + // Props ... + XXOBDInputs mInputs; // Inputs ... + + // + // Buffers ... + // double longExit1Buffer[]; + + // + // Tools ... + + // + // Calculate Values Until Now ... + void Calculate() + { + // + int totalBars = CountBars(); + + // // + // // Short Exit 2 ... + // CopyBuffer( + // mHandler, + // X_CHE_SHORT_EXIT_2_LINE, + // 0, + // totalBars, + // shortExit2Buffer + // // + // ); + } +} + +// +// Tools ... \ No newline at end of file diff --git a/Helpers/x-saherelm.xrsi.helper.mq5 b/Helpers/x-saherelm.xrsi.helper.mq5 new file mode 100644 index 00000000..dccde802 --- /dev/null +++ b/Helpers/x-saherelm.xrsi.helper.mq5 @@ -0,0 +1,256 @@ +/////////////////////////////////////////////////////// +// +// 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 XXRSIInputs +{ + // + // Props ... + string tmp; + + // + // Constructor(s) ... + XXRSIInputs() + { + // + Clean(); + } + + // + // Tools ... + + // + // Clean ... + void Clean() + { + // + } + + // + // Default ... + void Default() + { + // + } + + // + // Validate ... + bool IsValid() + { + // + bool result = false; + + // + result = + // + false + // + ; + + // + return result; + } + + // + // Retrieve MAx Length ... + int Max() + { + // + int result = 0; + + // + result = MathMax(0, 0); + + // + 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 + XXRSIInputs &inputs // Inputs + ) + { + // + bool result = false; + + // + mSymbol = symbol; + mPeriod = period; + + // + result = inputs.IsValid(); + if (!result) + { + return result; + } + + // + mInputs = inputs; + + // // + // // ArraySetAsSeries(shortExit2Buffer, true); + // mHandler = iCustom( + // mSymbol, + // mPeriod, + // "x-saherelm.x", + // // + // // Inputs ... + // // + // ); + // result = mHandler != INVALID_HANDLE; + // if (!result) + // { + // return result; + // } + + // + return result; + } + + // + // Inputs ... + + // + XXRSIInputs GetInputs() + { + return mInputs; + } + + // + bool SetInputs( + XXRSIInputs &inputs // Configs + ) + { + // + return Init( + mSymbol, + mPeriod, + inputs + // + ); + } + + // + // Buffers ... + + // // + // // Copy Required Long Exits 2 ... + // int CopyLongExit2( + // 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, + // longExit2Buffer, + // buffer, + // forceClean + // // + // ); + // } + + // + // Protected ... +protected: + // + // Private ... +private: + // + // Props ... + XXRSIInputs mInputs; // Inputs ... + + // + // Buffers ... + // double longExit1Buffer[]; + + // + // Tools ... + + // + // Calculate Values Until Now ... + void Calculate() + { + // + int totalBars = CountBars(); + + // // + // // Short Exit 2 ... + // CopyBuffer( + // mHandler, + // X_CHE_SHORT_EXIT_2_LINE, + // 0, + // totalBars, + // shortExit2Buffer + // // + // ); + } +} + +// +// Tools ... \ No newline at end of file diff --git a/Helpers/x-saherelm.xtd.helper.mq5 b/Helpers/x-saherelm.xtd.helper.mq5 new file mode 100644 index 00000000..1098a0ac --- /dev/null +++ b/Helpers/x-saherelm.xtd.helper.mq5 @@ -0,0 +1,256 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL5 Helper Class Library +// ---------------------------------------------- +// Name: XSCXTDHelper +// 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_XTD_BUFFERS +{ + XTD_MAIN_LINE = 0 +}; + +// +// Input Models ... +struct XXTDInputs +{ + // + // Props ... + string tmp; + + // + // Constructor(s) ... + XXTDInputs() + { + // + Clean(); + } + + // + // Tools ... + + // + // Clean ... + void Clean() + { + // + } + + // + // Default ... + void Default() + { + // + } + + // + // Validate ... + bool IsValid() + { + // + bool result = false; + + // + result = + // + false + // + ; + + // + return result; + } + + // + // Retrieve MAx Length ... + int Max() + { + // + int result = 0; + + // + result = MathMax(0, 0); + + // + return result; + } +}; + +// +// Class ... +class XSCXTDHelper : public XSCBaseHelper +{ + // + // Public ... +public: + // + // Props ... + + // + // Constructors ... + XSCXTDHelper() : XSCBaseHelper(_Symbol, _Period) + { + } + + // + // Deconstructor ... + ~XSCXTDHelper() {} + + // + // Tools ... + bool Init( + string symbol, // Trading Symbol + ENUM_TIMEFRAMES period, // Trading Period + XXTDInputs &inputs // Inputs + ) + { + // + bool result = false; + + // + mSymbol = symbol; + mPeriod = period; + + // + result = inputs.IsValid(); + if (!result) + { + return result; + } + + // + mInputs = inputs; + + // // + // // ArraySetAsSeries(shortExit2Buffer, true); + // mHandler = iCustom( + // mSymbol, + // mPeriod, + // "x-saherelm.x", + // // + // // Inputs ... + // // + // ); + // result = mHandler != INVALID_HANDLE; + // if (!result) + // { + // return result; + // } + + // + return result; + } + + // + // Inputs ... + + // + XXTDInputs GetInputs() + { + return mInputs; + } + + // + bool SetInputs( + XXTDInputs &inputs // Configs + ) + { + // + return Init( + mSymbol, + mPeriod, + inputs + // + ); + } + + // + // Buffers ... + + // // + // // Copy Required Long Exits 2 ... + // int CopyLongExit2( + // 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, + // longExit2Buffer, + // buffer, + // forceClean + // // + // ); + // } + + // + // Protected ... +protected: + // + // Private ... +private: + // + // Props ... + XXTDInputs mInputs; // Inputs ... + + // + // Buffers ... + // double longExit1Buffer[]; + + // + // Tools ... + + // + // Calculate Values Until Now ... + void Calculate() + { + // + int totalBars = CountBars(); + + // // + // // Short Exit 2 ... + // CopyBuffer( + // mHandler, + // X_CHE_SHORT_EXIT_2_LINE, + // 0, + // totalBars, + // shortExit2Buffer + // // + // ); + } +} + +// +// Tools ... \ No newline at end of file diff --git a/Helpers/x-saherelm.xtm.helper.mq5 b/Helpers/x-saherelm.xtm.helper.mq5 new file mode 100644 index 00000000..0d512061 --- /dev/null +++ b/Helpers/x-saherelm.xtm.helper.mq5 @@ -0,0 +1,256 @@ +/////////////////////////////////////////////////////// +// +// SaherElm IT Center MQL5 Helper Class Library +// ---------------------------------------------- +// Name: XSCXTMHelper +// 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_XTM_BUFFERS +{ + XTM_MAIN_LINE = 0 +}; + +// +// Input Models ... +struct XXTMInputs +{ + // + // Props ... + string tmp; + + // + // Constructor(s) ... + XXTMInputs() + { + // + Clean(); + } + + // + // Tools ... + + // + // Clean ... + void Clean() + { + // + } + + // + // Default ... + void Default() + { + // + } + + // + // Validate ... + bool IsValid() + { + // + bool result = false; + + // + result = + // + false + // + ; + + // + return result; + } + + // + // Retrieve MAx Length ... + int Max() + { + // + int result = 0; + + // + result = MathMax(0, 0); + + // + return result; + } +}; + +// +// Class ... +class XSCXTMHelper : public XSCBaseHelper +{ + // + // Public ... +public: + // + // Props ... + + // + // Constructors ... + XSCXTMHelper() : XSCBaseHelper(_Symbol, _Period) + { + } + + // + // Deconstructor ... + ~XSCXTMHelper() {} + + // + // Tools ... + bool Init( + string symbol, // Trading Symbol + ENUM_TIMEFRAMES period, // Trading Period + XXTMInputs &inputs // Inputs + ) + { + // + bool result = false; + + // + mSymbol = symbol; + mPeriod = period; + + // + result = inputs.IsValid(); + if (!result) + { + return result; + } + + // + mInputs = inputs; + + // // + // // ArraySetAsSeries(shortExit2Buffer, true); + // mHandler = iCustom( + // mSymbol, + // mPeriod, + // "x-saherelm.x", + // // + // // Inputs ... + // // + // ); + // result = mHandler != INVALID_HANDLE; + // if (!result) + // { + // return result; + // } + + // + return result; + } + + // + // Inputs ... + + // + XXTMInputs GetInputs() + { + return mInputs; + } + + // + bool SetInputs( + XXTMInputs &inputs // Configs + ) + { + // + return Init( + mSymbol, + mPeriod, + inputs + // + ); + } + + // + // Buffers ... + + // // + // // Copy Required Long Exits 2 ... + // int CopyLongExit2( + // 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, + // longExit2Buffer, + // buffer, + // forceClean + // // + // ); + // } + + // + // Protected ... +protected: + // + // Private ... +private: + // + // Props ... + XXTMInputs mInputs; // Inputs ... + + // + // Buffers ... + // double longExit1Buffer[]; + + // + // Tools ... + + // + // Calculate Values Until Now ... + void Calculate() + { + // + int totalBars = CountBars(); + + // // + // // Short Exit 2 ... + // CopyBuffer( + // mHandler, + // X_CHE_SHORT_EXIT_2_LINE, + // 0, + // totalBars, + // shortExit2Buffer + // // + // ); + } +} + +// +// Tools ... \ No newline at end of file diff --git a/Helpers/x-saherelm.xts.helper.mq5 b/Helpers/x-saherelm.xts.helper.mq5 new file mode 100644 index 00000000..206dd980 --- /dev/null +++ b/Helpers/x-saherelm.xts.helper.mq5 @@ -0,0 +1,256 @@ +/////////////////////////////////////////////////////// +// +// 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_MAIN_LINE = 0 +}; + +// +// Input Models ... +struct XXTSInputs +{ + // + // Props ... + string tmp; + + // + // Constructor(s) ... + XXTSInputs() + { + // + Clean(); + } + + // + // Tools ... + + // + // Clean ... + void Clean() + { + // + } + + // + // Default ... + void Default() + { + // + } + + // + // Validate ... + bool IsValid() + { + // + bool result = false; + + // + result = + // + false + // + ; + + // + return result; + } + + // + // Retrieve MAx Length ... + int Max() + { + // + int result = 0; + + // + result = MathMax(0, 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 + XXTSInputs &inputs // Inputs + ) + { + // + bool result = false; + + // + mSymbol = symbol; + mPeriod = period; + + // + result = inputs.IsValid(); + if (!result) + { + return result; + } + + // + mInputs = inputs; + + // // + // // ArraySetAsSeries(shortExit2Buffer, true); + // mHandler = iCustom( + // mSymbol, + // mPeriod, + // "x-saherelm.x", + // // + // // Inputs ... + // // + // ); + // result = mHandler != INVALID_HANDLE; + // if (!result) + // { + // return result; + // } + + // + return result; + } + + // + // Inputs ... + + // + XXTSInputs GetInputs() + { + return mInputs; + } + + // + bool SetInputs( + XXTSInputs &inputs // Configs + ) + { + // + return Init( + mSymbol, + mPeriod, + inputs + // + ); + } + + // + // Buffers ... + + // // + // // Copy Required Long Exits 2 ... + // int CopyLongExit2( + // 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, + // longExit2Buffer, + // buffer, + // forceClean + // // + // ); + // } + + // + // Protected ... +protected: + // + // Private ... +private: + // + // Props ... + XXTSInputs mInputs; // Inputs ... + + // + // Buffers ... + // double longExit1Buffer[]; + + // + // Tools ... + + // + // Calculate Values Until Now ... + void Calculate() + { + // + int totalBars = CountBars(); + + // // + // // Short Exit 2 ... + // CopyBuffer( + // mHandler, + // X_CHE_SHORT_EXIT_2_LINE, + // 0, + // totalBars, + // shortExit2Buffer + // // + // ); + } +} + +// +// Tools ... \ No newline at end of file diff --git a/Indicators/x-saherelm.xama.indicator.mq5 b/Indicators/x-saherelm.xama.mq5 similarity index 100% rename from Indicators/x-saherelm.xama.indicator.mq5 rename to Indicators/x-saherelm.xama.mq5 diff --git a/Indicators/x-saherelm.xchlh.oscillator.mq5 b/Indicators/x-saherelm.xchlh.mq5 similarity index 100% rename from Indicators/x-saherelm.xchlh.oscillator.mq5 rename to Indicators/x-saherelm.xchlh.mq5 diff --git a/Indicators/x-saherelm.xchma.oscillator.mq5 b/Indicators/x-saherelm.xchma.mq5 similarity index 100% rename from Indicators/x-saherelm.xchma.oscillator.mq5 rename to Indicators/x-saherelm.xchma.mq5 diff --git a/Indicators/x-saherelm.xct.indicator.mq5 b/Indicators/x-saherelm.xct.mq5 similarity index 100% rename from Indicators/x-saherelm.xct.indicator.mq5 rename to Indicators/x-saherelm.xct.mq5 diff --git a/Indicators/x-saherelm.xfi.oscillator.mq5 b/Indicators/x-saherelm.xfi.mq5 similarity index 100% rename from Indicators/x-saherelm.xfi.oscillator.mq5 rename to Indicators/x-saherelm.xfi.mq5 diff --git a/Indicators/x-saherelm.xlh.indicator.mq5 b/Indicators/x-saherelm.xlh.mq5 similarity index 100% rename from Indicators/x-saherelm.xlh.indicator.mq5 rename to Indicators/x-saherelm.xlh.mq5 diff --git a/Indicators/x-saherelm.xobd.indicator.mq5 b/Indicators/x-saherelm.xobd.mq5 similarity index 100% rename from Indicators/x-saherelm.xobd.indicator.mq5 rename to Indicators/x-saherelm.xobd.mq5 diff --git a/Indicators/x-saherelm.xrsi.oscillator.mq5 b/Indicators/x-saherelm.xrsi.mq5 similarity index 100% rename from Indicators/x-saherelm.xrsi.oscillator.mq5 rename to Indicators/x-saherelm.xrsi.mq5 diff --git a/Indicators/x-saherelm.xtd.oscillator.mq5 b/Indicators/x-saherelm.xtd.mq5 similarity index 100% rename from Indicators/x-saherelm.xtd.oscillator.mq5 rename to Indicators/x-saherelm.xtd.mq5 diff --git a/Indicators/x-saherelm.xtm.indicator.mq5 b/Indicators/x-saherelm.xtm.mq5 similarity index 100% rename from Indicators/x-saherelm.xtm.indicator.mq5 rename to Indicators/x-saherelm.xtm.mq5 diff --git a/Indicators/x-saherelm.xts.oscillator.mq5 b/Indicators/x-saherelm.xts.mq5 similarity index 100% rename from Indicators/x-saherelm.xts.oscillator.mq5 rename to Indicators/x-saherelm.xts.mq5