This commit is contained in:
2025-10-13 21:34:31 +03:30
parent abd074dffb
commit ba2231664a
7 changed files with 427 additions and 363 deletions
@@ -348,187 +348,6 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
return;
}
//
// Manage Zones of Pattern Detector ...
ENUM_X_DETECTOR_ZONE_ACTION zoneActions[];
int zoneActionsCount = poiDetector.UpdateZones(
iBar,
zoneActions,
3, // Validation Length ...
20, // Required Zones ...
1500 // Loopback ...
);
has = IsValidSize(zoneActionsCount);
if (has)
{
//
}
//
// Sample Draws ...
//
// Support ...
if (poiDetector.majorSupport.IsValid())
{
//
XPOIDrawConfig iConfig = structureDrawConfig.drawConfig;
iConfig.zonesWidth = 3;
//
poiDrawer.DrawZone(
poiDetector.majorSupport,
iConfig //
);
}
if (poiDetector.minorSupport.IsValid())
{
//
XPOIDrawConfig iConfig = structureDrawConfig.drawConfig;
iConfig.zonesStyle = STYLE_DASH;
//
poiDrawer.DrawZone(
poiDetector.minorSupport,
iConfig //
);
}
//
// Resistance ...
if (poiDetector.majorResistance.IsValid())
{
//
XPOIDrawConfig iConfig = structureDrawConfig.drawConfig;
iConfig.zonesWidth = 3;
//
poiDrawer.DrawZone(
poiDetector.majorResistance,
iConfig //
);
}
if (poiDetector.minorResistance.IsValid())
{
//
XPOIDrawConfig iConfig = structureDrawConfig.drawConfig;
iConfig.zonesStyle = STYLE_DASH;
//
poiDrawer.DrawZone(
poiDetector.minorResistance,
iConfig //
);
}
//
// Quarter Line ...
if (poiDetector.majorSupport.IsValid() &&
poiDetector.majorResistance.IsValid())
{
//
double quarter = poiDetector.CalculateQuarter();
//
datetime quarterFrom = MathMin(poiDetector.majorResistance.from,
poiDetector.majorSupport.from);
datetime quarterTo = MathMax(poiDetector.majorResistance.to,
poiDetector.majorSupport.to);
string quarterName = "XQuarter_" + ToXString(quarter) + "_" + ToXString(TimeToSeconds(quarterFrom));
//
CChartObjectTrend *iObj;
has = poiDrawer.DrawTrendLine(
quarter,
quarterFrom,
quarter,
quarterTo,
iObj,
quarterName,
false, // Ray Right ...
false // Ray Left ...
);
if (has) {
//
iObj.Width(2);
iObj.Color(clrYellow);
//
poiDrawer.drawnObjects.Add(iObj);
}
}
//
// Check Actions for Debugging ...
has = HasXValid(zoneActions) &&
(Contains(
X_DETECTOR_ZONE_ACTION_MINOR_SUPPORT_RETESTED,
zoneActions) ||
Contains(
X_DETECTOR_ZONE_ACTION_MINOR_RESISTANCE_RETESTED,
zoneActions));
if (has)
{
//
// Draw Bar Arrow Based On Action ...
XPivot msPivot;
XPivot mrPivot;
//
// Support ReTest ...
has = Contains(
X_DETECTOR_ZONE_ACTION_MINOR_SUPPORT_RETESTED,
zoneActions //
);
has =
has &&
ToPivot(
iBar,
msPivot,
X_DIRECTION_BULLISH,
X_BAR_PATTERN_SUPPORT //
);
if (has)
{
//
poiDrawer.DrawPivot(
msPivot,
structureDrawConfig.drawConfig //
);
}
//
// Resistance ReTest ...
has = Contains(
X_DETECTOR_ZONE_ACTION_MINOR_RESISTANCE_RETESTED,
zoneActions //
);
has =
has &&
ToPivot(
iBar,
mrPivot,
X_DIRECTION_BEARISH,
X_BAR_PATTERN_RESISTANCE //
);
if (has)
{
//
poiDrawer.DrawPivot(
mrPivot,
structureDrawConfig.drawConfig //
);
}
//
// Cleanup Pivots ...
msPivot.Clean();
mrPivot.Clean();
//
Print("Hot Zone Actions ...");
}
//
// Retrieve Conditions ...
has = fimaHelper.GetConditions(
@@ -553,6 +372,111 @@ class XCXFIMAStrategy1Signaller : public XCXFIMABaseSignaller
structureConfig,
barIndex //
);
//
// Sample Draws ...
//
// Support ...
if (structure.barAnalysis.IsQuarterReady())
{
//
// Majors ...
//
XPOIDrawConfig iConfig = structureDrawConfig.drawConfig;
iConfig.zonesWidth = 3;
//
poiDrawer.DrawZone(
structure.barAnalysis.majorSupport,
iConfig //
);
//
poiDrawer.DrawZone(
structure.barAnalysis.majorResistance,
iConfig //
);
//
// Minors ...
//
if (structure.barAnalysis.HasMinorSupport())
{
//
XPOIDrawConfig iConfig = structureDrawConfig.drawConfig;
iConfig.zonesStyle = STYLE_DASH;
//
poiDrawer.DrawZone(
structure.barAnalysis.minorSupport,
iConfig //
);
}
//
if (structure.barAnalysis.HasMinorResistance())
{
//
XPOIDrawConfig iConfig = structureDrawConfig.drawConfig;
iConfig.zonesStyle = STYLE_DASH;
//
poiDrawer.DrawZone(
structure.barAnalysis.minorResistance,
iConfig //
);
}
//
// Quarter Draw ...
if (structure.barAnalysis.quarter > 0)
{
//
double quarter = structure.barAnalysis.quarter;
//
datetime quarterFrom = MathMin(poiDetector.majorResistance.from,
poiDetector.majorSupport.from);
datetime quarterTo = iBar.time;
string quarterName = "XQuarter_" + ToXString(quarter) + "_" + ToXString(TimeToSeconds(quarterFrom));
//
CChartObjectTrend *iObj;
has = poiDrawer.DrawTrendLine(
quarter,
quarterFrom,
quarter,
quarterTo,
iObj,
quarterName,
false, // Ray Right ...
false // Ray Left ...
);
if (has)
{
//
iObj.Width(2);
iObj.Color(clrYellow);
//
poiDrawer.drawnObjects.Add(iObj);
}
}
}
//
// Resistance ...
//
// Quarter Line ...
if (poiDetector.majorSupport.IsValid() &&
poiDetector.majorResistance.IsValid())
{
}
// poiDrawer.drawnObjects.Clear();
// poiDrawer.DrawMarketStructure(
// structure,
@@ -427,6 +427,12 @@ class XCXFIMAPOIDetector : public XCMarketPatternDetector
iPatternAnalysis,
structure.barsAnalysis //
);
//
if (i == barIndex)
{
structure.barAnalysis = iPatternAnalysis;
}
}
//
+5 -2
View File
@@ -36,7 +36,8 @@
struct XFIMAMarketStructure
{
//
XOHCL bar; // Spacified Start Bar for Analysing ...
XOHCL bar; // Spacified Start Bar for Analysing ...
XPatternAnalysis barAnalysis; // Structure Bar Pattern Analysis ...
//
XPivotAnalysis pvAnalysis; // PV Pivot Analysis Result ...
@@ -62,6 +63,7 @@ struct XFIMAMarketStructure
{
//
bar.Clean();
barAnalysis.Clean();
//
pvAnalysis.Clean();
@@ -83,7 +85,8 @@ struct XFIMAMarketStructure
bool result = false;
//
result = bar.IsValid();
result = bar.IsValid() &&
barAnalysis.IsValid();
//
return result;