This commit is contained in:
2025-02-22 05:16:43 +03:30
parent c371004b3b
commit c876af3f1b
5 changed files with 2525 additions and 1985 deletions
@@ -1763,6 +1763,90 @@ class XCBarAnalyser : public XCBase
return result;
}
/**
* Check a Bar Has Support or not ...
*
* @param bar: XOHCL instance ...
* @param supportBar: XOHCL instance Specified Support Bar ...
* @param rage: int,
* @return ( bool )
*/
bool HasSupport(
XOHCL &bar,
XOHCL &supportBar,
int range = 21 //
)
{
//
bool result = false;
//
result = bar.IsValid();
if (!result)
{
return result;
}
//
int barIndex = bar.Index() + range;
result = IsValidIndex(barIndex);
if (!result)
{
//
supportBar.Clean();
return result;
}
result = supportBar.Init(
bar.symbol,
bar.period,
barIndex //
);
//
result = supportBar.low < supportBar.GetDown();
if (!result)
{
//
supportBar.Clean();
return result;
}
//
double selectedValue = supportBar.GetDown();
//
int llIDX = bar.FindLowestIndex(range - 1, MODE_LOW);
result = IsValidIndex(llIDX);
if (!result)
{
//
supportBar.Clean();
return result;
}
//
double llValue = iLow(
bar.symbol,
bar.period,
llIDX //
);
//
result = llValue >= selectedValue;
if (!result)
{
//
supportBar.Clean();
return result;
}
//
result = supportBar.IsValid();
//
return result;
}
/**
* Check a Bar is Resistance Bar or not ...
*