This commit is contained in:
2025-01-07 21:48:52 +03:30
parent 3d95220cc7
commit 73f39629fb
5 changed files with 1308 additions and 106 deletions
+81 -64
View File
@@ -719,13 +719,12 @@ ENUM_X_121_SMC_PROVIDERS ParseProvider(string value)
//
bool TestPOIState(
XCPOIDrawer *drawer,
ENUM_X_DIRECTION &forDir, // Test For Specified Direction ...
XFVGOrderBlock &bullishOrderBlocks[], // Bullish Order Blocks ...
XFVGOrderBlock &bearishOrderBlocks[], // Bearish Order Blocks ...
XPOIState &orderBlockState, // Order Block Detection TF POI(s) ...
XPOIState &fairValueGapState, // Fair Value Gap Detection TF POI(s) ...
XPOIState &triggerState, // Trigger TF POI(s) ...
XPOIState &decisionState, // Decision TF POI(s) ...
int barIndex = 0 // Bar Index ...
)
{
@@ -744,10 +743,9 @@ bool TestPOIState(
//
// Validate Args ...
result =
drawer != NULL &&
orderBlockState.HasChild() &&
fairValueGapState.HasChild() &&
triggerState.HasChild();
decisionState.HasChild();
if (!result)
{
return result;
@@ -771,6 +769,20 @@ bool TestPOIState(
int count = 0;
datetime cTime = TimeCurrent();
//
XOHCL jBar;
result = jBar.Init(
fairValueGapState.symbol,
fairValueGapState.period,
barIndex //
);
if (!result)
{
return result;
}
double jBarLL = jBar.FindLowest(3, MODE_LOW);
double jBarHH = jBar.FindHighest(3, MODE_HIGH);
//
// Bullish ...
int bullishOrderBlocksCount = orderBlockState.CountBullishOrderBlocks();
@@ -782,6 +794,7 @@ bool TestPOIState(
{
//
XCFVG *iFVG = NULL;
XStateZones iStateZones;
XCOrderBlock *iOb = orderBlockState.bullishOrderBlocks[i];
iOb.To(cTime);
@@ -829,13 +842,14 @@ bool TestPOIState(
//
bool isValid =
//
jFVG.IsBullish()
// &&
// jFVG.From() > iOb.From() &&
// ((jFVG.Upper() > iOb.Upper() &&
// jFVG.Lower() <= iOb.Upper()) ||
// (jFVG.Upper() <= iOb.Upper() &&
// jFVG.Lower() >= iOb.Lower()))
jFVG.IsBullish() &&
jBarLL > jFVG.Upper() &&
jBar.low > jFVG.Upper() &&
jFVG.From() >= iOb.From() &&
((jFVG.Upper() > iOb.Upper() &&
jFVG.Lower() <= iOb.Upper()) ||
(jFVG.Upper() <= iOb.Upper() &&
jFVG.Lower() >= iOb.Lower()))
//
;
if (isValid)
@@ -852,40 +866,41 @@ bool TestPOIState(
result = hasFVG;
if (!result)
{
return result;
continue;
}
// //
// double upper = MathMax(iOb.Upper(), iFVG.Upper());
// double lower = MathMin(iOb.Lower(), iFVG.Lower());
// datetime from = iFVG.From();
// //
// // Detect Price Zones ...
// // Based On Decision State ...
// bool hasStateZones = CalculateStateZones(
// iStateZones,
// decisionState,
// upper,
// lower,
// from //
// );
// result = hasStateZones;
// if (!result)
// {
// continue;
// }
//
XFVGOrderBlock iModel;
iModel.orderBlock = iOb;
iModel.fairValueGap = iFVG;
// iModel.stateZones = iStateZones;
//
AddRef(
iModel,
bullishOrderBlocks //
);
//
XCBullishOrderBlockObject *iOBObject;
bool isInited = drawer.CreateBullishOrderBlock(
iOb,
iOBObject //
);
if (isInited)
{
}
//
XCOHCLObject *iBarObj;
isInited = drawer.CreateBar(
breakerBar,
iBarObj,
cTime //
);
if (isInited)
{
}
}
}
@@ -900,6 +915,7 @@ bool TestPOIState(
{
//
XCFVG *iFVG = NULL;
XStateZones iStateZones;
XCOrderBlock *iOb = orderBlockState.bearishOrderBlocks[i];
iOb.To(cTime);
@@ -947,11 +963,14 @@ bool TestPOIState(
//
bool isValid =
//
jFVG.IsBearish()
// &&
// jFVG.From() > iOb.From() &&
// jFVG.Upper() > iOb.Lower() &&
// jFVG.Lower() <= iOb.Lower()
jFVG.IsBearish() &&
jBarHH < jFVG.Lower() &&
jBar.high < jFVG.Lower() &&
jFVG.From() >= iOb.From() &&
((jFVG.Upper() > iOb.Lower() &&
jFVG.Lower() <= iOb.Lower()) ||
(jFVG.Upper() <= iOb.Upper() &&
jFVG.Lower() >= iOb.Lower()))
//
;
if (isValid)
@@ -968,40 +987,41 @@ bool TestPOIState(
result = hasFVG;
if (!result)
{
return result;
continue;
}
//
double upper = MathMax(iOb.Upper(), iFVG.Upper());
double lower = MathMin(iOb.Lower(), iFVG.Lower());
datetime from = iFVG.From();
// //
// // Detect Price Zones ...
// // Based On Decision State ...
// bool hasStateZones = CalculateStateZones(
// iStateZones,
// decisionState,
// upper,
// lower,
// from //
// );
// result = hasStateZones;
// if (!result)
// {
// continue;
// }
//
XFVGOrderBlock iModel;
iModel.orderBlock = iOb;
iModel.fairValueGap = iFVG;
// iModel.stateZones = iStateZones;
//
AddRef(
iModel,
bullishOrderBlocks //
bearishOrderBlocks //
);
//
XCBearishOrderBlockObject *iOBObject;
bool isInited = drawer.CreateBearishOrderBlock(
iOb,
iOBObject //
);
if (isInited)
{
}
//
XCOHCLObject *iBarObj;
isInited = drawer.CreateBar(
breakerBar,
iBarObj,
cTime //
);
if (isInited)
{
}
}
}
@@ -1030,7 +1050,6 @@ bool TestPOIState(
//
bool isBullish = hasBullishOrderBlocks && !hasBearishOrderBlocks;
bool isBearish = hasBearishOrderBlocks && !hasBullishOrderBlocks;
bool isAll = hasBullishOrderBlocks && hasBearishOrderBlocks;
//
forDir =
@@ -1038,8 +1057,6 @@ bool TestPOIState(
? X_DIRECTION_BULLISH
: isBearish
? X_DIRECTION_BEARISH
: isAll
? X_DIRECTION_ALL
: X_DIRECTION_NONE;
//