debug XCATB V1.0 issues on Detecting Range Breakes POI(s) ...

This commit is contained in:
2025-06-21 16:31:40 +03:30
parent 062ce15181
commit b2310badea
+295 -151
View File
@@ -659,20 +659,22 @@ string mTriggerBarConditions;
// POI(s) ... // POI(s) ...
// //
bool mDrawLiquidities = false; // Liquidities ...
bool mDrawLiquidities = true;
bool mDetectLiquidities = true; bool mDetectLiquidities = true;
//
bool mDrawRangeBreakes = true;
bool mDetectRangeBreakes = true;
//
XBoxZone mBullishLiquidities[]; XBoxZone mBullishLiquidities[];
XBoxZone mBearishLiquidities[]; XBoxZone mBearishLiquidities[];
XPOIStyle mBullishLiquidityStyle;
XPOIStyle mBearishLiquidityStyle;
// //
// Range Breakes ...
bool mDrawRangeBreakes = true;
bool mDetectRangeBreakes = true;
XBoxZone mBullishRangeBreakes[]; XBoxZone mBullishRangeBreakes[];
XBoxZone mBearishRangeBreakes[]; XBoxZone mBearishRangeBreakes[];
XPOIStyle mBullishRangeBreakStyle;
XPOIStyle mBearishRangeBreakStyle;
// //
// Counters ... // Counters ...
@@ -1025,6 +1027,35 @@ int OnInit()
mDrawer = new XCPOIDrawer(); mDrawer = new XCPOIDrawer();
mBarAnalyser = new XCBarAnalyser(); mBarAnalyser = new XCBarAnalyser();
//
// Preparing POI Styles ...
//
// Liquidities ...
//
// Bullish ...
mBullishLiquidityStyle.width = 1;
mBullishLiquidityStyle.clr = clrLime;
//
// Bearish ...
mBearishLiquidityStyle.width = 1;
mBearishLiquidityStyle.clr = clrRed;
//
// Range Breakes ...
//
// Bullish ...
mBullishRangeBreakStyle.width = 1;
mBullishRangeBreakStyle.clr = clrAqua;
//
// Bearish ...
mBearishRangeBreakStyle.width = 1;
mBearishRangeBreakStyle.clr = clrMagenta;
// //
// Init Succeed ... // Init Succeed ...
return INIT_SUCCEEDED; return INIT_SUCCEEDED;
@@ -1088,6 +1119,18 @@ void OnDeinit(const int reason)
Clean(mBullishTrendChanges); Clean(mBullishTrendChanges);
Clean(mBearishTrendChanges); Clean(mBearishTrendChanges);
//
Clean(mBullishLiquidities);
Clean(mBearishLiquidities);
Clean(mBullishRangeBreakes);
Clean(mBearishRangeBreakes);
//
mBullishLiquidityStyle.Clean();
mBearishLiquidityStyle.Clean();
mBullishRangeBreakStyle.Clean();
mBearishRangeBreakStyle.Clean();
// //
} }
@@ -3564,6 +3607,142 @@ void PrepareMarketConditions(
isTriggerBarCond6Bearish || isTriggerBarCond6Bearish ||
isTriggerBarCond7Bearish; isTriggerBarCond7Bearish;
//
// Resetting Counters Based on Conditions ...
//
// XPV ...
//
if (!isSamePeak)
{
//
mSamePeakCount = 0;
mSamePeakGoldenMin = 0;
mSamePeakGoldenMax = 0;
}
//
if (!isSameVale)
{
//
mSameValeCount = 0;
mSameValeGoldenMin = 0;
mSameValeGoldenMax = 0;
}
//
if (!isSamePeakGolden)
{
mSamePeakGoldenCount = 0;
}
//
if (!isSameValeGolden)
{
mSameValeGoldenCount = 0;
}
//
// XKI ...
//
if (!isSameKI)
{
mSameKICount = 0;
}
//
if (!isSameBullishKI)
{
mSameBullishKICount = 0;
}
//
if (!isSameBearishKI)
{
mSameBearishKICount = 0;
}
//
// XSB ...
//
if (isSBSwitchedToBullish)
{
//
mSameSBCount = 0;
mSameBullishSBCount = 0;
}
//
if (isSBSwitchedToBearish)
{
//
mSameSBCount = 0;
mSameBearishSBCount = 0;
}
//
// XSAR ...
//
if (isSarSwitchedToBullish)
{
//
mSameSarCount = 0;
mSameBullishSarCount = 0;
}
//
if (isSarSwitchedToBearish)
{
//
mSameSarCount = 0;
mSameBearishSarCount = 0;
}
//
// XHKS ...
//
if (isHKSSwitchedToBullish)
{
//
mSameHKSCount = 0;
mSameBullishHKSCount = 0;
}
//
if (isHKSSwitchedToBearish)
{
//
mSameHKSCount = 0;
mSameBearishHKSCount = 0;
}
//
// XTREND ...
//
if (isTrendSwitchedToBullish)
{
//
mSameTrendCount = 0;
mSameBullishTrendCount = 0;
}
//
if (isTrendSwitchedToBearish)
{
//
mSameTrendCount = 0;
mSameBearishTrendCount = 0;
}
//
// Preparing Conditions ...
// //
// XPV ... // XPV ...
@@ -3771,13 +3950,6 @@ void PrepareMarketConditions(
? peakGoldenBuffer[pIndex] ? peakGoldenBuffer[pIndex]
: MathMax(mSamePeakGoldenMax, peakGoldenBuffer[pIndex]); : MathMax(mSamePeakGoldenMax, peakGoldenBuffer[pIndex]);
} }
else
{
//
mSamePeakCount = 0;
mSamePeakGoldenMin = 0;
mSamePeakGoldenMax = 0;
}
// //
if (isSameVale) if (isSameVale)
@@ -3793,33 +3965,18 @@ void PrepareMarketConditions(
? valeGoldenBuffer[pIndex] ? valeGoldenBuffer[pIndex]
: MathMax(mSameValeGoldenMax, valeGoldenBuffer[pIndex]); : MathMax(mSameValeGoldenMax, valeGoldenBuffer[pIndex]);
} }
else
{
//
mSameValeCount = 0;
mSameValeGoldenMin = 0;
mSameValeGoldenMax = 0;
}
// //
if (isSamePeakGolden) if (isSamePeakGolden)
{ {
mSamePeakGoldenCount++; mSamePeakGoldenCount++;
} }
else
{
mSamePeakGoldenCount = 0;
}
// //
if (isSameValeGolden) if (isSameValeGolden)
{ {
mSameValeGoldenCount++; mSameValeGoldenCount++;
} }
else
{
mSameValeGoldenCount = 0;
}
// //
// XSB Shifts ... // XSB Shifts ...
@@ -3917,10 +4074,6 @@ void PrepareMarketConditions(
{ {
mSameBullishSBCount++; mSameBullishSBCount++;
} }
else
{
mSameBullishSBCount = 0;
}
// //
bool isDBearish = bool isDBearish =
@@ -3930,10 +4083,6 @@ void PrepareMarketConditions(
{ {
mSameBearishSBCount++; mSameBearishSBCount++;
} }
else
{
mSameBearishSBCount = 0;
}
// //
if (isDBullish || if (isDBullish ||
@@ -3941,22 +4090,6 @@ void PrepareMarketConditions(
{ {
mSameSBCount++; mSameSBCount++;
} }
else
{
mSameSBCount = 0;
}
}
else if (isSBSwitchedToBullish)
{
//
mSameSBCount = 0;
mSameBullishSBCount = 0;
}
else if (isSBSwitchedToBearish)
{
//
mSameSBCount = 0;
mSameBearishSBCount = 0;
} }
// //
@@ -4051,10 +4184,6 @@ void PrepareMarketConditions(
{ {
mSameBullishSarCount++; mSameBullishSarCount++;
} }
else
{
mSameBullishSarCount = 0;
}
// //
bool isDBearish = bool isDBearish =
@@ -4064,10 +4193,6 @@ void PrepareMarketConditions(
{ {
mSameBearishSarCount++; mSameBearishSarCount++;
} }
else
{
mSameBearishSarCount = 0;
}
// //
if (isDBullish || if (isDBullish ||
@@ -4075,22 +4200,6 @@ void PrepareMarketConditions(
{ {
mSameSarCount++; mSameSarCount++;
} }
else
{
mSameSarCount = 0;
}
}
else if (isSarSwitchedToBullish)
{
//
mSameSarCount = 0;
mSameBullishSarCount = 0;
}
else if (isSarSwitchedToBearish)
{
//
mSameSarCount = 0;
mSameBearishSarCount = 0;
} }
// //
@@ -4189,10 +4298,6 @@ void PrepareMarketConditions(
{ {
mSameBullishHKSCount++; mSameBullishHKSCount++;
} }
else
{
mSameBullishHKSCount = 0;
}
// //
bool isDBearish = bool isDBearish =
@@ -4202,10 +4307,6 @@ void PrepareMarketConditions(
{ {
mSameBearishHKSCount++; mSameBearishHKSCount++;
} }
else
{
mSameBearishHKSCount = 0;
}
// //
if (isDBullish || if (isDBullish ||
@@ -4213,22 +4314,6 @@ void PrepareMarketConditions(
{ {
mSameHKSCount++; mSameHKSCount++;
} }
else
{
mSameHKSCount = 0;
}
}
else if (isHKSSwitchedToBullish)
{
//
mSameHKSCount = 0;
mSameBullishHKSCount = 0;
}
else if (isHKSSwitchedToBearish)
{
//
mSameHKSCount = 0;
mSameBearishHKSCount = 0;
} }
// //
@@ -4316,30 +4401,18 @@ void PrepareMarketConditions(
{ {
mSameKICount++; mSameKICount++;
} }
else
{
mSameKICount = 0;
}
// //
if (isSameBullishKI) if (isSameBullishKI)
{ {
mSameBullishKICount++; mSameBullishKICount++;
} }
else
{
mSameBullishKICount = 0;
}
// //
if (isSameBearishKI) if (isSameBearishKI)
{ {
mSameBearishKICount++; mSameBearishKICount++;
} }
else
{
mSameBearishKICount = 0;
}
// //
// XTREND Shifts ... // XTREND Shifts ...
@@ -4433,10 +4506,6 @@ void PrepareMarketConditions(
{ {
mSameBullishTrendCount++; mSameBullishTrendCount++;
} }
else
{
mSameBullishTrendCount = 0;
}
// //
bool isDBearish = bool isDBearish =
@@ -4446,10 +4515,6 @@ void PrepareMarketConditions(
{ {
mSameBearishTrendCount++; mSameBearishTrendCount++;
} }
else
{
mSameBearishTrendCount = 0;
}
// //
if (isDBullish || if (isDBullish ||
@@ -4457,22 +4522,6 @@ void PrepareMarketConditions(
{ {
mSameTrendCount++; mSameTrendCount++;
} }
else
{
mSameTrendCount = 0;
}
}
else if (isTrendSwitchedToBullish)
{
//
mSameTrendCount = 0;
mSameBullishTrendCount = 0;
}
else if (isTrendSwitchedToBearish)
{
//
mSameTrendCount = 0;
mSameBearishTrendCount = 0;
} }
// //
@@ -4622,23 +4671,16 @@ void DetectPOIs(
// //
// Bullish ... // Bullish ...
bool isBullishPeakPOI = bool isBullishPeakPOI =
(isSamePeakOverLast (isSamePeakOverLast &&
// && mSamePeakCount >= mRangeBreakesMinLength);
// mSamePeakCount >= mRangeBreakesMinLength
);
bool isBullishValePOI = bool isBullishValePOI =
(isSameValeOverLast (isSameValeOverLast &&
// && mSameValeCount >= mRangeBreakesMinLength);
// mSameValeCount >= mRangeBreakesMinLength
);
mHas = mHas =
isBullishPeakPOI || isBullishPeakPOI ||
isBullishValePOI; isBullishValePOI;
if (mHas) if (mHas)
{ {
//
Print("Bullish PV: ", mSamePeakCount, ",", mSameValeCount);
// //
if (isBullishPeakPOI) if (isBullishPeakPOI)
{ {
@@ -4688,9 +4730,6 @@ void DetectPOIs(
isBearishValePOI; isBearishValePOI;
if (mHas) if (mHas)
{ {
//
Print("Bearish PV ...");
// //
if (isBearishPeakPOI) if (isBearishPeakPOI)
{ {
@@ -4794,6 +4833,35 @@ void ValidatePOIs(
); );
} }
//
// Range Breakes ...
//
// Bullish ...
mHas = HasChild(mBullishRangeBreakes);
if (mHas)
{
//
ValidateBoxes(
mBullishRangeBreakes,
barIndex,
barsLength //
);
}
//
// Bearish ...
mHas = HasChild(mBearishRangeBreakes);
if (mHas)
{
//
ValidateBoxes(
mBearishRangeBreakes,
barIndex,
barsLength //
);
}
// //
} }
@@ -4852,6 +4920,25 @@ void DrawPOIs(
); );
if (mHas) if (mHas)
{ {
//
if (iBox.IsBullish())
{
//
mDrawer.ApplyStyle(
iBObj,
mBullishLiquidityStyle //
);
}
else
{
//
mDrawer.ApplyStyle(
iBObj,
mBearishLiquidityStyle //
);
}
//
mObjects.Add(iBObj); mObjects.Add(iBObj);
} }
@@ -4881,6 +4968,25 @@ void DrawPOIs(
); );
if (mHas) if (mHas)
{ {
//
if (iBox.IsBullish())
{
//
mDrawer.ApplyStyle(
iBObj,
mBullishLiquidityStyle //
);
}
else
{
//
mDrawer.ApplyStyle(
iBObj,
mBearishLiquidityStyle //
);
}
//
mObjects.Add(iBObj); mObjects.Add(iBObj);
} }
@@ -4915,6 +5021,25 @@ void DrawPOIs(
); );
if (mHas) if (mHas)
{ {
//
if (iBox.IsBullish())
{
//
mDrawer.ApplyStyle(
iBObj,
mBullishRangeBreakStyle //
);
}
else
{
//
mDrawer.ApplyStyle(
iBObj,
mBearishRangeBreakStyle //
);
}
//
mObjects.Add(iBObj); mObjects.Add(iBObj);
} }
@@ -4944,6 +5069,25 @@ void DrawPOIs(
); );
if (mHas) if (mHas)
{ {
//
if (iBox.IsBullish())
{
//
mDrawer.ApplyStyle(
iBObj,
mBullishRangeBreakStyle //
);
}
else
{
//
mDrawer.ApplyStyle(
iBObj,
mBearishRangeBreakStyle //
);
}
//
mObjects.Add(iBObj); mObjects.Add(iBObj);
} }