This commit is contained in:
2025-01-30 03:12:21 +03:30
parent 5b58753ab1
commit ea90e5f6c0
3 changed files with 267 additions and 23 deletions
@@ -700,9 +700,11 @@ bool DetectX121SMCXHKPVSignalSetup(
//
double upper = 0;
double lower = 0;
bool hasYoungestOB = false;
bool isPriceOBValid = false;
bool isBullishHappens = false;
bool isBearishHappens = false;
XCOrderBlock *youngestOB = NULL;
bool hasPriceBox = conditions.priceBox.IsValid();
bool hasState = visionCycleHelper.GetCycleState(conditions.state);
@@ -730,10 +732,21 @@ bool DetectX121SMCXHKPVSignalSetup(
upper = conditions.priceOB.Upper();
lower = conditions.priceOB.Lower();
//
hasYoungestOB = conditions.state.GetYoungestOB(youngestOB);
//
// Here We Can Validate Box by Same Cycles Peaks and Vales ...
bool isBullish = IsBullish(conditions.priceBox.dir);
//
bool isPriceBoxSameAsOB =
//
conditions.priceBox.upper <= conditions.priceOB.Upper() &&
conditions.priceBox.lower >= conditions.priceOB.Lower()
//
;
//
int cIDX = 1;
@@ -760,6 +773,7 @@ bool DetectX121SMCXHKPVSignalSetup(
isPriceOBValid =
//
hasPriceBox &&
isPriceBoxSameAsOB &&
(isBullish
? isSameCycleVales
: isSameCyclePeaks)
@@ -1369,29 +1383,61 @@ bool DetectX121SMCXHKPVSignalSetup(
if (!result)
{
//
bool canReset =
//
hasPriceBox &&
conditions.isPriceOBActed &&
conditions.isPriceOBBreaked &&
//
(
//
IsBullish(conditions.priceBox.dir)
? pBar.high < lower &&
cBar.high < lower
: pBar.low > upper &&
cBar.low > upper
//
)
//
;
if (canReset)
if (hasPriceBox && hasYoungestOB)
{
//
Print("canReset");
X121SMCCycleState iState;
bool iHasState = visionCycleHelper.GetCycleState(iState);
if (iHasState)
{
//
// Retrieve Youngest Order Blocks ...
XCOrderBlock *iYOB;
bool iHasYoungestOB = iState.GetYoungestOB(iYOB);
if (iHasYoungestOB)
{
//
// Compare it with current Condition PriceOB ...
bool isSame =
//
conditions.priceOB.Upper() == iYOB.Upper() &&
conditions.priceOB.Lower() == iYOB.Lower() &&
conditions.priceOB.From() == iYOB.From() &&
conditions.priceOB.Type() == iYOB.Type()
//
;
if (!isSame)
{
conditions.Clean();
}
}
}
}
//
// bool canReset =
// //
// hasPriceBox &&
// conditions.isPriceOBActed &&
// conditions.isPriceOBBreaked &&
// //
// (
// //
// IsBullish(conditions.priceBox.dir)
// ? pBar.high < lower &&
// cBar.high < lower
// : pBar.low > upper &&
// cBar.low > upper
// //
// )
// //
// ;
// if (canReset)
// {
// //
// Print("canReset");
// }
//
// Cleanup Arrays ...
ArrayFree(triggerPoiEvents);