last ...
This commit is contained in:
@@ -56,6 +56,8 @@ struct X121SMCStrategyXHKPVSignalConditions
|
||||
|
||||
//
|
||||
XBoxZone priceBox;
|
||||
bool isPriceOBActed;
|
||||
bool isPriceOBBreaked;
|
||||
XCOrderBlock *priceOB;
|
||||
X121SMCCycleState state;
|
||||
|
||||
@@ -181,6 +183,8 @@ struct X121SMCStrategyXHKPVSignalConditions
|
||||
state.Clean();
|
||||
priceOB = NULL;
|
||||
priceBox.Clean();
|
||||
isPriceOBActed = false;
|
||||
isPriceOBBreaked = false;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -235,9 +239,12 @@ bool DetectX121SMCXHKPVSignalSetup(
|
||||
conditions.symbol = symbol;
|
||||
conditions.period = period;
|
||||
|
||||
//
|
||||
XC121SMCCycleHelper *barCycle = triggerCycleHelper;
|
||||
|
||||
//
|
||||
XOHCL zBar;
|
||||
result = decisionCycleHelper.GetBar(
|
||||
result = barCycle.GetBar(
|
||||
zBar,
|
||||
zIndex //
|
||||
);
|
||||
@@ -248,7 +255,7 @@ bool DetectX121SMCXHKPVSignalSetup(
|
||||
|
||||
//
|
||||
XOHCL cBar;
|
||||
result = decisionCycleHelper.GetBar(
|
||||
result = barCycle.GetBar(
|
||||
cBar,
|
||||
cIndex //
|
||||
);
|
||||
@@ -259,7 +266,7 @@ bool DetectX121SMCXHKPVSignalSetup(
|
||||
|
||||
//
|
||||
XOHCL pBar;
|
||||
result = decisionCycleHelper.GetBar(
|
||||
result = barCycle.GetBar(
|
||||
pBar,
|
||||
pIndex //
|
||||
);
|
||||
@@ -691,6 +698,9 @@ bool DetectX121SMCXHKPVSignalSetup(
|
||||
// Detect Cycle State ...
|
||||
|
||||
//
|
||||
bool isPriceOBValid = false;
|
||||
bool isBullishHappens = false;
|
||||
bool isBearishHappens = false;
|
||||
bool hasPriceBox = conditions.priceBox.IsValid();
|
||||
bool hasState = visionCycleHelper.GetCycleState(conditions.state);
|
||||
|
||||
@@ -743,7 +753,7 @@ bool DetectX121SMCXHKPVSignalSetup(
|
||||
|
||||
//
|
||||
// Check Validation Conditions ...
|
||||
bool isPriceOBValid =
|
||||
isPriceOBValid =
|
||||
//
|
||||
hasPriceBox &&
|
||||
(isBullish
|
||||
@@ -751,12 +761,118 @@ bool DetectX121SMCXHKPVSignalSetup(
|
||||
: isSameCyclePeaks)
|
||||
//
|
||||
;
|
||||
if (isPriceOBValid)
|
||||
|
||||
//
|
||||
// Check Conditions ...
|
||||
|
||||
//
|
||||
X121Conditions xConditions = triggerXConditions;
|
||||
|
||||
//
|
||||
isBullishHappens =
|
||||
//
|
||||
isPriceOBValid &&
|
||||
isCBarBullishFormed &&
|
||||
conditions.priceOB.IsBullish() &&
|
||||
IsBullish(conditions.priceBox.dir) &&
|
||||
//
|
||||
(xConditions.isBreakedUpPrevSar ||
|
||||
xConditions.isBreakedUpPrevStr ||
|
||||
xConditions.isVWapMaxBreakedUp ||
|
||||
xConditions.isBreakedUpPrevCheMax ||
|
||||
xConditions.isBreakedUpPrevAtrLower) &&
|
||||
//
|
||||
(xConditions.isSarSwitchedToBullish ||
|
||||
xConditions.isStrSwitchedToBullish ||
|
||||
xConditions.isCheSwitchedToBullish ||
|
||||
xConditions.isVWapSwitchedToBullishState ||
|
||||
xConditions.isVWapSwitchedToBullishOrdered)
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
isBearishHappens =
|
||||
//
|
||||
isPriceOBValid &&
|
||||
isCBarBearishFormed &&
|
||||
conditions.priceOB.IsBearish() &&
|
||||
IsBearish(conditions.priceBox.dir) &&
|
||||
//
|
||||
(xConditions.isBreakedDownPrevSar ||
|
||||
xConditions.isBreakedDownPrevStr ||
|
||||
xConditions.isVWapMinBreakedDown ||
|
||||
xConditions.isBreakedDownPrevCheMin ||
|
||||
xConditions.isBreakedDownPrevAtrUpper) &&
|
||||
//
|
||||
(xConditions.isSarSwitchedToBearish ||
|
||||
xConditions.isStrSwitchedToBearish ||
|
||||
xConditions.isCheSwitchedToBearish ||
|
||||
xConditions.isVWapSwitchedToBearishState ||
|
||||
xConditions.isVWapSwitchedToBearishOrdered)
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
if (!conditions.isPriceOBActed)
|
||||
{
|
||||
Print("Valid Conditions ...");
|
||||
conditions.isPriceOBActed = isBullishHappens ||
|
||||
isBearishHappens;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Detect Accumulation ...
|
||||
if (conditions.isPriceOBActed)
|
||||
{
|
||||
//
|
||||
// Checking OB Breake on Side ...
|
||||
if (!conditions.isPriceOBBreaked)
|
||||
{
|
||||
//
|
||||
conditions.isPriceOBBreaked =
|
||||
conditions.priceOB.IsBullish()
|
||||
? (cBar.low < conditions.priceOB.Upper() &&
|
||||
cBar.high > conditions.priceOB.Upper() &&
|
||||
cBar.close > conditions.priceOB.Upper())
|
||||
//
|
||||
||
|
||||
//
|
||||
(pBar.high < conditions.priceOB.Upper() &&
|
||||
cBar.low > conditions.priceOB.Upper() &&
|
||||
cBar.open > conditions.priceOB.Upper())
|
||||
: (cBar.high > conditions.priceOB.Lower() &&
|
||||
cBar.low < conditions.priceOB.Lower() &&
|
||||
cBar.close < conditions.priceOB.Lower())
|
||||
//
|
||||
||
|
||||
//
|
||||
(pBar.low > conditions.priceOB.Lower() &&
|
||||
cBar.high < conditions.priceOB.Lower() &&
|
||||
cBar.open < conditions.priceOB.Lower());
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Detect Distribution ...
|
||||
bool isPriceOBUpperBrekedUp = false;
|
||||
bool isPriceOBLowerBrekedDown = false;
|
||||
if (conditions.isPriceOBBreaked)
|
||||
{
|
||||
//
|
||||
isPriceOBUpperBrekedUp = IsBarBreak(
|
||||
conditions.priceOB.Upper(),
|
||||
X_DIRECTION_BULLISH,
|
||||
cBar //
|
||||
);
|
||||
|
||||
//
|
||||
isPriceOBLowerBrekedDown = IsBarBreak(
|
||||
conditions.priceOB.Lower(),
|
||||
X_DIRECTION_BEARISH,
|
||||
cBar //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// Draw ...
|
||||
XCBaseObject *drawnObjects[];
|
||||
@@ -853,12 +969,6 @@ bool DetectX121SMCXHKPVSignalSetup(
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
if (IsValidSize(drawnObjectsCount))
|
||||
{
|
||||
Print("Drawn Objects ...");
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
@@ -866,21 +976,24 @@ bool DetectX121SMCXHKPVSignalSetup(
|
||||
//
|
||||
// Summarize Conditions ...
|
||||
|
||||
//
|
||||
X121Conditions xConditions = triggerXConditions;
|
||||
|
||||
//
|
||||
bool isCondition1Bullish =
|
||||
//
|
||||
isCBarBullishFormed &&
|
||||
//
|
||||
false
|
||||
isPriceOBUpperBrekedUp &&
|
||||
conditions.isPriceOBBreaked &&
|
||||
conditions.priceOB.IsBearish()
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isCondition1Bearish =
|
||||
//
|
||||
isCBarBearishFormed &&
|
||||
//
|
||||
false
|
||||
isPriceOBLowerBrekedDown &&
|
||||
conditions.isPriceOBBreaked &&
|
||||
conditions.priceOB.IsBullish()
|
||||
//
|
||||
;
|
||||
|
||||
@@ -901,11 +1014,18 @@ bool DetectX121SMCXHKPVSignalSetup(
|
||||
pzDir //
|
||||
);
|
||||
|
||||
//
|
||||
double longPivot = conditions.priceOB.Lower(); // triggerXConditions.valesBuffer[1];
|
||||
double shortPivot = conditions.priceOB.Upper(); // triggerXConditions.peaksBuffer[1];
|
||||
|
||||
//
|
||||
// Manipulate Conditions Point ...
|
||||
|
||||
//
|
||||
conditions.point = point;
|
||||
conditions.point =
|
||||
isCondition1Bullish
|
||||
? shortPivot
|
||||
: longPivot;
|
||||
|
||||
//
|
||||
// Manipulate Conditions Pivot ...
|
||||
@@ -913,8 +1033,8 @@ bool DetectX121SMCXHKPVSignalSetup(
|
||||
//
|
||||
conditions.pivot =
|
||||
isCondition1Bullish
|
||||
? triggerXConditions.valesBuffer[1]
|
||||
: triggerXConditions.peaksBuffer[1];
|
||||
? longPivot
|
||||
: shortPivot;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -1108,7 +1228,7 @@ bool DetectX121SMCXHKPVSignalTrigger(
|
||||
|
||||
//
|
||||
// Cycle X121Conditions ...
|
||||
X121Conditions decisionXHKPVConditions = decisionConditions.x121Conditions;
|
||||
X121Conditions decisionXConditions = decisionConditions.x121Conditions;
|
||||
|
||||
//
|
||||
// Trigger Conditions ...
|
||||
@@ -1117,22 +1237,22 @@ bool DetectX121SMCXHKPVSignalTrigger(
|
||||
// Slopes ...
|
||||
|
||||
//
|
||||
bool isRsiSlopeBullish = decisionXHKPVConditions.isRsiSlopeBullish;
|
||||
bool isStrSlopeBullish = decisionXHKPVConditions.isStrSlopeBullish;
|
||||
bool isAtrUpperSlopeBullish = decisionXHKPVConditions.isAtrUpperSlopeBullish;
|
||||
bool isAtrLowerSlopeBullish = decisionXHKPVConditions.isAtrLowerSlopeBullish;
|
||||
bool isVwapFastSlopeBullish = decisionXHKPVConditions.isVwapFastSlopeBullish;
|
||||
bool isVwapMidSlopeBullish = decisionXHKPVConditions.isVwapMidSlopeBullish;
|
||||
bool isVwapSlowSlopeBullish = decisionXHKPVConditions.isVwapSlowSlopeBullish;
|
||||
bool isRsiSlopeBullish = decisionXConditions.isRsiSlopeBullish;
|
||||
bool isStrSlopeBullish = decisionXConditions.isStrSlopeBullish;
|
||||
bool isAtrUpperSlopeBullish = decisionXConditions.isAtrUpperSlopeBullish;
|
||||
bool isAtrLowerSlopeBullish = decisionXConditions.isAtrLowerSlopeBullish;
|
||||
bool isVwapFastSlopeBullish = decisionXConditions.isVwapFastSlopeBullish;
|
||||
bool isVwapMidSlopeBullish = decisionXConditions.isVwapMidSlopeBullish;
|
||||
bool isVwapSlowSlopeBullish = decisionXConditions.isVwapSlowSlopeBullish;
|
||||
|
||||
//
|
||||
bool isRsiSlopeBearish = decisionXHKPVConditions.isRsiSlopeBearish;
|
||||
bool isStrSlopeBearish = decisionXHKPVConditions.isStrSlopeBearish;
|
||||
bool isAtrUpperSlopeBearish = decisionXHKPVConditions.isAtrUpperSlopeBearish;
|
||||
bool isAtrLowerSlopeBearish = decisionXHKPVConditions.isAtrLowerSlopeBearish;
|
||||
bool isVwapFastSlopeBearish = decisionXHKPVConditions.isVwapFastSlopeBearish;
|
||||
bool isVwapMidSlopeBearish = decisionXHKPVConditions.isVwapMidSlopeBearish;
|
||||
bool isVwapSlowSlopeBearish = decisionXHKPVConditions.isVwapSlowSlopeBearish;
|
||||
bool isRsiSlopeBearish = decisionXConditions.isRsiSlopeBearish;
|
||||
bool isStrSlopeBearish = decisionXConditions.isStrSlopeBearish;
|
||||
bool isAtrUpperSlopeBearish = decisionXConditions.isAtrUpperSlopeBearish;
|
||||
bool isAtrLowerSlopeBearish = decisionXConditions.isAtrLowerSlopeBearish;
|
||||
bool isVwapFastSlopeBearish = decisionXConditions.isVwapFastSlopeBearish;
|
||||
bool isVwapMidSlopeBearish = decisionXConditions.isVwapMidSlopeBearish;
|
||||
bool isVwapSlowSlopeBearish = decisionXConditions.isVwapSlowSlopeBearish;
|
||||
|
||||
//
|
||||
bool isSlopesBullish =
|
||||
@@ -1168,18 +1288,18 @@ bool DetectX121SMCXHKPVSignalTrigger(
|
||||
//
|
||||
isBullish =
|
||||
//
|
||||
isBullish // &&
|
||||
// isPointBreaked &&
|
||||
// isSlopesBullish
|
||||
isBullish &&
|
||||
isPointBreaked &&
|
||||
isSlopesBullish
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
isBearish =
|
||||
//
|
||||
isBearish // &&
|
||||
// isPointBreaked &&
|
||||
// isSlopesBearish
|
||||
isBearish &&
|
||||
isPointBreaked &&
|
||||
isSlopesBearish
|
||||
//
|
||||
;
|
||||
|
||||
@@ -1224,7 +1344,7 @@ bool DetectX121SMCXHKPVSignalTrigger(
|
||||
);
|
||||
|
||||
//
|
||||
double iAtr = 0; // decisionConditions.x121Conditions.atrBuffer[1];
|
||||
double iAtr = decisionConditions.x121Conditions.atrBuffer[1];
|
||||
iAtr *= 1.5;
|
||||
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user