This commit is contained in:
2025-09-25 18:36:56 +03:30
parent 696d3a55da
commit 4277b25b87
5 changed files with 942 additions and 17 deletions
+154 -12
View File
@@ -462,7 +462,7 @@ void OnTick()
bool isInited = cBar.Init(
_Symbol,
_Period,
1 //
0 //
);
//
// Here We Apply Custom Detecting ...
@@ -506,22 +506,164 @@ void OnTick()
if (marketStructure.support.IsValid() || marketStructure.resistance.IsValid())
{
//
// Check Conditions ...
datetime beforeTime = cBar.BeforeOn();
bool hasSupport =
(marketStructure.support.IsValid() &&
marketStructure.support.from == beforeTime);
bool hasResistance =
(marketStructure.resistance.IsValid() &&
marketStructure.resistance.from == beforeTime);
bool has =
hasSupport ||
hasResistance;
XOHCL pBar;
XOHCL p2Bar;
bool has = cBar.GetPreviousBar(pBar);
has = has &&
pBar.GetPreviousBar(p2Bar);
if (!has)
{
//
pBar.Clean();
p2Bar.Clean();
return;
}
// //
// bool isSupportTouched = marketStructure.isSupportTouched;
// bool isResistanceTouched = marketStructure.isResistanceTouched;
// has =
// isSupportTouched ||
// isResistanceTouched;
// if (!has)
// {
// //
// pBar.Clean();
// return;
// }
// //
// // Here we Have to Detect Previous Support or Resistance ...
// XOHCL prevZoneBar;
// XBoxZone prevZoneBox;
// //
// // Previous Support ...
// bool hasPrevSupport = isSupportTouched &&
// fima2Signaller
// .poiDetector
// .HasSupport(
// pBar,
// prevZoneBar,
// detectorConfig.supportAndResistanceValidationLength,
// detectorConfig.supportAndResistanceMaxAllowedLoopback //
// );
// if (hasPrevSupport)
// {
// hasPrevSupport = ToSupportBox(prevZoneBar, prevZoneBox, pBar.time);
// }
// //
// // Previous Resistance ...
// bool hasPrevResistance = isResistanceTouched &&
// fima2Signaller
// .poiDetector
// .HasSupport(
// pBar,
// prevZoneBar,
// detectorConfig.supportAndResistanceValidationLength,
// detectorConfig.supportAndResistanceMaxAllowedLoopback //
// );
// if (hasPrevResistance)
// {
// hasPrevResistance = ToResistanceBox(prevZoneBar, prevZoneBox, pBar.time);
// }
// //
// has = hasPrevSupport ||
// hasPrevResistance;
// if (!has)
// {
// //
// pBar.Clean();
// prevZoneBox.Clean();
// prevZoneBar.Clean();
// return;
// }
// //
// // Select Youngest ...
// int idx = -1;
// //
// if (hasPrevSupport)
// {
// //
// idx = GetYoungestBefore(
// marketStructure.support.from,
// fima2Signaller.poiDetector.supports //
// );
// has = IsValidIndex(idx);
// if (has)
// {
// //
// prevZoneBox.to = pBar.time;
// prevZoneBox = fima2Signaller.poiDetector.supports[idx];
// }
// }
// //
// if (hasPrevResistance)
// {
// //
// idx = GetYoungestBefore(
// marketStructure.resistance.from,
// fima2Signaller.poiDetector.resistances //
// );
// has = IsValidIndex(idx);
// if (has)
// {
// //
// prevZoneBox.to = pBar.time;
// prevZoneBox = fima2Signaller.poiDetector.resistances[idx];
// }
// }
//
// Draw Prev Zone ...
// XCBoxObject *iPrevZoneObj;
// prevZoneBox.to = pBar.time;
// has = fima2Signaller.poiDrawer.DrawBox(
// prevZoneBox,
// iPrevZoneObj //
// );
// if (has)
// {
// //
// XPOIStyle style;
// fima2Signaller.poiDrawer.GetBoxStyle(
// style,
// prevZoneBox.dir //
// );
// style.clr = clrYellow;
// fima2Signaller.poiDrawer.ApplyBoxStyle(
// iPrevZoneObj,
// style //
// );
// //
// style.Clean();
// eaDraws.Add(iPrevZoneObj);
// }
//
// Check Prev Zone is Breaked or not ...
//
if (has)
{
Print("Detected ...");
}
//
// Cleanup Resources ...
pBar.Clean();
p2Bar.Clean();
// prevZoneBox.Clean();
// prevZoneBar.Clean();
}
//
cBar.Clean();
}
//