last ...
This commit is contained in:
@@ -255,6 +255,95 @@ int ExtractPivots(
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
bool IsFakeBreakeout(
|
||||
XBoxZone &pivot,
|
||||
int barIndex = 0 //
|
||||
)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
barIndex = NormalizeInt(barIndex, 0);
|
||||
|
||||
//
|
||||
result = pivot.IsValid();
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
int fromIDX = pivot.FromIndex();
|
||||
result = barIndex > fromIDX;
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
bool isBullish = pivot.IsBullish();
|
||||
|
||||
//
|
||||
// Retrieve Required Bars ...
|
||||
XOHCL cBar;
|
||||
XOHCL pBar;
|
||||
XOHCL p2Bar;
|
||||
XOHCL p3Bar;
|
||||
result = cBar.Init(
|
||||
pivot.symbol,
|
||||
pivot.period,
|
||||
barIndex //
|
||||
);
|
||||
result = result &&
|
||||
cBar.GetPreviousBar(pBar);
|
||||
result = result &&
|
||||
pBar.GetPreviousBar(p2Bar);
|
||||
result = result &&
|
||||
p2Bar.GetPreviousBar(p3Bar);
|
||||
if (!result)
|
||||
{
|
||||
//
|
||||
cBar.Clean();
|
||||
pBar.Clean();
|
||||
p2Bar.Clean();
|
||||
p3Bar.Clean();
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
double breakPrice =
|
||||
isBullish
|
||||
? pivot.lower
|
||||
: pivot.upper;
|
||||
|
||||
//
|
||||
bool isBarInside =
|
||||
cBar.GetDirection() == pivot.dir &&
|
||||
cBar.GetUp() > breakPrice &&
|
||||
cBar.GetDown() < breakPrice;
|
||||
|
||||
//
|
||||
result =
|
||||
//
|
||||
// Bar Must Inside Pivot ...
|
||||
isBarInside
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
cBar.Clean();
|
||||
pBar.Clean();
|
||||
p2Bar.Clean();
|
||||
p3Bar.Clean();
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
struct XCAPivot
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user