last ...
This commit is contained in:
@@ -514,7 +514,7 @@ struct XCAPVFVG
|
||||
}
|
||||
|
||||
//
|
||||
void AddPivot(XCAPivot &pivot)
|
||||
void AddFVG(XCAPivot &pivot)
|
||||
{
|
||||
//
|
||||
if (!IsValid() ||
|
||||
@@ -530,7 +530,8 @@ struct XCAPVFVG
|
||||
pivot,
|
||||
fvgs //
|
||||
);
|
||||
if (has) {
|
||||
if (has)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -540,6 +541,53 @@ struct XCAPVFVG
|
||||
fvgs //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
int GetFVGs(XBoxZone &fvgBoxes[])
|
||||
{
|
||||
//
|
||||
int result = 0;
|
||||
|
||||
//
|
||||
Clean(fvgBoxes);
|
||||
|
||||
//
|
||||
bool has = false;
|
||||
|
||||
//
|
||||
has = IsValid() &&
|
||||
HasChild(fvgs);
|
||||
if (!has)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
int count = ArraySize(fvgs);
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
XBoxZone iBox;
|
||||
has = fvgs[i].AsBox(iBox);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
AddRef(
|
||||
iBox,
|
||||
fvgBoxes //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
iBox.Clean();
|
||||
}
|
||||
|
||||
//
|
||||
result = ArraySize(fvgBoxes);
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -594,6 +642,181 @@ bool FindPivotIndex(
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add or Update Specified Pivot to Specified Collection ...
|
||||
*
|
||||
* @param pivot: XCAPivot instance reference, Specified Item ...
|
||||
* @param pivots: XCAPivot instance reference Collection ...
|
||||
* @param maxAllowedPivots: int, Max Allowed Pivots number of Collection ...
|
||||
*/
|
||||
void AddPivot(
|
||||
XCAPivot &pivot,
|
||||
XCAPivot &pivots[],
|
||||
int maxAllowedPivots = 50 //
|
||||
)
|
||||
{
|
||||
//
|
||||
bool has = pivot.IsValid();
|
||||
if (!has)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
int idx = -1;
|
||||
has = FindPivotIndex(
|
||||
idx,
|
||||
pivot,
|
||||
pivots //
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
int updateIDX = -1;
|
||||
int count = ArraySize(pivots);
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
XCAPivot iPivot = pivots[i];
|
||||
|
||||
//
|
||||
has =
|
||||
iPivot.to > pivot.to &&
|
||||
iPivot.from == pivot.from &&
|
||||
iPivot.value == pivot.value &&
|
||||
iPivot.symbol == pivot.symbol &&
|
||||
iPivot.period == pivot.period;
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
updateIDX = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
has = IsValidIndex(updateIDX);
|
||||
if (!has)
|
||||
{
|
||||
//
|
||||
AddRef(
|
||||
pivot,
|
||||
pivots //
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
pivots[updateIDX].to = pivot.to;
|
||||
}
|
||||
|
||||
//
|
||||
// Apply Max Allowed ...
|
||||
CleanupArray(
|
||||
pivots,
|
||||
maxAllowedPivots //
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add or Update PV FVG item to Specified Collection ...
|
||||
*
|
||||
* @param value: double, Peak or Vale Value ...
|
||||
* @param fvg: XCAPivot instance reference, Specified Pivot ...
|
||||
* @param collection: XCAPVFVG instance Collection ...
|
||||
*/
|
||||
void AddOrUpdatePVFVG(
|
||||
double value,
|
||||
XCAPivot &fvg,
|
||||
XCAPVFVG &collection[] //
|
||||
)
|
||||
{
|
||||
//
|
||||
// Validate Args ...
|
||||
if (value < 0 &&
|
||||
!fvg.IsValid() &&
|
||||
(fvg.type == XCA_FVG_BULL ||
|
||||
fvg.type == XCA_FVG_BEAR))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
// Check Pivot is Exists or not ...
|
||||
ENUM_X_DIRECTION dir =
|
||||
fvg.type == XCA_FVG_BULL
|
||||
? X_DIRECTION_BULLISH
|
||||
: X_DIRECTION_BEARISH;
|
||||
|
||||
//
|
||||
bool isBullish = IsBullish(dir);
|
||||
bool isBearish = IsBearish(dir);
|
||||
|
||||
//
|
||||
// Try to Findout Pivot Value in Collection ...
|
||||
int idx = -1;
|
||||
int count = ArraySize(collection);
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
XCAPVFVG iTem = collection[i];
|
||||
|
||||
//
|
||||
bool isSameValue = iTem.value == value;
|
||||
bool isSameDirection = iTem.dir == dir;
|
||||
|
||||
//
|
||||
bool isValid = isSameValue &&
|
||||
isSameDirection;
|
||||
if (isValid)
|
||||
{
|
||||
//
|
||||
idx = i;
|
||||
iTem.Clean();
|
||||
break;
|
||||
}
|
||||
|
||||
//
|
||||
iTem.Clean();
|
||||
}
|
||||
|
||||
//
|
||||
// Try to Add Or Update Pivots ...
|
||||
bool hasIndex = IsValidIndex(idx);
|
||||
if (!hasIndex)
|
||||
{
|
||||
//
|
||||
// New Item ...
|
||||
XCAPVFVG iPVFVG;
|
||||
|
||||
//
|
||||
iPVFVG.dir = dir;
|
||||
iPVFVG.value = value;
|
||||
|
||||
//
|
||||
AddRef(
|
||||
fvg,
|
||||
iPVFVG.fvgs //
|
||||
);
|
||||
|
||||
//
|
||||
AddRef(
|
||||
iPVFVG,
|
||||
collection //
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
//
|
||||
// Add Pivot to Existing Item ...
|
||||
collection[idx].AddFVG(fvg);
|
||||
}
|
||||
|
||||
//
|
||||
}
|
||||
|
||||
//
|
||||
// Implementations ...
|
||||
class XCXCAEAPOIDetector : public XCBase
|
||||
@@ -734,6 +957,10 @@ class XCXCAEAPOIDetector : public XCBase
|
||||
XCAPivot rsiCrossedUnderOBPivots[];
|
||||
XCAPivot cciCrossedUnderOBPivots[];
|
||||
|
||||
//
|
||||
XCAPVFVG pvFVGBullishPivots[];
|
||||
XCAPVFVG pvFVGBearishPivots[];
|
||||
|
||||
//
|
||||
// Constructors ...
|
||||
XCXCAEAPOIDetector(
|
||||
@@ -1570,7 +1797,8 @@ class XCXCAEAPOIDetector : public XCBase
|
||||
//
|
||||
AddPivot(
|
||||
peakPivot,
|
||||
peakPivots //
|
||||
peakPivots,
|
||||
maxAllowedPivots //
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1634,7 +1862,8 @@ class XCXCAEAPOIDetector : public XCBase
|
||||
//
|
||||
AddPivot(
|
||||
valePivot,
|
||||
valePivots //
|
||||
valePivots,
|
||||
maxAllowedPivots //
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1728,7 +1957,8 @@ class XCXCAEAPOIDetector : public XCBase
|
||||
//
|
||||
AddPivot(
|
||||
swhPivot,
|
||||
swhPivots //
|
||||
swhPivots,
|
||||
maxAllowedPivots //
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1822,7 +2052,8 @@ class XCXCAEAPOIDetector : public XCBase
|
||||
//
|
||||
AddPivot(
|
||||
swlPivot,
|
||||
swlPivots //
|
||||
swlPivots,
|
||||
maxAllowedPivots //
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1886,7 +2117,8 @@ class XCXCAEAPOIDetector : public XCBase
|
||||
//
|
||||
AddPivot(
|
||||
peakSWHResPivot,
|
||||
peakSWHResPivots //
|
||||
peakSWHResPivots,
|
||||
maxAllowedPivots //
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1950,7 +2182,8 @@ class XCXCAEAPOIDetector : public XCBase
|
||||
//
|
||||
AddPivot(
|
||||
valeSWLSupPivot,
|
||||
valeSWLSupPivots //
|
||||
valeSWLSupPivots,
|
||||
maxAllowedPivots //
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2027,7 +2260,8 @@ class XCXCAEAPOIDetector : public XCBase
|
||||
//
|
||||
AddPivot(
|
||||
kiBullishPivot,
|
||||
kiBullishPivots //
|
||||
kiBullishPivots,
|
||||
maxAllowedPivots //
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2104,7 +2338,8 @@ class XCXCAEAPOIDetector : public XCBase
|
||||
//
|
||||
AddPivot(
|
||||
kiBearishPivot,
|
||||
kiBearishPivots //
|
||||
kiBearishPivots,
|
||||
maxAllowedPivots //
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2135,7 +2370,22 @@ class XCXCAEAPOIDetector : public XCBase
|
||||
//
|
||||
AddPivot(
|
||||
iPivot,
|
||||
fvgBullishPivots //
|
||||
fvgBullishPivots,
|
||||
maxAllowedPivots //
|
||||
);
|
||||
|
||||
//
|
||||
double fValue =
|
||||
fvgBox.IsBullish()
|
||||
? cVale
|
||||
: cPeak;
|
||||
|
||||
//
|
||||
// XPVFVG Handling ...
|
||||
AddOrUpdatePVFVG(
|
||||
fValue,
|
||||
iPivot,
|
||||
pvFVGBullishPivots //
|
||||
);
|
||||
|
||||
//
|
||||
@@ -2165,7 +2415,22 @@ class XCXCAEAPOIDetector : public XCBase
|
||||
//
|
||||
AddPivot(
|
||||
iPivot,
|
||||
fvgBearishPivots //
|
||||
fvgBearishPivots,
|
||||
maxAllowedPivots //
|
||||
);
|
||||
|
||||
//
|
||||
double fValue =
|
||||
fvgBox.IsBullish()
|
||||
? cVale
|
||||
: cPeak;
|
||||
|
||||
//
|
||||
// XPVFVG Handling ...
|
||||
AddOrUpdatePVFVG(
|
||||
fValue,
|
||||
iPivot,
|
||||
pvFVGBearishPivots //
|
||||
);
|
||||
|
||||
//
|
||||
@@ -2241,7 +2506,8 @@ class XCXCAEAPOIDetector : public XCBase
|
||||
//
|
||||
AddPivot(
|
||||
tkiBullishPivot,
|
||||
tkiBullishPivots //
|
||||
tkiBullishPivots,
|
||||
maxAllowedPivots //
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2318,7 +2584,8 @@ class XCXCAEAPOIDetector : public XCBase
|
||||
//
|
||||
AddPivot(
|
||||
tkiBearishPivot,
|
||||
tkiBearishPivots //
|
||||
tkiBearishPivots,
|
||||
maxAllowedPivots //
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2395,7 +2662,8 @@ class XCXCAEAPOIDetector : public XCBase
|
||||
//
|
||||
AddPivot(
|
||||
trendBullishPivot,
|
||||
trendBullishPivots //
|
||||
trendBullishPivots,
|
||||
maxAllowedPivots //
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2472,7 +2740,8 @@ class XCXCAEAPOIDetector : public XCBase
|
||||
//
|
||||
AddPivot(
|
||||
trendBearishPivot,
|
||||
trendBearishPivots //
|
||||
trendBearishPivots,
|
||||
maxAllowedPivots //
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2555,7 +2824,8 @@ class XCXCAEAPOIDetector : public XCBase
|
||||
//
|
||||
AddPivot(
|
||||
tkitrndBullishPivot,
|
||||
tkitrndBullishPivots //
|
||||
tkitrndBullishPivots,
|
||||
maxAllowedPivots //
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2638,7 +2908,8 @@ class XCXCAEAPOIDetector : public XCBase
|
||||
//
|
||||
AddPivot(
|
||||
tkitrndBearishPivot,
|
||||
tkitrndBearishPivots //
|
||||
tkitrndBearishPivots,
|
||||
maxAllowedPivots //
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2734,7 +3005,8 @@ class XCXCAEAPOIDetector : public XCBase
|
||||
//
|
||||
AddPivot(
|
||||
sSameLLPivot,
|
||||
sSameLLPivots //
|
||||
sSameLLPivots,
|
||||
maxAllowedPivots //
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2825,7 +3097,8 @@ class XCXCAEAPOIDetector : public XCBase
|
||||
//
|
||||
AddPivot(
|
||||
mSameLLPivot,
|
||||
mSameLLPivots //
|
||||
mSameLLPivots,
|
||||
maxAllowedPivots //
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2916,7 +3189,8 @@ class XCXCAEAPOIDetector : public XCBase
|
||||
//
|
||||
AddPivot(
|
||||
lSameLLPivot,
|
||||
lSameLLPivots //
|
||||
lSameLLPivots,
|
||||
maxAllowedPivots //
|
||||
);
|
||||
}
|
||||
|
||||
@@ -3007,7 +3281,8 @@ class XCXCAEAPOIDetector : public XCBase
|
||||
//
|
||||
AddPivot(
|
||||
hSameLLPivot,
|
||||
hSameLLPivots //
|
||||
hSameLLPivots,
|
||||
maxAllowedPivots //
|
||||
);
|
||||
}
|
||||
|
||||
@@ -3103,7 +3378,8 @@ class XCXCAEAPOIDetector : public XCBase
|
||||
//
|
||||
AddPivot(
|
||||
sSameHHPivot,
|
||||
sSameHHPivots //
|
||||
sSameHHPivots,
|
||||
maxAllowedPivots //
|
||||
);
|
||||
}
|
||||
|
||||
@@ -3194,7 +3470,8 @@ class XCXCAEAPOIDetector : public XCBase
|
||||
//
|
||||
AddPivot(
|
||||
mSameHHPivot,
|
||||
mSameHHPivots //
|
||||
mSameHHPivots,
|
||||
maxAllowedPivots //
|
||||
);
|
||||
}
|
||||
|
||||
@@ -3285,7 +3562,8 @@ class XCXCAEAPOIDetector : public XCBase
|
||||
//
|
||||
AddPivot(
|
||||
lSameHHPivot,
|
||||
lSameHHPivots //
|
||||
lSameHHPivots,
|
||||
maxAllowedPivots //
|
||||
);
|
||||
}
|
||||
|
||||
@@ -3376,7 +3654,8 @@ class XCXCAEAPOIDetector : public XCBase
|
||||
//
|
||||
AddPivot(
|
||||
hSameHHPivot,
|
||||
hSameHHPivots //
|
||||
hSameHHPivots,
|
||||
maxAllowedPivots //
|
||||
);
|
||||
}
|
||||
|
||||
@@ -3435,7 +3714,8 @@ class XCXCAEAPOIDetector : public XCBase
|
||||
//
|
||||
AddPivot(
|
||||
iPivot,
|
||||
rsiPeakPivots //
|
||||
rsiPeakPivots,
|
||||
maxAllowedPivots //
|
||||
);
|
||||
|
||||
//
|
||||
@@ -3493,7 +3773,8 @@ class XCXCAEAPOIDetector : public XCBase
|
||||
//
|
||||
AddPivot(
|
||||
iPivot,
|
||||
rsiValePivots //
|
||||
rsiValePivots,
|
||||
maxAllowedPivots //
|
||||
);
|
||||
|
||||
//
|
||||
@@ -3551,7 +3832,8 @@ class XCXCAEAPOIDetector : public XCBase
|
||||
//
|
||||
AddPivot(
|
||||
iPivot,
|
||||
rsiCrossedOverOSPivots //
|
||||
rsiCrossedOverOSPivots,
|
||||
maxAllowedPivots //
|
||||
);
|
||||
|
||||
//
|
||||
@@ -3609,7 +3891,8 @@ class XCXCAEAPOIDetector : public XCBase
|
||||
//
|
||||
AddPivot(
|
||||
iPivot,
|
||||
rsiCrossedUnderOBPivots //
|
||||
rsiCrossedUnderOBPivots,
|
||||
maxAllowedPivots //
|
||||
);
|
||||
|
||||
//
|
||||
@@ -3667,7 +3950,8 @@ class XCXCAEAPOIDetector : public XCBase
|
||||
//
|
||||
AddPivot(
|
||||
iPivot,
|
||||
cciPeakPivots //
|
||||
cciPeakPivots,
|
||||
maxAllowedPivots //
|
||||
);
|
||||
|
||||
//
|
||||
@@ -3725,7 +4009,8 @@ class XCXCAEAPOIDetector : public XCBase
|
||||
//
|
||||
AddPivot(
|
||||
iPivot,
|
||||
cciValePivots //
|
||||
cciValePivots,
|
||||
maxAllowedPivots //
|
||||
);
|
||||
|
||||
//
|
||||
@@ -3783,7 +4068,8 @@ class XCXCAEAPOIDetector : public XCBase
|
||||
//
|
||||
AddPivot(
|
||||
iPivot,
|
||||
cciCrossedOverOSPivots //
|
||||
cciCrossedOverOSPivots,
|
||||
maxAllowedPivots //
|
||||
);
|
||||
|
||||
//
|
||||
@@ -3841,7 +4127,8 @@ class XCXCAEAPOIDetector : public XCBase
|
||||
//
|
||||
AddPivot(
|
||||
iPivot,
|
||||
cciCrossedUnderOBPivots //
|
||||
cciCrossedUnderOBPivots,
|
||||
maxAllowedPivots //
|
||||
);
|
||||
|
||||
//
|
||||
@@ -4375,6 +4662,146 @@ class XCXCAEAPOIDetector : public XCBase
|
||||
Clean(tmp);
|
||||
}
|
||||
|
||||
//
|
||||
// PVFVG ...
|
||||
XCAPVFVG tmpPVFVG[];
|
||||
|
||||
//
|
||||
has = HasPVFVGBullishPivots();
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
Copy(
|
||||
pvFVGBullishPivots,
|
||||
tmpPVFVG //
|
||||
);
|
||||
Clean(pvFVGBullishPivots);
|
||||
while (HasChild(tmpPVFVG))
|
||||
{
|
||||
//
|
||||
XCAPVFVG iPVFVG = tmpPVFVG[0];
|
||||
ArrayRemove(
|
||||
tmpPVFVG,
|
||||
0,
|
||||
1 //
|
||||
);
|
||||
|
||||
//
|
||||
XCAPivot tmpFVGs[];
|
||||
Copy(
|
||||
iPVFVG.fvgs,
|
||||
tmpFVGs //
|
||||
);
|
||||
Clean(iPVFVG.fvgs);
|
||||
while (HasChild(tmpFVGs))
|
||||
{
|
||||
//
|
||||
XCAPivot iPivot = tmpFVGs[0];
|
||||
ArrayRemove(
|
||||
tmpFVGs,
|
||||
0,
|
||||
1 //
|
||||
);
|
||||
|
||||
//
|
||||
has = IsPivotBreaked(
|
||||
iPivot,
|
||||
unAvailableBoxes,
|
||||
barIndex //
|
||||
);
|
||||
if (!has)
|
||||
{
|
||||
//
|
||||
AddRef(
|
||||
iPivot,
|
||||
iPVFVG.fvgs //
|
||||
);
|
||||
}
|
||||
}
|
||||
Clean(tmpFVGs);
|
||||
|
||||
//
|
||||
if (HasChild(iPVFVG.fvgs))
|
||||
{
|
||||
//
|
||||
AddRef(
|
||||
iPVFVG,
|
||||
pvFVGBullishPivots //
|
||||
);
|
||||
}
|
||||
}
|
||||
Clean(tmp);
|
||||
Clean(tmpPVFVG);
|
||||
}
|
||||
|
||||
//
|
||||
has = HasPVFVGBearishPivots();
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
Copy(
|
||||
pvFVGBearishPivots,
|
||||
tmpPVFVG //
|
||||
);
|
||||
Clean(pvFVGBearishPivots);
|
||||
while (HasChild(tmpPVFVG))
|
||||
{
|
||||
//
|
||||
XCAPVFVG iPVFVG = tmpPVFVG[0];
|
||||
ArrayRemove(
|
||||
tmpPVFVG,
|
||||
0,
|
||||
1 //
|
||||
);
|
||||
|
||||
//
|
||||
XCAPivot tmpFVGs[];
|
||||
Copy(
|
||||
iPVFVG.fvgs,
|
||||
tmpFVGs //
|
||||
);
|
||||
Clean(iPVFVG.fvgs);
|
||||
while (HasChild(tmpFVGs))
|
||||
{
|
||||
//
|
||||
XCAPivot iPivot = tmpFVGs[0];
|
||||
ArrayRemove(
|
||||
tmpFVGs,
|
||||
0,
|
||||
1 //
|
||||
);
|
||||
|
||||
//
|
||||
has = IsPivotBreaked(
|
||||
iPivot,
|
||||
unAvailableBoxes,
|
||||
barIndex //
|
||||
);
|
||||
if (!has)
|
||||
{
|
||||
//
|
||||
AddRef(
|
||||
iPivot,
|
||||
iPVFVG.fvgs //
|
||||
);
|
||||
}
|
||||
}
|
||||
Clean(tmpFVGs);
|
||||
|
||||
//
|
||||
if (HasChild(iPVFVG.fvgs))
|
||||
{
|
||||
//
|
||||
AddRef(
|
||||
iPVFVG,
|
||||
pvFVGBearishPivots //
|
||||
);
|
||||
}
|
||||
}
|
||||
Clean(tmp);
|
||||
Clean(tmpPVFVG);
|
||||
}
|
||||
|
||||
//
|
||||
// TREND ...
|
||||
|
||||
@@ -5154,6 +5581,8 @@ class XCXCAEAPOIDetector : public XCBase
|
||||
}
|
||||
|
||||
//
|
||||
Clean(tmp);
|
||||
Clean(tmpPVFVG);
|
||||
}
|
||||
|
||||
//
|
||||
@@ -6174,6 +6603,33 @@ class XCXCAEAPOIDetector : public XCBase
|
||||
return ArraySize(fvgBearishPivots);
|
||||
}
|
||||
|
||||
//
|
||||
// PVFVG ...
|
||||
|
||||
//
|
||||
bool HasPVFVGBullishPivots()
|
||||
{
|
||||
return HasChild(pvFVGBullishPivots);
|
||||
}
|
||||
|
||||
//
|
||||
int CountPVFVGBullishPivots()
|
||||
{
|
||||
return ArraySize(pvFVGBullishPivots);
|
||||
}
|
||||
|
||||
//
|
||||
bool HasPVFVGBearishPivots()
|
||||
{
|
||||
return HasChild(pvFVGBearishPivots);
|
||||
}
|
||||
|
||||
//
|
||||
int CountPVFVGBearishPivots()
|
||||
{
|
||||
return ArraySize(pvFVGBearishPivots);
|
||||
}
|
||||
|
||||
//
|
||||
// TREND ...
|
||||
|
||||
@@ -6449,77 +6905,6 @@ class XCXCAEAPOIDetector : public XCBase
|
||||
XCXCAEAHelper *helper;
|
||||
XCBarAnalyser *barAnalyser;
|
||||
|
||||
//
|
||||
void AddPivot(
|
||||
XCAPivot &pivot,
|
||||
XCAPivot &pivots[] //
|
||||
)
|
||||
{
|
||||
//
|
||||
bool has = pivot.IsValid();
|
||||
if (!has)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
int idx = -1;
|
||||
has = FindPivotIndex(
|
||||
idx,
|
||||
pivot,
|
||||
pivots //
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
int updateIDX = -1;
|
||||
int count = ArraySize(pivots);
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
XCAPivot iPivot = pivots[i];
|
||||
|
||||
//
|
||||
has =
|
||||
iPivot.to > pivot.to &&
|
||||
iPivot.from == pivot.from &&
|
||||
iPivot.value == pivot.value &&
|
||||
iPivot.symbol == pivot.symbol &&
|
||||
iPivot.period == pivot.period;
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
updateIDX = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
has = IsValidIndex(updateIDX);
|
||||
if (!has)
|
||||
{
|
||||
//
|
||||
AddRef(
|
||||
pivot,
|
||||
pivots //
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
pivots[updateIDX].to = pivot.to;
|
||||
}
|
||||
|
||||
//
|
||||
// Apply Max Allowed ...
|
||||
CleanupArray(
|
||||
pivots,
|
||||
maxAllowedPivots //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
bool CheckPivotCommons(
|
||||
XCAPivot &pivot,
|
||||
|
||||
@@ -56,6 +56,8 @@ class XCXCAEAPOIDrawer : public XCBase
|
||||
bool drawCycleSameHHPivots;
|
||||
bool drawTrendBullishPivots;
|
||||
bool drawTrendBearishPivots;
|
||||
bool drawPVFVGBullishPivots;
|
||||
bool drawPVFVGBearishPivots;
|
||||
bool drawTKITRNDBullishPivots;
|
||||
bool drawTKITRNDBearishPivots;
|
||||
bool drawRSICrossedOverOSPivots;
|
||||
@@ -199,6 +201,8 @@ class XCXCAEAPOIDrawer : public XCBase
|
||||
drawTKIBearishPivots = false;
|
||||
drawCycleSameLLPivots = false;
|
||||
drawCycleSameHHPivots = false;
|
||||
drawPVFVGBullishPivots = false;
|
||||
drawPVFVGBearishPivots = false;
|
||||
drawTrendBullishPivots = false;
|
||||
drawTrendBearishPivots = false;
|
||||
drawTKITRNDBullishPivots = false;
|
||||
@@ -659,57 +663,114 @@ class XCXCAEAPOIDrawer : public XCBase
|
||||
//
|
||||
void DrawFVGBullishPivots(datetime to = NULL)
|
||||
{
|
||||
//
|
||||
if (!drawFVGBullishPivots)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
bool canUpdateTo = IsValid(to);
|
||||
|
||||
//
|
||||
bool has = detector.HasFVGBullishPivots();
|
||||
if (!has)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
int count = detector.CountFVGBullishPivots();
|
||||
for (int i = 0; i < count; i++)
|
||||
if (drawFVGBullishPivots)
|
||||
{
|
||||
//
|
||||
XBoxZone iBox;
|
||||
has = detector.fvgBullishPivots[i].AsBox(iBox);
|
||||
if (!has)
|
||||
{
|
||||
//
|
||||
iBox.Clean();
|
||||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
if (canUpdateTo)
|
||||
{
|
||||
iBox.to = to;
|
||||
}
|
||||
|
||||
//
|
||||
XCBoxObject *iObj;
|
||||
has = drawer.DrawBox(
|
||||
iBox,
|
||||
iObj //
|
||||
);
|
||||
bool has = detector.HasFVGBullishPivots();
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
iObj.BoxColor(fvgBullishPivotColor);
|
||||
iObj.BoxWidth(fvgBullishPivotWidth);
|
||||
iObj.BoxStyle(fvgBullishPivotStyle);
|
||||
int count = detector.CountFVGBullishPivots();
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
XBoxZone iBox;
|
||||
has = detector.fvgBullishPivots[i].AsBox(iBox);
|
||||
if (!has)
|
||||
{
|
||||
//
|
||||
iBox.Clean();
|
||||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
if (canUpdateTo)
|
||||
{
|
||||
iBox.to = to;
|
||||
}
|
||||
|
||||
//
|
||||
XCBoxObject *iObj;
|
||||
has = drawer.DrawBox(
|
||||
iBox,
|
||||
iObj //
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
iObj.BoxColor(fvgBullishPivotColor);
|
||||
iObj.BoxWidth(fvgBullishPivotWidth);
|
||||
iObj.BoxStyle(fvgBullishPivotStyle);
|
||||
|
||||
//
|
||||
mFVGBullishPivotObjects.Add(iObj);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
if (drawPVFVGBullishPivots)
|
||||
{
|
||||
//
|
||||
bool has = detector.HasPVFVGBullishPivots();
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
mFVGBullishPivotObjects.Add(iObj);
|
||||
int count = detector.CountPVFVGBullishPivots();
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
XCAPVFVG iPVFVG = detector.pvFVGBullishPivots[i];
|
||||
|
||||
//
|
||||
XBoxZone fvgBoxes[];
|
||||
int fvgBoxesCount = iPVFVG.GetFVGs(fvgBoxes);
|
||||
has = IsValidSize(fvgBoxesCount);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
int idx = GetLowest(fvgBoxes);
|
||||
if (IsValidIndex(idx))
|
||||
{
|
||||
//
|
||||
XBoxZone iBox = fvgBoxes[idx];
|
||||
|
||||
//
|
||||
if (canUpdateTo)
|
||||
{
|
||||
iBox.to = to;
|
||||
}
|
||||
|
||||
//
|
||||
XCBoxObject *iObj;
|
||||
|
||||
//
|
||||
has = drawer.DrawBox(
|
||||
iBox,
|
||||
iObj //
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
iObj.BoxColor(fvgBullishPivotColor);
|
||||
iObj.BoxWidth(fvgBullishPivotWidth);
|
||||
iObj.BoxStyle(fvgBullishPivotStyle);
|
||||
|
||||
//
|
||||
mFVGBullishPivotObjects.Add(iObj);
|
||||
}
|
||||
|
||||
//
|
||||
iBox.Clean();
|
||||
ZeroMemory(iObj);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -717,57 +778,114 @@ class XCXCAEAPOIDrawer : public XCBase
|
||||
//
|
||||
void DrawFVGBearishPivots(datetime to = NULL)
|
||||
{
|
||||
//
|
||||
if (!drawFVGBearishPivots)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
bool canUpdateTo = IsValid(to);
|
||||
|
||||
//
|
||||
bool has = detector.HasFVGBearishPivots();
|
||||
if (!has)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
int count = detector.CountFVGBearishPivots();
|
||||
for (int i = 0; i < count; i++)
|
||||
if (drawFVGBearishPivots)
|
||||
{
|
||||
//
|
||||
XBoxZone iBox;
|
||||
has = detector.fvgBearishPivots[i].AsBox(iBox);
|
||||
if (!has)
|
||||
{
|
||||
//
|
||||
iBox.Clean();
|
||||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
if (canUpdateTo)
|
||||
{
|
||||
iBox.to = to;
|
||||
}
|
||||
|
||||
//
|
||||
XCBoxObject *iObj;
|
||||
has = drawer.DrawBox(
|
||||
iBox,
|
||||
iObj //
|
||||
);
|
||||
bool has = detector.HasFVGBearishPivots();
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
iObj.BoxColor(fvgBearishPivotColor);
|
||||
iObj.BoxWidth(fvgBearishPivotWidth);
|
||||
iObj.BoxStyle(fvgBearishPivotStyle);
|
||||
int count = detector.CountFVGBearishPivots();
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
XBoxZone iBox;
|
||||
has = detector.fvgBearishPivots[i].AsBox(iBox);
|
||||
if (!has)
|
||||
{
|
||||
//
|
||||
iBox.Clean();
|
||||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
if (canUpdateTo)
|
||||
{
|
||||
iBox.to = to;
|
||||
}
|
||||
|
||||
//
|
||||
XCBoxObject *iObj;
|
||||
has = drawer.DrawBox(
|
||||
iBox,
|
||||
iObj //
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
iObj.BoxColor(fvgBearishPivotColor);
|
||||
iObj.BoxWidth(fvgBearishPivotWidth);
|
||||
iObj.BoxStyle(fvgBearishPivotStyle);
|
||||
|
||||
//
|
||||
mFVGBearishPivotObjects.Add(iObj);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
if (drawPVFVGBullishPivots)
|
||||
{
|
||||
//
|
||||
bool has = detector.HasPVFVGBearishPivots();
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
mFVGBearishPivotObjects.Add(iObj);
|
||||
int count = detector.CountPVFVGBearishPivots();
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
XCAPVFVG iPVFVG = detector.pvFVGBearishPivots[i];
|
||||
|
||||
//
|
||||
XBoxZone fvgBoxes[];
|
||||
int fvgBoxesCount = iPVFVG.GetFVGs(fvgBoxes);
|
||||
has = IsValidSize(fvgBoxesCount);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
int idx = GetHighest(fvgBoxes);
|
||||
if (IsValidIndex(idx))
|
||||
{
|
||||
//
|
||||
XBoxZone iBox = fvgBoxes[idx];
|
||||
|
||||
//
|
||||
if (canUpdateTo)
|
||||
{
|
||||
iBox.to = to;
|
||||
}
|
||||
|
||||
//
|
||||
XCBoxObject *iObj;
|
||||
|
||||
//
|
||||
has = drawer.DrawBox(
|
||||
iBox,
|
||||
iObj //
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
iObj.BoxColor(fvgBearishPivotColor);
|
||||
iObj.BoxWidth(fvgBearishPivotWidth);
|
||||
iObj.BoxStyle(fvgBearishPivotStyle);
|
||||
|
||||
//
|
||||
mFVGBearishPivotObjects.Add(iObj);
|
||||
}
|
||||
|
||||
//
|
||||
iBox.Clean();
|
||||
ZeroMemory(iObj);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -691,8 +691,8 @@ class XCXCAEASignaller : XCBase
|
||||
//
|
||||
inputs.caInputs.showKI = true;
|
||||
inputs.caInputs.showTKI = true;
|
||||
inputs.caInputs.showSar = false;
|
||||
inputs.caInputs.showTrend = false;
|
||||
inputs.caInputs.showSar = true;
|
||||
inputs.caInputs.showTrend = true;
|
||||
inputs.caInputs.showSwings = false;
|
||||
inputs.caInputs.showLongCycle = false;
|
||||
inputs.caInputs.showHindCycle = false;
|
||||
@@ -777,12 +777,14 @@ class XCXCAEASignaller : XCBase
|
||||
drawer.drawCCIValePivots = true;
|
||||
drawer.drawKIBullishPivots = false;
|
||||
drawer.drawKIBearishPivots = false;
|
||||
drawer.drawFVGBullishPivots = true;
|
||||
drawer.drawFVGBearishPivots = true;
|
||||
drawer.drawFVGBullishPivots = false;
|
||||
drawer.drawFVGBearishPivots = false;
|
||||
drawer.drawPeakSWHResPivots = true;
|
||||
drawer.drawValeSWLSupPivots = true;
|
||||
drawer.drawTKIBullishPivots = false;
|
||||
drawer.drawTKIBearishPivots = false;
|
||||
drawer.drawPVFVGBullishPivots = true;
|
||||
drawer.drawPVFVGBearishPivots = true;
|
||||
drawer.drawCycleSameLLPivots = false;
|
||||
drawer.drawCycleSameHHPivots = false;
|
||||
drawer.drawTrendBullishPivots = false;
|
||||
|
||||
Reference in New Issue
Block a user