add support for get verifications from other time frames ...
This commit is contained in:
@@ -2024,6 +2024,490 @@ struct X121SignalGenerator
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Retrieve Long Verifications ...
|
||||||
|
bool HasLongVerifications(
|
||||||
|
X121SetupConditions &conditions[] // Conditions Collection
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
bool result = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
int count = ArraySize(conditions);
|
||||||
|
result = IsValidSize(count);
|
||||||
|
if (!result)
|
||||||
|
{
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Loop through Conditions to Get Verifications ...
|
||||||
|
for (int i = count - 1; i >= 0; i--)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
X121SetupConditions iConditions = conditions[i];
|
||||||
|
|
||||||
|
//
|
||||||
|
result = IsConditionsValidForLong(iConditions);
|
||||||
|
if (result)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
bool IsConditionsValidForLong(
|
||||||
|
X121SetupConditions &conditions,
|
||||||
|
int verification = 4 //
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
bool result = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
int signs = 0;
|
||||||
|
|
||||||
|
//
|
||||||
|
// XTD ...
|
||||||
|
bool isTDPassed =
|
||||||
|
//
|
||||||
|
conditions.tdConditions.isBullish ||
|
||||||
|
conditions.tdConditions.isSwitchedToBullish
|
||||||
|
//
|
||||||
|
;
|
||||||
|
if (isTDPassed)
|
||||||
|
{
|
||||||
|
signs++;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// XHK ...
|
||||||
|
bool isHKPassed =
|
||||||
|
//
|
||||||
|
(conditions.hkConditions.isHKBullish ||
|
||||||
|
conditions.hkConditions.isHKSwitchedToBullish)
|
||||||
|
//
|
||||||
|
||
|
||||||
|
//
|
||||||
|
(conditions.hkConditions.isSMHKBullish ||
|
||||||
|
conditions.hkConditions.isSMHKSwitchedToBullish)
|
||||||
|
//
|
||||||
|
;
|
||||||
|
if (isHKPassed)
|
||||||
|
{
|
||||||
|
signs++;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// XCHE ...
|
||||||
|
bool isCHEPassed =
|
||||||
|
//
|
||||||
|
conditions.cheConditions.isBullish ||
|
||||||
|
conditions.cheConditions.isStrongBullish ||
|
||||||
|
conditions.cheConditions.isSwitchedToBullish ||
|
||||||
|
conditions.cheConditions.isStrongSwitchedToBullish
|
||||||
|
//
|
||||||
|
;
|
||||||
|
if (isCHEPassed)
|
||||||
|
{
|
||||||
|
signs++;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// XICH ...
|
||||||
|
bool isICHPassed =
|
||||||
|
//
|
||||||
|
(conditions.ichConditions.isTenkanSenOverKijunSen ||
|
||||||
|
conditions.ichConditions.isTenkanSenCrossedOverKijunSen)
|
||||||
|
//
|
||||||
|
&&
|
||||||
|
//
|
||||||
|
(conditions.ichConditions.isSenkouSpanAOverB ||
|
||||||
|
conditions.ichConditions.isSenkouSpanAOverLast ||
|
||||||
|
conditions.ichConditions.isSenkouSpanACrossedOverB ||
|
||||||
|
conditions.ichConditions.isSenkouSpanACrossedOverLast)
|
||||||
|
//
|
||||||
|
&&
|
||||||
|
//
|
||||||
|
(conditions.ichConditions.isFutureSenkouSpanAOverB ||
|
||||||
|
conditions.ichConditions.isFutureSenkouSpanAOverLast ||
|
||||||
|
conditions.ichConditions.isFutureSenkouSpanACrossedOverB ||
|
||||||
|
conditions.ichConditions.isFutureSenkouSpanACrossedOverLast)
|
||||||
|
//
|
||||||
|
;
|
||||||
|
if (isICHPassed)
|
||||||
|
{
|
||||||
|
signs++;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// XSTR ...
|
||||||
|
bool isSTRPassed =
|
||||||
|
//
|
||||||
|
conditions.strConditions.isTrendBullish ||
|
||||||
|
conditions.strConditions.isTrendSwitchedToBullish
|
||||||
|
//
|
||||||
|
;
|
||||||
|
if (isSTRPassed)
|
||||||
|
{
|
||||||
|
signs++;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// XMRB ...
|
||||||
|
bool isMRBPassed =
|
||||||
|
//
|
||||||
|
conditions.mrbConditions.isFastOverSlow ||
|
||||||
|
conditions.mrbConditions.isFastCrossedOverSlow
|
||||||
|
//
|
||||||
|
;
|
||||||
|
if (isMRBPassed)
|
||||||
|
{
|
||||||
|
signs++;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// XVLM ...
|
||||||
|
bool isVLMPassed =
|
||||||
|
//
|
||||||
|
conditions.vlmConditions.isVolumeBullish ||
|
||||||
|
conditions.vlmConditions.isVolumeOverLast ||
|
||||||
|
conditions.vlmConditions.isVolumeChangedToBullish
|
||||||
|
//
|
||||||
|
;
|
||||||
|
if (isVLMPassed)
|
||||||
|
{
|
||||||
|
signs++;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// XSSLC ...
|
||||||
|
bool isSSLCPassed =
|
||||||
|
//
|
||||||
|
conditions.sslcConditions.isBullish ||
|
||||||
|
conditions.sslcConditions.isSwitchedToBullish
|
||||||
|
//
|
||||||
|
;
|
||||||
|
if (isSSLCPassed)
|
||||||
|
{
|
||||||
|
signs++;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// XHULL ...
|
||||||
|
bool isHULLPassed =
|
||||||
|
//
|
||||||
|
conditions.hullConditions.isBullish ||
|
||||||
|
conditions.hullConditions.isUpBullish ||
|
||||||
|
conditions.hullConditions.isDownBullish ||
|
||||||
|
conditions.hullConditions.isSwitchedToBullish
|
||||||
|
//
|
||||||
|
;
|
||||||
|
if (isHULLPassed)
|
||||||
|
{
|
||||||
|
signs++;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// XADX ...
|
||||||
|
bool isADXTDPassed =
|
||||||
|
//
|
||||||
|
conditions.adxtdConditions.isBullish ||
|
||||||
|
conditions.adxtdConditions.isSwitchedToBullish ||
|
||||||
|
conditions.adxtdConditions.isStrongSwitchedToBullish
|
||||||
|
//
|
||||||
|
;
|
||||||
|
if (isADXTDPassed)
|
||||||
|
{
|
||||||
|
signs++;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// XMATD ...
|
||||||
|
bool isMATDPassed =
|
||||||
|
//
|
||||||
|
((conditions.matdConditions.isBullish ||
|
||||||
|
conditions.matdConditions.isSwitchedToBullish)
|
||||||
|
//
|
||||||
|
||
|
||||||
|
//
|
||||||
|
((conditions.matdConditions.isFastOverSlow ||
|
||||||
|
conditions.matdConditions.isFastCrossedOverSlow)
|
||||||
|
//
|
||||||
|
&&
|
||||||
|
//
|
||||||
|
(conditions.matdConditions.isMidOverSlow ||
|
||||||
|
conditions.matdConditions.isMidCrossedOverSlow)))
|
||||||
|
//
|
||||||
|
||
|
||||||
|
//
|
||||||
|
(conditions.matdConditions.isSARBullish ||
|
||||||
|
conditions.matdConditions.isSARSwitchedToBullish)
|
||||||
|
//
|
||||||
|
;
|
||||||
|
if (isMATDPassed)
|
||||||
|
{
|
||||||
|
signs++;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
result =
|
||||||
|
//
|
||||||
|
signs > verification
|
||||||
|
//
|
||||||
|
;
|
||||||
|
|
||||||
|
//
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Retrieve Short Verifications ...
|
||||||
|
bool HasShortVerifications(
|
||||||
|
X121SetupConditions &conditions[] // Conditions Collection
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
bool result = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
int count = ArraySize(conditions);
|
||||||
|
result = IsValidSize(count);
|
||||||
|
if (!result)
|
||||||
|
{
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Loop through Conditions to Get Verifications ...
|
||||||
|
for (int i = count - 1; i >= 0; i--)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
X121SetupConditions iConditions = conditions[i];
|
||||||
|
|
||||||
|
//
|
||||||
|
result = IsConditionsValidForShort(iConditions);
|
||||||
|
if (result)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
bool IsConditionsValidForShort(
|
||||||
|
X121SetupConditions &conditions,
|
||||||
|
int verification = 4 //
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
bool result = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
int signs = 0;
|
||||||
|
|
||||||
|
//
|
||||||
|
// XTD ...
|
||||||
|
bool isTDPassed =
|
||||||
|
//
|
||||||
|
conditions.tdConditions.isBearish ||
|
||||||
|
conditions.tdConditions.isSwitchedToBearish
|
||||||
|
//
|
||||||
|
;
|
||||||
|
if (isTDPassed)
|
||||||
|
{
|
||||||
|
signs++;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// XHK ...
|
||||||
|
bool isHKPassed =
|
||||||
|
//
|
||||||
|
(conditions.hkConditions.isHKBearish ||
|
||||||
|
conditions.hkConditions.isHKSwitchedToBearish)
|
||||||
|
//
|
||||||
|
||
|
||||||
|
//
|
||||||
|
(conditions.hkConditions.isSMHKBearish ||
|
||||||
|
conditions.hkConditions.isSMHKSwitchedToBearish)
|
||||||
|
//
|
||||||
|
;
|
||||||
|
if (isHKPassed)
|
||||||
|
{
|
||||||
|
signs++;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// XCHE ...
|
||||||
|
bool isCHEPassed =
|
||||||
|
//
|
||||||
|
conditions.cheConditions.isBearish ||
|
||||||
|
conditions.cheConditions.isStrongBearish ||
|
||||||
|
conditions.cheConditions.isSwitchedToBearish ||
|
||||||
|
conditions.cheConditions.isStrongSwitchedToBearish
|
||||||
|
//
|
||||||
|
;
|
||||||
|
if (isCHEPassed)
|
||||||
|
{
|
||||||
|
signs++;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// XICH ...
|
||||||
|
bool isICHPassed =
|
||||||
|
//
|
||||||
|
(conditions.ichConditions.isTenkanSenUnderKijunSen ||
|
||||||
|
conditions.ichConditions.isTenkanSenCrossedUnderKijunSen)
|
||||||
|
//
|
||||||
|
&&
|
||||||
|
//
|
||||||
|
(conditions.ichConditions.isSenkouSpanAUnderB ||
|
||||||
|
conditions.ichConditions.isSenkouSpanAUnderLast ||
|
||||||
|
conditions.ichConditions.isSenkouSpanACrossedUnderB ||
|
||||||
|
conditions.ichConditions.isSenkouSpanACrossedUnderLast)
|
||||||
|
//
|
||||||
|
&&
|
||||||
|
//
|
||||||
|
(conditions.ichConditions.isFutureSenkouSpanAUnderB ||
|
||||||
|
conditions.ichConditions.isFutureSenkouSpanAUnderLast ||
|
||||||
|
conditions.ichConditions.isFutureSenkouSpanACrossedUnderB ||
|
||||||
|
conditions.ichConditions.isFutureSenkouSpanACrossedUnderLast)
|
||||||
|
//
|
||||||
|
;
|
||||||
|
if (isICHPassed)
|
||||||
|
{
|
||||||
|
signs++;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// XSTR ...
|
||||||
|
bool isSTRPassed =
|
||||||
|
//
|
||||||
|
conditions.strConditions.isTrendBearish ||
|
||||||
|
conditions.strConditions.isTrendSwitchedToBearish
|
||||||
|
//
|
||||||
|
;
|
||||||
|
if (isSTRPassed)
|
||||||
|
{
|
||||||
|
signs++;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// XMRB ...
|
||||||
|
bool isMRBPassed =
|
||||||
|
//
|
||||||
|
conditions.mrbConditions.isFastUnderSlow ||
|
||||||
|
conditions.mrbConditions.isFastCrossedUnderSlow
|
||||||
|
//
|
||||||
|
;
|
||||||
|
if (isMRBPassed)
|
||||||
|
{
|
||||||
|
signs++;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// XVLM ...
|
||||||
|
bool isVLMPassed =
|
||||||
|
//
|
||||||
|
conditions.vlmConditions.isVolumeBearish ||
|
||||||
|
conditions.vlmConditions.isVolumeUnderLast ||
|
||||||
|
conditions.vlmConditions.isVolumeChangedToBearish
|
||||||
|
//
|
||||||
|
;
|
||||||
|
if (isVLMPassed)
|
||||||
|
{
|
||||||
|
signs++;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// XSSLC ...
|
||||||
|
bool isSSLCPassed =
|
||||||
|
//
|
||||||
|
conditions.sslcConditions.isBearish ||
|
||||||
|
conditions.sslcConditions.isSwitchedToBearish
|
||||||
|
//
|
||||||
|
;
|
||||||
|
if (isSSLCPassed)
|
||||||
|
{
|
||||||
|
signs++;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// XHULL ...
|
||||||
|
bool isHULLPassed =
|
||||||
|
//
|
||||||
|
conditions.hullConditions.isBearish ||
|
||||||
|
conditions.hullConditions.isUpBearish ||
|
||||||
|
conditions.hullConditions.isDownBearish ||
|
||||||
|
conditions.hullConditions.isSwitchedToBearish
|
||||||
|
//
|
||||||
|
;
|
||||||
|
if (isHULLPassed)
|
||||||
|
{
|
||||||
|
signs++;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// XADX ...
|
||||||
|
bool isADXTDPassed =
|
||||||
|
//
|
||||||
|
conditions.adxtdConditions.isBearish ||
|
||||||
|
conditions.adxtdConditions.isSwitchedToBearish ||
|
||||||
|
conditions.adxtdConditions.isStrongSwitchedToBearish
|
||||||
|
//
|
||||||
|
;
|
||||||
|
if (isADXTDPassed)
|
||||||
|
{
|
||||||
|
signs++;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// XMATD ...
|
||||||
|
bool isMATDPassed =
|
||||||
|
//
|
||||||
|
((conditions.matdConditions.isBearish ||
|
||||||
|
conditions.matdConditions.isSwitchedToBearish)
|
||||||
|
//
|
||||||
|
||
|
||||||
|
//
|
||||||
|
((conditions.matdConditions.isFastUnderSlow ||
|
||||||
|
conditions.matdConditions.isFastCrossedUnderSlow)
|
||||||
|
//
|
||||||
|
&&
|
||||||
|
//
|
||||||
|
(conditions.matdConditions.isMidUnderSlow ||
|
||||||
|
conditions.matdConditions.isMidCrossedUnderSlow)))
|
||||||
|
//
|
||||||
|
||
|
||||||
|
//
|
||||||
|
(conditions.matdConditions.isSARBearish ||
|
||||||
|
conditions.matdConditions.isSARSwitchedToBearish)
|
||||||
|
//
|
||||||
|
;
|
||||||
|
if (isMATDPassed)
|
||||||
|
{
|
||||||
|
signs++;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
result =
|
||||||
|
//
|
||||||
|
signs > verification
|
||||||
|
//
|
||||||
|
;
|
||||||
|
|
||||||
|
//
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Filter Long Conditions ...
|
// Filter Long Conditions ...
|
||||||
bool FilterLongConditions(
|
bool FilterLongConditions(
|
||||||
|
|||||||
@@ -88,6 +88,9 @@ struct XSignalInfo
|
|||||||
bearishScore = 0;
|
bearishScore = 0;
|
||||||
signal.Clean();
|
signal.Clean();
|
||||||
conditions.Clean();
|
conditions.Clean();
|
||||||
|
|
||||||
|
//
|
||||||
|
ResetGrid();
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -320,6 +323,21 @@ struct XSignalInfo
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Grid ...
|
||||||
|
|
||||||
|
//
|
||||||
|
double gVolume; // Next Grid Volume
|
||||||
|
double gEntry; // Next Grid Entry
|
||||||
|
|
||||||
|
//
|
||||||
|
void ResetGrid()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
gEntry = 0;
|
||||||
|
gVolume = 0;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -730,6 +748,18 @@ public:
|
|||||||
mReuiredSignalVerifications = value;
|
mReuiredSignalVerifications = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
bool GetVerificationFromOtherTimeFrames()
|
||||||
|
{
|
||||||
|
return mGetVerificationFromOtherTimeFrames;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
void GetVerificationFromOtherTimeFrames(bool value)
|
||||||
|
{
|
||||||
|
mGetVerificationFromOtherTimeFrames = value;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
int MaxAllowedTrades()
|
int MaxAllowedTrades()
|
||||||
{
|
{
|
||||||
@@ -851,6 +881,7 @@ public:
|
|||||||
// Current ...
|
// Current ...
|
||||||
XSignal cSignal;
|
XSignal cSignal;
|
||||||
int cPusher = 0;
|
int cPusher = 0;
|
||||||
|
bool cHasSignal = false;
|
||||||
string cProvider = NULL;
|
string cProvider = NULL;
|
||||||
X121SetupConditions cConditions;
|
X121SetupConditions cConditions;
|
||||||
|
|
||||||
@@ -858,6 +889,7 @@ public:
|
|||||||
// Short ...
|
// Short ...
|
||||||
XSignal sSignal;
|
XSignal sSignal;
|
||||||
int sPusher = 0;
|
int sPusher = 0;
|
||||||
|
bool sHasSignal = false;
|
||||||
string sProvider = NULL;
|
string sProvider = NULL;
|
||||||
X121SetupConditions sConditions;
|
X121SetupConditions sConditions;
|
||||||
|
|
||||||
@@ -865,6 +897,7 @@ public:
|
|||||||
// Medium ...
|
// Medium ...
|
||||||
XSignal mSignal;
|
XSignal mSignal;
|
||||||
int mPusher = 0;
|
int mPusher = 0;
|
||||||
|
bool mHasSignal = false;
|
||||||
string mProvider = NULL;
|
string mProvider = NULL;
|
||||||
X121SetupConditions mConditions;
|
X121SetupConditions mConditions;
|
||||||
|
|
||||||
@@ -872,6 +905,7 @@ public:
|
|||||||
// Long ...
|
// Long ...
|
||||||
XSignal lSignal;
|
XSignal lSignal;
|
||||||
int lPusher = 0;
|
int lPusher = 0;
|
||||||
|
bool lHasSignal = false;
|
||||||
string lProvider = NULL;
|
string lProvider = NULL;
|
||||||
X121SetupConditions lConditions;
|
X121SetupConditions lConditions;
|
||||||
|
|
||||||
@@ -879,6 +913,7 @@ public:
|
|||||||
// Hind ...
|
// Hind ...
|
||||||
XSignal hSignal;
|
XSignal hSignal;
|
||||||
int hPusher = 0;
|
int hPusher = 0;
|
||||||
|
bool hHasSignal = false;
|
||||||
string hProvider = NULL;
|
string hProvider = NULL;
|
||||||
X121SetupConditions hConditions;
|
X121SetupConditions hConditions;
|
||||||
|
|
||||||
@@ -909,6 +944,13 @@ public:
|
|||||||
lSignal.Clean();
|
lSignal.Clean();
|
||||||
hSignal.Clean();
|
hSignal.Clean();
|
||||||
|
|
||||||
|
//
|
||||||
|
cHasSignal = false;
|
||||||
|
sHasSignal = false;
|
||||||
|
mHasSignal = false;
|
||||||
|
lHasSignal = false;
|
||||||
|
hHasSignal = false;
|
||||||
|
|
||||||
//
|
//
|
||||||
cConditions.Clean();
|
cConditions.Clean();
|
||||||
sConditions.Clean();
|
sConditions.Clean();
|
||||||
@@ -961,7 +1003,7 @@ public:
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Parse Conditions for Signal ...
|
// Parse Conditions for Signal ...
|
||||||
bool hasSignal = signalGenerator.HasSignal(
|
bool cHasSignal = signalGenerator.HasSignal(
|
||||||
cConditions,
|
cConditions,
|
||||||
cSignal,
|
cSignal,
|
||||||
cPusher,
|
cPusher,
|
||||||
@@ -977,7 +1019,7 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
if (hasSignal)
|
if (cHasSignal)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
mSetups[i].WaitsUntilNextBar(
|
mSetups[i].WaitsUntilNextBar(
|
||||||
@@ -1024,7 +1066,7 @@ public:
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Parse Conditions for Signal ...
|
// Parse Conditions for Signal ...
|
||||||
bool hasSignal = signalGenerator.HasSignal(
|
bool sHasSignal = signalGenerator.HasSignal(
|
||||||
sConditions,
|
sConditions,
|
||||||
sSignal,
|
sSignal,
|
||||||
sPusher,
|
sPusher,
|
||||||
@@ -1039,7 +1081,7 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
if (hasSignal)
|
if (sHasSignal)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
mSetups[i].WaitsUntilNextBar(
|
mSetups[i].WaitsUntilNextBar(
|
||||||
@@ -1086,7 +1128,7 @@ public:
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Parse Conditions for Signal ...
|
// Parse Conditions for Signal ...
|
||||||
bool hasSignal = signalGenerator.HasSignal(
|
bool mHasSignal = signalGenerator.HasSignal(
|
||||||
mConditions,
|
mConditions,
|
||||||
mSignal,
|
mSignal,
|
||||||
mPusher,
|
mPusher,
|
||||||
@@ -1102,7 +1144,7 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
if (hasSignal)
|
if (mHasSignal)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
mSetups[i].WaitsUntilNextBar(
|
mSetups[i].WaitsUntilNextBar(
|
||||||
@@ -1149,7 +1191,7 @@ public:
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Parse Conditions for Signal ...
|
// Parse Conditions for Signal ...
|
||||||
bool hasSignal = signalGenerator.HasSignal(
|
bool lHasSignal = signalGenerator.HasSignal(
|
||||||
lConditions,
|
lConditions,
|
||||||
lSignal,
|
lSignal,
|
||||||
lPusher,
|
lPusher,
|
||||||
@@ -1165,7 +1207,7 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
if (hasSignal)
|
if (lHasSignal)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
mSetups[i].WaitsUntilNextBar(
|
mSetups[i].WaitsUntilNextBar(
|
||||||
@@ -1212,7 +1254,7 @@ public:
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Parse Conditions for Signal ...
|
// Parse Conditions for Signal ...
|
||||||
bool hasSignal = signalGenerator.HasSignal(
|
bool hHasSignal = signalGenerator.HasSignal(
|
||||||
hConditions,
|
hConditions,
|
||||||
hSignal,
|
hSignal,
|
||||||
hPusher,
|
hPusher,
|
||||||
@@ -1228,7 +1270,7 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
if (hasSignal)
|
if (hHasSignal)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
mSetups[i].WaitsUntilNextBar(
|
mSetups[i].WaitsUntilNextBar(
|
||||||
@@ -1259,21 +1301,62 @@ public:
|
|||||||
if (cPusher >= mReuiredSignalVerifications)
|
if (cPusher >= mReuiredSignalVerifications)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Check Final Bullish and Bearish Score ...
|
X121SetupConditions otherConditions[];
|
||||||
bool isScorePassed =
|
AddRef(
|
||||||
|
sConditions,
|
||||||
|
otherConditions //
|
||||||
|
);
|
||||||
|
AddRef(
|
||||||
|
mConditions,
|
||||||
|
otherConditions //
|
||||||
|
);
|
||||||
|
AddRef(
|
||||||
|
lConditions,
|
||||||
|
otherConditions //
|
||||||
|
);
|
||||||
|
AddRef(
|
||||||
|
hConditions,
|
||||||
|
otherConditions //
|
||||||
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
true
|
// Check Final Validations ...
|
||||||
// isLong
|
bool isValid =
|
||||||
// ? mBearishScore > mBullishScore
|
//
|
||||||
// : mBullishScore > mBearishScore
|
(
|
||||||
// isLong
|
//
|
||||||
// ? mBullishScore > (mBearishScore * 2)
|
sHasSignal
|
||||||
// : mBearishScore > (mBullishScore * 2)
|
//
|
||||||
|
||
|
||||||
|
//
|
||||||
|
mHasSignal
|
||||||
|
//
|
||||||
|
||
|
||||||
|
//
|
||||||
|
lHasSignal
|
||||||
|
//
|
||||||
|
||
|
||||||
|
//
|
||||||
|
hHasSignal
|
||||||
|
//
|
||||||
|
)
|
||||||
|
//
|
||||||
|
||
|
||||||
|
//
|
||||||
|
(
|
||||||
|
//
|
||||||
|
!mGetVerificationFromOtherTimeFrames
|
||||||
|
? true
|
||||||
|
: isLong
|
||||||
|
? signalGenerator.HasLongVerifications(otherConditions)
|
||||||
|
: signalGenerator.HasShortVerifications(otherConditions)
|
||||||
|
//
|
||||||
|
)
|
||||||
//
|
//
|
||||||
;
|
;
|
||||||
|
|
||||||
//
|
//
|
||||||
if (isScorePassed)
|
if (isValid)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
AddRef(
|
AddRef(
|
||||||
@@ -1312,21 +1395,62 @@ public:
|
|||||||
if (sPusher >= mReuiredSignalVerifications)
|
if (sPusher >= mReuiredSignalVerifications)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Check Final Bullish and Bearish Score ...
|
X121SetupConditions otherConditions[];
|
||||||
bool isScorePassed =
|
AddRef(
|
||||||
|
cConditions,
|
||||||
|
otherConditions //
|
||||||
|
);
|
||||||
|
AddRef(
|
||||||
|
mConditions,
|
||||||
|
otherConditions //
|
||||||
|
);
|
||||||
|
AddRef(
|
||||||
|
lConditions,
|
||||||
|
otherConditions //
|
||||||
|
);
|
||||||
|
AddRef(
|
||||||
|
hConditions,
|
||||||
|
otherConditions //
|
||||||
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
true
|
// Check Final Validations ...
|
||||||
// isLong
|
bool isValid =
|
||||||
// ? mBearishScore > mBullishScore
|
//
|
||||||
// : mBullishScore > mBearishScore
|
(
|
||||||
// isLong
|
//
|
||||||
// ? mBullishScore > (mBearishScore * 2)
|
cHasSignal
|
||||||
// : mBearishScore > (mBullishScore * 2)
|
//
|
||||||
|
||
|
||||||
|
//
|
||||||
|
mHasSignal
|
||||||
|
//
|
||||||
|
||
|
||||||
|
//
|
||||||
|
lHasSignal
|
||||||
|
//
|
||||||
|
||
|
||||||
|
//
|
||||||
|
hHasSignal
|
||||||
|
//
|
||||||
|
)
|
||||||
|
//
|
||||||
|
||
|
||||||
|
//
|
||||||
|
(
|
||||||
|
//
|
||||||
|
!mGetVerificationFromOtherTimeFrames
|
||||||
|
? true
|
||||||
|
: isLong
|
||||||
|
? signalGenerator.HasLongVerifications(otherConditions)
|
||||||
|
: signalGenerator.HasShortVerifications(otherConditions)
|
||||||
|
//
|
||||||
|
)
|
||||||
//
|
//
|
||||||
;
|
;
|
||||||
|
|
||||||
//
|
//
|
||||||
if (isScorePassed)
|
if (isValid)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
AddRef(
|
AddRef(
|
||||||
@@ -1365,21 +1489,62 @@ public:
|
|||||||
if (mPusher >= mReuiredSignalVerifications)
|
if (mPusher >= mReuiredSignalVerifications)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Check Final Bullish and Bearish Score ...
|
X121SetupConditions otherConditions[];
|
||||||
bool isScorePassed =
|
AddRef(
|
||||||
|
cConditions,
|
||||||
|
otherConditions //
|
||||||
|
);
|
||||||
|
AddRef(
|
||||||
|
sConditions,
|
||||||
|
otherConditions //
|
||||||
|
);
|
||||||
|
AddRef(
|
||||||
|
lConditions,
|
||||||
|
otherConditions //
|
||||||
|
);
|
||||||
|
AddRef(
|
||||||
|
hConditions,
|
||||||
|
otherConditions //
|
||||||
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
true
|
// Check Final Validations ...
|
||||||
// isLong
|
bool isValid =
|
||||||
// ? mBearishScore > mBullishScore
|
//
|
||||||
// : mBullishScore > mBearishScore
|
(
|
||||||
// isLong
|
//
|
||||||
// ? mBullishScore > (mBearishScore * 2)
|
cHasSignal
|
||||||
// : mBearishScore > (mBullishScore * 2)
|
//
|
||||||
|
||
|
||||||
|
//
|
||||||
|
sHasSignal
|
||||||
|
//
|
||||||
|
||
|
||||||
|
//
|
||||||
|
lHasSignal
|
||||||
|
//
|
||||||
|
||
|
||||||
|
//
|
||||||
|
hHasSignal
|
||||||
|
//
|
||||||
|
)
|
||||||
|
//
|
||||||
|
||
|
||||||
|
//
|
||||||
|
(
|
||||||
|
//
|
||||||
|
!mGetVerificationFromOtherTimeFrames
|
||||||
|
? true
|
||||||
|
: isLong
|
||||||
|
? signalGenerator.HasLongVerifications(otherConditions)
|
||||||
|
: signalGenerator.HasShortVerifications(otherConditions)
|
||||||
|
//
|
||||||
|
)
|
||||||
//
|
//
|
||||||
;
|
;
|
||||||
|
|
||||||
//
|
//
|
||||||
if (isScorePassed)
|
if (isValid)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
AddRef(
|
AddRef(
|
||||||
@@ -1418,21 +1583,62 @@ public:
|
|||||||
if (lPusher >= mReuiredSignalVerifications)
|
if (lPusher >= mReuiredSignalVerifications)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Check Final Bullish and Bearish Score ...
|
X121SetupConditions otherConditions[];
|
||||||
bool isScorePassed =
|
AddRef(
|
||||||
|
cConditions,
|
||||||
|
otherConditions //
|
||||||
|
);
|
||||||
|
AddRef(
|
||||||
|
sConditions,
|
||||||
|
otherConditions //
|
||||||
|
);
|
||||||
|
AddRef(
|
||||||
|
mConditions,
|
||||||
|
otherConditions //
|
||||||
|
);
|
||||||
|
AddRef(
|
||||||
|
hConditions,
|
||||||
|
otherConditions //
|
||||||
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
true
|
// Check Final Validations ...
|
||||||
// isLong
|
bool isValid =
|
||||||
// ? mBearishScore > mBullishScore
|
//
|
||||||
// : mBullishScore > mBearishScore
|
(
|
||||||
// isLong
|
//
|
||||||
// ? mBullishScore > (mBearishScore * 2)
|
cHasSignal
|
||||||
// : mBearishScore > (mBullishScore * 2)
|
//
|
||||||
|
||
|
||||||
|
//
|
||||||
|
sHasSignal
|
||||||
|
//
|
||||||
|
||
|
||||||
|
//
|
||||||
|
mHasSignal
|
||||||
|
//
|
||||||
|
||
|
||||||
|
//
|
||||||
|
hHasSignal
|
||||||
|
//
|
||||||
|
)
|
||||||
|
//
|
||||||
|
||
|
||||||
|
//
|
||||||
|
(
|
||||||
|
//
|
||||||
|
!mGetVerificationFromOtherTimeFrames
|
||||||
|
? true
|
||||||
|
: isLong
|
||||||
|
? signalGenerator.HasLongVerifications(otherConditions)
|
||||||
|
: signalGenerator.HasShortVerifications(otherConditions)
|
||||||
|
//
|
||||||
|
)
|
||||||
//
|
//
|
||||||
;
|
;
|
||||||
|
|
||||||
//
|
//
|
||||||
if (isScorePassed)
|
if (isValid)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
AddRef(
|
AddRef(
|
||||||
@@ -1471,21 +1677,61 @@ public:
|
|||||||
if (hPusher >= mReuiredSignalVerifications)
|
if (hPusher >= mReuiredSignalVerifications)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
// Check Final Bullish and Bearish Score ...
|
X121SetupConditions otherConditions[];
|
||||||
bool isScorePassed =
|
AddRef(
|
||||||
|
cConditions,
|
||||||
|
otherConditions //
|
||||||
|
);
|
||||||
|
AddRef(
|
||||||
|
sConditions,
|
||||||
|
otherConditions //
|
||||||
|
);
|
||||||
|
AddRef(
|
||||||
|
mConditions,
|
||||||
|
otherConditions //
|
||||||
|
);
|
||||||
|
AddRef(
|
||||||
|
lConditions,
|
||||||
|
otherConditions //
|
||||||
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
true
|
// Check Final Validations ...
|
||||||
// isLong
|
bool isValid =
|
||||||
// ? mBearishScore > mBullishScore
|
//
|
||||||
// : mBullishScore > mBearishScore
|
(
|
||||||
// isLong
|
//
|
||||||
// ? mBullishScore > (mBearishScore * 2)
|
cHasSignal
|
||||||
// : mBearishScore > (mBullishScore * 2)
|
//
|
||||||
|
||
|
||||||
|
//
|
||||||
|
sHasSignal
|
||||||
|
//
|
||||||
|
||
|
||||||
|
//
|
||||||
|
mHasSignal
|
||||||
|
//
|
||||||
|
||
|
||||||
|
//
|
||||||
|
lHasSignal
|
||||||
|
//
|
||||||
|
) //
|
||||||
|
||
|
||||||
|
//
|
||||||
|
(
|
||||||
|
//
|
||||||
|
!mGetVerificationFromOtherTimeFrames
|
||||||
|
? true
|
||||||
|
: isLong
|
||||||
|
? signalGenerator.HasLongVerifications(otherConditions)
|
||||||
|
: signalGenerator.HasShortVerifications(otherConditions)
|
||||||
|
//
|
||||||
|
)
|
||||||
//
|
//
|
||||||
;
|
;
|
||||||
|
|
||||||
//
|
//
|
||||||
if (isScorePassed)
|
if (isValid)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
AddRef(
|
AddRef(
|
||||||
@@ -1506,19 +1752,6 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
if (mBullishScore == mBearishScore ||
|
|
||||||
mBullishScore < 10 ||
|
|
||||||
mBullishScore == 0 ||
|
|
||||||
mBullishScore > 200 ||
|
|
||||||
mBearishScore < 10 ||
|
|
||||||
mBearishScore == 0 ||
|
|
||||||
mBearishScore > 200)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// Print("Custom Scores ...");
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Create Score Summary for Commenting on Chart ...
|
// Create Score Summary for Commenting on Chart ...
|
||||||
string scoreSummary =
|
string scoreSummary =
|
||||||
@@ -1760,6 +1993,7 @@ private:
|
|||||||
bool mCloseOnOpposit; // Close all Positions on Opposit
|
bool mCloseOnOpposit; // Close all Positions on Opposit
|
||||||
int mCloseOnSpecificTime; // Close All Trades in Specific Time
|
int mCloseOnSpecificTime; // Close All Trades in Specific Time
|
||||||
int mReuiredSignalVerifications; // Required Verifications for Validate Signals
|
int mReuiredSignalVerifications; // Required Verifications for Validate Signals
|
||||||
|
bool mGetVerificationFromOtherTimeFrames; // Get Verifications from Other Time Frames
|
||||||
|
|
||||||
//
|
//
|
||||||
XSignalInfo mSignalInfos[];
|
XSignalInfo mSignalInfos[];
|
||||||
|
|||||||
@@ -43,20 +43,21 @@ string x121EASymbols = "EURUSDb"; // Symbols
|
|||||||
// Signals ...
|
// Signals ...
|
||||||
bool x121EAAllowLong = true; // Allow Long Trades
|
bool x121EAAllowLong = true; // Allow Long Trades
|
||||||
bool x121EAAllowShort = true; // Allow Short Trades
|
bool x121EAAllowShort = true; // Allow Short Trades
|
||||||
int x121EAReuiredSignalVerifications = 6; // Required Verifications for Signals
|
int x121EAReuiredSignalVerifications = 2; // Required Verifications for Signals
|
||||||
|
bool x121EAGetVerificationFromOtherTimeFrames = true; // Get Verifications from Other Time Frames
|
||||||
|
|
||||||
//
|
//
|
||||||
// Risk Management ...
|
// Risk Management ...
|
||||||
double x121EAVolume = 0.01; // Static Volume
|
double x121EAVolume = 0.01; // Static Volume
|
||||||
double x121EATPPoint = 50; // TP Point
|
double x121EATPPoint = 50; // TP Point
|
||||||
double x121EASLPoint = 500; // SL Point
|
double x121EASLPoint = 100; // SL Point
|
||||||
int x121EAMaxAllowedTrades = 0; // Max Allowed Positions
|
int x121EAMaxAllowedTrades = 1; // Max Allowed Positions
|
||||||
bool x121EAIgnoreSL = false; // Ignore Calculated SL
|
bool x121EAIgnoreSL = false; // Ignore Calculated SL
|
||||||
bool x121EAIgnoreTP = false; // Ignore Calculated TP
|
bool x121EAIgnoreTP = false; // Ignore Calculated TP
|
||||||
bool x121EAUseSupport = false; // Use Support Signals
|
bool x121EAUseSupport = false; // Use Support Signals
|
||||||
double x121EAMinRequiredProfitPerTrade = 0; // Minimum Required Profit for Hedging
|
double x121EAMinRequiredProfitPerTrade = 0; // Minimum Required Profit for Hedging
|
||||||
double x121EAMinRequiredProfitPerVolumeFactor = 0; // Minimum Required Profit for Hedging Per Velume
|
double x121EAMinRequiredProfitPerVolumeFactor = 0; // Minimum Required Profit for Hedging Per Velume
|
||||||
int x121EARestingAfterHedge = 300; // Resting Seconds After Hedge
|
int x121EARestingAfterHedge = 0; // Resting Seconds After Hedge
|
||||||
int x121EACloseOnSpecificTime = -1; // Close All Trades in Specific Time
|
int x121EACloseOnSpecificTime = -1; // Close All Trades in Specific Time
|
||||||
bool x121EACloseOnOpposit = false; // Close all Positions on Opposit
|
bool x121EACloseOnOpposit = false; // Close all Positions on Opposit
|
||||||
|
|
||||||
@@ -180,6 +181,7 @@ bool InitialEA()
|
|||||||
x121EA.MinRequiredProfitPerTrade(x121EAMinRequiredProfitPerTrade);
|
x121EA.MinRequiredProfitPerTrade(x121EAMinRequiredProfitPerTrade);
|
||||||
x121EA.ReuiredSignalVerifications(x121EAReuiredSignalVerifications);
|
x121EA.ReuiredSignalVerifications(x121EAReuiredSignalVerifications);
|
||||||
x121EA.MinRequiredProfitPerVolumeFactor(x121EAMinRequiredProfitPerVolumeFactor);
|
x121EA.MinRequiredProfitPerVolumeFactor(x121EAMinRequiredProfitPerVolumeFactor);
|
||||||
|
x121EA.GetVerificationFromOtherTimeFrames(x121EAGetVerificationFromOtherTimeFrames);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Configure Alert ...
|
// Configure Alert ...
|
||||||
|
|||||||
Reference in New Issue
Block a user