last ...
This commit is contained in:
@@ -361,6 +361,14 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
||||
Print("Has Inside Zones");
|
||||
}
|
||||
|
||||
//
|
||||
bool hasBreakedZones = hasWorkingZone &&
|
||||
workingZone.HasBreakedZones();
|
||||
if (hasBreakedZones)
|
||||
{
|
||||
Print("Has Breaked Zones");
|
||||
}
|
||||
|
||||
//
|
||||
UpdateTo(cTime);
|
||||
|
||||
|
||||
@@ -75,6 +75,7 @@ struct X121SMCStrategyXWZWorkingZone
|
||||
|
||||
//
|
||||
XOBFVG insideZones[];
|
||||
XOBFVG breakedZones[];
|
||||
XOBFVG waitingZones[];
|
||||
|
||||
//
|
||||
@@ -109,6 +110,7 @@ struct X121SMCStrategyXWZWorkingZone
|
||||
//
|
||||
Clean(insideZones);
|
||||
Clean(waitingZones);
|
||||
Clean(breakedZones);
|
||||
|
||||
//
|
||||
Clean(supportZones);
|
||||
@@ -432,70 +434,72 @@ struct X121SMCStrategyXWZWorkingZone
|
||||
return;
|
||||
}
|
||||
|
||||
// //
|
||||
// // Supply Zones ...
|
||||
// count = mtfState.FilterSupplyZones(
|
||||
// supplyZones,
|
||||
// NULL,
|
||||
// XZONE_STATE_PASSED,
|
||||
// false,
|
||||
// XZONE_STATE_FAILED,
|
||||
// false,
|
||||
// XZONE_STATE_FAILED,
|
||||
// false,
|
||||
// XZONE_STATE_IGNORED,
|
||||
// false //
|
||||
// );
|
||||
|
||||
// //
|
||||
// // Demand Zones ...
|
||||
// count = mtfState.FilterDemandZones(
|
||||
// demandZones,
|
||||
// NULL,
|
||||
// XZONE_STATE_PASSED,
|
||||
// false,
|
||||
// XZONE_STATE_FAILED,
|
||||
// false,
|
||||
// XZONE_STATE_FAILED,
|
||||
// false,
|
||||
// XZONE_STATE_IGNORED,
|
||||
// false //
|
||||
// );
|
||||
|
||||
// //
|
||||
// // Support Zones ...
|
||||
// count = stfState.FilterSupportZones(
|
||||
// supportZones,
|
||||
// period,
|
||||
// XZONE_STATE_PASSED,
|
||||
// false,
|
||||
// XZONE_STATE_FAILED,
|
||||
// false,
|
||||
// XZONE_STATE_FAILED,
|
||||
// false,
|
||||
// XZONE_STATE_IGNORED,
|
||||
// false //
|
||||
// );
|
||||
|
||||
// //
|
||||
// // Resistance Zones ...
|
||||
// count = stfState.FilterResistanceZones(
|
||||
// resistanceZones,
|
||||
// period,
|
||||
// XZONE_STATE_PASSED,
|
||||
// false,
|
||||
// XZONE_STATE_FAILED,
|
||||
// false,
|
||||
// XZONE_STATE_FAILED,
|
||||
// false,
|
||||
// XZONE_STATE_IGNORED,
|
||||
// false //
|
||||
// );
|
||||
//
|
||||
// Supply Zones ...
|
||||
count = mtfState.FilterSupplyZones(
|
||||
supplyZones,
|
||||
NULL,
|
||||
XZONE_STATE_PASSED,
|
||||
false,
|
||||
XZONE_STATE_FAILED,
|
||||
false,
|
||||
XZONE_STATE_FAILED,
|
||||
false,
|
||||
XZONE_STATE_IGNORED,
|
||||
false //
|
||||
);
|
||||
|
||||
//
|
||||
// Detect price Inside Zones ...
|
||||
// Demand Zones ...
|
||||
count = mtfState.FilterDemandZones(
|
||||
demandZones,
|
||||
NULL,
|
||||
XZONE_STATE_PASSED,
|
||||
false,
|
||||
XZONE_STATE_FAILED,
|
||||
false,
|
||||
XZONE_STATE_FAILED,
|
||||
false,
|
||||
XZONE_STATE_IGNORED,
|
||||
false //
|
||||
);
|
||||
|
||||
//
|
||||
// Support Zones ...
|
||||
count = stfState.FilterSupportZones(
|
||||
supportZones,
|
||||
period,
|
||||
XZONE_STATE_PASSED,
|
||||
false,
|
||||
XZONE_STATE_FAILED,
|
||||
false,
|
||||
XZONE_STATE_FAILED,
|
||||
false,
|
||||
XZONE_STATE_IGNORED,
|
||||
false //
|
||||
);
|
||||
|
||||
//
|
||||
// Resistance Zones ...
|
||||
count = stfState.FilterResistanceZones(
|
||||
resistanceZones,
|
||||
period,
|
||||
XZONE_STATE_PASSED,
|
||||
false,
|
||||
XZONE_STATE_FAILED,
|
||||
false,
|
||||
XZONE_STATE_FAILED,
|
||||
false,
|
||||
XZONE_STATE_IGNORED,
|
||||
false //
|
||||
);
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
//
|
||||
// Detect Price Inside Zones ...
|
||||
has = HasWaitingZones();
|
||||
if (has)
|
||||
{
|
||||
@@ -520,16 +524,25 @@ struct X121SMCStrategyXWZWorkingZone
|
||||
if (isInside)
|
||||
{
|
||||
//
|
||||
Add(
|
||||
i,
|
||||
mustRemove //
|
||||
);
|
||||
|
||||
//
|
||||
AddRef(
|
||||
idx = FindIndex(
|
||||
iOBFVG,
|
||||
insideZones //
|
||||
);
|
||||
has = IsValidSize(idx);
|
||||
if (!has)
|
||||
{
|
||||
//
|
||||
Add(
|
||||
i,
|
||||
mustRemove //
|
||||
);
|
||||
|
||||
//
|
||||
AddRef(
|
||||
iOBFVG,
|
||||
insideZones //
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -549,9 +562,97 @@ struct X121SMCStrategyXWZWorkingZone
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
Clean(mustRemove);
|
||||
}
|
||||
|
||||
//
|
||||
// Detect Inside Zones ...
|
||||
has = HasInsideZones();
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
int mustRemove[];
|
||||
count = CountInsideZones();
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
XOBFVG iOBFVG = insideZones[i];
|
||||
ENUM_X_DIRECTION iDir = iOBFVG.GetDirection();
|
||||
bool isBullish = IsBullish(iDir);
|
||||
|
||||
//
|
||||
bool isBullishBreaked =
|
||||
//
|
||||
zBar.high < iOBFVG.ob.Lower() &&
|
||||
cBar.high < iOBFVG.ob.Lower()
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isBearishBreaked =
|
||||
//
|
||||
zBar.low > iOBFVG.ob.Upper() &&
|
||||
cBar.low > iOBFVG.ob.Upper()
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isBreaked =
|
||||
isBullish
|
||||
? isBullishBreaked
|
||||
: isBearishBreaked;
|
||||
|
||||
//
|
||||
if (isBreaked)
|
||||
{
|
||||
//
|
||||
idx = FindIndex(
|
||||
iOBFVG,
|
||||
breakedZones //
|
||||
);
|
||||
has = IsValidIndex(idx);
|
||||
if (!has)
|
||||
{
|
||||
//
|
||||
Add(
|
||||
i,
|
||||
mustRemove //
|
||||
);
|
||||
|
||||
//
|
||||
AddRef(
|
||||
iOBFVG,
|
||||
breakedZones //
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
has = HasChild(mustRemove);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
count = ArraySize(mustRemove);
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
ArrayRemove(
|
||||
insideZones,
|
||||
mustRemove[i],
|
||||
1 //
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
Clean(mustRemove);
|
||||
}
|
||||
|
||||
//
|
||||
// Adding New OBFVG to Waiting Zones if not Exists ...
|
||||
XOBFVG tmpWaitingZones[];
|
||||
count = ExtractOBFVGs(
|
||||
tmpWaitingZones,
|
||||
@@ -682,6 +783,18 @@ struct X121SMCStrategyXWZWorkingZone
|
||||
return ArraySize(insideZones);
|
||||
}
|
||||
|
||||
//
|
||||
bool HasBreakedZones()
|
||||
{
|
||||
return HasChild(breakedZones);
|
||||
}
|
||||
|
||||
//
|
||||
int CountBreakedZones()
|
||||
{
|
||||
return ArraySize(breakedZones);
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user