Last Preparation ...
This commit is contained in:
@@ -658,9 +658,6 @@ class XCX121XKIPOIDetector : public XCMarketPatternDetector
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
DebugBreak();
|
||||
|
||||
//
|
||||
// Add candlestick confirmation ...
|
||||
XOHCL bar;
|
||||
@@ -700,9 +697,6 @@ class XCX121XKIPOIDetector : public XCMarketPatternDetector
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
DebugBreak();
|
||||
|
||||
//
|
||||
// Add candlestick confirmation ...
|
||||
XOHCL bar;
|
||||
@@ -886,8 +880,9 @@ class XCX121XKIPOIDetector : public XCMarketPatternDetector
|
||||
barIndex = kiParser.NormalizeBarIndex(barIndex);
|
||||
|
||||
//
|
||||
result = kiParser.IsTrendStrongBullish(barIndex) &&
|
||||
kiParser.IsRSIOverbought(barIndex);
|
||||
bool isTrendOk = kiParser.IsTrendStrongBullish(barIndex);
|
||||
bool isRSIOk = kiParser.IsRSIOverbought(barIndex);
|
||||
result = isTrendOk && isRSIOk;
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
@@ -896,7 +891,6 @@ class XCX121XKIPOIDetector : public XCMarketPatternDetector
|
||||
//
|
||||
// Add candlestick confirmation ...
|
||||
XOHCL bar;
|
||||
ENUM_X_DIRECTION dir;
|
||||
result = result &&
|
||||
bar.Init(symbol, period, barIndex);
|
||||
if (!result)
|
||||
@@ -906,8 +900,10 @@ class XCX121XKIPOIDetector : public XCMarketPatternDetector
|
||||
|
||||
//
|
||||
result = result &&
|
||||
IsPiercingPattern(bar, dir) &&
|
||||
IsXBullish(dir);
|
||||
HasCandlestickDirection(
|
||||
bar,
|
||||
X_DIRECTION_BEARISH //
|
||||
);
|
||||
|
||||
//
|
||||
bar.Clean();
|
||||
@@ -925,8 +921,9 @@ class XCX121XKIPOIDetector : public XCMarketPatternDetector
|
||||
barIndex = kiParser.NormalizeBarIndex(barIndex);
|
||||
|
||||
//
|
||||
result = kiParser.IsTrendStrongBearish(barIndex) &&
|
||||
kiParser.IsRSIOversold(barIndex);
|
||||
bool isTrendOk = kiParser.IsTrendStrongBearish(barIndex);
|
||||
bool isRSIOk = kiParser.IsRSIOversold(barIndex);
|
||||
result = isTrendOk && isRSIOk;
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
@@ -935,7 +932,6 @@ class XCX121XKIPOIDetector : public XCMarketPatternDetector
|
||||
//
|
||||
// Add candlestick confirmation ...
|
||||
XOHCL bar;
|
||||
ENUM_X_DIRECTION dir;
|
||||
result = result &&
|
||||
bar.Init(symbol, period, barIndex);
|
||||
if (!result)
|
||||
@@ -945,8 +941,10 @@ class XCX121XKIPOIDetector : public XCMarketPatternDetector
|
||||
|
||||
//
|
||||
result = result &&
|
||||
IsPiercingPattern(bar, dir) &&
|
||||
IsXBearish(dir);
|
||||
HasCandlestickDirection(
|
||||
bar,
|
||||
X_DIRECTION_BULLISH //
|
||||
);
|
||||
|
||||
//
|
||||
bar.Clean();
|
||||
@@ -999,9 +997,33 @@ class XCX121XKIPOIDetector : public XCMarketPatternDetector
|
||||
barIndex = kiParser.NormalizeBarIndex(barIndex);
|
||||
|
||||
//
|
||||
result = kiParser.IsTrendStrongBullish(barIndex) &&
|
||||
kiParser.IsVolatilityLow(barIndex) &&
|
||||
kiParser.IsRSIOverbought(barIndex);
|
||||
// Trend was strong in last 3 bars ...
|
||||
bool isTrendOk = kiParser.IsTrendStrongBullish(barIndex + 1);
|
||||
for (int i = 1; i <= 3; i++)
|
||||
{
|
||||
//
|
||||
if (kiParser.IsTrendStrongBullish(barIndex + i))
|
||||
{
|
||||
isTrendOk = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// RSI rolling over from overbought ...
|
||||
double rsiNow = kiHelper.GetRSI(barIndex);
|
||||
double rsiPrev = kiHelper.GetRSI(barIndex + 1);
|
||||
bool rsiFlip = (rsiPrev > 70 && rsiNow < rsiPrev);
|
||||
bool isRSIOk = rsiFlip || kiParser.IsRSIOverbought(barIndex);
|
||||
|
||||
//
|
||||
bool volCooling = kiHelper.GetATR(barIndex) <= kiHelper.GetATRSmoothed(barIndex) * 1.05;
|
||||
bool isVolatilityOk = volCooling || kiParser.IsVolatilityLow(barIndex);
|
||||
|
||||
//
|
||||
result = isRSIOk &&
|
||||
isTrendOk &&
|
||||
isVolatilityOk;
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
@@ -1010,7 +1032,6 @@ class XCX121XKIPOIDetector : public XCMarketPatternDetector
|
||||
//
|
||||
// Add candlestick confirmation ...
|
||||
XOHCL bar;
|
||||
ENUM_X_DIRECTION dir;
|
||||
result = result &&
|
||||
bar.Init(symbol, period, barIndex);
|
||||
if (!result)
|
||||
@@ -1020,8 +1041,10 @@ class XCX121XKIPOIDetector : public XCMarketPatternDetector
|
||||
|
||||
//
|
||||
result = result &&
|
||||
IsPiercingPattern(bar, dir) &&
|
||||
IsXBullish(dir);
|
||||
HasCandlestickDirection(
|
||||
bar,
|
||||
X_DIRECTION_BEARISH //
|
||||
);
|
||||
|
||||
//
|
||||
bar.Clean();
|
||||
@@ -1039,9 +1062,32 @@ class XCX121XKIPOIDetector : public XCMarketPatternDetector
|
||||
barIndex = kiParser.NormalizeBarIndex(barIndex);
|
||||
|
||||
//
|
||||
result = kiParser.IsTrendStrongBearish(barIndex) &&
|
||||
kiParser.IsVolatilityLow(barIndex) &&
|
||||
kiParser.IsRSIOversold(barIndex);
|
||||
bool isTrendOk = kiParser.IsTrendStrongBearish(barIndex + 1);
|
||||
for (int i = 1; i <= 3; i++)
|
||||
{
|
||||
//
|
||||
if (kiParser.IsTrendStrongBearish(barIndex + i))
|
||||
{
|
||||
isTrendOk = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// RSI rolling over from overbought ...
|
||||
double rsiNow = kiHelper.GetRSI(barIndex);
|
||||
double rsiPrev = kiHelper.GetRSI(barIndex + 1);
|
||||
bool rsiFlip = (rsiPrev < 30 && rsiNow > rsiPrev);
|
||||
bool isRSIOk = rsiFlip || kiParser.IsRSIOversold(barIndex);
|
||||
|
||||
//
|
||||
bool volCooling = kiHelper.GetATR(barIndex) <= kiHelper.GetATRSmoothed(barIndex) * 1.05;
|
||||
bool isVolatilityOk = volCooling || kiParser.IsVolatilityLow(barIndex);
|
||||
|
||||
//
|
||||
result = isRSIOk &&
|
||||
isTrendOk &&
|
||||
isVolatilityOk;
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
@@ -1050,7 +1096,6 @@ class XCX121XKIPOIDetector : public XCMarketPatternDetector
|
||||
//
|
||||
// Add candlestick confirmation ...
|
||||
XOHCL bar;
|
||||
ENUM_X_DIRECTION dir;
|
||||
result = result &&
|
||||
bar.Init(symbol, period, barIndex);
|
||||
if (!result)
|
||||
@@ -1060,8 +1105,10 @@ class XCX121XKIPOIDetector : public XCMarketPatternDetector
|
||||
|
||||
//
|
||||
result = result &&
|
||||
IsPiercingPattern(bar, dir) &&
|
||||
IsXBearish(dir);
|
||||
HasCandlestickDirection(
|
||||
bar,
|
||||
X_DIRECTION_BULLISH //
|
||||
);
|
||||
|
||||
//
|
||||
bar.Clean();
|
||||
|
||||
Reference in New Issue
Block a user