apply some fixe on Reversal POI Detection and Passed it ...
This commit is contained in:
@@ -1660,6 +1660,97 @@ class XCMarketPatternDetector : public XCBase
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool HasCandlestickDirection(
|
||||||
|
XOHCL &bar,
|
||||||
|
ENUM_X_DIRECTION forDir,
|
||||||
|
bool checkStarPattern = true,
|
||||||
|
bool checkPinBarPattern = true,
|
||||||
|
bool checkPiercingPattern = true,
|
||||||
|
bool checkEngulfedPattern = true,
|
||||||
|
bool checkSignalKeyBarPattern = true //
|
||||||
|
)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
bool result = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Validate ...
|
||||||
|
result = bar.IsValid() &&
|
||||||
|
HasDirection(forDir);
|
||||||
|
if (!result)
|
||||||
|
{
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
ENUM_X_DIRECTION tmpDir = X_DIRECTION_NONE;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Star ...
|
||||||
|
bool isStarPattern = false;
|
||||||
|
if (checkStarPattern)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
isStarPattern =
|
||||||
|
IsStarPattern(bar, tmpDir) &&
|
||||||
|
tmpDir == forDir;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
bool isPiercingPattern = false;
|
||||||
|
if (checkPiercingPattern)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
isPiercingPattern =
|
||||||
|
IsPiercingPattern(bar, tmpDir) &&
|
||||||
|
tmpDir == forDir;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Engulfed ...
|
||||||
|
bool isEngulfedPattern = false;
|
||||||
|
if (checkEngulfedPattern)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
isEngulfedPattern =
|
||||||
|
IsEngulfedBar(bar, tmpDir) &&
|
||||||
|
tmpDir == forDir;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// PinBar ...
|
||||||
|
bool isPinBarPattern = true;
|
||||||
|
if (checkPinBarPattern)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
isPinBarPattern =
|
||||||
|
IsPinnedBar(bar, tmpDir) &&
|
||||||
|
tmpDir == forDir;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Signal Key Bar ...
|
||||||
|
bool isSignalKeyBarPattern = false;
|
||||||
|
if (checkSignalKeyBarPattern)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
isSignalKeyBarPattern =
|
||||||
|
IsSignalKeyBarPattern(bar, tmpDir) &&
|
||||||
|
tmpDir == forDir;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
result =
|
||||||
|
isStarPattern ||
|
||||||
|
isPinBarPattern ||
|
||||||
|
isPiercingPattern ||
|
||||||
|
isEngulfedPattern ||
|
||||||
|
isSignalKeyBarPattern;
|
||||||
|
|
||||||
|
//
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Detect Order Flow ...
|
* Detect Order Flow ...
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -44,7 +44,7 @@
|
|||||||
{
|
{
|
||||||
"id": "6104db5f-95b2-401a-9efd-354b685e7a5f",
|
"id": "6104db5f-95b2-401a-9efd-354b685e7a5f",
|
||||||
"title": "Reversal POI",
|
"title": "Reversal POI",
|
||||||
"checked": false
|
"checked": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "05aaad69-af4d-4253-89a7-e46a80cae593",
|
"id": "05aaad69-af4d-4253-89a7-e46a80cae593",
|
||||||
|
|||||||
@@ -1234,7 +1234,29 @@ class XCX121XKIHelperParser : XCBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
result = IsKIWaveSwitchedToBullish(barIndex) && IsRSIOversold(barIndex);
|
// RSI oversold and turning upward ...
|
||||||
|
double rsiNow = helper.GetRSI(barIndex);
|
||||||
|
double rsiPrev = helper.GetRSI(barIndex + 1);
|
||||||
|
bool rsiFlip = (rsiNow > rsiPrev) && (rsiPrev < 30);
|
||||||
|
|
||||||
|
//
|
||||||
|
// ATR check (volatility supportive) ...
|
||||||
|
double atrNow = helper.GetATR(barIndex);
|
||||||
|
double atrPrev = helper.GetATR(barIndex + 1);
|
||||||
|
double atrMaNow = helper.GetATRSmoothed(barIndex);
|
||||||
|
double atrMaPrev = helper.GetATRSmoothed(barIndex + 1);
|
||||||
|
bool atrOk = atrNow > atrMaNow || atrNow > atrPrev || atrMaNow > atrMaPrev;
|
||||||
|
|
||||||
|
//
|
||||||
|
// MA crossover bullish ...
|
||||||
|
double maFastNow = helper.GetMAFast(barIndex);
|
||||||
|
double maSlowNow = helper.GetMASlow(barIndex);
|
||||||
|
bool maOk = maFastNow > maSlowNow;
|
||||||
|
|
||||||
|
//
|
||||||
|
result = rsiFlip && (atrOk || maOk);
|
||||||
|
|
||||||
|
//
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1256,7 +1278,29 @@ class XCX121XKIHelperParser : XCBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
result = IsKIWaveSwitchedToBearish(barIndex) && IsRSIOverbought(barIndex);
|
// RSI overbought and turning downward ...
|
||||||
|
double rsiNow = helper.GetRSI(barIndex);
|
||||||
|
double rsiPrev = helper.GetRSI(barIndex + 1);
|
||||||
|
bool rsiFlip = (rsiNow < rsiPrev) && (rsiPrev > 70);
|
||||||
|
|
||||||
|
//
|
||||||
|
// ATR check (volatility supportive) ...
|
||||||
|
double atrNow = helper.GetATR(barIndex);
|
||||||
|
double atrPrev = helper.GetATR(barIndex + 1);
|
||||||
|
double atrMaNow = helper.GetATRSmoothed(barIndex);
|
||||||
|
double atrMaPrev = helper.GetATRSmoothed(barIndex + 1);
|
||||||
|
bool atrOk = atrNow > atrMaNow || atrNow > atrPrev || atrMaNow > atrMaPrev;
|
||||||
|
|
||||||
|
//
|
||||||
|
// MA crossover bearish ...
|
||||||
|
double maFastNow = helper.GetMAFast(barIndex);
|
||||||
|
double maSlowNow = helper.GetMASlow(barIndex);
|
||||||
|
bool maOk = maFastNow < maSlowNow;
|
||||||
|
|
||||||
|
//
|
||||||
|
result = rsiFlip && (atrOk || maOk);
|
||||||
|
|
||||||
|
//
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -954,13 +954,13 @@ class XCX121XKIStrategy1Signaller : public XCX121XKIBaseSignaller
|
|||||||
IsXBullish(dir);
|
IsXBullish(dir);
|
||||||
bool isBearishReversalPOI = isReversalPOI &&
|
bool isBearishReversalPOI = isReversalPOI &&
|
||||||
IsXBearish(dir);
|
IsXBearish(dir);
|
||||||
isSafe = (isBullishReversalPOI && isSafeForBullishEntry) ||
|
isSafe = (isBullishReversalPOI && isSafeForBearishEntry) ||
|
||||||
(isBearishReversalPOI && isSafeForBearishEntry);
|
(isBearishReversalPOI && isSafeForBullishEntry);
|
||||||
if (isReversalPOI && isSafe)
|
if (isReversalPOI)
|
||||||
{
|
{
|
||||||
//
|
// //
|
||||||
Print("isReversalPOI: ", ToXString(dir));
|
// Print("isReversalPOI: ", ToXString(dir));
|
||||||
DebugBreak();
|
// DebugBreak();
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -658,10 +658,12 @@ class XCX121XKIPOIDetector : public XCMarketPatternDetector
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
DebugBreak();
|
||||||
|
|
||||||
//
|
//
|
||||||
// Add candlestick confirmation ...
|
// Add candlestick confirmation ...
|
||||||
XOHCL bar;
|
XOHCL bar;
|
||||||
ENUM_X_DIRECTION dir;
|
|
||||||
result = result &&
|
result = result &&
|
||||||
bar.Init(symbol, period, barIndex);
|
bar.Init(symbol, period, barIndex);
|
||||||
if (!result)
|
if (!result)
|
||||||
@@ -671,8 +673,10 @@ class XCX121XKIPOIDetector : public XCMarketPatternDetector
|
|||||||
|
|
||||||
//
|
//
|
||||||
result = result &&
|
result = result &&
|
||||||
IsStarPattern(bar, dir) &&
|
HasCandlestickDirection(
|
||||||
IsXBullish(dir);
|
bar,
|
||||||
|
X_DIRECTION_BULLISH //
|
||||||
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
bar.Clean();
|
bar.Clean();
|
||||||
@@ -696,10 +700,12 @@ class XCX121XKIPOIDetector : public XCMarketPatternDetector
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
DebugBreak();
|
||||||
|
|
||||||
//
|
//
|
||||||
// Add candlestick confirmation ...
|
// Add candlestick confirmation ...
|
||||||
XOHCL bar;
|
XOHCL bar;
|
||||||
ENUM_X_DIRECTION dir;
|
|
||||||
result = result &&
|
result = result &&
|
||||||
bar.Init(symbol, period, barIndex);
|
bar.Init(symbol, period, barIndex);
|
||||||
if (!result)
|
if (!result)
|
||||||
@@ -709,8 +715,10 @@ class XCX121XKIPOIDetector : public XCMarketPatternDetector
|
|||||||
|
|
||||||
//
|
//
|
||||||
result = result &&
|
result = result &&
|
||||||
IsStarPattern(bar, dir) &&
|
HasCandlestickDirection(
|
||||||
IsXBearish(dir);
|
bar,
|
||||||
|
X_DIRECTION_BEARISH //
|
||||||
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
bar.Clean();
|
bar.Clean();
|
||||||
|
|||||||
@@ -24,10 +24,10 @@ const workspacePaths = [
|
|||||||
"Helpers", // Indicator's Helpers Classes
|
"Helpers", // Indicator's Helpers Classes
|
||||||
"Indicators", // Required Indicators
|
"Indicators", // Required Indicators
|
||||||
"Libraries", // Required Libraries
|
"Libraries", // Required Libraries
|
||||||
"X121KIEA", // X121KIEA Projects ...
|
|
||||||
"XCATBEA", // XCATBEA Projects ...
|
|
||||||
"XOM1EA", // XOM1EA Projects ...
|
"XOM1EA", // XOM1EA Projects ...
|
||||||
"XFIMAEA", // XOM1EA Projects ...
|
"XFIMAEA", // XOM1EA Projects ...
|
||||||
|
"XCATBEA", // XCATBEA Projects ...
|
||||||
|
"X121XKIEA", // X121XKIEA Projects ...
|
||||||
];
|
];
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -493,5 +493,5 @@ module.exports = {
|
|||||||
cleanupWorkSpace,
|
cleanupWorkSpace,
|
||||||
compileWorkSpace,
|
compileWorkSpace,
|
||||||
prepareProject
|
prepareProject
|
||||||
}
|
};
|
||||||
//#endregion
|
//#endregion
|
||||||
Reference in New Issue
Block a user