add supports for wait until next candle to xAU5 ... fix XCTimer Initialization on EU and AU 5 ...
4430 lines
116 KiB
Plaintext
4430 lines
116 KiB
Plaintext
///////////////////////////////////////////////////////
|
|
//
|
|
// 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.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 XCPriver : public XCBase
|
|
{
|
|
//
|
|
// Public ...
|
|
public:
|
|
//
|
|
// Constructor ...
|
|
XCPriver(
|
|
//
|
|
// 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 ...
|
|
~XCPriver() {}
|
|
|
|
//
|
|
// 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;
|
|
}; |