This commit is contained in:
2025-02-22 14:28:59 +03:30
parent c876af3f1b
commit 60980ff036
4 changed files with 1998 additions and 611 deletions
+131 -2
View File
@@ -1136,6 +1136,51 @@ class XCBarAnalyser : public XCBase
return result;
}
/**
* Check Specified Bar is Swing or not ...
*
* @param bar: XOHCL instnce ...
* @param dir: ENUM_X_DIRECTION member ...
* @param range: Integer, Specified Range ...
*
* @return ( bool )
*/
bool IsSwing(
XOHCL &bar,
ENUM_X_DIRECTION &dir,
int range = 2 //
)
{
//
bool result = false;
//
dir = X_DIRECTION_NONE;
//
bool isSwingLow = IsSwingLow(bar, range);
bool isSwingHigh = IsSwingHigh(bar, range);
//
result = isSwingLow ||
isSwingHigh;
if (result)
{
//
if (isSwingLow)
{
dir = X_DIRECTION_BULLISH;
}
else
{
dir = X_DIRECTION_BEARISH;
}
}
//
return result;
}
/**
* Check a Bar is Momentum Bar or not ...
*
@@ -1765,10 +1810,10 @@ class XCBarAnalyser : public XCBase
/**
* Check a Bar Has Support or not ...
*
*
* @param bar: XOHCL instance ...
* @param supportBar: XOHCL instance Specified Support Bar ...
* @param rage: int,
* @param rage: int,
* @return ( bool )
*/
bool HasSupport(
@@ -1935,6 +1980,90 @@ class XCBarAnalyser : public XCBase
return result;
}
/**
* Check a Bar Has Resistance or not ...
*
* @param bar: XOHCL instance ...
* @param resistanceBar: XOHCL instance Specified Resistance Bar ...
* @param rage: int,
* @return ( bool )
*/
bool HasResistance(
XOHCL &bar,
XOHCL &resistanceBar,
int range = 21 //
)
{
//
bool result = false;
//
result = bar.IsValid();
if (!result)
{
return result;
}
//
int barIndex = bar.Index() + range;
result = IsValidIndex(barIndex);
if (!result)
{
//
resistanceBar.Clean();
return result;
}
result = resistanceBar.Init(
bar.symbol,
bar.period,
barIndex //
);
//
result = resistanceBar.low < resistanceBar.GetDown();
if (!result)
{
//
resistanceBar.Clean();
return result;
}
//
double selectedValue = resistanceBar.GetUp();
//
int hhIDX = bar.FindHighestIndex(range - 1, MODE_HIGH);
result = IsValidIndex(hhIDX);
if (!result)
{
//
resistanceBar.Clean();
return result;
}
//
double hhValue = iHigh(
bar.symbol,
bar.period,
hhIDX //
);
//
result = hhValue >= selectedValue;
if (!result)
{
//
resistanceBar.Clean();
return result;
}
//
result = resistanceBar.IsValid();
//
return result;
}
//
// Order Blocks ...