cleanup x121 helper, apply all cleanup and buffers and conditions on helpers and try to complete x121 new helper ...
This commit is contained in:
@@ -202,14 +202,6 @@ struct X121XCHEConditions
|
||||
bool isCheSwitchedToBullish;
|
||||
bool isCheSwitchedToBearish;
|
||||
|
||||
//
|
||||
bool isClosedOverCheMin;
|
||||
bool isClosedOverCheMax;
|
||||
|
||||
//
|
||||
bool isClosedUnderCheMin;
|
||||
bool isClosedUnderCheMax;
|
||||
|
||||
//
|
||||
// Constructor ...
|
||||
X121XCHEConditions()
|
||||
@@ -281,14 +273,6 @@ struct X121XCHEConditions
|
||||
isCheSwitchedToBullish = false;
|
||||
isCheSwitchedToBearish = false;
|
||||
|
||||
//
|
||||
isClosedOverCheMin = false;
|
||||
isClosedOverCheMax = false;
|
||||
|
||||
//
|
||||
isClosedUnderCheMin = false;
|
||||
isClosedUnderCheMax = false;
|
||||
|
||||
//
|
||||
ZeroMemory(this);
|
||||
}
|
||||
@@ -309,7 +293,56 @@ struct X121XCHEConditions
|
||||
bearishScore = 0;
|
||||
|
||||
//
|
||||
// TODO: Implement if Required ...
|
||||
double score = 1;
|
||||
double minScore = 0.5;
|
||||
double highScore = 1.5;
|
||||
|
||||
//
|
||||
// XCHE ...
|
||||
|
||||
//
|
||||
if (isCheBullish)
|
||||
{
|
||||
bullishScore += score;
|
||||
}
|
||||
if (isCheSwitchedToBullish)
|
||||
{
|
||||
bullishScore += highScore;
|
||||
}
|
||||
if (isChe1Bullish &&
|
||||
!isCheBullish &&
|
||||
!isCheSwitchedToBullish)
|
||||
{
|
||||
bullishScore += minScore;
|
||||
}
|
||||
if (isChe1SwitchedToBullish &&
|
||||
!isCheBullish &&
|
||||
!isCheSwitchedToBullish)
|
||||
{
|
||||
bullishScore += minScore;
|
||||
}
|
||||
|
||||
//
|
||||
if (isCheBearish)
|
||||
{
|
||||
bearishScore += score;
|
||||
}
|
||||
if (isCheSwitchedToBearish)
|
||||
{
|
||||
bearishScore += highScore;
|
||||
}
|
||||
if (isChe1Bearish &&
|
||||
!isCheBearish &&
|
||||
!isCheSwitchedToBearish)
|
||||
{
|
||||
bearishScore += minScore;
|
||||
}
|
||||
if (isChe1SwitchedToBearish &&
|
||||
!isCheBearish &&
|
||||
!isCheSwitchedToBearish)
|
||||
{
|
||||
bearishScore += minScore;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -363,6 +396,9 @@ struct X121XCHEConditions
|
||||
//
|
||||
string conditionsStr =
|
||||
//
|
||||
"-----------------------" + separator +
|
||||
"XCHE: " + separator +
|
||||
"-----------------------" + separator +
|
||||
ToString("isChe1Bullish", isChe1Bullish, ignoreFalseConditions, separator) +
|
||||
ToString("isChe1Bearish", isChe1Bearish, ignoreFalseConditions, separator) +
|
||||
ToString("isChe1SwitchedToBullish", isChe1SwitchedToBullish, ignoreFalseConditions, separator) +
|
||||
@@ -375,10 +411,6 @@ struct X121XCHEConditions
|
||||
ToString("isCheBearish", isCheBearish, ignoreFalseConditions, separator) +
|
||||
ToString("isCheSwitchedToBullish", isCheSwitchedToBullish, ignoreFalseConditions, separator) +
|
||||
ToString("isCheSwitchedToBearish", isCheSwitchedToBearish, ignoreFalseConditions, separator) +
|
||||
ToString("isClosedOverCheMin", isClosedOverCheMin, ignoreFalseConditions, separator) +
|
||||
ToString("isClosedOverCheMax", isClosedOverCheMax, ignoreFalseConditions, separator) +
|
||||
ToString("isClosedUnderCheMin", isClosedUnderCheMin, ignoreFalseConditions, separator) +
|
||||
ToString("isClosedUnderCheMax", isClosedUnderCheMax, ignoreFalseConditions, separator) +
|
||||
//
|
||||
""
|
||||
//
|
||||
@@ -979,42 +1011,6 @@ class XCX121XCHEHelper : public XCBaseHelper
|
||||
int pIndex = cIndex + 1;
|
||||
int ppIndex = pIndex + 1;
|
||||
|
||||
//
|
||||
XOHCL zBar;
|
||||
result = zBar.Init(
|
||||
mSymbol,
|
||||
mPeriod,
|
||||
zIndex //
|
||||
);
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
XOHCL cBar;
|
||||
result = cBar.Init(
|
||||
mSymbol,
|
||||
mPeriod,
|
||||
cIndex //
|
||||
);
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
XOHCL pBar;
|
||||
result = pBar.Init(
|
||||
mSymbol,
|
||||
mPeriod,
|
||||
pIndex //
|
||||
);
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Buffers ...
|
||||
|
||||
@@ -1178,12 +1174,6 @@ class XCX121XCHEHelper : public XCBaseHelper
|
||||
double cheMin = GetMin(ches);
|
||||
double cheMax = GetMax(ches);
|
||||
|
||||
//
|
||||
bool isClosedOverCheMin = cBar.close > cheMin;
|
||||
bool isClosedOverCheMax = cBar.close > cheMax;
|
||||
bool isClosedUnderCheMin = cBar.close < cheMin;
|
||||
bool isClosedUnderCheMax = cBar.close < cheMax;
|
||||
|
||||
//
|
||||
conditions.isChe1Bullish = isChe1Bullish;
|
||||
conditions.isChe1Bearish = isChe1Bearish;
|
||||
@@ -1197,19 +1187,10 @@ class XCX121XCHEHelper : public XCBaseHelper
|
||||
conditions.isCheBearish = isCheBearish;
|
||||
conditions.isCheSwitchedToBullish = isCheSwitchedToBullish;
|
||||
conditions.isCheSwitchedToBearish = isCheSwitchedToBearish;
|
||||
conditions.isClosedOverCheMin = isClosedOverCheMin;
|
||||
conditions.isClosedOverCheMax = isClosedOverCheMax;
|
||||
conditions.isClosedUnderCheMin = isClosedUnderCheMin;
|
||||
conditions.isClosedUnderCheMax = isClosedUnderCheMax;
|
||||
|
||||
//
|
||||
Cleanup();
|
||||
|
||||
//
|
||||
zBar.Clean();
|
||||
cBar.Clean();
|
||||
pBar.Clean();
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user