This commit is contained in:
2025-10-14 12:16:40 +03:30
parent 15ea43b9f3
commit cfe8734715
3 changed files with 357 additions and 9 deletions
+217
View File
@@ -3074,6 +3074,223 @@ class XCXFIMAHelper : public XCBaseHelper
return result;
}
//
// ZigZag Pivots With Liquidity ...
/**
* Check ZigZag has Lower Low by Liquidity or Not ...
*
* @param barIndex: int, Specified Bar Index ...
* @param forceBarValidation: bool, Force Bar Price based on Pivot ...
*
* @return ( bool )
*/
bool HasZigZagLowerLowByLiquidity(
int barIndex = 0,
bool forceBarValidation = false //
)
{
//
bool result = false;
//
// Normalize ...
XOHCL bar;
barIndex = NormalizeBarIndex(barIndex);
//
// Validate ...
result = IsValid() &&
bar.Init(
mSymbol,
mPeriod,
barIndex //
);
if (!result)
{
//
bar.Clean();
return result;
}
//
// Extract Pivots ...
XPivot pivots[];
int count = ExtractZigZagPivots(
pivots,
barIndex,
10,
200 //
);
//
// Validate Pivots and Nearest Pivot is Low ...
result = IsValidSize(count) &&
pivots[0].IsVale();
if (!result)
{
//
bar.Clean();
XClean(pivots);
//
return result;
}
//
// Extract Directional Pivots ...
XPivot selected[];
count = ExtractPivots(
selected,
pivots,
X_PIVOT_TYPE_VALE //
);
result = IsValidSize(count) &&
count >= 3;
if (!result)
{
//
bar.Clean();
XClean(pivots);
XClean(selected);
//
return result;
}
//
// Do Calculations ...
result =
//
// Check Pivot ...
selected[0].value < selected[1].value &&
//
// Check Liquidity ...
selected[1].value > selected[2].value &&
//
// Check Bar Place ...
(!forceBarValidation
? true
: bar.open > selected[0].value &&
bar.close > selected[0].value);
//
// Cleanup ...
bar.Clean();
XClean(pivots);
XClean(selected);
//
return result;
}
/**
* Check ZigZag has Higher High by Liquidity or Not ...
*
* @param barIndex: int, Specified Bar Index ...
* @param forceBarValidation: bool, Force Bar Price based on Pivot ...
*
* @return ( bool )
*/
bool HasZigZagHigherHighByLiquidity(
int barIndex = 0,
bool forceBarValidation = false //
)
{
//
bool result = false;
//
// Normalize ...
XOHCL bar;
barIndex = NormalizeBarIndex(barIndex);
//
// Validate ...
result = IsValid() &&
bar.Init(
mSymbol,
mPeriod,
barIndex //
);
if (!result)
{
//
bar.Clean();
return result;
}
//
// Extract Pivots ...
XPivot pivots[];
int count = ExtractZigZagPivots(
pivots,
barIndex,
10,
200 //
);
//
// Validate Pivots and Nearest Pivot is Low ...
result = IsValidSize(count) &&
pivots[0].IsPeak();
if (!result)
{
//
bar.Clean();
XClean(pivots);
//
return result;
}
//
// Extract Directional Pivots ...
XPivot selected[];
count = ExtractPivots(
selected,
pivots,
X_PIVOT_TYPE_PEAK //
);
result = IsValidSize(count) &&
count >= 3;
if (!result)
{
//
bar.Clean();
XClean(pivots);
XClean(selected);
//
return result;
}
//
// Do Calculations ...
result =
//
// Check Pivot ...
selected[0].value > selected[1].value &&
//
// Check Liquidity ...
selected[1].value < selected[2].value &&
//
// Check Bar Place ...
(!forceBarValidation
? true
: bar.open < selected[0].value &&
bar.close < selected[0].value);
//
// Cleanup ...
bar.Clean();
XClean(pivots);
XClean(selected);
//
return result;
}
//
// Extractions ...