last ...
This commit is contained in:
@@ -167,6 +167,7 @@ struct X121Conditions
|
||||
double lLLBuffer[];
|
||||
double hHHBuffer[];
|
||||
double hLLBuffer[];
|
||||
long volumeBuffer[];
|
||||
double peaksBuffer[];
|
||||
double valesBuffer[];
|
||||
double strUpBuffer[];
|
||||
@@ -198,6 +199,10 @@ struct X121Conditions
|
||||
double donCloseUpperBuffer[];
|
||||
double donCloseLowerBuffer[];
|
||||
|
||||
//
|
||||
bool bullishTrendBuffer[];
|
||||
bool bearishTrendBuffer[];
|
||||
|
||||
//
|
||||
double rsiSlope;
|
||||
double strSlope;
|
||||
@@ -292,11 +297,15 @@ struct X121Conditions
|
||||
bool isNewPeak;
|
||||
bool isNewPeakOverLast;
|
||||
bool isNewPeakUnderLast;
|
||||
bool isRejectedPrevPeak;
|
||||
bool isBreakedUpPrevPeak;
|
||||
|
||||
//
|
||||
bool isNewVale;
|
||||
bool isNewValeOverLast;
|
||||
bool isNewValeUnderLast;
|
||||
bool isRejectedPrevVale;
|
||||
bool isBreakedDownPrevVale;
|
||||
|
||||
//
|
||||
bool isStrBullish;
|
||||
@@ -488,6 +497,14 @@ struct X121Conditions
|
||||
bool isStrLowerCrossedOverDonLowLower;
|
||||
bool isStrLowerCrossedUnderDonLowLower;
|
||||
|
||||
//
|
||||
bool isTrendBullish;
|
||||
bool isTrendBearish;
|
||||
|
||||
//
|
||||
bool isTrendSwirchedToBullish;
|
||||
bool isTrendSwirchedToBearish;
|
||||
|
||||
//
|
||||
bool isAtrUpperOverPeak;
|
||||
bool isAtrUpperEqualsToPeak;
|
||||
@@ -546,6 +563,7 @@ struct X121Conditions
|
||||
Clean(peaksBuffer);
|
||||
Clean(valesBuffer);
|
||||
Clean(strUpBuffer);
|
||||
Clean(volumeBuffer);
|
||||
Clean(strDownBuffer);
|
||||
Clean(vwapMidBuffer);
|
||||
Clean(le1StartBuffer);
|
||||
@@ -574,6 +592,10 @@ struct X121Conditions
|
||||
Clean(donCloseUpperBuffer);
|
||||
Clean(donCloseLowerBuffer);
|
||||
|
||||
//
|
||||
Clean(bullishTrendBuffer);
|
||||
Clean(bearishTrendBuffer);
|
||||
|
||||
//
|
||||
ArraySetAsSeries(rsiBuffer, true);
|
||||
ArraySetAsSeries(atrBuffer, true);
|
||||
@@ -596,6 +618,7 @@ struct X121Conditions
|
||||
ArraySetAsSeries(peaksBuffer, true);
|
||||
ArraySetAsSeries(valesBuffer, true);
|
||||
ArraySetAsSeries(strUpBuffer, true);
|
||||
ArraySetAsSeries(volumeBuffer, true);
|
||||
ArraySetAsSeries(strDownBuffer, true);
|
||||
ArraySetAsSeries(vwapMidBuffer, true);
|
||||
ArraySetAsSeries(le1StartBuffer, true);
|
||||
@@ -624,6 +647,10 @@ struct X121Conditions
|
||||
ArraySetAsSeries(donCloseUpperBuffer, true);
|
||||
ArraySetAsSeries(donCloseLowerBuffer, true);
|
||||
|
||||
//
|
||||
ArraySetAsSeries(bullishTrendBuffer, true);
|
||||
ArraySetAsSeries(bearishTrendBuffer, true);
|
||||
|
||||
//
|
||||
cheMin = 0;
|
||||
cheMax = 0;
|
||||
@@ -747,11 +774,15 @@ struct X121Conditions
|
||||
isNewPeak = false;
|
||||
isNewPeakOverLast = false;
|
||||
isNewPeakUnderLast = false;
|
||||
isRejectedPrevPeak = false;
|
||||
isBreakedUpPrevPeak = false;
|
||||
|
||||
//
|
||||
isNewVale = false;
|
||||
isNewValeOverLast = false;
|
||||
isNewValeUnderLast = false;
|
||||
isRejectedPrevVale = false;
|
||||
isBreakedDownPrevVale = false;
|
||||
|
||||
//
|
||||
// STR ...
|
||||
@@ -983,6 +1014,14 @@ struct X121Conditions
|
||||
//
|
||||
isStrLowerCrossedOverDonLowLower = false;
|
||||
isStrLowerCrossedUnderDonLowLower = false;
|
||||
|
||||
//
|
||||
isTrendBullish = false;
|
||||
isTrendBearish = false;
|
||||
|
||||
//
|
||||
isTrendSwirchedToBullish = false;
|
||||
isTrendSwirchedToBearish = false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1074,9 +1113,13 @@ struct X121Conditions
|
||||
ToString("isNewPeak", isNewPeak, ignoreFalseConditions, separator) +
|
||||
ToString("isNewPeakOverLast", isNewPeakOverLast, ignoreFalseConditions, separator) +
|
||||
ToString("isNewPeakUnderLast", isNewPeakUnderLast, ignoreFalseConditions, separator) +
|
||||
ToString("isRejectedPrevPeak", isRejectedPrevPeak, ignoreFalseConditions, separator) +
|
||||
ToString("isBreakedUpPrevPeak", isBreakedUpPrevPeak, ignoreFalseConditions, separator) +
|
||||
ToString("isNewVale", isNewVale, ignoreFalseConditions, separator) +
|
||||
ToString("isNewValeOverLast", isNewValeOverLast, ignoreFalseConditions, separator) +
|
||||
ToString("isNewValeUnderLast", isNewValeUnderLast, ignoreFalseConditions, separator) +
|
||||
ToString("isRejectedPrevVale", isRejectedPrevVale, ignoreFalseConditions, separator) +
|
||||
ToString("isBreakedDownPrevVale", isBreakedDownPrevVale, ignoreFalseConditions, separator) +
|
||||
//
|
||||
"-----------------------" + separator +
|
||||
"> RSI ..." + separator +
|
||||
@@ -1188,6 +1231,10 @@ struct X121Conditions
|
||||
"-----------------------" + separator +
|
||||
"Coplex ..." + separator +
|
||||
"-----------------------" + separator +
|
||||
ToString("isTrendBullish", isTrendBullish, ignoreFalseConditions, separator) +
|
||||
ToString("isTrendBearish", isTrendBearish, ignoreFalseConditions, separator) +
|
||||
ToString("isTrendSwirchedToBullish", isTrendSwirchedToBullish, ignoreFalseConditions, separator) +
|
||||
ToString("isTrendSwirchedToBearish", isTrendSwirchedToBearish, ignoreFalseConditions, separator) +
|
||||
ToString("isSarIncreased", isSarIncreased, ignoreFalseConditions, separator) +
|
||||
ToString("isSarDecreased", isSarDecreased, ignoreFalseConditions, separator) +
|
||||
ToString("isSarEqualsToPeak", isSarEqualsToPeak, ignoreFalseConditions, separator) +
|
||||
@@ -1786,6 +1833,25 @@ class XCX121Helper : public XCBase
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Fill Volume Buffer ...
|
||||
for (int i = barIndex; i < barIndex + loopback; i++)
|
||||
{
|
||||
//
|
||||
// Reading Bar Valuem ...
|
||||
long iVol = iVolume(
|
||||
mSymbol,
|
||||
mPeriod,
|
||||
i //
|
||||
);
|
||||
|
||||
//
|
||||
Add(
|
||||
iVol,
|
||||
conditions.volumeBuffer //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// Fill X121 Conditions Reference by Using
|
||||
// Retrieved Conditions ...
|
||||
@@ -1878,6 +1944,18 @@ class XCX121Helper : public XCBase
|
||||
conditions.hLLBuffer //
|
||||
);
|
||||
|
||||
//
|
||||
Copy(
|
||||
xpvConditions.bullishTrendBuffer,
|
||||
conditions.bullishTrendBuffer //
|
||||
);
|
||||
|
||||
//
|
||||
Copy(
|
||||
xpvConditions.bearishTrendBuffer,
|
||||
conditions.bearishTrendBuffer //
|
||||
);
|
||||
|
||||
//
|
||||
// Conditions ...
|
||||
|
||||
@@ -1890,6 +1968,10 @@ class XCX121Helper : public XCBase
|
||||
conditions.isNewValeOverLast = xpvConditions.isNewValeOverLast;
|
||||
conditions.isNewPeakUnderLast = xpvConditions.isNewPeakUnderLast;
|
||||
conditions.isNewValeUnderLast = xpvConditions.isNewValeUnderLast;
|
||||
conditions.isRejectedPrevVale = xpvConditions.isRejectedPrevVale;
|
||||
conditions.isRejectedPrevPeak = xpvConditions.isRejectedPrevPeak;
|
||||
conditions.isBreakedUpPrevPeak = xpvConditions.isBreakedUpPrevPeak;
|
||||
conditions.isBreakedDownPrevVale = xpvConditions.isBreakedDownPrevVale;
|
||||
conditions.isSarSwitchedToBullish = xpvConditions.isSarSwitchedToBullish;
|
||||
conditions.isSarSwitchedToBearish = xpvConditions.isSarSwitchedToBearish;
|
||||
|
||||
@@ -2286,6 +2368,20 @@ class XCX121Helper : public XCBase
|
||||
//
|
||||
// Complex Conditions ...
|
||||
|
||||
//
|
||||
bool isTrendBullish = conditions.bullishTrendBuffer[0];
|
||||
bool isTrendBullishPrev = conditions.bullishTrendBuffer[1];
|
||||
|
||||
//
|
||||
bool isTrendBearish = conditions.bearishTrendBuffer[0];
|
||||
bool isTrendBearishPrev = conditions.bearishTrendBuffer[1];
|
||||
|
||||
//
|
||||
bool isTrendSwirchedToBullish = isTrendBullish &&
|
||||
!isTrendBullishPrev;
|
||||
bool isTrendSwirchedToBearish = isTrendBearish &&
|
||||
!isTrendBearishPrev;
|
||||
|
||||
//
|
||||
double vwapFast = conditions.vwapFastBuffer[cIDX];
|
||||
double vwapMid = conditions.vwapMidBuffer[cIDX];
|
||||
@@ -2705,6 +2801,12 @@ class XCX121Helper : public XCBase
|
||||
conditions.vwapMin = vwapMin;
|
||||
conditions.vwapMax = vwapMax;
|
||||
|
||||
//
|
||||
conditions.isTrendBullish = isTrendBullish;
|
||||
conditions.isTrendBearish = isTrendBearish;
|
||||
conditions.isTrendSwirchedToBullish = isTrendSwirchedToBullish;
|
||||
conditions.isTrendSwirchedToBearish = isTrendSwirchedToBearish;
|
||||
|
||||
//
|
||||
conditions.isSarIncreased = isSarIncreased;
|
||||
conditions.isSarDecreased = isSarDecreased;
|
||||
|
||||
@@ -270,6 +270,10 @@ struct X121XPVConditions
|
||||
double hHHBuffer[];
|
||||
double hLLBuffer[];
|
||||
|
||||
//
|
||||
bool bullishTrendBuffer[];
|
||||
bool bearishTrendBuffer[];
|
||||
|
||||
//
|
||||
// Conditions ...
|
||||
|
||||
@@ -291,11 +295,15 @@ struct X121XPVConditions
|
||||
bool isNewPeak;
|
||||
bool isNewPeakOverLast;
|
||||
bool isNewPeakUnderLast;
|
||||
bool isRejectedPrevPeak;
|
||||
bool isBreakedUpPrevPeak;
|
||||
|
||||
//
|
||||
bool isNewVale;
|
||||
bool isNewValeOverLast;
|
||||
bool isNewValeUnderLast;
|
||||
bool isRejectedPrevVale;
|
||||
bool isBreakedDownPrevVale;
|
||||
|
||||
//
|
||||
// Constructor ...
|
||||
@@ -336,6 +344,10 @@ struct X121XPVConditions
|
||||
Clean(hHHBuffer);
|
||||
Clean(hLLBuffer);
|
||||
|
||||
//
|
||||
Clean(bullishTrendBuffer);
|
||||
Clean(bearishTrendBuffer);
|
||||
|
||||
//
|
||||
ArraySetAsSeries(peaksBuffer, true);
|
||||
ArraySetAsSeries(valesBuffer, true);
|
||||
@@ -351,6 +363,10 @@ struct X121XPVConditions
|
||||
ArraySetAsSeries(hHHBuffer, true);
|
||||
ArraySetAsSeries(hLLBuffer, true);
|
||||
|
||||
//
|
||||
ArraySetAsSeries(bullishTrendBuffer, true);
|
||||
ArraySetAsSeries(bearishTrendBuffer, true);
|
||||
|
||||
//
|
||||
// Conditions ...
|
||||
|
||||
@@ -366,11 +382,14 @@ struct X121XPVConditions
|
||||
isNewPeak = false;
|
||||
isNewPeakOverLast = false;
|
||||
isNewPeakUnderLast = false;
|
||||
|
||||
isRejectedPrevPeak = false;
|
||||
isBreakedUpPrevPeak = false;
|
||||
//
|
||||
isNewVale = false;
|
||||
isNewValeOverLast = false;
|
||||
isNewValeUnderLast = false;
|
||||
isRejectedPrevVale = false;
|
||||
isBreakedDownPrevVale = false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -450,9 +469,13 @@ struct X121XPVConditions
|
||||
ToString("isNewPeak", isNewPeak, ignoreFalseConditions, separator) +
|
||||
ToString("isNewPeakOverLast", isNewPeakOverLast, ignoreFalseConditions, separator) +
|
||||
ToString("isNewPeakUnderLast", isNewPeakUnderLast, ignoreFalseConditions, separator) +
|
||||
ToString("isRejectedPrevPeak", isRejectedPrevPeak, ignoreFalseConditions, separator) +
|
||||
ToString("isBreakedUpPrevPeak", isBreakedUpPrevPeak, ignoreFalseConditions, separator) +
|
||||
ToString("isNewVale", isNewVale, ignoreFalseConditions, separator) +
|
||||
ToString("isNewValeOverLast", isNewValeOverLast, ignoreFalseConditions, separator) +
|
||||
ToString("isNewValeUnderLast", isNewValeUnderLast, ignoreFalseConditions, separator) +
|
||||
ToString("isRejectedPrevVale", isRejectedPrevVale, ignoreFalseConditions, separator) +
|
||||
ToString("isBreakedDownPrevVale", isBreakedDownPrevVale, ignoreFalseConditions, separator) +
|
||||
//
|
||||
""
|
||||
//
|
||||
@@ -1589,6 +1612,107 @@ class XCX121XPVHelper : public XCBaseHelper
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// Trends ...
|
||||
|
||||
// //
|
||||
// bool GetBullishTrend(
|
||||
// int barIndex // Bar Index
|
||||
// )
|
||||
// {
|
||||
// //
|
||||
// if (barIndex < 0)
|
||||
// {
|
||||
// barIndex = 0;
|
||||
// }
|
||||
|
||||
// //
|
||||
// Calculate();
|
||||
|
||||
// //
|
||||
// int count = ArraySize(bullishTrendBuffer);
|
||||
// if (barIndex >= count)
|
||||
// {
|
||||
// barIndex = count - 1;
|
||||
// }
|
||||
|
||||
// //
|
||||
// return bullishTrendBuffer[barIndex];
|
||||
// }
|
||||
|
||||
// //
|
||||
// int CopyBullishTrend(
|
||||
// int start, // Start
|
||||
// int count, // Number of Items for read
|
||||
// bool &buffer[], // Dest Buffer
|
||||
// bool forceClean = true // Force To Clean buffer
|
||||
// )
|
||||
// {
|
||||
// //
|
||||
// // Update Calculations ...
|
||||
// Calculate();
|
||||
|
||||
// //
|
||||
// // Copy Items ...
|
||||
// return Copy(
|
||||
// start,
|
||||
// count,
|
||||
// bullishTrendBuffer,
|
||||
// buffer,
|
||||
// forceClean
|
||||
// //
|
||||
// );
|
||||
// }
|
||||
|
||||
// //
|
||||
// bool GetBearishTrend(
|
||||
// int barIndex // Bar Index
|
||||
// )
|
||||
// {
|
||||
// //
|
||||
// if (barIndex < 0)
|
||||
// {
|
||||
// barIndex = 0;
|
||||
// }
|
||||
|
||||
// //
|
||||
// Calculate();
|
||||
|
||||
// //
|
||||
// int count = ArraySize(bearishTrendBuffer);
|
||||
// if (barIndex >= count)
|
||||
// {
|
||||
// barIndex = count - 1;
|
||||
// }
|
||||
|
||||
// //
|
||||
// return bearishTrendBuffer[barIndex];
|
||||
// }
|
||||
|
||||
// //
|
||||
// int CopyBearishTrend(
|
||||
// int start, // Start
|
||||
// int count, // Number of Items for read
|
||||
// bool &buffer[], // Dest Buffer
|
||||
// bool forceClean = true // Force To Clean buffer
|
||||
// )
|
||||
// {
|
||||
// //
|
||||
// // Update Calculations ...
|
||||
// Calculate();
|
||||
|
||||
// //
|
||||
// // Copy Items ...
|
||||
// return Copy(
|
||||
// start,
|
||||
// count,
|
||||
// bearishTrendBuffer,
|
||||
// buffer,
|
||||
// forceClean
|
||||
// //
|
||||
// );
|
||||
// }
|
||||
|
||||
//
|
||||
// Tools Function ...
|
||||
|
||||
@@ -1812,6 +1936,191 @@ class XCX121XPVHelper : public XCBaseHelper
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Detect Market Structure Method 2 ...
|
||||
*
|
||||
* @param model: XMarketStructure instance Reference ...
|
||||
*
|
||||
* @return ( bool )
|
||||
*/
|
||||
bool DetectMarketStructure(
|
||||
ENUM_X_DIRECTION &dir,
|
||||
int pivotsCount = 3 //
|
||||
)
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
|
||||
//
|
||||
int barIndex = 0;
|
||||
|
||||
//
|
||||
if (pivotsCount < 3)
|
||||
{
|
||||
pivotsCount = 3;
|
||||
}
|
||||
|
||||
//
|
||||
dir = X_DIRECTION_NONE;
|
||||
string symbol = GetSymbol();
|
||||
ENUM_TIMEFRAMES period = GetPeriod();
|
||||
|
||||
//
|
||||
int hpIndex = -1;
|
||||
int hpIndexes[];
|
||||
double hpValues[];
|
||||
|
||||
//
|
||||
int lvIndex = -1;
|
||||
int lvIndexes[];
|
||||
double lvValues[];
|
||||
|
||||
//
|
||||
for (int i = 0; i < pivotsCount; i++)
|
||||
{
|
||||
//
|
||||
hpIndex = barIndex;
|
||||
lvIndex = barIndex;
|
||||
|
||||
//
|
||||
double lastHP = 0;
|
||||
double lastLV = 0;
|
||||
|
||||
//
|
||||
int hpCount = ArraySize(hpIndexes);
|
||||
int lvCount = ArraySize(lvIndexes);
|
||||
|
||||
//
|
||||
if (IsValidSize(hpCount))
|
||||
{
|
||||
//
|
||||
lastHP = hpValues[hpCount - 1];
|
||||
hpIndex = hpIndexes[hpCount - 1];
|
||||
}
|
||||
|
||||
//
|
||||
if (IsValidSize(lvCount))
|
||||
{
|
||||
//
|
||||
lastLV = lvValues[lvCount - 1];
|
||||
lvIndex = lvIndexes[lvCount - 1];
|
||||
}
|
||||
|
||||
//
|
||||
if (lastHP == 0)
|
||||
{
|
||||
//
|
||||
lastHP = GetPeak(hpIndex);
|
||||
}
|
||||
|
||||
//
|
||||
if (lastLV == 0)
|
||||
{
|
||||
//
|
||||
lastLV = GetVale(lvIndex);
|
||||
}
|
||||
|
||||
//
|
||||
int highestPeakIndex = -1;
|
||||
double highesrPeak =
|
||||
GetHigherPeak(
|
||||
highestPeakIndex,
|
||||
lastHP,
|
||||
hpIndex //
|
||||
);
|
||||
if (IsValidIndex(highestPeakIndex))
|
||||
{
|
||||
//
|
||||
Add(
|
||||
highestPeakIndex,
|
||||
hpIndexes //
|
||||
);
|
||||
|
||||
//
|
||||
Add(
|
||||
highesrPeak,
|
||||
hpValues //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
int lowestValeIndex = -1;
|
||||
double lowestVale =
|
||||
GetLowerVale(
|
||||
lowestValeIndex,
|
||||
lastLV,
|
||||
lvIndex //
|
||||
);
|
||||
if (IsValidIndex(lowestValeIndex))
|
||||
{
|
||||
//
|
||||
Add(
|
||||
lowestValeIndex,
|
||||
lvIndexes //
|
||||
);
|
||||
|
||||
//
|
||||
Add(
|
||||
lowestVale,
|
||||
lvValues //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
bool canBreak = ArraySize(hpIndexes) >= pivotsCount ||
|
||||
ArraySize(lvIndexes) >= pivotsCount;
|
||||
if (canBreak)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
ArrayReverse(hpValues);
|
||||
ArrayReverse(hpIndexes);
|
||||
int countHPs = ArraySize(hpIndexes);
|
||||
|
||||
//
|
||||
ArrayReverse(lvValues);
|
||||
ArrayReverse(lvIndexes);
|
||||
int countLVs = ArraySize(lvIndexes);
|
||||
|
||||
//
|
||||
bool isValidHPs = countHPs >= pivotsCount;
|
||||
bool isValidLVs = countLVs >= pivotsCount;
|
||||
|
||||
//
|
||||
result = isValidHPs ||
|
||||
isValidLVs;
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
if (isValidHPs && isValidLVs)
|
||||
{
|
||||
//
|
||||
hpIndex = hpIndexes[countHPs - 1];
|
||||
lvIndex = lvIndexes[countLVs - 1];
|
||||
}
|
||||
|
||||
//
|
||||
dir =
|
||||
!isValidHPs && isValidLVs
|
||||
? X_DIRECTION_BULLISH
|
||||
: !isValidLVs && isValidHPs
|
||||
? X_DIRECTION_BEARISH
|
||||
: hpIndex < lvIndex
|
||||
? X_DIRECTION_BEARISH
|
||||
: lvIndex < hpIndex
|
||||
? X_DIRECTION_BULLISH
|
||||
: X_DIRECTION_ALL;
|
||||
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
bool GetConditions(
|
||||
X121XPVConditions &conditions, //
|
||||
@@ -1972,6 +2281,48 @@ class XCX121XPVHelper : public XCBaseHelper
|
||||
conditions.hLLBuffer //
|
||||
);
|
||||
|
||||
// //
|
||||
// CopyBullishTrend(
|
||||
// zIndex,
|
||||
// loopback,
|
||||
// conditions.bullishTrendBuffer //
|
||||
// );
|
||||
|
||||
// //
|
||||
// CopyBearishTrend(
|
||||
// zIndex,
|
||||
// loopback,
|
||||
// conditions.bearishTrendBuffer //
|
||||
// );
|
||||
|
||||
//
|
||||
for (int i = barIndex + 1; i < barIndex + 3; i++)
|
||||
{
|
||||
//
|
||||
ENUM_X_DIRECTION iDirection;
|
||||
bool iHasDirection = DetectMarketStructure(iDirection);
|
||||
|
||||
//
|
||||
bool iHasBullishTrend = iHasDirection &&
|
||||
IsBullish(iDirection);
|
||||
|
||||
//
|
||||
bool iHasBearishTrend = iHasDirection &&
|
||||
IsBearish(iDirection);
|
||||
|
||||
//
|
||||
Add(
|
||||
iHasBullishTrend,
|
||||
conditions.bullishTrendBuffer //
|
||||
);
|
||||
|
||||
//
|
||||
Add(
|
||||
iHasBearishTrend,
|
||||
conditions.bearishTrendBuffer //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// Conditions ...
|
||||
|
||||
@@ -2005,6 +2356,16 @@ class XCX121XPVHelper : public XCBaseHelper
|
||||
conditions.peaksBuffer[cIDX] > conditions.peaksBuffer[pIDX];
|
||||
bool isNewPeakUnderLast = isNewPeak &&
|
||||
conditions.peaksBuffer[cIDX] < conditions.peaksBuffer[pIDX];
|
||||
bool isRejectedPrevPeak = IsBarReject(
|
||||
conditions.peaksBuffer[pIDX],
|
||||
X_DIRECTION_BEARISH,
|
||||
cBar //
|
||||
);
|
||||
bool isBreakedUpPrevPeak = IsBarBreak(
|
||||
conditions.peaksBuffer[pIDX],
|
||||
X_DIRECTION_BULLISH,
|
||||
cBar //
|
||||
);
|
||||
|
||||
//
|
||||
bool isNewVale = conditions.valesBuffer[cIDX] != conditions.valesBuffer[pIDX];
|
||||
@@ -2012,6 +2373,16 @@ class XCX121XPVHelper : public XCBaseHelper
|
||||
conditions.valesBuffer[cIDX] > conditions.valesBuffer[pIDX];
|
||||
bool isNewValeUnderLast = isNewVale &&
|
||||
conditions.valesBuffer[cIDX] < conditions.valesBuffer[pIDX];
|
||||
bool isRejectedPrevVale = IsBarReject(
|
||||
conditions.valesBuffer[pIDX],
|
||||
X_DIRECTION_BULLISH,
|
||||
cBar //
|
||||
);
|
||||
bool isBreakedDownPrevVale = IsBarBreak(
|
||||
conditions.valesBuffer[pIDX],
|
||||
X_DIRECTION_BEARISH,
|
||||
cBar //
|
||||
);
|
||||
|
||||
//
|
||||
conditions.isSarBullish = isSarBullish;
|
||||
@@ -2021,9 +2392,18 @@ class XCX121XPVHelper : public XCBaseHelper
|
||||
conditions.isNewPeak = isNewPeak;
|
||||
conditions.isNewPeakOverLast = isNewPeakOverLast;
|
||||
conditions.isNewPeakUnderLast = isNewPeakUnderLast;
|
||||
conditions.isRejectedPrevPeak = isRejectedPrevPeak;
|
||||
conditions.isBreakedUpPrevPeak = isBreakedUpPrevPeak;
|
||||
conditions.isNewVale = isNewVale;
|
||||
conditions.isNewValeOverLast = isNewValeOverLast;
|
||||
conditions.isNewValeUnderLast = isNewValeUnderLast;
|
||||
conditions.isRejectedPrevVale = isRejectedPrevVale;
|
||||
conditions.isBreakedDownPrevVale = isBreakedDownPrevVale;
|
||||
|
||||
// //
|
||||
// if (isNewVale || isNewPeak) {
|
||||
// CalculateTrend();
|
||||
// }
|
||||
|
||||
//
|
||||
return result;
|
||||
@@ -2055,6 +2435,29 @@ class XCX121XPVHelper : public XCBaseHelper
|
||||
double hHHBuffer[];
|
||||
double hLLBuffer[];
|
||||
|
||||
//
|
||||
// bool bullishTrendBuffer[];
|
||||
// bool bearishTrendBuffer[];
|
||||
|
||||
//
|
||||
// void AddTrend(
|
||||
// bool isBullish,
|
||||
// bool isBearish //
|
||||
// )
|
||||
// {
|
||||
// //
|
||||
// Add(
|
||||
// isBullish,
|
||||
// bullishTrendBuffer //
|
||||
// );
|
||||
|
||||
// //
|
||||
// Add(
|
||||
// isBearish,
|
||||
// bearishTrendBuffer //
|
||||
// );
|
||||
// }
|
||||
|
||||
//
|
||||
void Calculate()
|
||||
{
|
||||
@@ -2229,6 +2632,28 @@ class XCX121XPVHelper : public XCBaseHelper
|
||||
//
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// void CalculateTrend()
|
||||
// {
|
||||
// //
|
||||
// ENUM_X_DIRECTION iDirection;
|
||||
// bool iHasDirection = DetectMarketStructure(iDirection);
|
||||
|
||||
// //
|
||||
// bool iHasBullishTrend = iHasDirection &&
|
||||
// IsBullish(iDirection);
|
||||
|
||||
// //
|
||||
// bool iHasBearishTrend = iHasDirection &&
|
||||
// IsBearish(iDirection);
|
||||
|
||||
// //
|
||||
// AddTrend(
|
||||
// iHasBullishTrend,
|
||||
// iHasBearishTrend //
|
||||
// );
|
||||
// }
|
||||
};
|
||||
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user