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
//
)
//
@@ -1901,12 +1901,13 @@ struct X121SMCStrategyXWZWorkingZone
barIndex = 0;
}
//
result = IsValid();
if (!result)
{
return result;
}
//
// TODO: Ignor Working Zone Validation ...
// result = IsValid();
// if (!result)
// {
// return result;
// }
//
int idx = -1;
@@ -768,6 +768,9 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
x121Inputs.x3maInputs.x3maMidMALength = 50;
x121Inputs.x3maInputs.x3maSlowMALength = 200;
//
x121Inputs.xichInputs.shiftKumo = false;
//
// x121Inputs.xcheInputs.cheLength = 14;
// x121Inputs.xcheInputs.cheLoopback = 7;
@@ -796,12 +799,12 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
//
// XPV ...
x121Inputs.xpvInputs.showSar = showAll || true;
x121Inputs.xpvInputs.showPeaks = showAll || true;
x121Inputs.xpvInputs.showVales = showAll || true;
x121Inputs.xpvInputs.showSar = showAll || false;
x121Inputs.xpvInputs.showPeaks = showAll || false;
x121Inputs.xpvInputs.showVales = showAll || false;
x121Inputs.xpvInputs.showSupports = showAll || false;
x121Inputs.xpvInputs.showResistances = showAll || false;
x121Inputs.xpvInputs.showGoldenZones = showAll || true;
x121Inputs.xpvInputs.showGoldenZones = showAll || false;
//
// XHK ...
@@ -814,9 +817,9 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
// XMAS ...
//
x121Inputs.xmasInputs.showUpper = showAll || true;
x121Inputs.xmasInputs.showMid = showAll || true;
x121Inputs.xmasInputs.showLower = showAll || true;
x121Inputs.xmasInputs.showUpper = showAll || false;
x121Inputs.xmasInputs.showMid = showAll || false;
x121Inputs.xmasInputs.showLower = showAll || false;
//
// XATR ...
@@ -855,6 +858,15 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
x121Inputs.x3maInputs.showX3MaMid = showAll || false;
x121Inputs.x3maInputs.showX3MaSlow = showAll || false;
//
// XICH ...
x121Inputs.xichInputs.showTenkanSen = showAll || true;
x121Inputs.xichInputs.showKijunSen = showAll || true;
x121Inputs.xichInputs.showChikouSpan = showAll || false;
x121Inputs.xichInputs.showSenkouSpanA = showAll || true;
x121Inputs.xichInputs.showSenkouSpanB = showAll || true;
x121Inputs.xichInputs.showKumo = showAll || false;
//
// Initialize Cycle Helpers ...