This commit is contained in:
2025-03-26 05:25:00 +03:30
parent a5511f2f69
commit 8278d132dd
10 changed files with 3686 additions and 30 deletions
@@ -3604,6 +3604,409 @@ struct X121SMCStrategyConditionParser
//
// Checking Other Conditions ...
//
// Checking Bar Based on Positions State ...
ENUM_X_DIRECTION iBarPosDir;
bool isBarValidForDir = cHelper
.mBarAnalyser
.IsValidForPosition(
cBar,
iBarPosDir //
);
bool isBarValidForBullish =
isBarValidForDir &&
IsBullish(iBarPosDir);
bool isBarValidForBearish =
isBarValidForDir &&
IsBearish(iBarPosDir);
// //
// // Continuation Bullish ...
// bool isContinuationBullish =
// //
// isBarValidForBullish &&
// cXConditions.isSarBullish &&
// cXConditions.isStrBullish &&
// cXConditions.isNewPeakOverLast
// //
// ;
// //
// // Continuation Bearish ...
// bool isContinuationBearish =
// //
// isBarValidForBearish &&
// cXConditions.isSarBearish &&
// cXConditions.isStrBearish &&
// cXConditions.isNewValeUnderLast
// //
// ;
//
XBoxZone obBox;
XBoxZone fvgBox;
XBoxZone supResBox;
XBoxZone tmpBoxes[];
bool isBullishFVGRejected = false;
bool isBearishFVGRejected = false;
bool isFVGLowerBullishRejected = false;
bool isFVGUpperBullishRejected = false;
bool isFVGLowerBearishRejected = false;
bool isFVGUpperBearishRejected = false;
has = cState.HasFairValueGaps();
if (has)
{
//
// Converts FairValueGaps to Box ...
ToBox(
cState.fairValueGaps,
tmpBoxes //
);
//
// Select FVG ...
while (HasChild(tmpBoxes))
{
//
idx = GetYoungest(tmpBoxes);
has = IsValidIndex(idx);
if (!has)
{
break;
}
//
XBoxZone iBox = tmpBoxes[idx];
ArrayRemove(
tmpBoxes,
idx,
1 //
);
//
isFVGLowerBullishRejected =
//
cBar.low < iBox.lower &&
cBar.GetDown() > iBox.lower
//
;
//
isFVGUpperBullishRejected =
//
cBar.low < iBox.upper &&
cBar.GetDown() > iBox.upper
//
;
//
isFVGLowerBearishRejected =
//
cBar.high > iBox.lower &&
cBar.GetUp() < iBox.lower
//
;
//
isFVGUpperBearishRejected =
//
cBar.high > iBox.upper &&
cBar.GetUp() < iBox.upper
//
;
//
//
//
isBullishFVGRejected =
//
iBox.IsBullish() &&
cBar.IsBullish() &&
(isFVGLowerBullishRejected
// || isFVGUpperBullishRejected
)
//
;
//
isBearishFVGRejected =
//
iBox.IsBearish() &&
cBar.IsBearish() &&
( // isFVGLowerBearishRejected ||
isFVGUpperBearishRejected)
//
;
//
has = isBullishFVGRejected ||
isBearishFVGRejected;
if (has)
{
//
iBox.to = TimeCurrent();
fvgBox = iBox;
iBox.Clean();
break;
}
//
iBox.Clean();
}
Clean(tmpBoxes);
//
// Select Order Block which FVG is Inside it ...
has = fvgBox.IsValid();
if (has)
{
//
// Converts Order Blocks to Box ...
ToBox(
cState.orderBlocks,
tmpBoxes //
);
//
// Select Order Blocks ...
has = HasChild(tmpBoxes);
if (has)
{
//
while (HasChild(tmpBoxes))
{
//
idx = GetYoungest(tmpBoxes);
has = IsValidIndex(idx);
if (!has)
{
break;
}
//
XBoxZone iBox = tmpBoxes[idx];
ArrayRemove(
tmpBoxes,
idx,
1 //
);
//
// Validate Order Blocks ...
bool isSameDir = iBox.dir == fvgBox.dir;
bool isFVGInsideOB = IsBoxInsideOr(
fvgBox,
iBox //
);
//
has =
isSameDir &&
isFVGInsideOB;
if (has)
{
//
iBox.to = TimeCurrent();
obBox = iBox;
iBox.Clean();
break;
}
//
iBox.Clean();
}
}
}
//
has = obBox.IsValid();
if (!has)
{
//
obBox.Clean();
fvgBox.Clean();
//
isBullishFVGRejected = false;
isBearishFVGRejected = false;
isFVGLowerBullishRejected = false;
isFVGUpperBullishRejected = false;
isFVGLowerBearishRejected = false;
isFVGUpperBearishRejected = false;
}
Clean(tmpBoxes);
//
// Checking Support nad Resistance ...
bool isDirBullish =
obBox.IsBullish() &&
fvgBox.IsBullish();
has =
obBox.IsValid() &&
fvgBox.IsValid();
if (has)
{
//
// Converts Support or Resistance to Boxes ...
if (isDirBullish)
{
//
ToBox(
cState.supportZones,
tmpBoxes //
);
}
else
{
//
ToBox(
cState.resistanceZones,
tmpBoxes //
);
}
//
// Selecting Support nad Resistance ...
has = HasChild(tmpBoxes);
if (has)
{
//
while (HasChild(tmpBoxes))
{
//
idx = GetYoungest(tmpBoxes);
has = IsValidIndex(idx);
if (!has)
{
break;
}
//
XBoxZone iBox = tmpBoxes[idx];
ArrayRemove(
tmpBoxes,
idx,
1 //
);
//
// Validate Support and Resistane ...
bool isDirPassed = iBox.dir == obBox.dir;
bool isPlacePassed =
IsBoxAbove(
iBox,
fvgBox //
) ||
IsBoxAbove(
fvgBox,
iBox //
) ||
IsBoxInside(
iBox,
fvgBox //
) ||
IsBoxInside(
fvgBox,
iBox //
);
has =
isDirPassed &&
isPlacePassed;
if (has)
{
//
iBox.to = TimeCurrent();
supResBox = iBox;
iBox.Clean();
break;
}
//
iBox.Clean();
}
}
//
has = obBox.IsValid() &&
fvgBox.IsValid() &&
supResBox.IsValid();
if (!has)
{
//
obBox.Clean();
fvgBox.Clean();
supResBox.Clean();
//
isBullishFVGRejected = false;
isBearishFVGRejected = false;
isFVGLowerBullishRejected = false;
isFVGUpperBullishRejected = false;
isFVGLowerBearishRejected = false;
isFVGUpperBearishRejected = false;
}
}
}
Clean(tmpBoxes);
//
// Checking OB and FVG Validation ...
has = obBox.IsValid() &&
fvgBox.IsValid() &&
supResBox.IsValid();
if (has)
{
//
// Draw OB ...
if (obBox.IsValid())
{
//
XCBoxObject *iObj;
has = drawer.DrawBox(
obBox,
iObj //
);
if (has)
{
iObj.BoxStyle(STYLE_DASH);
}
}
//
// Draw FVG ...
if (fvgBox.IsValid())
{
//
XCBoxObject *iObj;
has = drawer.DrawBox(
fvgBox,
iObj //
);
if (has)
{
iObj.BoxStyle(STYLE_SOLID);
}
}
//
// Draw Sup/Res Box ...
if (supResBox.IsValid())
{
//
XCBoxObject *iObj;
has = drawer.DrawBox(
supResBox,
iObj //
);
if (has)
{
iObj.BoxStyle(STYLE_DOT);
}
}
}
//
// Bullish Conditions ...
isBullish =
@@ -3611,7 +4014,8 @@ struct X121SMCStrategyConditionParser
// Base Condition ...
(
//
false
// false
isBullishFVGRejected
//
)
//
@@ -3624,7 +4028,8 @@ struct X121SMCStrategyConditionParser
// Base Condition ...
(
//
false
// false
isBearishFVGRejected
//
)
//