last ...
This commit is contained in:
@@ -329,6 +329,7 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
||||
//
|
||||
// Setup Conditions ...
|
||||
double sls[];
|
||||
double sl = 0;
|
||||
double pivot = 0;
|
||||
double point = 0;
|
||||
double targets[];
|
||||
@@ -339,10 +340,16 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
||||
bool hasSignalBox = false;
|
||||
bool hasRewardAmount = false;
|
||||
bool isSignalBoxReversal = false;
|
||||
bool hasWorkingZoneOveralDirection = false;
|
||||
ENUM_X_DIRECTION wzOveralDir = X_DIRECTION_NONE;
|
||||
ENUM_X_DIRECTION signalBoxDir = X_DIRECTION_NONE;
|
||||
ENUM_X121SMC_XWZ_PRIORITY priority = X121SMC_XWZ_PRIORITY_NONE;
|
||||
ENUM_X121SMC_XWZ_PROVIDERS provider = X121SMC_XWZ_PROVIDER_NONE;
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
//
|
||||
// First We Have to Has Working Zone ...
|
||||
bool hasWorkingZone = workingZone.IsValid();
|
||||
@@ -361,21 +368,25 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
||||
}
|
||||
|
||||
//
|
||||
// Update Working Zone ...
|
||||
if (hasWorkingZone)
|
||||
{
|
||||
//
|
||||
// Reset POI Detector Required POI(s) ...
|
||||
visionCycleHelper.mPOIDetector.MaxRequiredPOIs(50);
|
||||
analyseCycleHelper.mPOIDetector.MaxRequiredPOIs(50);
|
||||
decisionCycleHelper.mPOIDetector.MaxRequiredPOIs(50);
|
||||
consolidationCycleHelper.mPOIDetector.MaxRequiredPOIs(50);
|
||||
|
||||
//
|
||||
// Reset POI Detector Allowed Loopback ...
|
||||
visionCycleHelper.mPOIDetector.MaxAllowedLoopbackForInit(578);
|
||||
analyseCycleHelper.mPOIDetector.MaxAllowedLoopbackForInit(578);
|
||||
decisionCycleHelper.mPOIDetector.MaxAllowedLoopbackForInit(578);
|
||||
consolidationCycleHelper.mPOIDetector.MaxAllowedLoopbackForInit(578);
|
||||
|
||||
//
|
||||
// Update Working Zone ...
|
||||
workingZone.Update(
|
||||
zIndex,
|
||||
visionState,
|
||||
@@ -385,16 +396,63 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
||||
);
|
||||
|
||||
//
|
||||
bool isDestroyed = workingZone.IsDestroyed(
|
||||
// Check Working Zone Overal Direction ...
|
||||
hasWorkingZoneOveralDirection = workingZone
|
||||
.DetectOveralDirection(wzOveralDir);
|
||||
|
||||
//
|
||||
// Checking Working Zone Destory or not ...
|
||||
bool isWorkingZoneDestroyed = workingZone.IsDestroyed(
|
||||
zIndex,
|
||||
period //
|
||||
);
|
||||
if (isDestroyed)
|
||||
|
||||
//
|
||||
// Cleanup WorkingZone and ignore all conditions ...
|
||||
if (isWorkingZoneDestroyed)
|
||||
{
|
||||
//
|
||||
result = false;
|
||||
workingZone.Clean();
|
||||
hasWorkingZone = false;
|
||||
|
||||
//
|
||||
// Cleanup Resources ...
|
||||
Clean(visionPoiEvents);
|
||||
Clean(analysePoiEvents);
|
||||
Clean(decisionPoiEvents);
|
||||
Clean(consolidationPoiEvents);
|
||||
|
||||
//
|
||||
Clean(visionCycleEvents);
|
||||
Clean(analyseCycleEvents);
|
||||
Clean(decisionCycleEvents);
|
||||
Clean(consolidationCycleEvents);
|
||||
|
||||
//
|
||||
visionState.Clean();
|
||||
analyseState.Clean();
|
||||
decisionState.Clean();
|
||||
consolidationState.Clean();
|
||||
|
||||
//
|
||||
visionConditions.Clean();
|
||||
analyseConditions.Clean();
|
||||
decisionConditions.Clean();
|
||||
consolidationConditions.Clean();
|
||||
|
||||
//
|
||||
visionXConditions.Clean();
|
||||
analyseXConditions.Clean();
|
||||
decisionXConditions.Clean();
|
||||
consolidationXConditions.Clean();
|
||||
|
||||
//
|
||||
mConditions.Clean();
|
||||
consolidationZBar.Clean();
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -513,17 +571,24 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
||||
//
|
||||
// Remove Signal Box from Waiting Boxes of
|
||||
// Working Zone ...
|
||||
if (hasSignalBox &&
|
||||
IsValidIndex(idx))
|
||||
if (hasSignalBox)
|
||||
{
|
||||
//
|
||||
ArrayRemove(
|
||||
workingZone.waitingBoxes,
|
||||
idx,
|
||||
1 //
|
||||
);
|
||||
if (IsValidIndex(idx))
|
||||
{
|
||||
//
|
||||
ArrayRemove(
|
||||
workingZone.waitingBoxes,
|
||||
idx,
|
||||
1 //
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Ignore Zone's Signals ...
|
||||
hasSignalBox = false;
|
||||
|
||||
//
|
||||
// Cleanup Resources ...
|
||||
|
||||
@@ -555,8 +620,6 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
||||
{
|
||||
//
|
||||
// Senari A ...
|
||||
|
||||
//
|
||||
hasSignalBox = hasWorkingZone &&
|
||||
workingZone.DetectSenarioASignalBox(
|
||||
signalBox,
|
||||
@@ -574,6 +637,55 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
||||
isSignalBoxReversal = false;
|
||||
provider = X121SMC_XWZ_PROVIDER_PV_ZONE;
|
||||
}
|
||||
|
||||
//
|
||||
// Validating Signal Box if Exists ...
|
||||
if (hasSignalBox)
|
||||
{
|
||||
//
|
||||
// Validate Signal Boxes using Inside Box ...
|
||||
if (hasInsideBoxes)
|
||||
{
|
||||
//
|
||||
int idx = -1;
|
||||
bool has = false;
|
||||
|
||||
//
|
||||
idx =
|
||||
IsBullish(signalBoxDir)
|
||||
? GetLowest(workingZone.insideBoxes)
|
||||
: GetHighest(workingZone.insideBoxes);
|
||||
has = IsValidIndex(idx);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
hasSignalBox =
|
||||
signalBoxDir == workingZone.insideBoxes[idx].dir;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Validate Signal Box Using Overal Trend ...
|
||||
if (hasWorkingZoneOveralDirection)
|
||||
{
|
||||
//
|
||||
hasSignalBox =
|
||||
signalBoxDir == wzOveralDir;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
//
|
||||
// Cleanup Signal if UnApproved ...
|
||||
if (!hasSignalBox)
|
||||
{
|
||||
//
|
||||
signalBox.Clean();
|
||||
signalBoxDir = X_DIRECTION_NONE;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -646,15 +758,54 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
||||
iSL = signalBox.lower + (signalBox.upper - signalBox.lower) / 2;
|
||||
}
|
||||
|
||||
//
|
||||
if (provider == X121SMC_XWZ_PROVIDER_PV_ZONE)
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
Add(
|
||||
iSL,
|
||||
sls //
|
||||
);
|
||||
|
||||
//
|
||||
// Select Condition SL ...
|
||||
|
||||
//
|
||||
double entry = GetEntry(
|
||||
signalBox.symbol,
|
||||
signalBoxDir //
|
||||
);
|
||||
|
||||
//
|
||||
double slsMin = GetMin(sls);
|
||||
double slsMax = GetMax(sls);
|
||||
|
||||
//
|
||||
double longSL = slsMin;
|
||||
double shortSL = slsMax;
|
||||
|
||||
//
|
||||
sl = isBullish
|
||||
? longSL
|
||||
: shortSL;
|
||||
|
||||
//
|
||||
// Targets ...
|
||||
|
||||
//
|
||||
// Force Add TP 2 as Target ...
|
||||
double risk = MathAbs(entry - sl);
|
||||
double reward2 = 2 * risk;
|
||||
double iTP2 = isBullish
|
||||
? entry + reward2
|
||||
: entry - reward2;
|
||||
Add(
|
||||
iTP2,
|
||||
targets //
|
||||
);
|
||||
|
||||
//
|
||||
// Based On Priority ...
|
||||
has = priority != X121SMC_XWZ_PRIORITY_NONE;
|
||||
@@ -979,6 +1130,7 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
||||
}
|
||||
|
||||
//
|
||||
// Summarize Results ...
|
||||
result = hasPriority &&
|
||||
hasSignalBox &&
|
||||
hasRewardAmount;
|
||||
@@ -997,6 +1149,7 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
||||
);
|
||||
|
||||
//
|
||||
mConditions.sl = sl;
|
||||
mConditions.pivot = pivot;
|
||||
mConditions.point = point;
|
||||
mConditions.reward = reward;
|
||||
@@ -1032,6 +1185,10 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
//
|
||||
// Cleanup Resources ...
|
||||
|
||||
@@ -1222,42 +1379,6 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
||||
if (result)
|
||||
{
|
||||
//
|
||||
// Retrieve Entry Price ...
|
||||
double entry = GetEntry(
|
||||
conditions.symbol,
|
||||
setupDir //
|
||||
);
|
||||
|
||||
//
|
||||
// Select and Apply SL ...
|
||||
|
||||
//
|
||||
double slsMin = GetMin(conditions.sls);
|
||||
double slsMax = GetMax(conditions.sls);
|
||||
|
||||
//
|
||||
double longSL = slsMin;
|
||||
double shortSL = slsMax;
|
||||
|
||||
//
|
||||
double sl = isBullish
|
||||
? longSL
|
||||
: shortSL;
|
||||
|
||||
//
|
||||
// Add TP 2 as Target ...
|
||||
double risk = MathAbs(entry - sl);
|
||||
double reward2 = 2 * risk;
|
||||
double iTP2 = isBullish
|
||||
? entry + reward2
|
||||
: entry - reward2;
|
||||
Add(
|
||||
iTP2,
|
||||
conditions.targets //
|
||||
);
|
||||
|
||||
//
|
||||
conditions.sl = sl;
|
||||
conditions.triggerTime = cTime;
|
||||
conditions.type = isBullish
|
||||
? X_POSITION_TYPE_LONG
|
||||
|
||||
@@ -47,6 +47,9 @@ enum ENUM_X121SMC_XWZ_PRIORITY
|
||||
X121SMC_XWZ_PRIORITY_STRONG_HIGH,
|
||||
};
|
||||
|
||||
//
|
||||
// Definitions ...
|
||||
|
||||
//
|
||||
struct X121SMCStrategyXWZWorkingZone
|
||||
{
|
||||
@@ -78,6 +81,7 @@ struct X121SMCStrategyXWZWorkingZone
|
||||
XBoxZone insideBoxes[];
|
||||
XBoxZone breakedBoxes[];
|
||||
XBoxZone waitingBoxes[];
|
||||
XBoxZone breakedInsideBoxes[];
|
||||
XConsolidationZone consolidationZones[];
|
||||
|
||||
//
|
||||
@@ -85,8 +89,10 @@ struct X121SMCStrategyXWZWorkingZone
|
||||
CArrayObj mBreakedZoneObjects;
|
||||
CArrayObj mWaitingZoneObjects;
|
||||
CArrayObj mWorkingZoneObjects;
|
||||
CArrayObj mBreakedInsideZoneObjects;
|
||||
|
||||
//
|
||||
bool mUseSupDems;
|
||||
bool mUseOrderBlocks;
|
||||
bool mUseFairValueGaps;
|
||||
|
||||
@@ -134,10 +140,12 @@ struct X121SMCStrategyXWZWorkingZone
|
||||
mBreakedZoneObjects.Clear();
|
||||
mWaitingZoneObjects.Clear();
|
||||
mWorkingZoneObjects.Clear();
|
||||
mBreakedInsideZoneObjects.Clear();
|
||||
|
||||
//
|
||||
mUseSupDems = false;
|
||||
mUseOrderBlocks = true;
|
||||
mUseFairValueGaps = false;
|
||||
mUseFairValueGaps = true;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -271,6 +279,10 @@ struct X121SMCStrategyXWZWorkingZone
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
//
|
||||
// Supply Zones ...
|
||||
has = HasSupplyZones();
|
||||
@@ -581,6 +593,102 @@ struct X121SMCStrategyXWZWorkingZone
|
||||
//
|
||||
// Update Exists Zones ...
|
||||
|
||||
// //
|
||||
// // Supply Zones ...
|
||||
// has = mtfState.HasSupplyZones();
|
||||
// if (has)
|
||||
// {
|
||||
// //
|
||||
// XCSupplyZone *tmpZones[];
|
||||
// count = mtfState.FilterSupplyZones(
|
||||
// tmpZones,
|
||||
// period,
|
||||
// XZONE_STATE_PASSED,
|
||||
// false,
|
||||
// XZONE_STATE_FAILED,
|
||||
// false,
|
||||
// XZONE_STATE_FAILED,
|
||||
// false,
|
||||
// XZONE_STATE_IGNORED,
|
||||
// false //
|
||||
// );
|
||||
// has = IsValidSize(count);
|
||||
// if (has)
|
||||
// {
|
||||
// //
|
||||
// for (int i = 0; i < count; i++)
|
||||
// {
|
||||
// //
|
||||
// // Try to Validate Indexes ...
|
||||
|
||||
// //
|
||||
// XCSupplyZone *iZone = tmpZones[i];
|
||||
// has = IsSupplyExists(iZone);
|
||||
// if (!has)
|
||||
// {
|
||||
// //
|
||||
// Add(
|
||||
// iZone,
|
||||
// supplyZones //
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// //
|
||||
// Clean(tmpZones);
|
||||
// }
|
||||
|
||||
// //
|
||||
// // Demand Zones ...
|
||||
// has = mtfState.HasDemandZones();
|
||||
// if (has)
|
||||
// {
|
||||
// //
|
||||
// XCDemandZone *tmpZones[];
|
||||
// count = mtfState.FilterDemandZones(
|
||||
// tmpZones,
|
||||
// period,
|
||||
// XZONE_STATE_PASSED,
|
||||
// false,
|
||||
// XZONE_STATE_FAILED,
|
||||
// false,
|
||||
// XZONE_STATE_FAILED,
|
||||
// false,
|
||||
// XZONE_STATE_IGNORED,
|
||||
// false //
|
||||
// );
|
||||
// has = IsValidSize(count);
|
||||
// if (has)
|
||||
// {
|
||||
// //
|
||||
// for (int i = 0; i < count; i++)
|
||||
// {
|
||||
// //
|
||||
// // Try to Validate Indexes ...
|
||||
|
||||
// //
|
||||
// XCDemandZone *iZone = tmpZones[i];
|
||||
// has = IsDemandExists(iZone);
|
||||
// if (!has)
|
||||
// {
|
||||
// //
|
||||
// Add(
|
||||
// iZone,
|
||||
// demandZones //
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// //
|
||||
// Clean(tmpZones);
|
||||
// }
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
//
|
||||
// Supply Zones ...
|
||||
has = HasSupplyZones();
|
||||
@@ -1647,7 +1755,7 @@ struct X121SMCStrategyXWZWorkingZone
|
||||
{
|
||||
//
|
||||
XCBoxObject *iObj;
|
||||
bool isCreated= drawer.DrawBox(
|
||||
bool isCreated = drawer.DrawBox(
|
||||
signalBox,
|
||||
iObj //
|
||||
);
|
||||
@@ -1763,6 +1871,120 @@ struct X121SMCStrategyXWZWorkingZone
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
bool DetectOveralDirection(
|
||||
ENUM_X_DIRECTION &dir //
|
||||
)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
dir = X_DIRECTION_NONE;
|
||||
|
||||
//
|
||||
result = IsValid() &&
|
||||
HasSupplyZone() &&
|
||||
HasDemandZone();
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
XBoxZone demBox;
|
||||
XBoxZone supBox;
|
||||
result = ToBox(
|
||||
demBox,
|
||||
demandZone //
|
||||
);
|
||||
if (!result)
|
||||
{
|
||||
//
|
||||
supBox.Clean();
|
||||
demBox.Clean();
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
result = ToBox(
|
||||
supBox,
|
||||
supplyZone //
|
||||
);
|
||||
if (!result)
|
||||
{
|
||||
//
|
||||
supBox.Clean();
|
||||
demBox.Clean();
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
XOHCL supPriceOutBar;
|
||||
XOHCL demPriceOutBar;
|
||||
result = DetectBoxNearestPriceOut(
|
||||
supBox,
|
||||
supPriceOutBar,
|
||||
period //
|
||||
);
|
||||
if (!result)
|
||||
{
|
||||
//
|
||||
demBox.Clean();
|
||||
supBox.Clean();
|
||||
supPriceOutBar.Clean();
|
||||
demPriceOutBar.Clean();
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
result = DetectBoxNearestPriceOut(
|
||||
demBox,
|
||||
demPriceOutBar,
|
||||
period //
|
||||
);
|
||||
if (!result)
|
||||
{
|
||||
//
|
||||
demBox.Clean();
|
||||
supBox.Clean();
|
||||
supPriceOutBar.Clean();
|
||||
demPriceOutBar.Clean();
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Specified Direction ...
|
||||
dir =
|
||||
(supPriceOutBar.IsValid() &&
|
||||
demPriceOutBar.IsValid())
|
||||
? supPriceOutBar.time > demPriceOutBar.time
|
||||
? X_DIRECTION_BEARISH
|
||||
: demPriceOutBar.time > supPriceOutBar.time
|
||||
? X_DIRECTION_BULLISH
|
||||
: X_DIRECTION_NONE
|
||||
: X_DIRECTION_NONE;
|
||||
|
||||
//
|
||||
result = HasDirection(dir);
|
||||
|
||||
//
|
||||
// Clean Up Resources ...
|
||||
|
||||
//
|
||||
demBox.Clean();
|
||||
supBox.Clean();
|
||||
supPriceOutBar.Clean();
|
||||
demPriceOutBar.Clean();
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
bool HasInsideBox(
|
||||
XBoxZone &box //
|
||||
@@ -1868,6 +2090,199 @@ struct X121SMCStrategyXWZWorkingZone
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
bool IsExists(XBoxZone &box)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
result = box.IsValid();
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
int idx = -1;
|
||||
bool has = false;
|
||||
|
||||
//
|
||||
// Checking Index Waiting Box ...
|
||||
has = HasWaitingBoxes();
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
idx = FindIndex(
|
||||
box,
|
||||
waitingBoxes //
|
||||
);
|
||||
result = !IsValidIndex(idx);
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Checking Index Inside Boxes ...
|
||||
has = HasInsideBoxes();
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
idx = FindIndex(
|
||||
box,
|
||||
insideBoxes //
|
||||
);
|
||||
result = !IsValidIndex(idx);
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Checking Index Breaked Boxes ...
|
||||
has = HasBreakedBoxes();
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
idx = FindIndex(
|
||||
box,
|
||||
breakedBoxes //
|
||||
);
|
||||
result = !IsValidIndex(idx);
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Checking Index BreakedInside Boxes ...
|
||||
has = HasBreakedInsideBoxes();
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
idx = FindIndex(
|
||||
box,
|
||||
breakedInsideBoxes //
|
||||
);
|
||||
result = !IsValidIndex(idx);
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
bool IsSupplyExists(XCSupplyZone *zone)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
result = zone != NULL &&
|
||||
zone.IsValid();
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Converts Zone to Box ...
|
||||
XBoxZone box;
|
||||
result = ToBox(
|
||||
box,
|
||||
zone //
|
||||
);
|
||||
if (!result)
|
||||
{
|
||||
//
|
||||
box.Clean();
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Checking Index in SupplyZones ...
|
||||
int idx = FindIndex(
|
||||
zone,
|
||||
supplyZones //
|
||||
);
|
||||
result = !IsValidIndex(idx);
|
||||
if (!result)
|
||||
{
|
||||
//
|
||||
box.Clean();
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
result = IsExists(box);
|
||||
|
||||
//
|
||||
box.Clean();
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
bool IsDemandExists(XCDemandZone *zone)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
result = zone != NULL &&
|
||||
zone.IsValid();
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Converts Zone to Box ...
|
||||
XBoxZone box;
|
||||
result = ToBox(
|
||||
box,
|
||||
zone //
|
||||
);
|
||||
if (!result)
|
||||
{
|
||||
//
|
||||
box.Clean();
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Checking Index in SupplyZones ...
|
||||
int idx = FindIndex(
|
||||
zone,
|
||||
demandZones //
|
||||
);
|
||||
result = !IsValidIndex(idx);
|
||||
if (!result)
|
||||
{
|
||||
//
|
||||
box.Clean();
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
result = IsExists(box);
|
||||
|
||||
//
|
||||
box.Clean();
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
void UpdateTo(datetime value = NULL)
|
||||
{
|
||||
@@ -2486,11 +2901,22 @@ struct X121SMCStrategyXWZWorkingZone
|
||||
return ArraySize(breakedBoxes);
|
||||
}
|
||||
|
||||
//
|
||||
bool HasBreakedInsideBoxes()
|
||||
{
|
||||
return HasChild(breakedInsideBoxes);
|
||||
}
|
||||
|
||||
//
|
||||
int CountBreakedInsideBoxes()
|
||||
{
|
||||
return ArraySize(breakedInsideBoxes);
|
||||
}
|
||||
|
||||
//
|
||||
};
|
||||
|
||||
//
|
||||
// Definitions ...
|
||||
struct X121SMCStrategyXWZSignalConditions
|
||||
{
|
||||
//
|
||||
|
||||
@@ -763,38 +763,38 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
|
||||
// XTREND ...
|
||||
x121Inputs.xtrendInputs.showUpTrend = showAll || false;
|
||||
x121Inputs.xtrendInputs.showDownTrend = showAll || false;
|
||||
x121Inputs.xtrendInputs.showOnlyTrendStart = showAll || true;
|
||||
x121Inputs.xtrendInputs.showOnlyTrendStart = showAll || false;
|
||||
|
||||
//
|
||||
// XPV ...
|
||||
x121Inputs.xpvInputs.showSar = showAll || true;
|
||||
x121Inputs.xpvInputs.showPeaks = showAll || true;
|
||||
x121Inputs.xpvInputs.showVales = showAll || true;
|
||||
x121Inputs.xpvInputs.showSar = showAll || false;
|
||||
x121Inputs.xpvInputs.showPeaks = showAll || false;
|
||||
x121Inputs.xpvInputs.showVales = showAll || false;
|
||||
|
||||
//
|
||||
// XHK ...
|
||||
|
||||
//
|
||||
x121Inputs.xhkInputs.drawRawXHKCandles = showAll || true;
|
||||
x121Inputs.xhkInputs.drawSmoothedXHKCandles = showAll || true;
|
||||
x121Inputs.xhkInputs.drawRawXHKCandles = showAll || false;
|
||||
x121Inputs.xhkInputs.drawSmoothedXHKCandles = showAll || false;
|
||||
|
||||
//
|
||||
// XATR ...
|
||||
x121Inputs.xatrInputs.showATRUpper = showAll || true;
|
||||
x121Inputs.xatrInputs.showATRLower = showAll || true;
|
||||
x121Inputs.xatrInputs.showATRUpper = showAll || false;
|
||||
x121Inputs.xatrInputs.showATRLower = showAll || false;
|
||||
|
||||
//
|
||||
// XSTR ...
|
||||
x121Inputs.xstrInputs.showStr = showAll || true;
|
||||
x121Inputs.xstrInputs.showStr = showAll || false;
|
||||
x121Inputs.xstrInputs.showStrUpper = showAll || false;
|
||||
x121Inputs.xstrInputs.showStrLower = showAll || false;
|
||||
|
||||
//
|
||||
// XCHE ...
|
||||
x121Inputs.xcheInputs.showLE1 = showAll || true;
|
||||
x121Inputs.xcheInputs.showLE2 = showAll || true;
|
||||
x121Inputs.xcheInputs.showSE1 = showAll || true;
|
||||
x121Inputs.xcheInputs.showSE2 = showAll || true;
|
||||
x121Inputs.xcheInputs.showLE1 = showAll || false;
|
||||
x121Inputs.xcheInputs.showLE2 = showAll || false;
|
||||
x121Inputs.xcheInputs.showSE1 = showAll || false;
|
||||
x121Inputs.xcheInputs.showSE2 = showAll || false;
|
||||
|
||||
//
|
||||
// XDON ...
|
||||
@@ -805,15 +805,15 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
|
||||
|
||||
//
|
||||
// XVWAP ...
|
||||
x121Inputs.xvwapInputs.showVWapFast = showAll || true;
|
||||
x121Inputs.xvwapInputs.showVWapMedium = showAll || true;
|
||||
x121Inputs.xvwapInputs.showVWapSlow = showAll || true;
|
||||
x121Inputs.xvwapInputs.showVWapFast = showAll || false;
|
||||
x121Inputs.xvwapInputs.showVWapMedium = showAll || false;
|
||||
x121Inputs.xvwapInputs.showVWapSlow = showAll || false;
|
||||
|
||||
//
|
||||
// X3MA ...
|
||||
x121Inputs.x3maInputs.showX3MaFast = showAll || true;
|
||||
x121Inputs.x3maInputs.showX3MaMid = showAll || true;
|
||||
x121Inputs.x3maInputs.showX3MaSlow = showAll || true;
|
||||
x121Inputs.x3maInputs.showX3MaFast = showAll || false;
|
||||
x121Inputs.x3maInputs.showX3MaMid = showAll || false;
|
||||
x121Inputs.x3maInputs.showX3MaSlow = showAll || false;
|
||||
|
||||
//
|
||||
// Initialize Cycle Helpers ...
|
||||
|
||||
Reference in New Issue
Block a user