This commit is contained in:
2025-04-07 18:10:34 +03:30
parent 1c6785d043
commit 5eab321741
+144 -47
View File
@@ -604,61 +604,59 @@ bool IsFVGBoxValid(
// //
bool isBullish = bool isBullish =
isBoxBullish && isBoxBullish &&
!hasBearishOrConditions // && !hasBearishOrConditions &&
// hasBullishAndConditions hasBullishOrConditions;
;
// //
bool isBearish = bool isBearish =
!isBoxBullish && !isBoxBullish &&
!hasBullishOrConditions // && !hasBullishOrConditions &&
// hasBearishAndConditions hasBearishOrConditions;
;
// //
result = isBullish || result = isBullish ||
isBearish; isBearish;
// //
if (result) // if (result)
{ // {
// // //
XCBoxObject *iBoxObj; // XCBoxObject *iBoxObj;
XCBoxObject *iInBoxObj; // XCBoxObject *iInBoxObj;
// // //
has = provider // has = provider
.verificationCycleHelper // .verificationCycleHelper
.mPOIDrawer // .mPOIDrawer
.DrawBox( // .DrawBox(
box, // box,
iBoxObj // // iBoxObj //
); // );
if (has) // if (has)
{ // {
// // //
iBoxObj.BoxWidth(2); // iBoxObj.BoxWidth(2);
iBoxObj.BoxStyle(STYLE_SOLID); // iBoxObj.BoxStyle(STYLE_SOLID);
} // }
// // //
has = provider // has = provider
.verificationCycleHelper // .verificationCycleHelper
.mPOIDrawer // .mPOIDrawer
.DrawBox( // .DrawBox(
selectedBox, // selectedBox,
iInBoxObj // // iInBoxObj //
); // );
if (has) // if (has)
{ // {
// // //
iInBoxObj.BoxWidth(2); // iInBoxObj.BoxWidth(2);
iInBoxObj.BoxStyle(STYLE_DASH); // iInBoxObj.BoxStyle(STYLE_DASH);
} // }
// // //
Print("Inside Selected Box ..."); // Print("Inside Selected Box ...");
} // }
} }
// //
@@ -801,8 +799,8 @@ bool HasXINDConditions(
// Select Waiting Box ... // Select Waiting Box ...
XBoxZone selectedBox; XBoxZone selectedBox;
bool hasSelectedBox = false; bool hasSelectedBox = false;
bool useWaitingBoxes = false; bool useWaitingBoxes = true;
bool useActivtedBoxes = false; bool useActivtedBoxes = true;
bool useBreakedBoxes = false; bool useBreakedBoxes = false;
if (useWaitingBoxes && IsValidSize(waitingBoxesCount)) if (useWaitingBoxes && IsValidSize(waitingBoxesCount))
{ {
@@ -812,6 +810,21 @@ bool HasXINDConditions(
// //
XBoxZone iBox = waitingBoxes[i]; XBoxZone iBox = waitingBoxes[i];
//
has = IsBoxPVPassed(
iBox,
cXConditions //
);
if (has)
{
//
selectedBox = iBox;
iBox.Clean();
//
break;
}
// //
iBox.Clean(); iBox.Clean();
} }
@@ -831,6 +844,21 @@ bool HasXINDConditions(
// //
XBoxZone iBox = activatedBoxes[i]; XBoxZone iBox = activatedBoxes[i];
//
has = IsBoxPVPassed(
iBox,
cXConditions //
);
if (has)
{
//
selectedBox = iBox;
iBox.Clean();
//
break;
}
// //
iBox.Clean(); iBox.Clean();
} }
@@ -890,6 +918,28 @@ bool HasXINDConditions(
// //
// //
//
// Reading Resources ...
//
double priceChange = cXConditions.priceChangeBuffer[cIDX];
double priceChangeZ = cXConditions.priceChangeBuffer[zIDX];
double priceChangeP = cXConditions.priceChangeBuffer[pIDX];
double priceChangePP = cXConditions.priceChangeBuffer[ppIDX];
//
// Generate Conditions ...
//
bool isCBarBullishPriceChangeVPattern =
priceChange > priceChangeP &&
priceChange > priceChangeZ;
//
bool isCBarBearishPriceChangeVPattern =
priceChange < priceChangeP &&
priceChange < priceChangeZ;
// //
// //
// //
@@ -900,16 +950,22 @@ bool HasXINDConditions(
// //
isBullish = isBullish =
// //
false // false
// //
hasSelectedBox &&
selectedBox.IsBullish() &&
isCBarBullishPriceChangeVPattern
// //
; ;
// //
isBearish = isBearish =
// //
false // false
// //
hasSelectedBox &&
selectedBox.IsBearish() &&
isCBarBearishPriceChangeVPattern
// //
; ;
@@ -939,7 +995,9 @@ bool HasXINDConditions(
// //
// Usually is Preffered SL ... // Usually is Preffered SL ...
double pivot = double pivot =
0; isBullish
? selectedBox.lower
: selectedBox.upper;
// //
// Usually is Current Price or Entry Price ... // Usually is Current Price or Entry Price ...
@@ -1018,4 +1076,43 @@ bool HasXINDConditions(
// //
// //
//
bool IsBoxPVPassed(
XBoxZone &box,
X121Conditions &conditions //
)
{
//
bool result = false;
//
result = box.IsValid();
if (!result)
{
return result;
}
//
double boxMid = box.lower + ((box.upper - box.lower) / 2);
//
bool isBullishPassed =
box.IsBullish() &&
conditions.valesBuffer[0] < boxMid &&
conditions.valesBuffer[0] > box.lower;
//
bool isBearishPassed =
box.IsBearish() &&
conditions.peaksBuffer[0] > boxMid &&
conditions.peaksBuffer[0] < box.upper;
//
result = isBullishPassed ||
isBearishPassed;
//
return result;
}
// //