last ...
This commit is contained in:
@@ -328,7 +328,7 @@ bool InitialEA()
|
|||||||
eurusdSymbol,
|
eurusdSymbol,
|
||||||
PERIOD_M5,
|
PERIOD_M5,
|
||||||
eaVolume,
|
eaVolume,
|
||||||
eaR2R, // R2R ...
|
1, // eaR2R, // R2R ...
|
||||||
eaSlippage,
|
eaSlippage,
|
||||||
magicNumber,
|
magicNumber,
|
||||||
true, // Ignore Signal Execution
|
true, // Ignore Signal Execution
|
||||||
|
|||||||
@@ -24,6 +24,9 @@
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Import(s) Helper(s) ...
|
// Import(s) Helper(s) ...
|
||||||
|
#include "../Helpers/x-saherelm.xpv.helper.mq5"
|
||||||
|
#include "../Helpers/x-saherelm.xstr.helper.mq5"
|
||||||
|
#include "../Helpers/x-saherelm.xche.helper.mq5"
|
||||||
#include "../Helpers/x-saherelm.xchma.helper.mq5"
|
#include "../Helpers/x-saherelm.xchma.helper.mq5"
|
||||||
#include "../Helpers/x-saherelm.xchhk.helper.mq5"
|
#include "../Helpers/x-saherelm.xchhk.helper.mq5"
|
||||||
|
|
||||||
@@ -94,6 +97,11 @@ public:
|
|||||||
// Deconstructor ...
|
// Deconstructor ...
|
||||||
void ~XSCXCHKMStrategy()
|
void ~XSCXCHKMStrategy()
|
||||||
{
|
{
|
||||||
|
//
|
||||||
|
delete pvHelper;
|
||||||
|
delete strHelper;
|
||||||
|
delete cheHelper;
|
||||||
|
|
||||||
//
|
//
|
||||||
delete chhkHelper;
|
delete chhkHelper;
|
||||||
delete chmaHelper;
|
delete chmaHelper;
|
||||||
@@ -377,7 +385,7 @@ public:
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Bullish XCHMA Conditions ...
|
// Bullish XCHMA Conditions ...
|
||||||
bool isCHMACrossedOver =
|
bool isCHMABullish =
|
||||||
//
|
//
|
||||||
isCHMAHCrossedOver
|
isCHMAHCrossedOver
|
||||||
//
|
//
|
||||||
@@ -456,7 +464,7 @@ public:
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Bullish XCHMA Conditions ...
|
// Bullish XCHMA Conditions ...
|
||||||
bool isCHMACrossedUnder =
|
bool isCHMABearish =
|
||||||
//
|
//
|
||||||
isCHMAHCrossedUnder
|
isCHMAHCrossedUnder
|
||||||
//
|
//
|
||||||
@@ -474,6 +482,91 @@ public:
|
|||||||
//
|
//
|
||||||
;
|
;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Max ...
|
||||||
|
double maxCHMA = MathMax(
|
||||||
|
chmaConditions.cFast[cIndex],
|
||||||
|
chmaConditions.cSlow[cIndex] //
|
||||||
|
);
|
||||||
|
maxCHMA = MathMax(
|
||||||
|
maxCHMA,
|
||||||
|
chmaConditions.sFast[cIndex] //
|
||||||
|
);
|
||||||
|
maxCHMA = MathMax(
|
||||||
|
maxCHMA,
|
||||||
|
chmaConditions.sSlow[cIndex] //
|
||||||
|
);
|
||||||
|
maxCHMA = MathMax(
|
||||||
|
maxCHMA,
|
||||||
|
chmaConditions.mFast[cIndex] //
|
||||||
|
);
|
||||||
|
maxCHMA = MathMax(
|
||||||
|
maxCHMA,
|
||||||
|
chmaConditions.mSlow[cIndex] //
|
||||||
|
);
|
||||||
|
maxCHMA = MathMax(
|
||||||
|
maxCHMA,
|
||||||
|
chmaConditions.lFast[cIndex] //
|
||||||
|
);
|
||||||
|
maxCHMA = MathMax(
|
||||||
|
maxCHMA,
|
||||||
|
chmaConditions.lSlow[cIndex] //
|
||||||
|
);
|
||||||
|
maxCHMA = MathMax(
|
||||||
|
maxCHMA,
|
||||||
|
chmaConditions.hFast[cIndex] //
|
||||||
|
);
|
||||||
|
maxCHMA = MathMax(
|
||||||
|
maxCHMA,
|
||||||
|
chmaConditions.hSlow[cIndex] //
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Min
|
||||||
|
double minCHMA = MathMin(
|
||||||
|
chmaConditions.cFast[cIndex],
|
||||||
|
chmaConditions.cSlow[cIndex] //
|
||||||
|
);
|
||||||
|
minCHMA = MathMin(
|
||||||
|
minCHMA,
|
||||||
|
chmaConditions.sFast[cIndex] //
|
||||||
|
);
|
||||||
|
minCHMA = MathMin(
|
||||||
|
minCHMA,
|
||||||
|
chmaConditions.sSlow[cIndex] //
|
||||||
|
);
|
||||||
|
minCHMA = MathMin(
|
||||||
|
minCHMA,
|
||||||
|
chmaConditions.mFast[cIndex] //
|
||||||
|
);
|
||||||
|
minCHMA = MathMin(
|
||||||
|
minCHMA,
|
||||||
|
chmaConditions.mSlow[cIndex] //
|
||||||
|
);
|
||||||
|
minCHMA = MathMin(
|
||||||
|
minCHMA,
|
||||||
|
chmaConditions.lFast[cIndex] //
|
||||||
|
);
|
||||||
|
minCHMA = MathMin(
|
||||||
|
minCHMA,
|
||||||
|
chmaConditions.lSlow[cIndex] //
|
||||||
|
);
|
||||||
|
minCHMA = MathMin(
|
||||||
|
minCHMA,
|
||||||
|
chmaConditions.hFast[cIndex] //
|
||||||
|
);
|
||||||
|
minCHMA = MathMin(
|
||||||
|
minCHMA,
|
||||||
|
chmaConditions.hSlow[cIndex] //
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
double chmaDistanceDiffInPoint =
|
||||||
|
//
|
||||||
|
(maxCHMA - minCHMA) / points
|
||||||
|
//
|
||||||
|
;
|
||||||
|
|
||||||
//
|
//
|
||||||
// XCHHM Conditions ...
|
// XCHHM Conditions ...
|
||||||
|
|
||||||
@@ -676,91 +769,6 @@ public:
|
|||||||
//
|
//
|
||||||
;
|
;
|
||||||
|
|
||||||
//
|
|
||||||
// Max ...
|
|
||||||
double maxCHMA = MathMax(
|
|
||||||
chmaConditions.cFast[cIndex],
|
|
||||||
chmaConditions.cSlow[cIndex] //
|
|
||||||
);
|
|
||||||
maxCHMA = MathMax(
|
|
||||||
maxCHMA,
|
|
||||||
chmaConditions.sFast[cIndex] //
|
|
||||||
);
|
|
||||||
maxCHMA = MathMax(
|
|
||||||
maxCHMA,
|
|
||||||
chmaConditions.sSlow[cIndex] //
|
|
||||||
);
|
|
||||||
maxCHMA = MathMax(
|
|
||||||
maxCHMA,
|
|
||||||
chmaConditions.mFast[cIndex] //
|
|
||||||
);
|
|
||||||
maxCHMA = MathMax(
|
|
||||||
maxCHMA,
|
|
||||||
chmaConditions.mSlow[cIndex] //
|
|
||||||
);
|
|
||||||
maxCHMA = MathMax(
|
|
||||||
maxCHMA,
|
|
||||||
chmaConditions.lFast[cIndex] //
|
|
||||||
);
|
|
||||||
maxCHMA = MathMax(
|
|
||||||
maxCHMA,
|
|
||||||
chmaConditions.lSlow[cIndex] //
|
|
||||||
);
|
|
||||||
maxCHMA = MathMax(
|
|
||||||
maxCHMA,
|
|
||||||
chmaConditions.hFast[cIndex] //
|
|
||||||
);
|
|
||||||
maxCHMA = MathMax(
|
|
||||||
maxCHMA,
|
|
||||||
chmaConditions.hSlow[cIndex] //
|
|
||||||
);
|
|
||||||
|
|
||||||
//
|
|
||||||
// Min
|
|
||||||
double minCHMA = MathMin(
|
|
||||||
chmaConditions.cFast[cIndex],
|
|
||||||
chmaConditions.cSlow[cIndex] //
|
|
||||||
);
|
|
||||||
minCHMA = MathMin(
|
|
||||||
minCHMA,
|
|
||||||
chmaConditions.sFast[cIndex] //
|
|
||||||
);
|
|
||||||
minCHMA = MathMin(
|
|
||||||
minCHMA,
|
|
||||||
chmaConditions.sSlow[cIndex] //
|
|
||||||
);
|
|
||||||
minCHMA = MathMin(
|
|
||||||
minCHMA,
|
|
||||||
chmaConditions.mFast[cIndex] //
|
|
||||||
);
|
|
||||||
minCHMA = MathMin(
|
|
||||||
minCHMA,
|
|
||||||
chmaConditions.mSlow[cIndex] //
|
|
||||||
);
|
|
||||||
minCHMA = MathMin(
|
|
||||||
minCHMA,
|
|
||||||
chmaConditions.lFast[cIndex] //
|
|
||||||
);
|
|
||||||
minCHMA = MathMin(
|
|
||||||
minCHMA,
|
|
||||||
chmaConditions.lSlow[cIndex] //
|
|
||||||
);
|
|
||||||
minCHMA = MathMin(
|
|
||||||
minCHMA,
|
|
||||||
chmaConditions.hFast[cIndex] //
|
|
||||||
);
|
|
||||||
minCHMA = MathMin(
|
|
||||||
minCHMA,
|
|
||||||
chmaConditions.hSlow[cIndex] //
|
|
||||||
);
|
|
||||||
|
|
||||||
//
|
|
||||||
double chmaDistanceDiffInPoint =
|
|
||||||
//
|
|
||||||
(maxCHMA - minCHMA) / points
|
|
||||||
//
|
|
||||||
;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Bearish ...
|
// Bearish ...
|
||||||
|
|
||||||
@@ -1049,46 +1057,106 @@ public:
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Preparing Signals for Execution ...
|
// Preparing Signals for Execution ...
|
||||||
|
bool allowCHHKSignals = true;
|
||||||
|
bool allowCHMASignals = false;
|
||||||
|
|
||||||
//
|
//
|
||||||
if (isCHHKBullish)
|
// XCHMA ...
|
||||||
|
if (allowCHMASignals)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
hasLong =
|
double pressureDistance = 200;
|
||||||
//
|
|
||||||
isCHHKBullish &&
|
|
||||||
hasBullishPattern &&
|
|
||||||
chhkDistanceDiffInPoint <= 250
|
|
||||||
//
|
|
||||||
;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
if (hasLong)
|
if (isCHMABullish)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
type = POSITION_TYPE_BUY;
|
hasLong =
|
||||||
sl = maxCHHKLow;
|
//
|
||||||
|
isCHMABullish &&
|
||||||
|
hasBullishPattern &&
|
||||||
|
chmaDistanceDiffInPoint <= pressureDistance
|
||||||
|
//
|
||||||
|
;
|
||||||
|
|
||||||
|
//
|
||||||
|
if (hasLong)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
type = POSITION_TYPE_SELL;
|
||||||
|
sl = minCHMA;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
if (isCHMABearish)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
hasShort =
|
||||||
|
//
|
||||||
|
isCHMABearish &&
|
||||||
|
hasBearishPattern &&
|
||||||
|
chmaDistanceDiffInPoint <= pressureDistance
|
||||||
|
//
|
||||||
|
;
|
||||||
|
|
||||||
|
//
|
||||||
|
if (hasShort)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
type = POSITION_TYPE_SELL;
|
||||||
|
sl = minCHMA;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
if (isCHHKBearish)
|
// XCHHK ...
|
||||||
|
if (allowCHHKSignals)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
hasShort =
|
double pressureDistance = 200;
|
||||||
//
|
|
||||||
isCHHKBearish &&
|
|
||||||
hasBearishPattern &&
|
|
||||||
chhkDistanceDiffInPoint <= 250
|
|
||||||
//
|
|
||||||
;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
if (hasShort)
|
if (isCHHKBullish)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
type = POSITION_TYPE_SELL;
|
hasLong =
|
||||||
sl = minCHHKHigh;
|
//
|
||||||
|
isCHHKBullish &&
|
||||||
|
hasBullishPattern &&
|
||||||
|
chhkDistanceDiffInPoint <= pressureDistance
|
||||||
|
//
|
||||||
|
;
|
||||||
|
|
||||||
|
//
|
||||||
|
if (hasLong)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
type = POSITION_TYPE_BUY;
|
||||||
|
sl = maxCHHKLow;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
if (isCHHKBearish)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
hasShort =
|
||||||
|
//
|
||||||
|
isCHHKBearish &&
|
||||||
|
hasBearishPattern &&
|
||||||
|
chhkDistanceDiffInPoint <= pressureDistance
|
||||||
|
//
|
||||||
|
;
|
||||||
|
|
||||||
|
//
|
||||||
|
if (hasShort)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
type = POSITION_TYPE_SELL;
|
||||||
|
sl = minCHHKHigh;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1199,6 +1267,21 @@ protected:
|
|||||||
XOHCL support;
|
XOHCL support;
|
||||||
XOHCL resistance;
|
XOHCL resistance;
|
||||||
|
|
||||||
|
//
|
||||||
|
// XPV ...
|
||||||
|
XPVInputs pvInputs;
|
||||||
|
XSCXPVHelper *pvHelper;
|
||||||
|
|
||||||
|
//
|
||||||
|
// XSTR ...
|
||||||
|
XSTRInputs strInputs;
|
||||||
|
XSCXSTRHelper *strHelper;
|
||||||
|
|
||||||
|
//
|
||||||
|
// XCHE ...
|
||||||
|
XCHEInputs cheInputs;
|
||||||
|
XSCXCHEHelper *cheHelper;
|
||||||
|
|
||||||
//
|
//
|
||||||
// XHK ...
|
// XHK ...
|
||||||
XCHHKInputs chhkInputs;
|
XCHHKInputs chhkInputs;
|
||||||
@@ -1276,6 +1359,68 @@ private:
|
|||||||
mPeriod,
|
mPeriod,
|
||||||
chhkInputs //
|
chhkInputs //
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
// XPV ...
|
||||||
|
|
||||||
|
//
|
||||||
|
pvInputs.Default();
|
||||||
|
|
||||||
|
//
|
||||||
|
pvInputs.showPeaksAndVales = true;
|
||||||
|
pvInputs.showLevels = false;
|
||||||
|
pvInputs.showConsolidations = false;
|
||||||
|
pvInputs.showFibo1Levels = false;
|
||||||
|
pvInputs.showFibo2Levels = false;
|
||||||
|
pvInputs.showFibo3Levels = false;
|
||||||
|
pvInputs.showFibo4Levels = false;
|
||||||
|
pvInputs.showFibo5Levels = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
pvHelper = new XSCXPVHelper();
|
||||||
|
pvHelper.Init(
|
||||||
|
mSymbol,
|
||||||
|
mPeriod,
|
||||||
|
pvInputs //
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
// XSTR ...
|
||||||
|
|
||||||
|
//
|
||||||
|
strInputs.Default();
|
||||||
|
|
||||||
|
//
|
||||||
|
strInputs.showTrends = true;
|
||||||
|
strInputs.fillTrends = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
strHelper = new XSCXPVHelper();
|
||||||
|
strHelper.Init(
|
||||||
|
mSymbol,
|
||||||
|
mPeriod,
|
||||||
|
strInputs //
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
// XCHE ...
|
||||||
|
|
||||||
|
//
|
||||||
|
cheInputs.Default();
|
||||||
|
|
||||||
|
//
|
||||||
|
cheInputs.showLongExit1Line = true;
|
||||||
|
cheInputs.showShortExit1Line = true;
|
||||||
|
cheInputs.showLongExit2Line = true;
|
||||||
|
cheInputs.showShortExit2Line = true;
|
||||||
|
|
||||||
|
//
|
||||||
|
cheHelper = new XSCXPVHelper();
|
||||||
|
cheHelper.Init(
|
||||||
|
mSymbol,
|
||||||
|
mPeriod,
|
||||||
|
cheInputs //
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|||||||
Reference in New Issue
Block a user