complete consolidation Zones ...
This commit is contained in:
@@ -211,7 +211,7 @@ class XCBarAnalyser : public XCBase
|
||||
*
|
||||
* @return ( bool )
|
||||
*/
|
||||
bool FillPrice(
|
||||
int FillPrice(
|
||||
double &prices[],
|
||||
XOHCL &bar,
|
||||
int loopback = 14,
|
||||
@@ -219,7 +219,7 @@ class XCBarAnalyser : public XCBase
|
||||
)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
int result = 0;
|
||||
|
||||
//
|
||||
Clean(prices);
|
||||
@@ -228,9 +228,9 @@ class XCBarAnalyser : public XCBase
|
||||
loopback = NormalizeInt(loopback, 1);
|
||||
|
||||
//
|
||||
result = IsValid(type) &&
|
||||
bool has = IsValid(type) &&
|
||||
bar.IsValid();
|
||||
if (!result)
|
||||
if (!has)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
@@ -245,7 +245,7 @@ class XCBarAnalyser : public XCBase
|
||||
int start = -1;
|
||||
int end = -1;
|
||||
int count = -1;
|
||||
result = CalculateLoopbackData(
|
||||
has = CalculateLoopbackData(
|
||||
index,
|
||||
start,
|
||||
end,
|
||||
@@ -253,13 +253,13 @@ class XCBarAnalyser : public XCBase
|
||||
bar,
|
||||
loopback //
|
||||
);
|
||||
if (!result)
|
||||
if (!has)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
for (int i = index; i < count; i++)
|
||||
for (int i = start; i < end; i++)
|
||||
{
|
||||
//
|
||||
XOHCL iBar;
|
||||
@@ -294,9 +294,11 @@ class XCBarAnalyser : public XCBase
|
||||
}
|
||||
|
||||
//
|
||||
result = ArraySize(prices) == count;
|
||||
if (!result)
|
||||
result = ArraySize(prices);
|
||||
has = result == count;
|
||||
if (!has)
|
||||
{
|
||||
//
|
||||
Clean(prices);
|
||||
}
|
||||
|
||||
@@ -1994,19 +1996,44 @@ class XCBarAnalyser : public XCBase
|
||||
}
|
||||
|
||||
//
|
||||
// Check Bar Must Be Swing ...
|
||||
result = IsSwing(
|
||||
bar,
|
||||
dir //
|
||||
);
|
||||
XOHCL pBar;
|
||||
result = bar.GetPreviousBar(pBar);
|
||||
if (!result)
|
||||
{
|
||||
//
|
||||
pBar.Clean();
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
bool isBullish = IsBullish(dir);
|
||||
bool isBearish = IsBearish(dir);
|
||||
bool isBullish =
|
||||
//
|
||||
bar.low < pBar.low &&
|
||||
bar.GetShadows() > bar.GetBody() &&
|
||||
bar.GetLowShadow() > bar.GetBody() &&
|
||||
bar.GetLowShadow() > bar.GetHighShadow()
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
bool isBearish =
|
||||
//
|
||||
bar.high > pBar.high &&
|
||||
bar.GetShadows() > bar.GetBody() &&
|
||||
bar.GetHighShadow() > bar.GetBody() &&
|
||||
bar.GetHighShadow() > bar.GetLowShadow()
|
||||
//
|
||||
;
|
||||
|
||||
//
|
||||
result = isBullish ||
|
||||
isBearish;
|
||||
if (!result)
|
||||
{
|
||||
//
|
||||
pBar.Clean();
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Check Force Type ...
|
||||
@@ -2021,6 +2048,16 @@ class XCBarAnalyser : public XCBase
|
||||
isBearish =
|
||||
isBearish &&
|
||||
bar.IsBearish();
|
||||
|
||||
//
|
||||
result = isBullish ||
|
||||
isBearish;
|
||||
if (!result)
|
||||
{
|
||||
//
|
||||
pBar.Clean();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
@@ -2032,7 +2069,7 @@ class XCBarAnalyser : public XCBase
|
||||
HasFiboPressure(
|
||||
bar,
|
||||
X_DIRECTION_BULLISH,
|
||||
X_FIBO_LEVEL_270 //
|
||||
X_FIBO_LEVEL_236 //
|
||||
);
|
||||
|
||||
//
|
||||
@@ -2040,7 +2077,7 @@ class XCBarAnalyser : public XCBase
|
||||
HasFiboPressure(
|
||||
bar,
|
||||
X_DIRECTION_BEARISH,
|
||||
X_FIBO_LEVEL_270 //
|
||||
X_FIBO_LEVEL_236 //
|
||||
);
|
||||
|
||||
//
|
||||
@@ -2057,11 +2094,18 @@ class XCBarAnalyser : public XCBase
|
||||
//
|
||||
result = isBullish ||
|
||||
isBearish;
|
||||
if (!result)
|
||||
if (result)
|
||||
{
|
||||
dir = X_DIRECTION_NONE;
|
||||
//
|
||||
dir =
|
||||
isBullish
|
||||
? X_DIRECTION_BULLISH
|
||||
: X_DIRECTION_BEARISH;
|
||||
}
|
||||
|
||||
//
|
||||
pBar.Clean();
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
@@ -2072,15 +2116,13 @@ class XCBarAnalyser : public XCBase
|
||||
* @param bar: XOHCL instance reference, Specified Bar to Check ...
|
||||
* @param dir: ENUM_X_DIRECTION member, Specified Doji Direction ...
|
||||
* @param loopback: int, Specified Loopback ...
|
||||
* @param rangeExtendMultiplier: double, a Multiplier for Checking Price Range ...
|
||||
*
|
||||
* @return ( bool )
|
||||
*/
|
||||
bool IsMomentum(
|
||||
XOHCL &bar,
|
||||
ENUM_X_DIRECTION &dir,
|
||||
int loopback = 2,
|
||||
double rangeExtendMultiplier = 1.5 //
|
||||
int loopback = 2 //
|
||||
)
|
||||
{
|
||||
//
|
||||
@@ -2089,7 +2131,6 @@ class XCBarAnalyser : public XCBase
|
||||
//
|
||||
dir = X_DIRECTION_NONE;
|
||||
loopback = NormalizeInt(loopback, 1);
|
||||
rangeExtendMultiplier = NormalizeDouble(rangeExtendMultiplier, 1);
|
||||
|
||||
//
|
||||
result = bar.IsValid();
|
||||
|
||||
Reference in New Issue
Block a user