last ...
This commit is contained in:
@@ -728,6 +728,99 @@ struct X121SMCStrategyXWZWorkingZone
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
bool IsZoneOBRejected(
|
||||
XOBFVG &zone,
|
||||
X121Conditions &conditions,
|
||||
int barIndex = 0 //
|
||||
)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
// Cleanup Result ...
|
||||
zone.Clean();
|
||||
|
||||
//
|
||||
// Normalize Bar Index ...
|
||||
if (barIndex < 0)
|
||||
{
|
||||
barIndex = 0;
|
||||
}
|
||||
|
||||
//
|
||||
if (barIndex == 0)
|
||||
{
|
||||
barIndex = 1;
|
||||
}
|
||||
|
||||
//
|
||||
XOHCL bar;
|
||||
bool isInited = bar.Init(
|
||||
symbol,
|
||||
period,
|
||||
barIndex //
|
||||
);
|
||||
|
||||
//
|
||||
// Validate ...
|
||||
result = isInited &&
|
||||
IsValid() &&
|
||||
HasWaitingZones();
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
double points = GetPoints(bar.symbol);
|
||||
|
||||
//
|
||||
// Detecting Rejected Waiting Zone ...
|
||||
int count = CountWaitingZones();
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
// Detecting XBoxZone Area of Waiting Zone ...
|
||||
XBoxZone iBox;
|
||||
bool hasBox = waitingZones[i]
|
||||
.ToZone(iBox);
|
||||
if (hasBox)
|
||||
{
|
||||
//
|
||||
double peak = conditions.peaksBuffer[1];
|
||||
double lower = waitingZones[i].ob.Lower();
|
||||
|
||||
//
|
||||
double delta = MathAbs(lower - peak);
|
||||
|
||||
//
|
||||
result = delta == 0 ||
|
||||
delta < points * 2;
|
||||
}
|
||||
|
||||
//
|
||||
// Validate Result ...
|
||||
if (result)
|
||||
{
|
||||
//
|
||||
iBox.Clean();
|
||||
zone = waitingZones[i];
|
||||
break;
|
||||
}
|
||||
|
||||
//
|
||||
iBox.Clean();
|
||||
}
|
||||
|
||||
//
|
||||
bar.Clean();
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
bool IsExists(XOBFVG &zone)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user