This commit is contained in:
2025-02-01 21:49:07 +03:30
parent 606c636687
commit 959a4f417a
+195 -1
View File
@@ -55,6 +55,16 @@ struct X121SMCStrategyXOBSSignalConditions
double point; double point;
// //
// Extwnsion ...
//
datetime vOBAt;
XCOrderBlock *vOB;
bool isVOBActivated;
//
datetime cOBAt;
XCOrderBlock *cOB;
// //
// Constructor ... // Constructor ...
@@ -178,6 +188,15 @@ struct X121SMCStrategyXOBSSignalConditions
point = 0; point = 0;
// //
vOB = NULL;
cOB = NULL;
//
vOBAt = NULL;
cOBAt = NULL;
//
isVOBActivated = false;
} }
// //
@@ -414,6 +433,21 @@ bool DetectX121SMCXOBSSignalSetup(
// //
// Detect Trend ... // Detect Trend ...
//
// Vision ...
ENUM_X_DIRECTION visionTrendDir;
bool hasVisionTrend =
visionCycleHelper
.DetectMarketStructure(
visionTrendDir //
);
bool hasVisionBullishTrend =
hasVisionTrend &&
IsBullish(visionTrendDir);
bool hasVisionBearishTrend =
hasVisionTrend &&
IsBearish(visionTrendDir);
// //
// Consolidation ... // Consolidation ...
ENUM_X_DIRECTION consolidationTrendDir; ENUM_X_DIRECTION consolidationTrendDir;
@@ -692,7 +726,167 @@ bool DetectX121SMCXOBSSignalSetup(
; ;
// //
// Detect Cycle State ... // Detect OrderBlocks ...
//
bool hasVOB =
conditions.vOB != NULL &&
conditions.vOB.IsValid() &&
IsValid(conditions.vOBAt);
//
bool hasCOB =
conditions.cOB != NULL &&
conditions.cOB.IsValid() &&
IsValid(conditions.cOBAt);
//
if (!hasVOB)
{
//
int poiEvntsCount = ArraySize(visionPoiEvents);
bool hasEvent = IsValidSize(poiEvntsCount);
if (hasEvent)
{
//
bool hasNewBullOB = Contains(
X_BULLISH_ORDERBLOCK_DETECTED,
visionPoiEvents //
);
//
bool hasNewBearOB = Contains(
X_BEARISH_ORDERBLOCK_DETECTED,
visionPoiEvents //
);
//
bool hasNewOB =
hasNewBullOB ||
hasNewBearOB;
//
if (hasNewOB)
{
//
if (hasNewBullOB)
{
//
int lastIDX = visionState.CountBullishOrderBlocks() - 1;
conditions.vOB = visionState.bullishOrderBlocks[lastIDX];
}
else if (hasNewBearOB)
{
//
int lastIDX = visionState.CountBearishOrderBlocks() - 1;
conditions.vOB = visionState.bearishOrderBlocks[lastIDX];
}
//
conditions.vOBAt = cTime;
//
hasVOB =
conditions.vOB != NULL &&
conditions.vOB.IsValid() &&
IsValid(conditions.vOBAt);
}
}
else
{
//
X121SMCCycleState vState;
bool hasVState = visionCycleHelper.GetCycleState(vState);
//
bool hasYoungestOB = vState.GetYoungestOB(conditions.vOB);
if (hasYoungestOB)
{
//
conditions.vOBAt = cTime;
//
hasVOB =
conditions.vOB != NULL &&
conditions.vOB.IsValid() &&
IsValid(conditions.vOBAt);
}
}
}
//
// Update To Time ...
if (hasVOB)
{
//
conditions.vOB.To(cTime);
}
//
// Vait for Order Block Activation ...
if (hasVOB &&
!conditions.isVOBActivated)
{
//
conditions.isVOBActivated =
//
cBar.low >= conditions.vOB.Lower() &&
cBar.high <= conditions.vOB.Upper() &&
//
bid >= conditions.vOB.Lower() &&
bid <= conditions.vOB.Upper()
//
;
}
//
// Check Result ...
result = hasVOB &&
conditions.isVOBActivated;
if (!result)
{
return result;
}
//
// Check Market Trend ...
bool isTrendOveralBullish = hasVisionBullishTrend &&
hasConsolidationBullishTrend;
bool isTrendOveralBearish = hasVisionBearishTrend &&
hasConsolidationBearishTrend;
result = (isTrendOveralBullish &&
!isTrendOveralBearish) ||
(!isTrendOveralBullish &&
isTrendOveralBearish);
if (!result)
{
return result;
}
//
bool isBullishOB = conditions.vOB.IsBullish();
if (isBullishOB)
{
//
XCBullishOrderBlockObject *iObj;
bool isCreated = visionCycleHelper
.mPOIDrawer
.CreateBullishOrderBlock(
conditions.vOB,
iObj //
);
}
else
{
//
XCBearishOrderBlockObject *iObj;
bool isCreated = visionCycleHelper
.mPOIDrawer
.CreateBearishOrderBlock(
conditions.vOB,
iObj //
);
}
// //
double upper = 0; double upper = 0;