This commit is contained in:
2025-04-27 19:13:26 +03:30
parent 97a444c92d
commit fdfcfda5c5
4 changed files with 565 additions and 223 deletions
+142 -3
View File
@@ -2151,7 +2151,16 @@ class XCXCAEAPOIDetector : public XCBase
if (detectFVGBullishPivots)
{
//
if (isBullishFVG)
bool checkingCondition =
//
isBullishFVG &&
(cPeak > pPeak ||
pPeak > p2Peak)
//
;
//
if (checkingCondition)
{
//
XBoxZone iBox;
@@ -2193,7 +2202,16 @@ class XCXCAEAPOIDetector : public XCBase
if (detectFVGBearishPivots)
{
//
if (isBearishFVG)
bool checkingCondition =
//
isBearishFVG &&
(cVale < pVale ||
pVale < p2Vale)
//
;
//
if (checkingCondition)
{
//
XBoxZone iBox;
@@ -2921,7 +2939,8 @@ class XCXCAEAPOIDetector : public XCBase
//
void Validate(
XBoxZone &unAvailableBoxes[],
int barIndex = 0 //
int barIndex = 0,
bool validateFVGsUsingPV = false //
)
{
//
@@ -2942,6 +2961,20 @@ class XCXCAEAPOIDetector : public XCBase
int pIDX = cIDX + 1;
int p2IDX = pIDX + 1;
//
// Retrieve Conditions ...
XCAEAConditions conditions;
has = helper.GetConditions(
conditions,
barIndex,
5 //
);
if (!has)
{
conditions.Clean();
return;
}
//
// Implement Validation Senarios ...
@@ -3040,6 +3073,16 @@ class XCXCAEAPOIDetector : public XCBase
unAvailableBoxes,
barIndex //
);
//
if (validateFVGsUsingPV)
{
//
ApplyFVGPVValidation(
fvgBullishPivots,
conditions //
);
}
}
//
@@ -3055,6 +3098,16 @@ class XCXCAEAPOIDetector : public XCBase
unAvailableBoxes,
barIndex //
);
//
if (validateFVGsUsingPV)
{
//
ApplyFVGPVValidation(
fvgBearishPivots,
conditions //
);
}
}
//
@@ -3177,6 +3230,9 @@ class XCXCAEAPOIDetector : public XCBase
);
}
//
conditions.Clean();
//
SortPivots();
}
@@ -4175,6 +4231,89 @@ class XCXCAEAPOIDetector : public XCBase
Clean(tmp);
}
//
void ApplyFVGPVValidation(
XBoxZone &fvgs[],
XCAEAConditions &conditions //
)
{
//
int zIDX = 0;
int cIDX = zIDX + 1;
int pIDX = cIDX + 1;
int p2IDX = pIDX + 1;
//
bool has = HasChild(fvgs);
if (!has)
{
return;
}
//
// Reading Values ...
//
// PEAK ...
double zPeak = conditions.peakBuffer[zIDX];
double cPeak = conditions.peakBuffer[cIDX];
double pPeak = conditions.peakBuffer[pIDX];
double p2Peak = conditions.peakBuffer[p2IDX];
//
// VALE ...
double zVale = conditions.valeBuffer[zIDX];
double cVale = conditions.valeBuffer[cIDX];
double pVale = conditions.valeBuffer[pIDX];
double p2Vale = conditions.valeBuffer[p2IDX];
//
XBoxZone tmp[];
Copy(
fvgs,
tmp //
);
Clean(fvgs);
while (HasChild(tmp))
{
//
XBoxZone iBox = tmp[0];
ArrayRemove(
tmp,
0,
1 //
);
//
bool isBullish = iBox.IsBullish();
//
bool isTooOld = iBox.GetAge() > 21;
bool isPVBreaked =
isBullish
? cVale > iBox.upper
: cPeak < iBox.lower;
//
has = !isTooOld &&
!isPVBreaked;
if (has)
{
//
AddRef(
iBox,
fvgs //
);
}
//
iBox.Clean();
}
//
Clean(tmp);
}
//
void ApplySortOnBox(
XBoxZone &items[] //