This commit is contained in:
2024-07-21 17:37:34 +03:30
parent 608d387a92
commit a996143dd3
11 changed files with 3160 additions and 378 deletions
+215 -1
View File
@@ -1663,6 +1663,111 @@ struct XOHCL
return result;
}
//
// Touches ...
//
bool IsBullishTouched(double price)
{
//
bool result = false;
//
result =
//
IsValid()
//
&&
//
price > 0
//
;
if (!result)
{
return result;
}
//
XOHCL pBar;
result = GetPreviousBar(pBar);
if (!result)
{
return result;
}
//
result =
//
(pBar.low <= price ||
pBar.GetDown() <= price)
//
&&
//
(pBar.high > price ||
pBar.GetUp() > price)
//
&&
//
open > price &&
low > price
//
;
//
return result;
}
//
bool IsBearishTouched(double price)
{
//
bool result = false;
//
result =
//
IsValid()
//
&&
//
price > 0
//
;
if (!result)
{
return result;
}
//
XOHCL pBar;
result = GetPreviousBar(pBar);
if (!result)
{
return result;
}
//
result =
//
(pBar.high >= price ||
pBar.GetUp() >= price)
//
&&
//
(pBar.low < price ||
pBar.GetDown() < price)
//
&&
//
open < price &&
high < price
//
;
//
return result;
}
//
// Candlestic Patterns ...
@@ -2405,6 +2510,60 @@ struct XOHCL
return result;
}
//
// Find Last Swing High ...
bool FindLastSwingHigh(XOHCL &swing)
{
//
bool result = false;
//
swing.Clean();
//
result = IsValid();
if (!result)
{
return result;
}
//
int totalBars = iBars(
symbol,
period //
);
int maxAllowed = MathMin(100, (totalBars / 100));
//
int idx = Index();
for (int i = idx; i <= idx + maxAllowed; i++)
{
//
swing.Clean();
result = swing.Init(
symbol,
period,
i //
);
if (!result)
{
//
swing.Clean();
break;
}
//
result = swing.IsSwingHigh();
if (result)
{
break;
}
}
//
return result;
}
//
// Check Swing Low ...
bool IsSwingLow()
@@ -2476,6 +2635,60 @@ struct XOHCL
return result;
}
//
// Find Last Swing Low ...
bool FindLastSwingLow(XOHCL &swing)
{
//
bool result = false;
//
swing.Clean();
//
result = IsValid();
if (!result)
{
return result;
}
//
int totalBars = iBars(
symbol,
period //
);
int maxAllowed = MathMin(100, (totalBars / 100));
//
int idx = Index();
for (int i = idx; i <= idx + maxAllowed; i++)
{
//
swing.Clean();
result = swing.Init(
symbol,
period,
i //
);
if (!result)
{
//
swing.Clean();
break;
}
//
result = swing.IsSwingLow();
if (result)
{
break;
}
}
//
return result;
}
//
// Check Bullish FVG ...
bool HasBullishFVG(
@@ -3479,7 +3692,8 @@ struct XOHCL
period,
cIDX //
);
if (!result) {
if (!result)
{
break;
}