This commit is contained in:
2025-01-27 20:58:16 +03:30
parent 692c1b786c
commit 221eb2bcb2
4 changed files with 2019 additions and 471 deletions
File diff suppressed because it is too large Load Diff
+17 -2
View File
@@ -926,7 +926,13 @@ bool DetectPriceInsideBox(
// //
if (hasPriceInsideOB) if (hasPriceInsideOB)
{ {
//
orderBlock = priceInsideOB; orderBlock = priceInsideOB;
boxDir = priceInsideOB.IsBullish()
? X_DIRECTION_BULLISH
: priceInsideOB.IsBearish()
? X_DIRECTION_BEARISH
: X_DIRECTION_NONE;
} }
// //
@@ -972,6 +978,7 @@ bool DetectPriceInsideBox(
{ {
// //
// Use Price Inside OB as Box ... // Use Price Inside OB as Box ...
box.dir = boxDir;
box.to = priceInsideOB.To(); box.to = priceInsideOB.To();
box.from = priceInsideOB.From(); box.from = priceInsideOB.From();
box.upper = priceInsideOB.Upper(); box.upper = priceInsideOB.Upper();
@@ -994,7 +1001,7 @@ bool DetectPriceInsideBox(
{ {
// //
double price = xConditions.valesBuffer[1]; double price = xConditions.valesBuffer[1];
ENUM_X_DIRECTION dir = X_DIRECTION_BULLISH; dir = X_DIRECTION_BULLISH;
// //
// Bullish FVG ... // Bullish FVG ...
@@ -1144,7 +1151,7 @@ bool DetectPriceInsideBox(
{ {
// //
double price = xConditions.peaksBuffer[1]; double price = xConditions.peaksBuffer[1];
ENUM_X_DIRECTION dir = X_DIRECTION_BEARISH; dir = X_DIRECTION_BEARISH;
// //
// Bearish FVG ... // Bearish FVG ...
@@ -1303,6 +1310,13 @@ bool DetectPriceInsideBox(
// //
XBoxZone iBox = boxes[i]; XBoxZone iBox = boxes[i];
//
// Direction ...
if (!HasDirection(box.dir) || box.dir != iBox.dir)
{
box.dir = iBox.dir;
}
// //
// Upper ... // Upper ...
if (box.upper == 0 || box.upper < iBox.upper) if (box.upper == 0 || box.upper < iBox.upper)
@@ -1336,6 +1350,7 @@ bool DetectPriceInsideBox(
{ {
// //
// Use Price Inside OB as Box ... // Use Price Inside OB as Box ...
box.dir = boxDir;
box.to = priceInsideOB.To(); box.to = priceInsideOB.To();
box.from = priceInsideOB.From(); box.from = priceInsideOB.From();
box.upper = priceInsideOB.Upper(); box.upper = priceInsideOB.Upper();
+163 -43
View File
@@ -56,6 +56,8 @@ struct X121SMCStrategyXHKPVSignalConditions
// //
XBoxZone priceBox; XBoxZone priceBox;
bool isPriceOBActed;
bool isPriceOBBreaked;
XCOrderBlock *priceOB; XCOrderBlock *priceOB;
X121SMCCycleState state; X121SMCCycleState state;
@@ -181,6 +183,8 @@ struct X121SMCStrategyXHKPVSignalConditions
state.Clean(); state.Clean();
priceOB = NULL; priceOB = NULL;
priceBox.Clean(); priceBox.Clean();
isPriceOBActed = false;
isPriceOBBreaked = false;
} }
// //
@@ -235,9 +239,12 @@ bool DetectX121SMCXHKPVSignalSetup(
conditions.symbol = symbol; conditions.symbol = symbol;
conditions.period = period; conditions.period = period;
//
XC121SMCCycleHelper *barCycle = triggerCycleHelper;
// //
XOHCL zBar; XOHCL zBar;
result = decisionCycleHelper.GetBar( result = barCycle.GetBar(
zBar, zBar,
zIndex // zIndex //
); );
@@ -248,7 +255,7 @@ bool DetectX121SMCXHKPVSignalSetup(
// //
XOHCL cBar; XOHCL cBar;
result = decisionCycleHelper.GetBar( result = barCycle.GetBar(
cBar, cBar,
cIndex // cIndex //
); );
@@ -259,7 +266,7 @@ bool DetectX121SMCXHKPVSignalSetup(
// //
XOHCL pBar; XOHCL pBar;
result = decisionCycleHelper.GetBar( result = barCycle.GetBar(
pBar, pBar,
pIndex // pIndex //
); );
@@ -691,6 +698,9 @@ bool DetectX121SMCXHKPVSignalSetup(
// Detect Cycle State ... // Detect Cycle State ...
// //
bool isPriceOBValid = false;
bool isBullishHappens = false;
bool isBearishHappens = false;
bool hasPriceBox = conditions.priceBox.IsValid(); bool hasPriceBox = conditions.priceBox.IsValid();
bool hasState = visionCycleHelper.GetCycleState(conditions.state); bool hasState = visionCycleHelper.GetCycleState(conditions.state);
@@ -743,7 +753,7 @@ bool DetectX121SMCXHKPVSignalSetup(
// //
// Check Validation Conditions ... // Check Validation Conditions ...
bool isPriceOBValid = isPriceOBValid =
// //
hasPriceBox && hasPriceBox &&
(isBullish (isBullish
@@ -751,12 +761,118 @@ bool DetectX121SMCXHKPVSignalSetup(
: isSameCyclePeaks) : 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 ... // Draw ...
XCBaseObject *drawnObjects[]; XCBaseObject *drawnObjects[];
@@ -853,12 +969,6 @@ bool DetectX121SMCXHKPVSignalSetup(
} }
} }
//
if (IsValidSize(drawnObjectsCount))
{
Print("Drawn Objects ...");
}
// //
// //
// //
@@ -866,21 +976,24 @@ bool DetectX121SMCXHKPVSignalSetup(
// //
// Summarize Conditions ... // Summarize Conditions ...
//
X121Conditions xConditions = triggerXConditions;
// //
bool isCondition1Bullish = bool isCondition1Bullish =
// //
isCBarBullishFormed && isPriceOBUpperBrekedUp &&
// conditions.isPriceOBBreaked &&
false conditions.priceOB.IsBearish()
// //
; ;
// //
bool isCondition1Bearish = bool isCondition1Bearish =
// //
isCBarBearishFormed && isPriceOBLowerBrekedDown &&
// conditions.isPriceOBBreaked &&
false conditions.priceOB.IsBullish()
// //
; ;
@@ -901,11 +1014,18 @@ bool DetectX121SMCXHKPVSignalSetup(
pzDir // pzDir //
); );
//
double longPivot = conditions.priceOB.Lower(); // triggerXConditions.valesBuffer[1];
double shortPivot = conditions.priceOB.Upper(); // triggerXConditions.peaksBuffer[1];
// //
// Manipulate Conditions Point ... // Manipulate Conditions Point ...
// //
conditions.point = point; conditions.point =
isCondition1Bullish
? shortPivot
: longPivot;
// //
// Manipulate Conditions Pivot ... // Manipulate Conditions Pivot ...
@@ -913,8 +1033,8 @@ bool DetectX121SMCXHKPVSignalSetup(
// //
conditions.pivot = conditions.pivot =
isCondition1Bullish isCondition1Bullish
? triggerXConditions.valesBuffer[1] ? longPivot
: triggerXConditions.peaksBuffer[1]; : shortPivot;
} }
// //
@@ -1108,7 +1228,7 @@ bool DetectX121SMCXHKPVSignalTrigger(
// //
// Cycle X121Conditions ... // Cycle X121Conditions ...
X121Conditions decisionXHKPVConditions = decisionConditions.x121Conditions; X121Conditions decisionXConditions = decisionConditions.x121Conditions;
// //
// Trigger Conditions ... // Trigger Conditions ...
@@ -1117,22 +1237,22 @@ bool DetectX121SMCXHKPVSignalTrigger(
// Slopes ... // Slopes ...
// //
bool isRsiSlopeBullish = decisionXHKPVConditions.isRsiSlopeBullish; bool isRsiSlopeBullish = decisionXConditions.isRsiSlopeBullish;
bool isStrSlopeBullish = decisionXHKPVConditions.isStrSlopeBullish; bool isStrSlopeBullish = decisionXConditions.isStrSlopeBullish;
bool isAtrUpperSlopeBullish = decisionXHKPVConditions.isAtrUpperSlopeBullish; bool isAtrUpperSlopeBullish = decisionXConditions.isAtrUpperSlopeBullish;
bool isAtrLowerSlopeBullish = decisionXHKPVConditions.isAtrLowerSlopeBullish; bool isAtrLowerSlopeBullish = decisionXConditions.isAtrLowerSlopeBullish;
bool isVwapFastSlopeBullish = decisionXHKPVConditions.isVwapFastSlopeBullish; bool isVwapFastSlopeBullish = decisionXConditions.isVwapFastSlopeBullish;
bool isVwapMidSlopeBullish = decisionXHKPVConditions.isVwapMidSlopeBullish; bool isVwapMidSlopeBullish = decisionXConditions.isVwapMidSlopeBullish;
bool isVwapSlowSlopeBullish = decisionXHKPVConditions.isVwapSlowSlopeBullish; bool isVwapSlowSlopeBullish = decisionXConditions.isVwapSlowSlopeBullish;
// //
bool isRsiSlopeBearish = decisionXHKPVConditions.isRsiSlopeBearish; bool isRsiSlopeBearish = decisionXConditions.isRsiSlopeBearish;
bool isStrSlopeBearish = decisionXHKPVConditions.isStrSlopeBearish; bool isStrSlopeBearish = decisionXConditions.isStrSlopeBearish;
bool isAtrUpperSlopeBearish = decisionXHKPVConditions.isAtrUpperSlopeBearish; bool isAtrUpperSlopeBearish = decisionXConditions.isAtrUpperSlopeBearish;
bool isAtrLowerSlopeBearish = decisionXHKPVConditions.isAtrLowerSlopeBearish; bool isAtrLowerSlopeBearish = decisionXConditions.isAtrLowerSlopeBearish;
bool isVwapFastSlopeBearish = decisionXHKPVConditions.isVwapFastSlopeBearish; bool isVwapFastSlopeBearish = decisionXConditions.isVwapFastSlopeBearish;
bool isVwapMidSlopeBearish = decisionXHKPVConditions.isVwapMidSlopeBearish; bool isVwapMidSlopeBearish = decisionXConditions.isVwapMidSlopeBearish;
bool isVwapSlowSlopeBearish = decisionXHKPVConditions.isVwapSlowSlopeBearish; bool isVwapSlowSlopeBearish = decisionXConditions.isVwapSlowSlopeBearish;
// //
bool isSlopesBullish = bool isSlopesBullish =
@@ -1168,18 +1288,18 @@ bool DetectX121SMCXHKPVSignalTrigger(
// //
isBullish = isBullish =
// //
isBullish // && isBullish &&
// isPointBreaked && isPointBreaked &&
// isSlopesBullish isSlopesBullish
// //
; ;
// //
isBearish = isBearish =
// //
isBearish // && isBearish &&
// isPointBreaked && isPointBreaked &&
// isSlopesBearish isSlopesBearish
// //
; ;
@@ -1224,7 +1344,7 @@ bool DetectX121SMCXHKPVSignalTrigger(
); );
// //
double iAtr = 0; // decisionConditions.x121Conditions.atrBuffer[1]; double iAtr = decisionConditions.x121Conditions.atrBuffer[1];
iAtr *= 1.5; iAtr *= 1.5;
// //
+151 -426
View File
@@ -55,8 +55,9 @@ struct X121SMCStrategyXOBPVSignalConditions
double point; double point;
// //
XCOrderBlock *bullishOBs[]; XBoxZone priceBox;
XCOrderBlock *bearishOBs[]; XCOrderBlock *priceOB;
X121SMCCycleState state;
// //
// Constructor ... // Constructor ...
@@ -177,34 +178,9 @@ struct X121SMCStrategyXOBPVSignalConditions
point = 0; point = 0;
// //
Clean(bullishOBs); state.Clean();
Clean(bearishOBs); priceOB = NULL;
priceBox.Clean();
//
}
//
int CountBullishOBs()
{
return ArraySize(bullishOBs);
}
//
bool HasBullishOBs()
{
return IsValidSize(CountBullishOBs());
}
//
int CountBearishOBs()
{
return ArraySize(bearishOBs);
}
//
bool HasBearishOBs()
{
return IsValidSize(CountBearishOBs());
} }
// //
@@ -259,9 +235,12 @@ bool DetectX121SMCXOBPVSignalSetup(
conditions.symbol = symbol; conditions.symbol = symbol;
conditions.period = period; conditions.period = period;
//
XC121SMCCycleHelper *barCycle = triggerCycleHelper;
// //
XOHCL zBar; XOHCL zBar;
result = decisionCycleHelper.GetBar( result = barCycle.GetBar(
zBar, zBar,
zIndex // zIndex //
); );
@@ -272,7 +251,7 @@ bool DetectX121SMCXOBPVSignalSetup(
// //
XOHCL cBar; XOHCL cBar;
result = decisionCycleHelper.GetBar( result = barCycle.GetBar(
cBar, cBar,
cIndex // cIndex //
); );
@@ -283,7 +262,7 @@ bool DetectX121SMCXOBPVSignalSetup(
// //
XOHCL pBar; XOHCL pBar;
result = decisionCycleHelper.GetBar( result = barCycle.GetBar(
pBar, pBar,
pIndex // pIndex //
); );
@@ -421,12 +400,12 @@ bool DetectX121SMCXOBPVSignalSetup(
// //
// Cycle X121Conditions ... // Cycle X121Conditions ...
X121Conditions triggerXOBPVConditions = triggerConditions.x121Conditions; X121Conditions triggerXConditions = triggerConditions.x121Conditions;
X121Conditions decisionXOBPVConditions = decisionConditions.x121Conditions; X121Conditions decisionXConditions = decisionConditions.x121Conditions;
X121Conditions analyseXOBPVConditions = analyseConditions.x121Conditions; X121Conditions analyseXConditions = analyseConditions.x121Conditions;
X121Conditions verificationXOBPVConditions = verificationConditions.x121Conditions; X121Conditions verificationXConditions = verificationConditions.x121Conditions;
X121Conditions consolidationXOBPVConditions = consolidationConditions.x121Conditions; X121Conditions consolidationXConditions = consolidationConditions.x121Conditions;
X121Conditions visionXOBPVConditions = visionConditions.x121Conditions; X121Conditions visionXConditions = visionConditions.x121Conditions;
// //
// Setup Conditions ... // Setup Conditions ...
@@ -712,287 +691,110 @@ bool DetectX121SMCXOBPVSignalSetup(
; ;
// //
// Detect Order Block ... // Detect Cycle State ...
// //
bool hasBullishOrderBlocks = conditions.HasBullishOBs(); bool isPriceOBValid = false;
int bullishOrderBlocksCount = conditions.CountBullishOBs(); bool hasPriceBox = conditions.priceBox.IsValid();
bool hasState = visionCycleHelper.GetCycleState(conditions.state);
// //
bool hasBearishOrderBlocks = conditions.HasBearishOBs(); // Detect Price Box if not Provided ...
int bearishOrderBlocksCount = conditions.CountBearishOBs(); if (hasState &&
!hasPriceBox)
//
bool hasOrderBlocks = hasBullishOrderBlocks &&
hasBearishOrderBlocks;
if (!hasOrderBlocks)
{ {
// //
XCOrderBlock *bullishOBs[]; hasPriceBox = DetectPriceInsideBox(
XCOrderBlock *bearishOBs[]; conditions.priceBox,
bool hasOrderBlocks = visionCycleHelper.DetectOrderBlocks( conditions.priceOB,
bullishOBs, decisionXConditions,
bearishOBs // conditions.state //
); );
//
if (!hasBullishOrderBlocks)
{
//
Copy(
bullishOBs,
conditions.bullishOBs //
);
}
//
if (!hasBearishOrderBlocks)
{
//
Copy(
bearishOBs,
conditions.bearishOBs //
);
}
//
hasBullishOrderBlocks = conditions.HasBullishOBs();
bullishOrderBlocksCount = conditions.CountBullishOBs();
//
hasBearishOrderBlocks = conditions.HasBearishOBs();
bearishOrderBlocksCount = conditions.CountBearishOBs();
} }
// //
bool hasOldestBullishOB = false; if (hasPriceBox)
bool hasYoungestBullishOB = false;
XCOrderBlock *oldestBullishOB = NULL;
XCOrderBlock *youngestBullishOB = NULL;
if (hasBullishOrderBlocks)
{ {
// //
XCZone *zones[]; // Update Price Box Date ...
bool isConverted = ToZone( conditions.priceOB.To(cTime);
conditions.bullishOBs, conditions.priceBox.to = cTime;
zones //
);
// //
int oldestIDX = GetOldest(zones); // Here We Can Validate Box by Same Cycles Peaks and Vales ...
hasOldestBullishOB = IsValidIndex(oldestIDX); bool isBullish = IsBullish(conditions.priceBox.dir);
if (hasOldestBullishOB)
{
oldestBullishOB = conditions.bullishOBs[oldestIDX];
}
// //
int youngestIDX = GetYoungest(zones); int cIDX = 1;
hasYoungestBullishOB = IsValidIndex(youngestIDX);
if (hasYoungestBullishOB)
{
youngestBullishOB = conditions.bullishOBs[youngestIDX];
}
}
//
bool hasOldestBearishOB = false;
bool hasYoungestBearishOB = false;
XCOrderBlock *oldestBearishOB = NULL;
XCOrderBlock *youngestBearishOB = NULL;
if (hasBearishOrderBlocks)
{
//
XCZone *zones[];
bool isConverted = ToZone(
conditions.bearishOBs,
zones //
);
// //
int oldestIDX = GetOldest(zones); bool isSameCyclePeaks =
hasOldestBearishOB = IsValidIndex(oldestIDX);
if (hasOldestBearishOB)
{
oldestBearishOB = conditions.bearishOBs[oldestIDX];
}
//
int youngestIDX = GetYoungest(zones);
hasYoungestBearishOB = IsValidIndex(youngestIDX);
if (hasYoungestBearishOB)
{
youngestBearishOB = conditions.bearishOBs[youngestIDX];
}
}
//
bool hasPriceInsideOB = false;
XCOrderBlock *priceInsideOB = NULL;
//
if (!hasPriceInsideOB &&
hasBullishOrderBlocks)
{
//
for (int i = 0; i < bullishOrderBlocksCount; i++)
{
// //
XCOrderBlock *iOb = conditions.bullishOBs[i]; triggerXConditions.peaksBuffer[cIDX] == decisionXConditions.peaksBuffer[cIDX] &&
decisionXConditions.peaksBuffer[cIDX] == analyseXConditions.peaksBuffer[cIDX] &&
analyseXConditions.peaksBuffer[cIDX] == verificationXConditions.peaksBuffer[cIDX]
// //
bool isInside = IsPriceInsideZone( ;
decisionXOBPVConditions.valesBuffer[1],
(XCZone *)iOb //
);
if (isInside)
{
//
hasPriceInsideOB = true;
priceInsideOB = iOb;
break;
}
}
}
//
if (!hasPriceInsideOB &&
hasBearishOrderBlocks)
{
//
for (int i = 0; i < bearishOrderBlocksCount; i++)
{
//
XCOrderBlock *iOb = conditions.bearishOBs[i];
//
bool isInside = IsPriceInsideZone(
decisionXOBPVConditions.peaksBuffer[1],
(XCZone *)iOb //
);
if (isInside)
{
//
hasPriceInsideOB = true;
priceInsideOB = iOb;
break;
}
}
}
//
XStateZones obState;
bool hasOBState = false;
XOHCL priceInsideOBBreakerBar;
if (hasPriceInsideOB)
{
//
XOHCL toBar;
XOHCL fromBar;
ENUM_X_DIRECTION forDir =
priceInsideOB.IsBullish()
? X_DIRECTION_BULLISH
: X_DIRECTION_BEARISH;
bool hasBreakerBar = HasBreakerBar(
toBar,
fromBar,
priceInsideOBBreakerBar,
forDir,
priceInsideOB.GetSymbol(),
priceInsideOB.GetPeriod(),
priceInsideOB.Upper(),
priceInsideOB.Lower(),
priceInsideOB.From(),
priceInsideOB.To() //
);
if (hasBreakerBar)
{
//
CalculateStateZones(
obState,
consolidationState,
priceInsideOB.Upper(),
priceInsideOB.Lower(),
priceInsideOBBreakerBar.time //
);
}
// //
hasOBState = obState.IsValid(); bool isSameCycleVales =
} //
triggerXConditions.valesBuffer[cIDX] == decisionXConditions.valesBuffer[cIDX] &&
decisionXConditions.valesBuffer[cIDX] == analyseXConditions.valesBuffer[cIDX] &&
analyseXConditions.valesBuffer[cIDX] == verificationXConditions.valesBuffer[cIDX]
//
;
// //
// DRAW ... // Check Validation Conditions ...
// isPriceOBValid =
//
hasPriceBox &&
(isBullish
? isSameCycleVales
: isSameCyclePeaks)
//
;
}
// // // //
// // Draw ...
// XCBaseObject *drawnObjects[]; // XCBaseObject *drawnObjects[];
// int drawnObjectsCount = visionCycleHelper.DrawCycleState(
// conditions.state,
// drawnObjects //
// );
// // // //
// if (hasBullishOrderBlocks) // if (hasPriceBox)
// { // {
// // // //
// for (int i = 0; i < bullishOrderBlocksCount; i++) // bool isBullish = IsBullish(conditions.priceBox.dir);
// color boxColor = isBullish ? clrYellow : clrOrange;
// //
// XCBoxObject *iObj;
// bool isCreated = visionCycleHelper.mPOIDrawer.CreateBox(
// conditions.priceBox,
// iObj,
// boxColor,
// 1,
// false,
// STYLE_DASHDOTDOT //
// );
// //
// if (isCreated)
// { // {
// // // //
// XCOrderBlock *iOb = conditions.bullishOBs[i]; // Add(
// (XCBaseObject *)iObj,
// // // drawnObjects //
// XCBullishOrderBlockObject *iObObj; // );
// bool isCreated = visionCycleHelper
// .mPOIDrawer
// .CreateBullishOrderBlock(
// iOb,
// iObObj //
// );
// if (isCreated)
// {
// //
// Add(
// (XCBaseObject *)iObObj,
// drawnObjects //
// );
// }
// } // }
// }
// //
// if (hasBearishOrderBlocks)
// {
// //
// for (int i = 0; i < bearishOrderBlocksCount; i++)
// {
// //
// XCOrderBlock *iOb = conditions.bearishOBs[i];
// //
// XCBearishOrderBlockObject *iObObj;
// bool isCreated = visionCycleHelper
// .mPOIDrawer
// .CreateBearishOrderBlock(
// iOb,
// iObObj //
// );
// if (isCreated)
// {
// //
// Add(
// (XCBaseObject *)iObObj,
// drawnObjects //
// );
// }
// }
// }
// //
// if (hasPriceInsideOB)
// {
// //
// bool isBullish = priceInsideOB.IsBullish();
// // // //
// bool isCreated = false; // XCBaseObject *priceOBObj = NULL;
// XCBaseObject *priceInsideOBObj = NULL;
// if (isBullish) // if (isBullish)
// { // {
// // // //
@@ -1000,16 +802,20 @@ bool DetectX121SMCXOBPVSignalSetup(
// isCreated = visionCycleHelper // isCreated = visionCycleHelper
// .mPOIDrawer // .mPOIDrawer
// .CreateBullishOrderBlock( // .CreateBullishOrderBlock(
// priceInsideOB, // conditions.priceOB,
// iObj // // iObj //
// ); // );
// //
// if (isCreated) // if (isCreated)
// { // {
// // // //
// iObj.ZoneColor(clrYellow); // iObj.ZoneWidth(2);
// iObj.ZoneColor(boxColor);
// iObj.ZoneStyle(STYLE_SOLID);
// // // //
// priceInsideOBObj = (XCBaseObject *)iObj; // priceOBObj = (XCBaseObject *)iObj;
// } // }
// } // }
// else // else
@@ -1019,16 +825,20 @@ bool DetectX121SMCXOBPVSignalSetup(
// isCreated = visionCycleHelper // isCreated = visionCycleHelper
// .mPOIDrawer // .mPOIDrawer
// .CreateBearishOrderBlock( // .CreateBearishOrderBlock(
// priceInsideOB, // conditions.priceOB,
// iObj // // iObj //
// ); // );
// //
// if (isCreated) // if (isCreated)
// { // {
// // // //
// iObj.ZoneColor(clrOrange); // iObj.ZoneWidth(2);
// iObj.ZoneColor(boxColor);
// iObj.ZoneStyle(STYLE_SOLID);
// // // //
// priceInsideOBObj = (XCBaseObject *)iObj; // priceOBObj = (XCBaseObject *)iObj;
// } // }
// } // }
@@ -1037,109 +847,17 @@ bool DetectX121SMCXOBPVSignalSetup(
// { // {
// // // //
// Add( // Add(
// priceInsideOBObj, // priceOBObj,
// drawnObjects // // drawnObjects //
// ); // );
// } // }
// } // }
//
// if (hasOldestBullishOB)
// {
// //
// XCBullishOrderBlockObject *iObj;
// bool isCreated = visionCycleHelper
// .mPOIDrawer
// .CreateBullishOrderBlock(
// oldestBullishOB,
// iObj //
// );
// if (isCreated)
// {
// }
// }
// // // //
// if (hasYoungestBullishOB) // if (IsValidSize(drawnObjectsCount))
// { // {
// //
// XCBullishOrderBlockObject *iObj;
// bool isCreated = visionCycleHelper
// .mPOIDrawer
// .CreateBullishOrderBlock(
// youngestBullishOB,
// iObj //
// );
// if (isCreated)
// {
// }
// } // }
// //
// if (hasOldestBearishOB)
// {
// //
// XCBearishOrderBlockObject *iObj;
// bool isCreated = visionCycleHelper
// .mPOIDrawer
// .CreateBearishOrderBlock(
// oldestBearishOB,
// iObj //
// );
// if (isCreated)
// {
// }
// }
// //
// if (hasYoungestBearishOB)
// {
// //
// XCBearishOrderBlockObject *iObj;
// bool isCreated = visionCycleHelper
// .mPOIDrawer
// .CreateBearishOrderBlock(
// youngestBearishOB,
// iObj //
// );
// if (isCreated)
// {
// }
// }
//
//
//
//
bool isSameCyclesPeak =
//
triggerXOBPVConditions.peaksBuffer[1] == decisionXOBPVConditions.peaksBuffer[1] &&
decisionXOBPVConditions.peaksBuffer[1] == analyseXOBPVConditions.peaksBuffer[1] &&
analyseXOBPVConditions.peaksBuffer[1] == verificationXOBPVConditions.peaksBuffer[1]
// &&
// verificationXOBPVConditions.peaksBuffer[1] == consolidationXOBPVConditions.peaksBuffer[1]
//
;
//
bool isSameCyclesVale =
//
triggerXOBPVConditions.valesBuffer[1] == decisionXOBPVConditions.valesBuffer[1] &&
decisionXOBPVConditions.valesBuffer[1] == analyseXOBPVConditions.valesBuffer[1] &&
analyseXOBPVConditions.valesBuffer[1] == verificationXOBPVConditions.valesBuffer[1]
// &&
// verificationXOBPVConditions.valesBuffer[1] == consolidationXOBPVConditions.valesBuffer[1]
//
;
//
bool hasSameCyclesPV =
// hasOBState &&
hasPriceInsideOB &&
(isSameCyclesPeak ||
isSameCyclesVale);
// //
// //
// //
@@ -1147,45 +865,50 @@ bool DetectX121SMCXOBPVSignalSetup(
// //
// Summarize Conditions ... // Summarize Conditions ...
//
X121Conditions xConditions = triggerXConditions;
// //
bool isCondition1Bullish = bool isCondition1Bullish =
// //
hasSameCyclesPV && isPriceOBValid &&
isCBarBullishFormed && isCBarBullishFormed &&
priceInsideOB.IsBullish() && conditions.priceOB.IsBullish() &&
IsBullish(conditions.priceBox.dir) &&
// //
(decisionXOBPVConditions.isBreakedUpPrevSar || (xConditions.isBreakedUpPrevSar ||
decisionXOBPVConditions.isBreakedUpPrevStr || xConditions.isBreakedUpPrevStr ||
decisionXOBPVConditions.isVWapMaxBreakedUp || xConditions.isVWapMaxBreakedUp ||
decisionXOBPVConditions.isBreakedUpPrevCheMax || xConditions.isBreakedUpPrevCheMax ||
decisionXOBPVConditions.isBreakedUpPrevAtrLower) && xConditions.isBreakedUpPrevAtrLower) &&
// //
(decisionXOBPVConditions.isSarSwitchedToBullish || (xConditions.isSarSwitchedToBullish ||
decisionXOBPVConditions.isStrSwitchedToBullish || xConditions.isStrSwitchedToBullish ||
decisionXOBPVConditions.isCheSwitchedToBullish || xConditions.isCheSwitchedToBullish ||
decisionXOBPVConditions.isVWapSwitchedToBullishState || xConditions.isVWapSwitchedToBullishState ||
decisionXOBPVConditions.isVWapSwitchedToBullishOrdered) xConditions.isVWapSwitchedToBullishOrdered)
// //
; ;
// //
bool isCondition1Bearish = bool isCondition1Bearish =
// //
hasSameCyclesPV && isPriceOBValid &&
isCBarBearishFormed && isCBarBearishFormed &&
priceInsideOB.IsBearish() && conditions.priceOB.IsBearish() &&
IsBearish(conditions.priceBox.dir) &&
// //
(decisionXOBPVConditions.isBreakedDownPrevSar || (xConditions.isBreakedDownPrevSar ||
decisionXOBPVConditions.isBreakedDownPrevStr || xConditions.isBreakedDownPrevStr ||
decisionXOBPVConditions.isVWapMinBreakedDown || xConditions.isVWapMinBreakedDown ||
decisionXOBPVConditions.isBreakedDownPrevCheMin || xConditions.isBreakedDownPrevCheMin ||
decisionXOBPVConditions.isBreakedDownPrevAtrUpper) && xConditions.isBreakedDownPrevAtrUpper) &&
// //
(decisionXOBPVConditions.isSarSwitchedToBearish || (xConditions.isSarSwitchedToBearish ||
decisionXOBPVConditions.isStrSwitchedToBearish || xConditions.isStrSwitchedToBearish ||
decisionXOBPVConditions.isCheSwitchedToBearish || xConditions.isCheSwitchedToBearish ||
decisionXOBPVConditions.isVWapSwitchedToBearishState || xConditions.isVWapSwitchedToBearishState ||
decisionXOBPVConditions.isVWapSwitchedToBearishOrdered) xConditions.isVWapSwitchedToBearishOrdered)
// //
; ;
@@ -1214,12 +937,14 @@ bool DetectX121SMCXOBPVSignalSetup(
// //
// Manipulate Conditions Pivot ... // Manipulate Conditions Pivot ...
double longPivot = triggerXConditions.valesBuffer[1]; // conditions.priceOB.Lower();
double shortPivot = triggerXConditions.peaksBuffer[1]; // conditions.priceOB.Upper();
// //
conditions.pivot = conditions.pivot =
isCondition1Bullish isCondition1Bullish
? priceInsideOB.Upper() ? longPivot
: priceInsideOB.Lower(); : shortPivot;
} }
// //
@@ -1413,7 +1138,7 @@ bool DetectX121SMCXOBPVSignalTrigger(
// //
// Cycle X121Conditions ... // Cycle X121Conditions ...
X121Conditions decisionXOBPVConditions = decisionConditions.x121Conditions; X121Conditions decisionXConditions = decisionConditions.x121Conditions;
// //
// Trigger Conditions ... // Trigger Conditions ...
@@ -1422,22 +1147,22 @@ bool DetectX121SMCXOBPVSignalTrigger(
// Slopes ... // Slopes ...
// //
bool isRsiSlopeBullish = decisionXOBPVConditions.isRsiSlopeBullish; bool isRsiSlopeBullish = decisionXConditions.isRsiSlopeBullish;
bool isStrSlopeBullish = decisionXOBPVConditions.isStrSlopeBullish; bool isStrSlopeBullish = decisionXConditions.isStrSlopeBullish;
bool isAtrUpperSlopeBullish = decisionXOBPVConditions.isAtrUpperSlopeBullish; bool isAtrUpperSlopeBullish = decisionXConditions.isAtrUpperSlopeBullish;
bool isAtrLowerSlopeBullish = decisionXOBPVConditions.isAtrLowerSlopeBullish; bool isAtrLowerSlopeBullish = decisionXConditions.isAtrLowerSlopeBullish;
bool isVwapFastSlopeBullish = decisionXOBPVConditions.isVwapFastSlopeBullish; bool isVwapFastSlopeBullish = decisionXConditions.isVwapFastSlopeBullish;
bool isVwapMidSlopeBullish = decisionXOBPVConditions.isVwapMidSlopeBullish; bool isVwapMidSlopeBullish = decisionXConditions.isVwapMidSlopeBullish;
bool isVwapSlowSlopeBullish = decisionXOBPVConditions.isVwapSlowSlopeBullish; bool isVwapSlowSlopeBullish = decisionXConditions.isVwapSlowSlopeBullish;
// //
bool isRsiSlopeBearish = decisionXOBPVConditions.isRsiSlopeBearish; bool isRsiSlopeBearish = decisionXConditions.isRsiSlopeBearish;
bool isStrSlopeBearish = decisionXOBPVConditions.isStrSlopeBearish; bool isStrSlopeBearish = decisionXConditions.isStrSlopeBearish;
bool isAtrUpperSlopeBearish = decisionXOBPVConditions.isAtrUpperSlopeBearish; bool isAtrUpperSlopeBearish = decisionXConditions.isAtrUpperSlopeBearish;
bool isAtrLowerSlopeBearish = decisionXOBPVConditions.isAtrLowerSlopeBearish; bool isAtrLowerSlopeBearish = decisionXConditions.isAtrLowerSlopeBearish;
bool isVwapFastSlopeBearish = decisionXOBPVConditions.isVwapFastSlopeBearish; bool isVwapFastSlopeBearish = decisionXConditions.isVwapFastSlopeBearish;
bool isVwapMidSlopeBearish = decisionXOBPVConditions.isVwapMidSlopeBearish; bool isVwapMidSlopeBearish = decisionXConditions.isVwapMidSlopeBearish;
bool isVwapSlowSlopeBearish = decisionXOBPVConditions.isVwapSlowSlopeBearish; bool isVwapSlowSlopeBearish = decisionXConditions.isVwapSlowSlopeBearish;
// //
bool isSlopesBullish = bool isSlopesBullish =