last works on xcatb ...
This commit is contained in:
@@ -646,12 +646,45 @@ XCBarAnalyser *mBarAnalyser;
|
||||
|
||||
//
|
||||
// Temparory ...
|
||||
bool mHas = false;
|
||||
ENUM_X_DIRECTION mDir;
|
||||
bool mHasSignal = false;
|
||||
bool mIsBullish = false;
|
||||
bool mIsBearish = false;
|
||||
XDirectionShift mDirShift;
|
||||
string mTriggerBarConditions;
|
||||
|
||||
//
|
||||
// Direction Shift ...
|
||||
|
||||
//
|
||||
XDirectionShift mBullishKIChanges[];
|
||||
XDirectionShift mBearishKIChanges[];
|
||||
|
||||
//
|
||||
XDirectionShift mBullishSBChanges[];
|
||||
XDirectionShift mBearishSBChanges[];
|
||||
|
||||
//
|
||||
XDirectionShift mBullishHKSChanges[];
|
||||
XDirectionShift mBearishHKSChanges[];
|
||||
|
||||
//
|
||||
XDirectionShift mBullishSarChanges[];
|
||||
XDirectionShift mBearishSarChanges[];
|
||||
|
||||
//
|
||||
XDirectionShift mBullishTrendChanges[];
|
||||
XDirectionShift mBearishTrendChanges[];
|
||||
|
||||
//
|
||||
// Liquidities ...
|
||||
|
||||
//
|
||||
bool isLiquidity = false;
|
||||
bool isBullishLiquidity = false;
|
||||
bool isBearishLiquidity = false;
|
||||
|
||||
//
|
||||
// Trigger Bars Conditions ...
|
||||
|
||||
@@ -715,6 +748,14 @@ bool isPeakUnderLast = false;
|
||||
bool isValeOverLast = false;
|
||||
bool isValeUnderLast = false;
|
||||
|
||||
//
|
||||
bool isSamePeakOverLast = false;
|
||||
bool isSamePeakUnderLast = false;
|
||||
|
||||
//
|
||||
bool isSameValeOverLast = false;
|
||||
bool isSameValeUnderLast = false;
|
||||
|
||||
//
|
||||
bool isSamePeakGolden = false;
|
||||
bool isSamePeakGoldenP = false;
|
||||
@@ -731,6 +772,14 @@ bool isPeakGoldenUnderLast = false;
|
||||
bool isValeGoldenOverLast = false;
|
||||
bool isValeGoldenUnderLast = false;
|
||||
|
||||
//
|
||||
bool isSamePeakGoldenOverLast = false;
|
||||
bool isSamePeakGoldenUnderLast = false;
|
||||
|
||||
//
|
||||
bool isSameValeGoldenOverLast = false;
|
||||
bool isSameValeGoldenUnderLast = false;
|
||||
|
||||
//
|
||||
// XSAR ...
|
||||
|
||||
@@ -753,6 +802,14 @@ bool isBearishSarBreakedLast = false;
|
||||
//
|
||||
// XSB ...
|
||||
|
||||
//
|
||||
double mSBMax = 0;
|
||||
double mSBMin = 0;
|
||||
|
||||
//
|
||||
double mSBPMax = 0;
|
||||
double mSBPMin = 0;
|
||||
|
||||
//
|
||||
bool isSBBullish = false;
|
||||
bool isSBBullishP = false;
|
||||
@@ -772,6 +829,14 @@ bool isBearishSBBreakedLast = false;
|
||||
//
|
||||
// XHKS ...
|
||||
|
||||
//
|
||||
double mHKSMax = 0;
|
||||
double mHKSMin = 0;
|
||||
|
||||
//
|
||||
double mHKSPMax = 0;
|
||||
double mHKSPMin = 0;
|
||||
|
||||
//
|
||||
bool isHKSBullish = false;
|
||||
bool isHKSBullishP = false;
|
||||
@@ -812,6 +877,25 @@ bool isKISwitchedToBearish = false;
|
||||
bool isBullishKIBreakedLast = false;
|
||||
bool isBearishKIBreakedLast = false;
|
||||
|
||||
//
|
||||
// XTREND ...
|
||||
|
||||
//
|
||||
bool isTrendBullish = false;
|
||||
bool isTrendBullishP = false;
|
||||
|
||||
//
|
||||
bool isTrendBearish = false;
|
||||
bool isTrendBearishP = false;
|
||||
|
||||
//
|
||||
bool isTrendSwitchedToBullish = false;
|
||||
bool isTrendSwitchedToBearish = false;
|
||||
|
||||
//
|
||||
bool isBullishTrendBreakedLast = false;
|
||||
bool isBearishTrendBreakedLast = false;
|
||||
|
||||
//
|
||||
// Event Handlers ...
|
||||
|
||||
@@ -3166,6 +3250,25 @@ void PrepareMarketConditions(
|
||||
//
|
||||
// Start Preparing Conditions ...
|
||||
|
||||
//
|
||||
// Liquidities ...
|
||||
|
||||
//
|
||||
isLiquidity =
|
||||
mBarAnalyser
|
||||
.IsRejected(
|
||||
iBar,
|
||||
mDir,
|
||||
true,
|
||||
true //
|
||||
);
|
||||
isBullishLiquidity =
|
||||
isLiquidity &&
|
||||
IsBullish(mDir);
|
||||
isBearishLiquidity =
|
||||
isLiquidity &&
|
||||
IsBearish(mDir);
|
||||
|
||||
//
|
||||
// Trigger Bars Conditions ...
|
||||
|
||||
@@ -3175,7 +3278,7 @@ void PrepareMarketConditions(
|
||||
mBarAnalyser
|
||||
.IsValidForTrigger(
|
||||
iPBar,
|
||||
triggerDir,
|
||||
mDir,
|
||||
true, // Cond 1 ...
|
||||
false, // Cond 2 ...
|
||||
false, // Cond 3 ...
|
||||
@@ -3190,6 +3293,10 @@ void PrepareMarketConditions(
|
||||
isTriggerBarCond1Bearish =
|
||||
isTriggerBarCond1 &&
|
||||
IsBearish(mDir);
|
||||
if (isTriggerBarCond1)
|
||||
{
|
||||
mTriggerBarConditions += "1";
|
||||
}
|
||||
|
||||
//
|
||||
// Cond 2 ...
|
||||
@@ -3197,7 +3304,7 @@ void PrepareMarketConditions(
|
||||
mBarAnalyser
|
||||
.IsValidForTrigger(
|
||||
iPBar,
|
||||
triggerDir,
|
||||
mDir,
|
||||
false, // Cond 1 ...
|
||||
true, // Cond 2 ...
|
||||
false, // Cond 3 ...
|
||||
@@ -3212,6 +3319,10 @@ void PrepareMarketConditions(
|
||||
isTriggerBarCond2Bearish =
|
||||
isTriggerBarCond2 &&
|
||||
IsBearish(mDir);
|
||||
if (isTriggerBarCond2)
|
||||
{
|
||||
mTriggerBarConditions += ",2";
|
||||
}
|
||||
|
||||
//
|
||||
// Cond 3 ...
|
||||
@@ -3219,7 +3330,7 @@ void PrepareMarketConditions(
|
||||
mBarAnalyser
|
||||
.IsValidForTrigger(
|
||||
iPBar,
|
||||
triggerDir,
|
||||
mDir,
|
||||
false, // Cond 1 ...
|
||||
false, // Cond 2 ...
|
||||
true, // Cond 3 ...
|
||||
@@ -3234,6 +3345,10 @@ void PrepareMarketConditions(
|
||||
isTriggerBarCond3Bearish =
|
||||
isTriggerBarCond3 &&
|
||||
IsBearish(mDir);
|
||||
if (isTriggerBarCond3)
|
||||
{
|
||||
mTriggerBarConditions += ",3";
|
||||
}
|
||||
|
||||
//
|
||||
// Cond 4 ...
|
||||
@@ -3241,7 +3356,7 @@ void PrepareMarketConditions(
|
||||
mBarAnalyser
|
||||
.IsValidForTrigger(
|
||||
iPBar,
|
||||
triggerDir,
|
||||
mDir,
|
||||
false, // Cond 1 ...
|
||||
false, // Cond 2 ...
|
||||
false, // Cond 3 ...
|
||||
@@ -3256,6 +3371,10 @@ void PrepareMarketConditions(
|
||||
isTriggerBarCond4Bearish =
|
||||
isTriggerBarCond4 &&
|
||||
IsBearish(mDir);
|
||||
if (isTriggerBarCond4)
|
||||
{
|
||||
mTriggerBarConditions += ",4";
|
||||
}
|
||||
|
||||
//
|
||||
// Cond 5 ...
|
||||
@@ -3263,7 +3382,7 @@ void PrepareMarketConditions(
|
||||
mBarAnalyser
|
||||
.IsValidForTrigger(
|
||||
iPBar,
|
||||
triggerDir,
|
||||
mDir,
|
||||
false, // Cond 1 ...
|
||||
false, // Cond 2 ...
|
||||
false, // Cond 3 ...
|
||||
@@ -3278,6 +3397,10 @@ void PrepareMarketConditions(
|
||||
isTriggerBarCond5Bearish =
|
||||
isTriggerBarCond5 &&
|
||||
IsBearish(mDir);
|
||||
if (isTriggerBarCond5)
|
||||
{
|
||||
mTriggerBarConditions += ",5";
|
||||
}
|
||||
|
||||
//
|
||||
// Cond 6 ...
|
||||
@@ -3285,7 +3408,7 @@ void PrepareMarketConditions(
|
||||
mBarAnalyser
|
||||
.IsValidForTrigger(
|
||||
iPBar,
|
||||
triggerDir,
|
||||
mDir,
|
||||
false, // Cond 1 ...
|
||||
false, // Cond 2 ...
|
||||
false, // Cond 3 ...
|
||||
@@ -3300,6 +3423,10 @@ void PrepareMarketConditions(
|
||||
isTriggerBarCond6Bearish =
|
||||
isTriggerBarCond6 &&
|
||||
IsBearish(mDir);
|
||||
if (isTriggerBarCond6)
|
||||
{
|
||||
mTriggerBarConditions += ",6";
|
||||
}
|
||||
|
||||
//
|
||||
// Cond 7 ...
|
||||
@@ -3307,7 +3434,7 @@ void PrepareMarketConditions(
|
||||
mBarAnalyser
|
||||
.IsValidForTrigger(
|
||||
iPBar,
|
||||
triggerDir,
|
||||
mDir,
|
||||
false, // Cond 1 ...
|
||||
false, // Cond 2 ...
|
||||
false, // Cond 3 ...
|
||||
@@ -3322,6 +3449,10 @@ void PrepareMarketConditions(
|
||||
isTriggerBarCond7Bearish =
|
||||
isTriggerBarCond7 &&
|
||||
IsBearish(mDir);
|
||||
if (isTriggerBarCond7)
|
||||
{
|
||||
mTriggerBarConditions += ",7";
|
||||
}
|
||||
|
||||
//
|
||||
// Summarizing Trigger Bar ...
|
||||
@@ -3360,51 +3491,87 @@ void PrepareMarketConditions(
|
||||
// XPV ...
|
||||
|
||||
//
|
||||
isSamePeak = false;
|
||||
isSamePeakP = false;
|
||||
isSamePeak = peakBuffer[pIndex] == peakBuffer[p2Index];
|
||||
isSamePeakP = peakBuffer[p2Index] == peakBuffer[p3Index];
|
||||
|
||||
//
|
||||
isSameVale = false;
|
||||
isSameValeP = false;
|
||||
isSameVale = valeBuffer[pIndex] == valeBuffer[p2Index];
|
||||
isSameValeP = valeBuffer[p2Index] == valeBuffer[p3Index];
|
||||
|
||||
//
|
||||
isPeakOverLast = false;
|
||||
isPeakUnderLast = false;
|
||||
isPeakOverLast = peakBuffer[pIndex] > peakBuffer[p2Index];
|
||||
isPeakUnderLast = peakBuffer[pIndex] < peakBuffer[p2Index];
|
||||
|
||||
//
|
||||
isValeOverLast = false;
|
||||
isValeUnderLast = false;
|
||||
isValeOverLast = valeBuffer[pIndex] > valeBuffer[p2Index];
|
||||
isValeUnderLast = valeBuffer[pIndex] < valeBuffer[p2Index];
|
||||
|
||||
//
|
||||
isSamePeakGolden = false;
|
||||
isSamePeakGoldenP = false;
|
||||
isSamePeakOverLast =
|
||||
isSamePeakP &&
|
||||
isPeakOverLast;
|
||||
isSamePeakUnderLast =
|
||||
isSamePeakP &&
|
||||
isPeakUnderLast;
|
||||
|
||||
//
|
||||
isSameValeGolden = false;
|
||||
isSameValeGoldenP = false;
|
||||
isSameValeOverLast =
|
||||
isSameValeP &&
|
||||
isValeOverLast;
|
||||
isSameValeUnderLast =
|
||||
isSameValeP &&
|
||||
isValeUnderLast;
|
||||
|
||||
//
|
||||
isPeakGoldenOverLast = false;
|
||||
isPeakGoldenUnderLast = false;
|
||||
isSamePeakGolden = peakGoldenBuffer[pIndex] == peakGoldenBuffer[p2Index];
|
||||
isSamePeakGoldenP = peakGoldenBuffer[p2Index] == peakGoldenBuffer[p3Index];
|
||||
|
||||
//
|
||||
isValeGoldenOverLast = false;
|
||||
isValeGoldenUnderLast = false;
|
||||
isSameValeGolden = valeGoldenBuffer[pIndex] == valeGoldenBuffer[p2Index];
|
||||
isSameValeGoldenP = valeGoldenBuffer[p2Index] == valeGoldenBuffer[p3Index];
|
||||
|
||||
//
|
||||
isPeakGoldenOverLast = peakGoldenBuffer[pIndex] > peakGoldenBuffer[p2Index];
|
||||
isPeakGoldenUnderLast = peakGoldenBuffer[pIndex] < peakGoldenBuffer[p2Index];
|
||||
|
||||
//
|
||||
isValeGoldenOverLast = valeGoldenBuffer[pIndex] > valeGoldenBuffer[p2Index];
|
||||
isValeGoldenUnderLast = valeGoldenBuffer[pIndex] < valeGoldenBuffer[p2Index];
|
||||
|
||||
//
|
||||
isSamePeakGoldenOverLast =
|
||||
isSamePeakGoldenP &&
|
||||
isPeakGoldenOverLast;
|
||||
isSamePeakGoldenUnderLast =
|
||||
isSamePeakGoldenP &&
|
||||
isPeakGoldenUnderLast;
|
||||
|
||||
//
|
||||
isSameValeGoldenOverLast =
|
||||
isSameValeGoldenP &&
|
||||
isValeGoldenOverLast;
|
||||
isSameValeGoldenUnderLast =
|
||||
isSameValeGoldenP &&
|
||||
isSameValeGoldenUnderLast;
|
||||
|
||||
//
|
||||
// XSAR ...
|
||||
|
||||
//
|
||||
isSarBullish = false;
|
||||
isSarBullishP = false;
|
||||
isSarBullish = sarStateBuffer[pIndex] > 0;
|
||||
isSarBullishP = sarStateBuffer[p2Index] > 0;
|
||||
|
||||
//
|
||||
isSarBearish = false;
|
||||
isSarBearishP = false;
|
||||
isSarBearish = sarStateBuffer[pIndex] < 0;
|
||||
isSarBearishP = sarStateBuffer[p2Index] < 0;
|
||||
|
||||
//
|
||||
isSarSwitchedToBullish = false;
|
||||
isSarSwitchedToBearish = false;
|
||||
isSarSwitchedToBullish =
|
||||
isSarBullish &&
|
||||
!isSarBullishP;
|
||||
isSarSwitchedToBearish =
|
||||
isSarBearish &&
|
||||
!isSarBearishP;
|
||||
|
||||
//
|
||||
isBullishSarBreakedLast = false;
|
||||
@@ -3414,70 +3581,516 @@ void PrepareMarketConditions(
|
||||
// XSB ...
|
||||
|
||||
//
|
||||
isSBBullish = false;
|
||||
isSBBullishP = false;
|
||||
isSBBullish = sBarCloseBuffer[pIndex] > sBarOpenBuffer[pIndex];
|
||||
isSBBullishP = sBarCloseBuffer[p2Index] > sBarOpenBuffer[p2Index];
|
||||
|
||||
//
|
||||
isSBBearish = false;
|
||||
isSBBearishP = false;
|
||||
isSBBearish = sBarCloseBuffer[pIndex] < sBarOpenBuffer[pIndex];
|
||||
isSBBearishP = sBarCloseBuffer[p2Index] < sBarOpenBuffer[p2Index];
|
||||
|
||||
//
|
||||
isSBSwitchedToBullish = false;
|
||||
isSBSwitchedToBearish = false;
|
||||
isSBSwitchedToBullish =
|
||||
isSBBullish &&
|
||||
!isSBBullishP;
|
||||
isSBSwitchedToBearish =
|
||||
isSBBearish &&
|
||||
!isSBBearishP;
|
||||
|
||||
//
|
||||
isBullishSBBreakedLast = false;
|
||||
isBearishSBBreakedLast = false;
|
||||
|
||||
//
|
||||
mSBMin = MathMin(sBarCloseBuffer[pIndex], sBarOpenBuffer[pIndex]);
|
||||
mSBMax = MathMax(sBarCloseBuffer[pIndex], sBarOpenBuffer[pIndex]);
|
||||
|
||||
//
|
||||
mSBPMin = MathMin(sBarCloseBuffer[p2Index], sBarOpenBuffer[p2Index]);
|
||||
mSBPMax = MathMax(sBarCloseBuffer[p2Index], sBarOpenBuffer[p2Index]);
|
||||
|
||||
//
|
||||
// XHKS ...
|
||||
|
||||
//
|
||||
isHKSBullish = false;
|
||||
isHKSBullishP = false;
|
||||
isHKSBullish = hkSBarCloseBuffer[pIndex] > hkSBarOpenBuffer[pIndex];
|
||||
isHKSBullishP = hkSBarCloseBuffer[p2Index] > hkSBarOpenBuffer[p2Index];
|
||||
|
||||
//
|
||||
isHKSBearish = false;
|
||||
isHKSBearishP = false;
|
||||
isHKSBearish = hkSBarCloseBuffer[pIndex] < hkSBarOpenBuffer[pIndex];
|
||||
isHKSBearishP = hkSBarCloseBuffer[p2Index] < hkSBarOpenBuffer[p2Index];
|
||||
|
||||
//
|
||||
isHKSSwitchedToBullish = false;
|
||||
isHKSSwitchedToBearish = false;
|
||||
isHKSSwitchedToBullish =
|
||||
isHKSBullish &&
|
||||
!isHKSBullishP;
|
||||
isHKSSwitchedToBearish =
|
||||
isHKSBearish &&
|
||||
!isHKSBearishP;
|
||||
|
||||
//
|
||||
isBullishHKSBreakedLast = false;
|
||||
isBearishHKSBreakedLast = false;
|
||||
|
||||
//
|
||||
mHKSMin = MathMin(hkSBarCloseBuffer[pIndex], hkSBarOpenBuffer[pIndex]);
|
||||
mHKSMax = MathMax(hkSBarCloseBuffer[pIndex], hkSBarOpenBuffer[pIndex]);
|
||||
|
||||
//
|
||||
mHKSPMin = MathMin(hkSBarCloseBuffer[p2Index], hkSBarOpenBuffer[p2Index]);
|
||||
mHKSPMax = MathMax(hkSBarCloseBuffer[p2Index], hkSBarOpenBuffer[p2Index]);
|
||||
|
||||
//
|
||||
// XKI ...
|
||||
|
||||
//
|
||||
isKIBullish = false;
|
||||
isKIBullishP = false;
|
||||
isKIBullish = kiStateBuffer[pIndex] > 0;
|
||||
isKIBullishP = kiStateBuffer[p2Index] > 0;
|
||||
|
||||
//
|
||||
isKIBearish = false;
|
||||
isKIBearishP = false;
|
||||
isKIBearish = kiStateBuffer[pIndex] < 0;
|
||||
isKIBearishP = kiStateBuffer[p2Index] < 0;
|
||||
|
||||
//
|
||||
isKISame = false;
|
||||
isBullishKISame = false;
|
||||
isBearishKISame = false;
|
||||
isKISame = kiBuffer[pIndex] == kiBuffer[p2Index];
|
||||
isBullishKISame =
|
||||
isKISame &&
|
||||
isKIBullish;
|
||||
isBearishKISame =
|
||||
isKISame &&
|
||||
isKIBearish;
|
||||
|
||||
//
|
||||
isKISwitchedToBullish = false;
|
||||
isKISwitchedToBearish = false;
|
||||
isKISwitchedToBullish =
|
||||
isKIBullish &&
|
||||
!isKIBullishP;
|
||||
isKISwitchedToBearish =
|
||||
isKIBearish &&
|
||||
!isKIBearishP;
|
||||
|
||||
//
|
||||
isBullishKIBreakedLast = false;
|
||||
isBearishKIBreakedLast = false;
|
||||
|
||||
//
|
||||
// XTREND ...
|
||||
|
||||
//
|
||||
isTrendBullish = trendStateBuffer[pIndex] > 0;
|
||||
isTrendBullishP = trendStateBuffer[p2Index] > 0;
|
||||
|
||||
//
|
||||
isTrendBearish = trendStateBuffer[pIndex] < 0;
|
||||
isTrendBearishP = trendStateBuffer[p2Index] < 0;
|
||||
|
||||
//
|
||||
isTrendSwitchedToBullish =
|
||||
isTrendBullish &&
|
||||
!isTrendBullishP;
|
||||
isTrendSwitchedToBearish =
|
||||
isTrendBearish &&
|
||||
!isTrendBearishP;
|
||||
|
||||
//
|
||||
isBullishTrendBreakedLast = false;
|
||||
isBearishTrendBreakedLast = false;
|
||||
|
||||
//
|
||||
// Creating Direction Shifts and it's related Conditions ...
|
||||
|
||||
//
|
||||
// XSB Shifts ...
|
||||
|
||||
//
|
||||
// Detection ...
|
||||
if (isSBSwitchedToBullish ||
|
||||
isSBSwitchedToBearish)
|
||||
{
|
||||
//
|
||||
mDirShift.at = iPBar.time;
|
||||
mDirShift.symbol = _Symbol;
|
||||
mDirShift.period = _Period;
|
||||
|
||||
//
|
||||
mDirShift.type = "XSBSHFT";
|
||||
|
||||
//
|
||||
mDirShift.after = 0;
|
||||
mDirShift.before = 0;
|
||||
|
||||
//
|
||||
if (isSBSwitchedToBullish)
|
||||
{
|
||||
//
|
||||
mDirShift.after = mSBMax;
|
||||
mDirShift.before = mSBPMax;
|
||||
mDirShift.shiftTo = X_DIRECTION_BULLISH;
|
||||
|
||||
//
|
||||
if (mDirShift.IsValid())
|
||||
{
|
||||
//
|
||||
AddIfNotExists(
|
||||
mDirShift,
|
||||
mBullishSBChanges //
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
if (isSBSwitchedToBearish)
|
||||
{
|
||||
//
|
||||
mDirShift.after = mSBMin;
|
||||
mDirShift.before = mSBPMin;
|
||||
mDirShift.shiftTo = X_DIRECTION_BEARISH;
|
||||
|
||||
//
|
||||
if (mDirShift.IsValid())
|
||||
{
|
||||
//
|
||||
AddIfNotExists(
|
||||
mDirShift,
|
||||
mBearishSBChanges //
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
mDirShift.Clean();
|
||||
}
|
||||
|
||||
//
|
||||
// Parsers ...
|
||||
|
||||
//
|
||||
mHas = isSBBullish &&
|
||||
HasChild(mBearishSBChanges);
|
||||
if (mHas)
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
mHas = isSBBearish &&
|
||||
HasChild(mBullishSBChanges);
|
||||
if (mHas)
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
// XSAR Shifts ...
|
||||
|
||||
//
|
||||
// Detection ...
|
||||
if (isSarSwitchedToBullish ||
|
||||
isSarSwitchedToBearish)
|
||||
{
|
||||
//
|
||||
mDirShift.at = iPBar.time;
|
||||
mDirShift.symbol = _Symbol;
|
||||
mDirShift.period = _Period;
|
||||
|
||||
//
|
||||
mDirShift.type = "XSARSHFT";
|
||||
|
||||
//
|
||||
mDirShift.after = sarBuffer[pIndex];
|
||||
mDirShift.before = sarBuffer[p2Index];
|
||||
|
||||
//
|
||||
if (isSarSwitchedToBullish)
|
||||
{
|
||||
//
|
||||
mDirShift.shiftTo = X_DIRECTION_BULLISH;
|
||||
|
||||
//
|
||||
if (mDirShift.IsValid())
|
||||
{
|
||||
//
|
||||
AddIfNotExists(
|
||||
mDirShift,
|
||||
mBullishSarChanges //
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
if (isSarSwitchedToBearish)
|
||||
{
|
||||
//
|
||||
mDirShift.shiftTo = X_DIRECTION_BEARISH;
|
||||
|
||||
//
|
||||
if (mDirShift.IsValid())
|
||||
{
|
||||
//
|
||||
AddIfNotExists(
|
||||
mDirShift,
|
||||
mBearishSarChanges //
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
mDirShift.Clean();
|
||||
}
|
||||
|
||||
//
|
||||
// Parsers ...
|
||||
|
||||
//
|
||||
mHas = isSarBullish &&
|
||||
HasChild(mBearishSarChanges);
|
||||
if (mHas)
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
mHas = isSarBearish &&
|
||||
HasChild(mBullishSarChanges);
|
||||
if (mHas)
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
// XHKS Shifts ...
|
||||
|
||||
//
|
||||
// Detection ...
|
||||
if (isHKSSwitchedToBullish ||
|
||||
isHKSSwitchedToBearish)
|
||||
{
|
||||
//
|
||||
mDirShift.at = iPBar.time;
|
||||
mDirShift.symbol = _Symbol;
|
||||
mDirShift.period = _Period;
|
||||
|
||||
//
|
||||
mDirShift.type = "XHKSSHFT";
|
||||
|
||||
//
|
||||
mDirShift.after = 0;
|
||||
mDirShift.before = 0;
|
||||
|
||||
//
|
||||
if (isHKSSwitchedToBullish)
|
||||
{
|
||||
//
|
||||
mDirShift.after = mHKSMax;
|
||||
mDirShift.before = mHKSPMax;
|
||||
mDirShift.shiftTo = X_DIRECTION_BULLISH;
|
||||
|
||||
//
|
||||
if (mDirShift.IsValid())
|
||||
{
|
||||
//
|
||||
AddIfNotExists(
|
||||
mDirShift,
|
||||
mBullishHKSChanges //
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
if (isHKSSwitchedToBearish)
|
||||
{
|
||||
//
|
||||
mDirShift.after = mHKSMin;
|
||||
mDirShift.before = mHKSPMin;
|
||||
mDirShift.shiftTo = X_DIRECTION_BEARISH;
|
||||
|
||||
//
|
||||
if (mDirShift.IsValid())
|
||||
{
|
||||
//
|
||||
AddIfNotExists(
|
||||
mDirShift,
|
||||
mBearishHKSChanges //
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
mDirShift.Clean();
|
||||
}
|
||||
|
||||
//
|
||||
// Parsers ...
|
||||
|
||||
//
|
||||
mHas = isHKSBullish &&
|
||||
HasChild(mBearishHKSChanges);
|
||||
if (mHas)
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
mHas = isHKSBearish &&
|
||||
HasChild(mBullishHKSChanges);
|
||||
if (mHas)
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
// XKI Shifts ...
|
||||
|
||||
//
|
||||
// Detection ...
|
||||
if (isKISwitchedToBullish ||
|
||||
isKISwitchedToBearish)
|
||||
{
|
||||
//
|
||||
mDirShift.at = iPBar.time;
|
||||
mDirShift.symbol = _Symbol;
|
||||
mDirShift.period = _Period;
|
||||
|
||||
//
|
||||
mDirShift.type = "XKISHFT";
|
||||
|
||||
//
|
||||
mDirShift.after = kiBuffer[pIndex];
|
||||
mDirShift.before = kiBuffer[p2Index];
|
||||
|
||||
//
|
||||
if (isKISwitchedToBullish)
|
||||
{
|
||||
//
|
||||
mDirShift.shiftTo = X_DIRECTION_BULLISH;
|
||||
|
||||
//
|
||||
if (mDirShift.IsValid())
|
||||
{
|
||||
//
|
||||
AddIfNotExists(
|
||||
mDirShift,
|
||||
mBullishKIChanges //
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
if (isKISwitchedToBearish)
|
||||
{
|
||||
//
|
||||
mDirShift.shiftTo = X_DIRECTION_BEARISH;
|
||||
|
||||
//
|
||||
if (mDirShift.IsValid())
|
||||
{
|
||||
//
|
||||
AddIfNotExists(
|
||||
mDirShift,
|
||||
mBearishKIChanges //
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
mDirShift.Clean();
|
||||
}
|
||||
|
||||
//
|
||||
// Parsers ...
|
||||
|
||||
//
|
||||
mHas = isKIBullish &&
|
||||
HasChild(mBearishKIChanges);
|
||||
if (mHas)
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
mHas = isKIBearish &&
|
||||
HasChild(mBullishKIChanges);
|
||||
if (mHas)
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
// XTREND Shifts ...
|
||||
|
||||
//
|
||||
// Detection ...
|
||||
if (isTrendSwitchedToBullish ||
|
||||
isTrendSwitchedToBearish)
|
||||
{
|
||||
//
|
||||
mDirShift.at = iPBar.time;
|
||||
mDirShift.symbol = _Symbol;
|
||||
mDirShift.period = _Period;
|
||||
|
||||
//
|
||||
mDirShift.type = "XTRENDSHFT";
|
||||
|
||||
//
|
||||
mDirShift.after = trendBuffer[pIndex];
|
||||
mDirShift.before = trendBuffer[p2Index];
|
||||
|
||||
//
|
||||
if (isTrendSwitchedToBullish)
|
||||
{
|
||||
//
|
||||
mDirShift.shiftTo = X_DIRECTION_BULLISH;
|
||||
|
||||
//
|
||||
if (mDirShift.IsValid())
|
||||
{
|
||||
//
|
||||
AddIfNotExists(
|
||||
mDirShift,
|
||||
mBullishTrendChanges //
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
if (isTrendSwitchedToBearish)
|
||||
{
|
||||
//
|
||||
mDirShift.shiftTo = X_DIRECTION_BEARISH;
|
||||
|
||||
//
|
||||
if (mDirShift.IsValid())
|
||||
{
|
||||
//
|
||||
AddIfNotExists(
|
||||
mDirShift,
|
||||
mBearishTrendChanges //
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
mDirShift.Clean();
|
||||
}
|
||||
|
||||
//
|
||||
// Parsers ...
|
||||
|
||||
//
|
||||
mHas = isTrendBullish &&
|
||||
HasChild(mBearishTrendChanges);
|
||||
if (mHas)
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
mHas = isTrendBearish &&
|
||||
HasChild(mBullishTrendChanges);
|
||||
if (mHas)
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
//
|
||||
// Cleanup Resources ...
|
||||
|
||||
//
|
||||
iBar.Clean();
|
||||
iPBar.Clean();
|
||||
mDirShift.Clean();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user