last ...
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -5943,7 +5943,7 @@ struct XConsolidationZone
|
|||||||
//
|
//
|
||||||
string result =
|
string result =
|
||||||
//
|
//
|
||||||
GetTypeName(this) + "_" +
|
"ConsolidationZone" + "_" +
|
||||||
symbol + "_" +
|
symbol + "_" +
|
||||||
ToString(period) + "_" +
|
ToString(period) + "_" +
|
||||||
ToString(upper) + "_" +
|
ToString(upper) + "_" +
|
||||||
@@ -7357,13 +7357,15 @@ bool IsBoxAbove(
|
|||||||
* @param source: XBoxZone instance Reference ...
|
* @param source: XBoxZone instance Reference ...
|
||||||
* @param dest: XBoxZone instance Reference ...
|
* @param dest: XBoxZone instance Reference ...
|
||||||
* @param forceSideOut: bool, force check Box has One Side Out ...
|
* @param forceSideOut: bool, force check Box has One Side Out ...
|
||||||
|
* @param ignoreSideOut: bool, Accept if source Box one Side is out of Dest Box ...
|
||||||
*
|
*
|
||||||
* @return ( bool )
|
* @return ( bool )
|
||||||
*/
|
*/
|
||||||
bool IsBoxInside(
|
bool IsBoxInside(
|
||||||
XBoxZone &source,
|
XBoxZone &source,
|
||||||
XBoxZone &dest,
|
XBoxZone &dest,
|
||||||
bool forceSideOut = false //
|
bool forceSideOut = false, //
|
||||||
|
bool ignoreSideOut = true //
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
@@ -7383,12 +7385,21 @@ bool IsBoxInside(
|
|||||||
|
|
||||||
//
|
//
|
||||||
if (!forceSideOut)
|
if (!forceSideOut)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
if (ignoreSideOut)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
result = source.lower >= dest.lower &&
|
result = source.lower >= dest.lower &&
|
||||||
source.upper <= dest.upper;
|
source.upper <= dest.upper;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
result = source.lower >= dest.lower ||
|
||||||
|
source.upper <= dest.upper;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
bool hasSideIn =
|
bool hasSideIn =
|
||||||
|
|||||||
@@ -527,15 +527,26 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Detect Start Zones ...
|
// Detect Start Zones ...
|
||||||
bool hasStartZone = mConditions.HasStartZone();
|
bool hasStartZone = mConditions.HasStartZones();
|
||||||
if (!hasStartZone)
|
if (!hasStartZone)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
hasStartZone = mConditions.DetectStartZone(
|
hasStartZone = mConditions.DetectStartZones(
|
||||||
trend,
|
trend,
|
||||||
analyseState,
|
analyseState,
|
||||||
decisionCycleHelper //
|
decisionCycleHelper //
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
if (hasStartZone)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
mConditions.UpdateTo(cTime);
|
||||||
|
DrawConditions(
|
||||||
|
mConditions,
|
||||||
|
visionCycleHelper.mPOIDrawer //
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -563,56 +574,105 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
|||||||
: false;
|
: false;
|
||||||
|
|
||||||
//
|
//
|
||||||
bool hasCondition = false;
|
DrawWorkingZone(
|
||||||
ENUM_X_DIRECTION conditionsDir = X_DIRECTION_NONE;
|
mConditions,
|
||||||
|
visionCycleHelper.mPOIDrawer //
|
||||||
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Detect Start Zone Based Conditions ...
|
// Here we are Make sure we have Correct:
|
||||||
if (hasStartZone)
|
// - WorkSpace ...
|
||||||
{
|
// - Trend ...
|
||||||
|
// - What we looking for: Long or Short ...
|
||||||
|
// - Priority ...
|
||||||
|
|
||||||
|
//
|
||||||
|
DrawConditions(
|
||||||
|
mConditions,
|
||||||
|
visionCycleHelper.mPOIDrawer //
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
double pivot = 0;
|
||||||
|
double point = 0;
|
||||||
|
bool hasCondition = false;
|
||||||
|
ENUM_X_DIRECTION conditionsDir = X_DIRECTION_NONE;
|
||||||
//
|
//
|
||||||
// Detect Start Zone Conditions ...
|
// Detect Start Zone Conditions ...
|
||||||
hasCondition = mConditions
|
hasCondition = mConditions
|
||||||
.startZone
|
.HasConditions(
|
||||||
.HasCondition(
|
conditionsDir,
|
||||||
decisionState,
|
decisionState,
|
||||||
zIndex,
|
zIndex,
|
||||||
NULL // period //
|
decisionState.period //
|
||||||
);
|
);
|
||||||
conditionsDir = mConditions
|
if (hasCondition)
|
||||||
.startZone
|
|
||||||
.GetDirection();
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
RemoveWorkingZoneDraws();
|
|
||||||
DrawWorkingZone(mConditions, visionCycleHelper.mPOIDrawer);
|
|
||||||
|
|
||||||
//
|
|
||||||
// Detect Supply and Deman Zone Based Conditions ...
|
|
||||||
if (!hasCondition)
|
|
||||||
{
|
{
|
||||||
//
|
// //
|
||||||
bool isPriceInsideSupplyZone =
|
// XBoxZone startZoneBox;
|
||||||
bearishPriority == X121SMC_XWZ_PRIORITY_STRONG_HIGH;
|
// bool hasBox = mConditions.startZone.AsBox(startZoneBox);
|
||||||
|
// if (hasBox)
|
||||||
|
// {
|
||||||
|
// //
|
||||||
|
// bool isBullish = IsBullish(conditionsDir);
|
||||||
|
|
||||||
//
|
// //
|
||||||
bool isPriceInsideDemandZone =
|
// pivot =
|
||||||
bullishPriority == X121SMC_XWZ_PRIORITY_STRONG_HIGH;
|
// isBullish
|
||||||
|
// ? startZoneBox.lower
|
||||||
|
// : startZoneBox.upper;
|
||||||
|
|
||||||
//
|
// //
|
||||||
bool isPriceInsideSupDem = isPriceInsideSupplyZone ||
|
// point =
|
||||||
isPriceInsideDemandZone;
|
// isBullish
|
||||||
if (isPriceInsideSupDem)
|
// ? startZoneBox.upper
|
||||||
{
|
// : startZoneBox.lower;
|
||||||
//
|
// }
|
||||||
hasCondition = mConditions.HasWorkingZoneConditions(
|
|
||||||
conditionsDir,
|
|
||||||
decisionState //
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// //
|
||||||
|
// // Detect Supply and Deman Zone Based Conditions ...
|
||||||
|
// if (!hasCondition)
|
||||||
|
// {
|
||||||
|
// //
|
||||||
|
// bool isPriceInsideSupplyZone =
|
||||||
|
// bearishPriority == X121SMC_XWZ_PRIORITY_STRONG_HIGH;
|
||||||
|
|
||||||
|
// //
|
||||||
|
// bool isPriceInsideDemandZone =
|
||||||
|
// bullishPriority == X121SMC_XWZ_PRIORITY_STRONG_HIGH;
|
||||||
|
|
||||||
|
// //
|
||||||
|
// bool isPriceInsideSupDem = isPriceInsideSupplyZone ||
|
||||||
|
// isPriceInsideDemandZone;
|
||||||
|
// if (isPriceInsideSupDem)
|
||||||
|
// {
|
||||||
|
// //
|
||||||
|
// hasCondition = mConditions.HasWorkingZoneConditions(
|
||||||
|
// conditionsDir,
|
||||||
|
// decisionState //
|
||||||
|
// );
|
||||||
|
|
||||||
|
// //
|
||||||
|
// if (hasCondition)
|
||||||
|
// {
|
||||||
|
// //
|
||||||
|
// if (IsBullish(conditionsDir))
|
||||||
|
// {
|
||||||
|
// //
|
||||||
|
// pivot = mConditions.demandZone.Lower();
|
||||||
|
// point = mConditions.demandZone.Upper();
|
||||||
|
// }
|
||||||
|
// else if (IsBearish(conditionsDir))
|
||||||
|
// {
|
||||||
|
// //
|
||||||
|
// pivot = mConditions.supplyZone.Upper();
|
||||||
|
// point = mConditions.supplyZone.Lower();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
//
|
//
|
||||||
isBullish = IsBullish(conditionsDir);
|
isBullish = IsBullish(conditionsDir);
|
||||||
isBearish = IsBearish(conditionsDir);
|
isBearish = IsBearish(conditionsDir);
|
||||||
@@ -630,11 +690,152 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
|||||||
amountPercent //
|
amountPercent //
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
bool hasLastBullishConsolidationZone = false;
|
||||||
|
bool hasLastBearishConsolidationZone = false;
|
||||||
|
bool hasPrevBullishConsolidationZone = false;
|
||||||
|
bool hasPrevBearishConsolidationZone = false;
|
||||||
|
XConsolidationZone lastBullishConsolidationZone;
|
||||||
|
XConsolidationZone lastBearishConsolidationZone;
|
||||||
|
XConsolidationZone prevBullishConsolidationZone;
|
||||||
|
XConsolidationZone prevBearishConsolidationZone;
|
||||||
|
bool hasConsolidationZones = decisionCycleHelper.HasConsolidationZones();
|
||||||
|
if (hasConsolidationZones)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
int cZCount = 0;
|
||||||
|
XConsolidationZone tmp[];
|
||||||
|
|
||||||
|
//
|
||||||
|
cZCount = decisionCycleHelper
|
||||||
|
.FillConsolidationZones(
|
||||||
|
X_DIRECTION_BULLISH,
|
||||||
|
tmp //
|
||||||
|
);
|
||||||
|
if (IsValidSize(cZCount))
|
||||||
|
{
|
||||||
|
//
|
||||||
|
lastBullishConsolidationZone = tmp[cZCount - 1];
|
||||||
|
if (cZCount >= 2)
|
||||||
|
{
|
||||||
|
prevBullishConsolidationZone = tmp[cZCount - 2];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
Clean(tmp);
|
||||||
|
cZCount = decisionCycleHelper
|
||||||
|
.FillConsolidationZones(
|
||||||
|
X_DIRECTION_BEARISH,
|
||||||
|
tmp //
|
||||||
|
);
|
||||||
|
if (IsValidSize(cZCount))
|
||||||
|
{
|
||||||
|
//
|
||||||
|
lastBearishConsolidationZone = tmp[cZCount - 1];
|
||||||
|
if (cZCount >= 2)
|
||||||
|
{
|
||||||
|
prevBearishConsolidationZone = tmp[cZCount - 2];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
Clean(tmp);
|
||||||
|
|
||||||
|
//
|
||||||
|
hasLastBullishConsolidationZone = lastBullishConsolidationZone.IsValid();
|
||||||
|
hasLastBearishConsolidationZone = lastBearishConsolidationZone.IsValid();
|
||||||
|
hasPrevBullishConsolidationZone = prevBullishConsolidationZone.IsValid();
|
||||||
|
hasPrevBearishConsolidationZone = prevBearishConsolidationZone.IsValid();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
RemoveDraws();
|
||||||
|
|
||||||
|
//
|
||||||
|
if (hasLastBullishConsolidationZone)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
XCConsolidationZoneObject *iObj;
|
||||||
|
bool isCreated = visionCycleHelper
|
||||||
|
.mPOIDrawer
|
||||||
|
.CreateConsolidationZone(
|
||||||
|
lastBullishConsolidationZone,
|
||||||
|
iObj //
|
||||||
|
);
|
||||||
|
if (isCreated)
|
||||||
|
{
|
||||||
|
mObjects.Add(iObj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
if (hasLastBearishConsolidationZone)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
XCConsolidationZoneObject *iObj;
|
||||||
|
bool isCreated = visionCycleHelper
|
||||||
|
.mPOIDrawer
|
||||||
|
.CreateConsolidationZone(
|
||||||
|
lastBearishConsolidationZone,
|
||||||
|
iObj //
|
||||||
|
);
|
||||||
|
if (isCreated)
|
||||||
|
{
|
||||||
|
mObjects.Add(iObj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
if (hasPrevBullishConsolidationZone)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
XCConsolidationZoneObject *iObj;
|
||||||
|
bool isCreated = visionCycleHelper
|
||||||
|
.mPOIDrawer
|
||||||
|
.CreateConsolidationZone(
|
||||||
|
prevBullishConsolidationZone,
|
||||||
|
iObj //
|
||||||
|
);
|
||||||
|
if (isCreated)
|
||||||
|
{
|
||||||
|
mObjects.Add(iObj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
if (hasPrevBearishConsolidationZone)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
XCConsolidationZoneObject *iObj;
|
||||||
|
bool isCreated = visionCycleHelper
|
||||||
|
.mPOIDrawer
|
||||||
|
.CreateConsolidationZone(
|
||||||
|
prevBearishConsolidationZone,
|
||||||
|
iObj //
|
||||||
|
);
|
||||||
|
if (isCreated)
|
||||||
|
{
|
||||||
|
mObjects.Add(iObj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isConsolidationZonePassed =
|
||||||
|
isBullish
|
||||||
|
? (point > 0 &&
|
||||||
|
hasPrevBullishConsolidationZone &&
|
||||||
|
point >= prevBullishConsolidationZone.upper)
|
||||||
|
: (point > 0 &&
|
||||||
|
hasPrevBearishConsolidationZone &&
|
||||||
|
point <= prevBearishConsolidationZone.lower);
|
||||||
|
|
||||||
//
|
//
|
||||||
result = hasCondition &&
|
result = hasCondition &&
|
||||||
hasRewardAmount &&
|
hasRewardAmount &&
|
||||||
isPriorityPassed &&
|
isPriorityPassed &&
|
||||||
trend == conditionsDir;
|
trend == conditionsDir &&
|
||||||
|
isConsolidationZonePassed;
|
||||||
if (!result)
|
if (!result)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
@@ -664,6 +865,12 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
|||||||
consolidationConditions.Clean();
|
consolidationConditions.Clean();
|
||||||
consolidationXConditions.Clean();
|
consolidationXConditions.Clean();
|
||||||
|
|
||||||
|
//
|
||||||
|
lastBullishConsolidationZone.Clean();
|
||||||
|
lastBearishConsolidationZone.Clean();
|
||||||
|
prevBullishConsolidationZone.Clean();
|
||||||
|
prevBearishConsolidationZone.Clean();
|
||||||
|
|
||||||
//
|
//
|
||||||
mConditions.Clean();
|
mConditions.Clean();
|
||||||
|
|
||||||
@@ -718,18 +925,24 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
mConditions.pivot = pivot;
|
||||||
|
mConditions.point = point;
|
||||||
mConditions.reward = reward;
|
mConditions.reward = reward;
|
||||||
mConditions.target = target;
|
mConditions.target = target;
|
||||||
mConditions.setupTime = cTime;
|
mConditions.setupTime = cTime;
|
||||||
mConditions.priority = priority;
|
mConditions.priority = priority;
|
||||||
mConditions.dir = conditionsDir;
|
mConditions.dir = conditionsDir;
|
||||||
mConditions.amountPercent = amountPercent;
|
mConditions.amountPercent = amountPercent;
|
||||||
mConditions.pivot = mConditions.GetExit();
|
|
||||||
mConditions.point = mConditions.GetPoint();
|
|
||||||
|
|
||||||
//
|
//
|
||||||
mConditions.UpdateTo(cTime);
|
mConditions.UpdateTo(cTime);
|
||||||
|
|
||||||
|
//
|
||||||
|
DrawConditions(
|
||||||
|
mConditions,
|
||||||
|
visionCycleHelper.mPOIDrawer //
|
||||||
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
Clean(visionPoiEvents);
|
Clean(visionPoiEvents);
|
||||||
Clean(analysePoiEvents);
|
Clean(analysePoiEvents);
|
||||||
@@ -757,6 +970,12 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
|||||||
consolidationConditions.Clean();
|
consolidationConditions.Clean();
|
||||||
consolidationXConditions.Clean();
|
consolidationXConditions.Clean();
|
||||||
|
|
||||||
|
//
|
||||||
|
lastBullishConsolidationZone.Clean();
|
||||||
|
lastBearishConsolidationZone.Clean();
|
||||||
|
prevBullishConsolidationZone.Clean();
|
||||||
|
prevBearishConsolidationZone.Clean();
|
||||||
|
|
||||||
//
|
//
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -929,16 +1148,18 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
|||||||
//
|
//
|
||||||
isBullish =
|
isBullish =
|
||||||
//
|
//
|
||||||
isBullish &&
|
isBullish
|
||||||
isPointBreaked
|
// &&
|
||||||
|
// isPointBreaked
|
||||||
//
|
//
|
||||||
;
|
;
|
||||||
|
|
||||||
//
|
//
|
||||||
isBearish =
|
isBearish =
|
||||||
//
|
//
|
||||||
isBearish &&
|
isBearish
|
||||||
isPointBreaked
|
// &&
|
||||||
|
// isPointBreaked
|
||||||
//
|
//
|
||||||
;
|
;
|
||||||
|
|
||||||
@@ -2293,57 +2514,73 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
|||||||
color bearishColor = drawer.BarBearishColor();
|
color bearishColor = drawer.BarBearishColor();
|
||||||
|
|
||||||
//
|
//
|
||||||
// Start Zone ...
|
// Start Zones ...
|
||||||
bool hasStartZone = conditions.HasStartZone();
|
bool hasStartZones = conditions.HasStartZones();
|
||||||
if (hasStartZone)
|
if (hasStartZones)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
bool isBullish = conditions.startZone.IsBullish();
|
int count = conditions.CountStartZones();
|
||||||
|
for (int i = 0; i < count; i++)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
bool isBullish = conditions.startZones[i].IsBullish();
|
||||||
|
|
||||||
//
|
//
|
||||||
bool hasOB = conditions.startZone.HasOB();
|
bool hasOB = conditions.startZones[i].HasOB();
|
||||||
if (hasOB)
|
if (hasOB)
|
||||||
{
|
{
|
||||||
|
// //
|
||||||
|
// XCBaseObject *iObj;
|
||||||
|
// isCreated = drawer.CreateOrderBlock(
|
||||||
|
// conditions.startZones[i].ob,
|
||||||
|
// iObj //
|
||||||
|
// );
|
||||||
|
|
||||||
|
// //
|
||||||
|
// if (isCreated)
|
||||||
|
// {
|
||||||
|
// mObjects.Add(iObj);
|
||||||
|
// }
|
||||||
|
|
||||||
//
|
//
|
||||||
XCBaseObject *iObj;
|
DrawOrderBlock(
|
||||||
isCreated = drawer.CreateOrderBlock(
|
conditions.startZones[i].ob,
|
||||||
conditions.startZone.ob,
|
drawer //
|
||||||
iObj //
|
|
||||||
);
|
);
|
||||||
|
|
||||||
//
|
|
||||||
if (isCreated)
|
|
||||||
{
|
|
||||||
mObjects.Add(iObj);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
bool hasFVG = conditions.startZone.HasFVG();
|
bool hasFVG = conditions.startZones[i].HasFVG();
|
||||||
if (hasFVG)
|
if (hasFVG)
|
||||||
{
|
{
|
||||||
|
// //
|
||||||
|
// XCBaseObject *iObj;
|
||||||
|
// isCreated = drawer.CreateFairValueGap(
|
||||||
|
// conditions.startZones[i].fvg,
|
||||||
|
// iObj //
|
||||||
|
// );
|
||||||
|
|
||||||
|
// //
|
||||||
|
// if (isCreated)
|
||||||
|
// {
|
||||||
|
// mObjects.Add(iObj);
|
||||||
|
// }
|
||||||
|
|
||||||
//
|
//
|
||||||
XCBaseObject *iObj;
|
DrawFairValueGap(
|
||||||
isCreated = drawer.CreateFairValueGap(
|
conditions.startZones[i].fvg,
|
||||||
conditions.startZone.fvg,
|
drawer //
|
||||||
iObj //
|
|
||||||
);
|
);
|
||||||
|
|
||||||
//
|
|
||||||
if (isCreated)
|
|
||||||
{
|
|
||||||
mObjects.Add(iObj);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
bool hasSupply = conditions.startZone.HasSupply();
|
bool hasSupply = conditions.startZones[i].HasSupply();
|
||||||
if (hasSupply)
|
if (hasSupply)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
XCSupplyZoneObject *iObj;
|
XCSupplyZoneObject *iObj;
|
||||||
isCreated = drawer.CreateSupplyZone(
|
isCreated = drawer.CreateSupplyZone(
|
||||||
conditions.startZone.supply,
|
conditions.startZones[i].supply,
|
||||||
iObj //
|
iObj //
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -2355,13 +2592,13 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
bool hasDemand = conditions.startZone.HasDemand();
|
bool hasDemand = conditions.startZones[i].HasDemand();
|
||||||
if (hasDemand)
|
if (hasDemand)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
XCDemandZoneObject *iObj;
|
XCDemandZoneObject *iObj;
|
||||||
isCreated = drawer.CreateDemandZone(
|
isCreated = drawer.CreateDemandZone(
|
||||||
conditions.startZone.demand,
|
conditions.startZones[i].demand,
|
||||||
iObj //
|
iObj //
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -2373,13 +2610,13 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
bool hasSupport = conditions.startZone.HasSupport();
|
bool hasSupport = conditions.startZones[i].HasSupport();
|
||||||
if (hasSupport)
|
if (hasSupport)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
XCSupportZoneObject *iObj;
|
XCSupportZoneObject *iObj;
|
||||||
isCreated = drawer.CreateSupportZone(
|
isCreated = drawer.CreateSupportZone(
|
||||||
conditions.startZone.support,
|
conditions.startZones[i].support,
|
||||||
iObj //
|
iObj //
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -2391,49 +2628,13 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
bool hasResistance = conditions.startZone.HasResistance();
|
bool hasResistance = conditions.startZones[i].HasResistance();
|
||||||
if (hasResistance)
|
if (hasResistance)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
XCResistanceZoneObject *iObj;
|
XCResistanceZoneObject *iObj;
|
||||||
isCreated = drawer.CreateResistanceZone(
|
isCreated = drawer.CreateResistanceZone(
|
||||||
conditions.startZone.resistance,
|
conditions.startZones[i].resistance,
|
||||||
iObj //
|
|
||||||
);
|
|
||||||
|
|
||||||
//
|
|
||||||
if (isCreated)
|
|
||||||
{
|
|
||||||
mObjects.Add(iObj);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
bool hasBullishCZone = conditions.startZone.HasBullishConsolidationZone();
|
|
||||||
if (hasBullishCZone)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
XCConsolidationZoneObject *iObj;
|
|
||||||
isCreated = drawer.CreateConsolidationZone(
|
|
||||||
conditions.startZone.bullishConsolidationZone,
|
|
||||||
iObj //
|
|
||||||
);
|
|
||||||
|
|
||||||
//
|
|
||||||
if (isCreated)
|
|
||||||
{
|
|
||||||
mObjects.Add(iObj);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
bool hasBearishCZone = conditions.startZone.HasBearishConsolidationZone();
|
|
||||||
if (hasBearishCZone)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
XCConsolidationZoneObject *iObj;
|
|
||||||
isCreated = drawer.CreateConsolidationZone(
|
|
||||||
conditions.startZone.bearishConsolidationZone,
|
|
||||||
iObj //
|
iObj //
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -2456,11 +2657,11 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
|||||||
ENUM_X_PRICE bPrice = X_PRICE_CLOSE;
|
ENUM_X_PRICE bPrice = X_PRICE_CLOSE;
|
||||||
|
|
||||||
//
|
//
|
||||||
bool hasSwingBar = conditions.startZone.swingBar.IsValid();
|
bool hasSwingBar = conditions.startZones[i].swingBar.IsValid();
|
||||||
if (hasSwingBar)
|
if (hasSwingBar)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
bSuffix = ToMD5(conditions.startZone.swingBar.GetTag());
|
bSuffix = ToMD5(conditions.startZones[i].swingBar.GetTag());
|
||||||
bName =
|
bName =
|
||||||
(isBullish
|
(isBullish
|
||||||
? "SWING_LOW"
|
? "SWING_LOW"
|
||||||
@@ -2484,7 +2685,7 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
|||||||
bName,
|
bName,
|
||||||
subWindow,
|
subWindow,
|
||||||
arrowCode,
|
arrowCode,
|
||||||
conditions.startZone.swingBar,
|
conditions.startZones[i].swingBar,
|
||||||
bPrice //
|
bPrice //
|
||||||
);
|
);
|
||||||
if (isCreated)
|
if (isCreated)
|
||||||
@@ -2498,11 +2699,11 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
bool hasBreakerBar = conditions.startZone.breakerBar.IsValid();
|
bool hasBreakerBar = conditions.startZones[i].breakerBar.IsValid();
|
||||||
if (hasBreakerBar)
|
if (hasBreakerBar)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
bSuffix = ToMD5(conditions.startZone.breakerBar.GetTag());
|
bSuffix = ToMD5(conditions.startZones[i].breakerBar.GetTag());
|
||||||
bName =
|
bName =
|
||||||
(isBullish
|
(isBullish
|
||||||
? "BULL_BREAKER"
|
? "BULL_BREAKER"
|
||||||
@@ -2529,7 +2730,7 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
|||||||
bName,
|
bName,
|
||||||
subWindow,
|
subWindow,
|
||||||
arrowCode,
|
arrowCode,
|
||||||
conditions.startZone.breakerBar,
|
conditions.startZones[i].breakerBar,
|
||||||
bPrice //
|
bPrice //
|
||||||
);
|
);
|
||||||
if (isCreated)
|
if (isCreated)
|
||||||
@@ -2543,11 +2744,11 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
bool hasMomentumBar = conditions.startZone.momentumBar.IsValid();
|
bool hasMomentumBar = conditions.startZones[i].momentumBar.IsValid();
|
||||||
if (hasMomentumBar)
|
if (hasMomentumBar)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
bSuffix = ToMD5(conditions.startZone.momentumBar.GetTag());
|
bSuffix = ToMD5(conditions.startZones[i].momentumBar.GetTag());
|
||||||
bName =
|
bName =
|
||||||
(isBullish
|
(isBullish
|
||||||
? "BULL_MOMENTUM"
|
? "BULL_MOMENTUM"
|
||||||
@@ -2574,7 +2775,7 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
|||||||
bName,
|
bName,
|
||||||
subWindow,
|
subWindow,
|
||||||
arrowCode,
|
arrowCode,
|
||||||
conditions.startZone.momentumBar,
|
conditions.startZones[i].momentumBar,
|
||||||
bPrice //
|
bPrice //
|
||||||
);
|
);
|
||||||
if (isCreated)
|
if (isCreated)
|
||||||
@@ -2588,11 +2789,11 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
bool hasRejectionBar = conditions.startZone.rejectionBar.IsValid();
|
bool hasRejectionBar = conditions.startZones[i].rejectionBar.IsValid();
|
||||||
if (hasRejectionBar)
|
if (hasRejectionBar)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
bSuffix = ToMD5(conditions.startZone.rejectionBar.GetTag());
|
bSuffix = ToMD5(conditions.startZones[i].rejectionBar.GetTag());
|
||||||
bName =
|
bName =
|
||||||
(isBullish
|
(isBullish
|
||||||
? "BULL_REJECTION"
|
? "BULL_REJECTION"
|
||||||
@@ -2619,7 +2820,7 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
|||||||
bName,
|
bName,
|
||||||
subWindow,
|
subWindow,
|
||||||
arrowCode,
|
arrowCode,
|
||||||
conditions.startZone.rejectionBar,
|
conditions.startZones[i].rejectionBar,
|
||||||
bPrice //
|
bPrice //
|
||||||
);
|
);
|
||||||
if (isCreated)
|
if (isCreated)
|
||||||
@@ -2633,19 +2834,19 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
bool hasAppliedBox = conditions.startZone.appliedBox.IsValid();
|
bool hasAppliedBox = conditions.startZones[i].appliedBox.IsValid();
|
||||||
if (hasAppliedBox)
|
if (hasAppliedBox)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
arrowColor =
|
arrowColor =
|
||||||
IsBullish(conditions.startZone.appliedBox.dir)
|
IsBullish(conditions.startZones[i].appliedBox.dir)
|
||||||
? bullishColor
|
? bullishColor
|
||||||
: bearishColor;
|
: bearishColor;
|
||||||
|
|
||||||
//
|
//
|
||||||
XCBoxObject *iObj;
|
XCBoxObject *iObj;
|
||||||
isCreated = drawer.CreateBox(
|
isCreated = drawer.CreateBox(
|
||||||
conditions.startZone.appliedBox,
|
conditions.startZones[i].appliedBox,
|
||||||
iObj //
|
iObj //
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -2662,6 +2863,7 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
protected:
|
protected:
|
||||||
@@ -2696,44 +2898,6 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
|||||||
//
|
//
|
||||||
// Helpers ...
|
// Helpers ...
|
||||||
|
|
||||||
//
|
|
||||||
bool CheckPriceInside(
|
|
||||||
XOHCL &zBar,
|
|
||||||
XOHCL &cBar,
|
|
||||||
double upper,
|
|
||||||
double lower //
|
|
||||||
)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
bool result = false;
|
|
||||||
|
|
||||||
//
|
|
||||||
result = zBar.IsValid() &&
|
|
||||||
cBar.IsValid() &&
|
|
||||||
upper > 0 &&
|
|
||||||
lower > 0 &&
|
|
||||||
upper > lower &&
|
|
||||||
zBar.time > cBar.time;
|
|
||||||
if (!result)
|
|
||||||
{
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
result =
|
|
||||||
//
|
|
||||||
zBar.high < upper &&
|
|
||||||
cBar.high < upper &&
|
|
||||||
//
|
|
||||||
zBar.low > lower &&
|
|
||||||
cBar.low > lower
|
|
||||||
//
|
|
||||||
;
|
|
||||||
|
|
||||||
//
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
bool CalculateRiskReward(
|
bool CalculateRiskReward(
|
||||||
ENUM_X121SMC_XWZ_PRIORITY priority,
|
ENUM_X121SMC_XWZ_PRIORITY priority,
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user