add support for get verifications from other time frames ...
This commit is contained in:
@@ -2024,6 +2024,490 @@ struct X121SignalGenerator
|
||||
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 ...
|
||||
bool FilterLongConditions(
|
||||
|
||||
Reference in New Issue
Block a user