This commit is contained in:
2025-10-28 03:56:41 +03:30
parent fda0da2d2e
commit 1fd79e5621
@@ -1395,7 +1395,7 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
bool useSignaller1 = false;
bool useSignaller2 = false;
bool useSignaller3 = true;
bool useSignaller4 = false;
bool useSignaller4 = true;
//
// Validator Flags ...
@@ -1745,13 +1745,6 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
dir = X_DIRECTION_NONE;
}
//
// Debug Breake ...
if (result)
{
// DebugBreak();
}
//
// Cleanup ...
iDrawConfig.Clean();
@@ -2605,12 +2598,6 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
iConfig.Clean();
}
//
if (result)
{
DebugBreak();
}
//
// Cleanup ...
zoneTrend.Clean();
@@ -2618,8 +2605,9 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
//
// Reset Flags ...
if (!result) {
//
if (!result)
{
//
zone.Clean();
isBullish = false;
isBearish = false;
@@ -2650,9 +2638,6 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
{
poiDrawer.DrawPatternAnalysis(pBarPatterns, structureDrawConfig.barAnalysisDrawConfig);
}
//
DebugBreak();
}
//
@@ -2799,8 +2784,9 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
//
XTrend boundaryTrend;
double boundaryMax = EMPTY_VALUE;
double boundaryMin = EMPTY_VALUE;
XTrend boundaryZoneTrend;
//
double atrBandUpper = EMPTY_VALUE;
double atrBandLower = EMPTY_VALUE;
double atrBandMiddle = EMPTY_VALUE;
@@ -3155,8 +3141,7 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
//
// Validate ...
result = isBullish ||
isBearish;
result = isBullish || isBearish;
if (result)
{
//
@@ -3193,205 +3178,42 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
if (result && validateByXFIMABoundary)
{
//
// Reading Zones Boundary ...
XPivot uppers[];
XPivot lowers[];
int boundariesCount = poiDetector.CollectZonesBoundary(uppers, lowers, zone);
int lowestIDX = GetLowest(lowers);
int highestIDX = GetHighest(uppers);
if (IsValidIndex(lowestIDX))
{
boundaryMin = lowers[lowestIDX].value;
}
if (IsValidIndex(highestIDX))
{
boundaryMax = uppers[highestIDX].value;
}
// Try to Retrieve Boundary To Trend ...
result = poiDetector.HasBoundaryTrend(
zone,
boundaryTrend,
true //
);
//
isBullish =
isBullish &&
IsValidIndex(lowestIDX) &&
IsValidSize(boundariesCount) &&
zone.lower > lowers[lowestIDX].value;
// Try to Retrieve Boundary Zone Trend ...
result =
result &&
poiDetector.HasBoundaryTrend(
zone,
boundaryZoneTrend,
false //
);
//
isBearish =
isBearish &&
IsValidIndex(highestIDX) &&
IsValidSize(boundariesCount) &&
zone.upper < uppers[highestIDX].value;
// Check and Validate Trend Direction ...
result =
result &&
zone.dir == boundaryTrend.dir &&
zone.dir == boundaryZoneTrend.dir;
//
// Detect Directions of Boundary ...
//
bool isUppersBullish = uppers[0].value > uppers[1].value;
bool isUppersBearish = uppers[0].value < uppers[1].value;
//
bool isLowersBullish = lowers[0].value > lowers[1].value;
bool isLowersBearish = lowers[0].value < lowers[1].value;
//
bool isBoundaryBullish = isUppersBullish || isLowersBullish;
bool isBoundaryBearish = isUppersBearish || isLowersBearish;
//
bool isBoundaryTrend = isBoundaryBullish || isBoundaryBearish;
if (isBoundaryTrend)
{
//
double fromPrice =
isBoundaryBullish
? isLowersBullish
? lowers[1].value
: isUppersBullish
? uppers[1].value
: EMPTY_VALUE
: isBoundaryBearish
? isUppersBearish
? uppers[1].value
: isLowersBearish
? lowers[1].value
: EMPTY_VALUE
: EMPTY_VALUE;
//
double toPrice =
isBoundaryBullish
? isLowersBullish
? lowers[0].value
: isUppersBullish
? uppers[0].value
: EMPTY_VALUE
: isBoundaryBearish
? isUppersBearish
? uppers[0].value
: isLowersBearish
? lowers[0].value
: EMPTY_VALUE
: EMPTY_VALUE;
//
if (NotEmptyZero(fromPrice) && NotEmptyZero(toPrice))
{
//
boundaryTrend.Init(
zone.symbol,
zone.period,
bar.time,
fromPrice,
zone.from,
toPrice,
zone.to //
);
//
// Validate By Boundary Trend ...
if (validateByXFIMABoundaryTrend)
{
//
isBullish =
isBullish &&
boundaryTrend.IsValid() &&
boundaryTrend.IsBullish();
//
isBearish =
isBearish &&
boundaryTrend.IsValid() &&
boundaryTrend.IsBearish();
//
// Summarizing Result ...
result = isBullish || isBearish;
if (!result)
{
zone.Clean();
}
}
}
}
//
// Cleanup ...
XClean(uppers);
XClean(lowers);
//
// Summarize Result ...
result = isBullish || isBearish;
// Reset Flags ...
if (!result)
{
//
zone.Clean();
result = false;
isBullish = false;
isBearish = false;
}
}
//
// Draws ...
if (result)
{
// //
// if (NotEmptyZero(boundaryMin))
// {
// //
// XPOIDrawConfig iConfig = structureDrawConfig.drawConfig;
// iConfig.trendRayLeft = false;
// iConfig.trendRayRight = false;
// poiDrawer.DrawTrendLine(
// "LOWEST_" + ToXString(TimeToSeconds(zone.from)),
// boundaryMin,
// zone.from,
// boundaryMin,
// zone.to,
// iConfig,
// clrYellow //
// );
// iConfig.Clean();
// }
// //
// if (NotEmptyZero(boundaryMax))
// {
// //
// XPOIDrawConfig iConfig = structureDrawConfig.drawConfig;
// iConfig.trendRayLeft = false;
// iConfig.trendRayRight = false;
// poiDrawer.DrawTrendLine(
// "HIGHEST_" + ToXString(TimeToSeconds(zone.from)),
// boundaryMax,
// zone.from,
// boundaryMax,
// zone.to,
// iConfig,
// clrYellow //
// );
// iConfig.Clean();
// }
// //
// if (boundaryTrend.IsValid())
// {
// //
// XPOIDrawConfig iConfig = structureDrawConfig.drawConfig;
// iConfig.trendRayLeft = false;
// iConfig.trendRayRight = false;
// poiDrawer.DrawTrendLine(
// boundaryTrend,
// iConfig //
// );
// iConfig.Clean();
// }
// //
// poiDrawer.DrawZone(zone, structureDrawConfig.drawConfig);
// poiDrawer.DrawPatternAnalysis(pBarPatterns, structureDrawConfig.barAnalysisDrawConfig);
// //
// DebugBreak();
}
//
// Manage Stops ...
if (result)
@@ -3459,6 +3281,7 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
pBarPatterns.Clean();
boundaryTrend.Clean();
patternConfig.Clean();
boundaryZoneTrend.Clean();
//
return result;