last ...
This commit is contained in:
@@ -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 ...
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user