complete support and resistance zones ...

This commit is contained in:
2025-03-17 21:42:38 +03:30
parent b8eaf9ffa8
commit 48c78e1256
3 changed files with 104 additions and 88 deletions
+81 -66
View File
@@ -229,7 +229,7 @@ class XCBarAnalyser : public XCBase
//
bool has = IsValid(type) &&
bar.IsValid();
bar.IsValid();
if (!has)
{
return result;
@@ -1033,22 +1033,12 @@ class XCBarAnalyser : public XCBase
}
//
int barIndex = bar.Index() + range;
result = IsValidIndex(barIndex);
if (!result)
{
//
supportBar.Clean();
return result;
}
int supportIDX = bar.Index() + range;
result = supportBar.Init(
bar.symbol,
bar.period,
barIndex //
supportIDX //
);
//
result = supportBar.low < supportBar.GetDown();
if (!result)
{
//
@@ -1057,11 +1047,7 @@ class XCBarAnalyser : public XCBase
}
//
double selectedValue = supportBar.GetDown();
//
int llIDX = bar.FindLowestIndex(range - 1, MODE_LOW);
result = IsValidIndex(llIDX);
result = bar.low > supportBar.low;
if (!result)
{
//
@@ -1070,23 +1056,46 @@ class XCBarAnalyser : public XCBase
}
//
double llValue = iLow(
bar.symbol,
bar.period,
llIDX //
);
//
result = llValue >= selectedValue;
if (!result)
// Validate Point ...
for (int i = 1; i < range; i++)
{
//
supportBar.Clean();
return result;
}
XOHCL iPBar;
XOHCL iNBar;
bool iHas = false;
//
result = supportBar.IsValid();
//
iHas = iPBar.Init(
bar.symbol,
bar.period,
supportIDX + i //
);
result = iHas;
if (!result)
{
break;
}
//
iHas = iNBar.Init(
bar.symbol,
bar.period,
supportIDX - i //
);
result = iHas;
if (!result)
{
break;
}
//
result = supportBar.low < iPBar.low &&
supportBar.low < iNBar.low;
if (!result)
{
break;
}
}
//
return result;
@@ -1110,9 +1119,6 @@ class XCBarAnalyser : public XCBase
//
bool result = false;
//
resistanceBar.Clean();
//
result = bar.IsValid();
if (!result)
@@ -1121,22 +1127,12 @@ class XCBarAnalyser : public XCBase
}
//
int barIndex = bar.Index() + range;
result = IsValidIndex(barIndex);
if (!result)
{
//
resistanceBar.Clean();
return result;
}
int resistanceIDX = bar.Index() + range;
result = resistanceBar.Init(
bar.symbol,
bar.period,
barIndex //
resistanceIDX //
);
//
result = resistanceBar.low < resistanceBar.GetDown();
if (!result)
{
//
@@ -1145,11 +1141,7 @@ class XCBarAnalyser : public XCBase
}
//
double selectedValue = resistanceBar.GetUp();
//
int hhIDX = bar.FindHighestIndex(range - 1, MODE_HIGH);
result = IsValidIndex(hhIDX);
result = bar.high < resistanceBar.high;
if (!result)
{
//
@@ -1158,23 +1150,46 @@ class XCBarAnalyser : public XCBase
}
//
double hhValue = iHigh(
bar.symbol,
bar.period,
hhIDX //
);
//
result = hhValue >= selectedValue;
if (!result)
// Validate Point ...
for (int i = 1; i < range; i++)
{
//
resistanceBar.Clean();
return result;
}
XOHCL iPBar;
XOHCL iNBar;
bool iHas = false;
//
result = resistanceBar.IsValid();
//
iHas = iPBar.Init(
bar.symbol,
bar.period,
resistanceIDX + i //
);
result = iHas;
if (!result)
{
break;
}
//
iHas = iNBar.Init(
bar.symbol,
bar.period,
resistanceIDX - i //
);
result = iHas;
if (!result)
{
break;
}
//
result = resistanceBar.high > iPBar.high &&
resistanceBar.high > iNBar.high;
if (!result)
{
break;
}
}
//
return result;
+16 -16
View File
@@ -832,17 +832,17 @@ class XCPOIDetector : public XCBaseAlert
//
// Support ...
// DetectSupportZone(
// iBar,
// iEvent //
// );
DetectSupportZone(
iBar,
iEvent //
);
//
// Resistance ...
// DetectResistanceZone(
// iBar,
// iEvent //
// );
DetectResistanceZone(
iBar,
iEvent //
);
//
// Supply ...
@@ -1051,10 +1051,10 @@ class XCPOIDetector : public XCBaseAlert
//
// Support ...
// has = DetectSupportZone(
// iBar,
// iEvent //
// );
has = DetectSupportZone(
iBar,
iEvent //
);
if (has)
{
//
@@ -1066,10 +1066,10 @@ class XCPOIDetector : public XCBaseAlert
//
// Resistance ...
// has = DetectResistanceZone(
// iBar,
// iEvent //
// );
has = DetectResistanceZone(
iBar,
iEvent //
);
if (has)
{
//
+7 -6
View File
@@ -344,10 +344,10 @@ void DetectPOIState()
// Bullish ...
showBullishPOIs && true, // SwingLows
showBullishPOIs && true, // DemandZones
showBullishPOIs && true, // SupportZones
showBullishPOIs && false, // SupportZones
showBullishPOIs && true, // BullishSharps
showBullishPOIs && true, // BullishSpikes
showBullishPOIs && false, // BullishPullbacks
showBullishPOIs && true, // BullishPullbacks
showBullishPOIs && true, // BullishMomentums
showBullishPOIs && true, // BullishRejections
showBullishPOIs && true, // BullishOrderBlocks
@@ -357,10 +357,10 @@ void DetectPOIState()
// Bearish ...
showBearishPOIs && true, // SwingHighs
showBearishPOIs && true, // SupplyZones
showBearishPOIs && true, // ResistanceZones
showBearishPOIs && false, // ResistanceZones
showBearishPOIs && true, // BearishSharps
showBearishPOIs && true, // BearishSpikes
showBearishPOIs && false, // BearishPullbacks
showBearishPOIs && true, // BearishPullbacks
showBearishPOIs && true, // BearishMomentums
showBearishPOIs && true, // BearishRejections
showBearishPOIs && true, // BearishOrderBlocks
@@ -369,9 +369,10 @@ void DetectPOIState()
);
//
if (poiEventNotifier.hasNewPullback)
if (poiEventNotifier.hasNewSupportZone ||
poiEventNotifier.hasNewResistanceZone)
{
Print("Pullback ...");
Print("Support/Resistance ...");
}
//