This commit is contained in:
2026-01-05 00:52:08 +03:30
parent 69f0ca8bb2
commit 2df090d2f3
5 changed files with 736 additions and 163 deletions
+149
View File
@@ -1976,3 +1976,152 @@ bool Strategy1HasSignal(
// zone = resistances[tmpResistanceIDX];
// }
// }
//
//
//
// #region Market Structure ...
XBoxZone supports[];
XBoxZone resistances[];
XBoxZone minorSupport;
XBoxZone majorSupport;
XBoxZone minorResistance;
XBoxZone majorResistance;
poiDetector.GetCurrentStructure(
supports,
resistances,
minorSupport,
majorSupport,
minorResistance,
majorResistance,
barIndex,
bar.symbol,
iBar.period, // Minor ...
PERIOD_H1, // Major ...
50,
14,
21,
0 //
);
//
// Refining Zones ...
int refineLoopback = 500;
double refineBreakThreshold = 10;
ENUM_X_PRICE refineBreakBy = X_PRICE_CLOSE;
poiDetector.RefineStructure(
supports,
resistances,
minorSupport,
majorSupport,
minorResistance,
majorResistance,
refineLoopback,
refineBreakThreshold,
refineBreakBy //
);
// #endregion
// #region NearInside Support/Resistance ...
//
int tmpSupportIDX = -1;
bool isNearSupport = poiDetector.HasNearZone(tmpSupportIDX, iBar.close, 5, supports);
if (isNearSupport)
{
scoreBullish++;
}
//
int tmpResistanceIDX = -1;
bool isNearResistance = poiDetector.HasNearZone(tmpResistanceIDX, iBar.close, 5, resistances);
if (isNearResistance)
{
scoreBearish++;
}
// #endregion
//
// Cleanup Resources ...
iBar.Clean();
XClean(supports);
XClean(resistances);
minorSupport.Clean();
majorSupport.Clean();
minorResistance.Clean();
majorResistance.Clean();
//
// Draws ...
bool draw = true;
if (draw && result)
{
//
int drawn = 0;
//
XPOIDrawConfig config;
config.Default();
//
if (zone.IsValid())
{
//
drawn++;
//
config.zonesWidth = 3;
config.bullishColor = clrYellow;
config.bearishColor = clrOrange;
//
poiDrawer.DrawZone(zone, config);
//
config.Default();
}
//
// Minors ...
if (minorSupport.IsValid())
{
//
drawn++;
poiDrawer.DrawZone(minorSupport, config);
}
if (minorResistance.IsValid())
{
//
drawn++;
poiDrawer.DrawZone(minorResistance, config);
}
//
// Majors ...
config.bullishColor = clrLime;
config.bearishColor = clrRed;
config.zonesWidth = 4;
//
if (majorSupport.IsValid())
{
//
drawn++;
poiDrawer.DrawZone(majorSupport, config);
}
if (majorResistance.IsValid())
{
//
drawn++;
poiDrawer.DrawZone(majorResistance, config);
}
//
config.Clean();
//
if (drawn > 0)
{
DebugBreak();
}
}