last works on XOSCS ...
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -38,12 +38,10 @@ enum ENUM_X121_XSTR_BUFFERS
|
||||
X121_XSTR_DOWN_LINE = 3,
|
||||
X121_XSTR_HSM_LINE = 4,
|
||||
X121_XSTR_LSM_LINE = 5,
|
||||
X121_XSTR_MID_LINE = 6,
|
||||
X121_XSTR_MID_STATE_LINE = 7,
|
||||
X121_XSTR_XVIDYA_LINE = 8,
|
||||
X121_XSTR_ATR_LINE = 9,
|
||||
X121_XSTR_PRICE_LINE = 10,
|
||||
X121_XSTR_STATE_LINE = 11,
|
||||
X121_XSTR_XVIDYA_LINE = 6,
|
||||
X121_XSTR_ATR_LINE = 7,
|
||||
X121_XSTR_PRICE_LINE = 8,
|
||||
X121_XSTR_STATE_LINE = 9,
|
||||
};
|
||||
|
||||
//
|
||||
@@ -63,7 +61,6 @@ struct X121XSTRInputs
|
||||
//
|
||||
bool showStr; // Show Str
|
||||
bool showVidya; // Show Vidya
|
||||
bool showStrMid; // Show Str Mid
|
||||
bool showStrUpper; // Show Str Upper
|
||||
bool showStrLower; // Show Str Lower
|
||||
bool showStrSMLow; // Show Str SM Low
|
||||
@@ -95,7 +92,6 @@ struct X121XSTRInputs
|
||||
//
|
||||
showStr = false;
|
||||
showVidya = false;
|
||||
showStrMid = false;
|
||||
showStrUpper = false;
|
||||
showStrLower = false;
|
||||
showStrSMLow = false;
|
||||
@@ -120,7 +116,6 @@ struct X121XSTRInputs
|
||||
//
|
||||
showStr = true;
|
||||
showVidya = true;
|
||||
showStrMid = true;
|
||||
showStrUpper = true;
|
||||
showStrLower = true;
|
||||
showStrSMLow = true;
|
||||
@@ -177,17 +172,18 @@ struct X121XSTRConditions
|
||||
double atrBuffer[];
|
||||
double vidyaBuffer[];
|
||||
double strUpBuffer[];
|
||||
double strMidBuffer[];
|
||||
double strDownBuffer[];
|
||||
double strPriceBuffer[];
|
||||
double strStateBuffer[];
|
||||
double strSMLowBuffer[];
|
||||
double strSMHighBuffer[];
|
||||
double strMidStateBuffer[];
|
||||
|
||||
//
|
||||
// Conditions ...
|
||||
|
||||
//
|
||||
// STR ...
|
||||
|
||||
//
|
||||
bool isStrBullish;
|
||||
bool isStrBearish;
|
||||
@@ -196,6 +192,91 @@ struct X121XSTRConditions
|
||||
bool isStrSwitchedToBullish;
|
||||
bool isStrSwitchedToBearish;
|
||||
|
||||
//
|
||||
// VIDYA ...
|
||||
|
||||
//
|
||||
bool isRejectUpVidya;
|
||||
bool isClosedOverVidya;
|
||||
bool isCrossedOverVidya;
|
||||
|
||||
//
|
||||
bool isRejectDownVidya;
|
||||
bool isCloseUnderVidya;
|
||||
bool isCrossedUnderVidya;
|
||||
|
||||
//
|
||||
// HMS ...
|
||||
|
||||
//
|
||||
bool isRejectUpLSM;
|
||||
bool isCloseOverLSM;
|
||||
bool isCrossedOverLSM;
|
||||
|
||||
//
|
||||
bool isRejectDownLSM;
|
||||
bool isCloseUnderLSM;
|
||||
bool isCrossedUnderLSM;
|
||||
|
||||
//
|
||||
// HSM ..
|
||||
|
||||
//
|
||||
bool isRejectUpHSM;
|
||||
bool isCloseOverHSM;
|
||||
bool isCrossedOverHSM;
|
||||
|
||||
//
|
||||
bool isRejectDownHSM;
|
||||
bool isCloseUnderHSM;
|
||||
bool isCrossedUnderHSM;
|
||||
|
||||
//
|
||||
// STR ...
|
||||
|
||||
//
|
||||
bool isRejectUpStr;
|
||||
bool isCloseOverStr;
|
||||
bool isCrossedOverStr;
|
||||
|
||||
//
|
||||
bool isRejectDownStr;
|
||||
bool isCloseUnderStr;
|
||||
bool isCrossedUnderStr;
|
||||
|
||||
//
|
||||
// HSM / ViDYA ...
|
||||
|
||||
//
|
||||
bool isVidyaOverHSM;
|
||||
bool isVidyaCrossedOverHSM;
|
||||
|
||||
//
|
||||
bool isVidyaUnderHSM;
|
||||
bool isVidyaCrossedUnderHSM;
|
||||
|
||||
//
|
||||
// LSM / VIDYA ...
|
||||
|
||||
//
|
||||
bool isVidyaOverLSM;
|
||||
bool isVidyaCrossedOverLSM;
|
||||
|
||||
//
|
||||
bool isVidyaUnderLSM;
|
||||
bool isVidyaCrossedUnderLSM;
|
||||
|
||||
//
|
||||
// STR / VIDYA ...
|
||||
|
||||
//
|
||||
bool isVidyaOverStr;
|
||||
bool isVidyaCrossedOverStr;
|
||||
|
||||
//
|
||||
bool isVidyaUnderStr;
|
||||
bool isVidyaCrossedUnderStr;
|
||||
|
||||
//
|
||||
// bool isCloseLower
|
||||
|
||||
@@ -228,35 +309,64 @@ struct X121XSTRConditions
|
||||
Clean(atrBuffer);
|
||||
Clean(vidyaBuffer);
|
||||
Clean(strUpBuffer);
|
||||
Clean(strMidBuffer);
|
||||
Clean(strDownBuffer);
|
||||
Clean(strPriceBuffer);
|
||||
Clean(strStateBuffer);
|
||||
Clean(strSMLowBuffer);
|
||||
Clean(strSMHighBuffer);
|
||||
Clean(strMidStateBuffer);
|
||||
|
||||
//
|
||||
ArraySetAsSeries(strBuffer, true);
|
||||
ArraySetAsSeries(atrBuffer, true);
|
||||
ArraySetAsSeries(vidyaBuffer, true);
|
||||
ArraySetAsSeries(strUpBuffer, true);
|
||||
ArraySetAsSeries(strMidBuffer, true);
|
||||
ArraySetAsSeries(strDownBuffer, true);
|
||||
ArraySetAsSeries(strPriceBuffer, true);
|
||||
ArraySetAsSeries(strStateBuffer, true);
|
||||
ArraySetAsSeries(strSMLowBuffer, true);
|
||||
ArraySetAsSeries(strSMHighBuffer, true);
|
||||
ArraySetAsSeries(strMidStateBuffer, true);
|
||||
|
||||
//
|
||||
// Conditions ...
|
||||
|
||||
//
|
||||
isStrBullish = false;
|
||||
isStrBearish = false;
|
||||
|
||||
//
|
||||
isRejectUpLSM = false;
|
||||
isRejectUpHSM = false;
|
||||
isRejectUpStr = false;
|
||||
isCloseOverHSM = false;
|
||||
isCloseOverLSM = false;
|
||||
isCloseOverStr = false;
|
||||
isVidyaOverHSM = false;
|
||||
isVidyaOverLSM = false;
|
||||
isVidyaOverStr = false;
|
||||
isRejectDownLSM = false;
|
||||
isRejectDownHSM = false;
|
||||
isVidyaUnderStr = false;
|
||||
isVidyaUnderHSM = false;
|
||||
isVidyaUnderLSM = false;
|
||||
isCloseUnderStr = false;
|
||||
isRejectDownStr = false;
|
||||
isRejectUpVidya = false;
|
||||
isCloseUnderHSM = false;
|
||||
isCloseUnderLSM = false;
|
||||
isCrossedOverLSM = false;
|
||||
isCrossedOverHSM = false;
|
||||
isCrossedOverStr = false;
|
||||
isCrossedUnderHSM = false;
|
||||
isCrossedUnderLSM = false;
|
||||
isCrossedUnderStr = false;
|
||||
isClosedOverVidya = false;
|
||||
isRejectDownVidya = false;
|
||||
isCloseUnderVidya = false;
|
||||
isCrossedOverVidya = false;
|
||||
isCrossedUnderVidya = false;
|
||||
isVidyaCrossedOverHSM = false;
|
||||
isVidyaCrossedOverStr = false;
|
||||
isVidyaCrossedOverLSM = false;
|
||||
isVidyaCrossedUnderHSM = false;
|
||||
isVidyaCrossedUnderLSM = false;
|
||||
isVidyaCrossedUnderStr = false;
|
||||
isStrSwitchedToBullish = false;
|
||||
isStrSwitchedToBearish = false;
|
||||
|
||||
@@ -293,6 +403,78 @@ struct X121XSTRConditions
|
||||
{
|
||||
bullishScore += score;
|
||||
}
|
||||
if (isRejectUpVidya)
|
||||
{
|
||||
bullishScore += minScore;
|
||||
}
|
||||
if (isClosedOverVidya)
|
||||
{
|
||||
bullishScore += minScore;
|
||||
}
|
||||
if (isCrossedOverVidya)
|
||||
{
|
||||
bullishScore += minScore;
|
||||
}
|
||||
if (isRejectUpLSM)
|
||||
{
|
||||
bullishScore += minScore;
|
||||
}
|
||||
if (isCloseOverLSM)
|
||||
{
|
||||
bullishScore += minScore;
|
||||
}
|
||||
if (isCrossedOverLSM)
|
||||
{
|
||||
bullishScore += minScore;
|
||||
}
|
||||
if (isRejectUpHSM)
|
||||
{
|
||||
bullishScore += minScore;
|
||||
}
|
||||
if (isCloseOverHSM)
|
||||
{
|
||||
bullishScore += minScore;
|
||||
}
|
||||
if (isCrossedOverHSM)
|
||||
{
|
||||
bullishScore += minScore;
|
||||
}
|
||||
if (isRejectUpStr)
|
||||
{
|
||||
bullishScore += minScore;
|
||||
}
|
||||
if (isCloseOverStr)
|
||||
{
|
||||
bullishScore += minScore;
|
||||
}
|
||||
if (isCrossedOverStr)
|
||||
{
|
||||
bullishScore += minScore;
|
||||
}
|
||||
if (isVidyaOverHSM)
|
||||
{
|
||||
bullishScore += minScore;
|
||||
}
|
||||
if (isVidyaCrossedOverHSM)
|
||||
{
|
||||
bullishScore += minScore;
|
||||
}
|
||||
if (isVidyaOverLSM)
|
||||
{
|
||||
bullishScore += minScore;
|
||||
}
|
||||
if (isVidyaCrossedOverLSM)
|
||||
{
|
||||
bullishScore += minScore;
|
||||
}
|
||||
if (isVidyaOverStr)
|
||||
{
|
||||
bullishScore += minScore;
|
||||
}
|
||||
if (isVidyaCrossedOverStr)
|
||||
{
|
||||
bullishScore += minScore;
|
||||
}
|
||||
|
||||
//
|
||||
if (isStrBearish)
|
||||
@@ -303,6 +485,78 @@ struct X121XSTRConditions
|
||||
{
|
||||
bearishScore += score;
|
||||
}
|
||||
if (isRejectDownVidya)
|
||||
{
|
||||
bearishScore += minScore;
|
||||
}
|
||||
if (isCloseUnderVidya)
|
||||
{
|
||||
bearishScore += minScore;
|
||||
}
|
||||
if (isCrossedUnderVidya)
|
||||
{
|
||||
bearishScore += minScore;
|
||||
}
|
||||
if (isRejectDownLSM)
|
||||
{
|
||||
bearishScore += minScore;
|
||||
}
|
||||
if (isCloseUnderLSM)
|
||||
{
|
||||
bearishScore += minScore;
|
||||
}
|
||||
if (isCrossedUnderLSM)
|
||||
{
|
||||
bearishScore += minScore;
|
||||
}
|
||||
if (isRejectDownHSM)
|
||||
{
|
||||
bearishScore += minScore;
|
||||
}
|
||||
if (isCloseUnderHSM)
|
||||
{
|
||||
bearishScore += minScore;
|
||||
}
|
||||
if (isCrossedUnderHSM)
|
||||
{
|
||||
bearishScore += minScore;
|
||||
}
|
||||
if (isRejectDownStr)
|
||||
{
|
||||
bearishScore += minScore;
|
||||
}
|
||||
if (isCloseUnderStr)
|
||||
{
|
||||
bearishScore += minScore;
|
||||
}
|
||||
if (isCrossedUnderStr)
|
||||
{
|
||||
bearishScore += minScore;
|
||||
}
|
||||
if (isVidyaUnderHSM)
|
||||
{
|
||||
bearishScore += minScore;
|
||||
}
|
||||
if (isVidyaCrossedUnderHSM)
|
||||
{
|
||||
bearishScore += minScore;
|
||||
}
|
||||
if (isVidyaUnderLSM)
|
||||
{
|
||||
bearishScore += minScore;
|
||||
}
|
||||
if (isVidyaCrossedUnderLSM)
|
||||
{
|
||||
bearishScore += minScore;
|
||||
}
|
||||
if (isVidyaUnderStr)
|
||||
{
|
||||
bearishScore += minScore;
|
||||
}
|
||||
if (isVidyaCrossedUnderStr)
|
||||
{
|
||||
bearishScore += minScore;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -363,6 +617,42 @@ struct X121XSTRConditions
|
||||
ToString("isStrBearish", isStrBearish, ignoreFalseConditions, separator) +
|
||||
ToString("isStrSwitchedToBullish", isStrSwitchedToBullish, ignoreFalseConditions, separator) +
|
||||
ToString("isStrSwitchedToBearish", isStrSwitchedToBearish, ignoreFalseConditions, separator) +
|
||||
ToString("isRejectUpVidya", isRejectUpVidya, ignoreFalseConditions, separator) +
|
||||
ToString("isClosedOverVidya", isClosedOverVidya, ignoreFalseConditions, separator) +
|
||||
ToString("isCrossedOverVidya", isCrossedOverVidya, ignoreFalseConditions, separator) +
|
||||
ToString("isRejectDownVidya", isRejectDownVidya, ignoreFalseConditions, separator) +
|
||||
ToString("isCloseUnderVidya", isCloseUnderVidya, ignoreFalseConditions, separator) +
|
||||
ToString("isCrossedUnderVidya", isCrossedUnderVidya, ignoreFalseConditions, separator) +
|
||||
ToString("isRejectUpLSM", isRejectUpLSM, ignoreFalseConditions, separator) +
|
||||
ToString("isCloseOverLSM", isCloseOverLSM, ignoreFalseConditions, separator) +
|
||||
ToString("isCrossedOverLSM", isCrossedOverLSM, ignoreFalseConditions, separator) +
|
||||
ToString("isRejectDownLSM", isRejectDownLSM, ignoreFalseConditions, separator) +
|
||||
ToString("isCloseUnderLSM", isCloseUnderLSM, ignoreFalseConditions, separator) +
|
||||
ToString("isCrossedUnderLSM", isCrossedUnderLSM, ignoreFalseConditions, separator) +
|
||||
ToString("isRejectUpHSM", isRejectUpHSM, ignoreFalseConditions, separator) +
|
||||
ToString("isCloseOverHSM", isCloseOverHSM, ignoreFalseConditions, separator) +
|
||||
ToString("isCrossedOverHSM", isCrossedOverHSM, ignoreFalseConditions, separator) +
|
||||
ToString("isRejectDownHSM", isRejectDownHSM, ignoreFalseConditions, separator) +
|
||||
ToString("isCloseUnderHSM", isCloseUnderHSM, ignoreFalseConditions, separator) +
|
||||
ToString("isCrossedUnderHSM", isCrossedUnderHSM, ignoreFalseConditions, separator) +
|
||||
ToString("isRejectUpStr", isRejectUpStr, ignoreFalseConditions, separator) +
|
||||
ToString("isCloseOverStr", isCloseOverStr, ignoreFalseConditions, separator) +
|
||||
ToString("isCrossedOverStr", isCrossedOverStr, ignoreFalseConditions, separator) +
|
||||
ToString("isRejectDownStr", isRejectDownStr, ignoreFalseConditions, separator) +
|
||||
ToString("isCloseUnderStr", isCloseUnderStr, ignoreFalseConditions, separator) +
|
||||
ToString("isCrossedUnderStr", isCrossedUnderStr, ignoreFalseConditions, separator) +
|
||||
ToString("isVidyaOverHSM", isVidyaOverHSM, ignoreFalseConditions, separator) +
|
||||
ToString("isVidyaCrossedOverHSM", isVidyaCrossedOverHSM, ignoreFalseConditions, separator) +
|
||||
ToString("isVidyaUnderHSM", isVidyaUnderHSM, ignoreFalseConditions, separator) +
|
||||
ToString("isVidyaCrossedUnderHSM", isVidyaCrossedUnderHSM, ignoreFalseConditions, separator) +
|
||||
ToString("isVidyaOverLSM", isVidyaOverLSM, ignoreFalseConditions, separator) +
|
||||
ToString("isVidyaCrossedOverLSM", isVidyaCrossedOverLSM, ignoreFalseConditions, separator) +
|
||||
ToString("isVidyaUnderLSM", isVidyaUnderLSM, ignoreFalseConditions, separator) +
|
||||
ToString("isVidyaCrossedUnderLSM", isVidyaCrossedUnderLSM, ignoreFalseConditions, separator) +
|
||||
ToString("isVidyaOverStr", isVidyaOverStr, ignoreFalseConditions, separator) +
|
||||
ToString("isVidyaCrossedOverStr", isVidyaCrossedOverStr, ignoreFalseConditions, separator) +
|
||||
ToString("isVidyaUnderStr", isVidyaUnderStr, ignoreFalseConditions, separator) +
|
||||
ToString("isVidyaCrossedUnderStr", isVidyaCrossedUnderStr, ignoreFalseConditions, separator) +
|
||||
//
|
||||
""
|
||||
//
|
||||
@@ -463,13 +753,11 @@ class XCX121XSTRHelper : public XCBaseHelper
|
||||
ArraySetAsSeries(atrBuffer, true);
|
||||
ArraySetAsSeries(vidyaBuffer, true);
|
||||
ArraySetAsSeries(strUpBuffer, true);
|
||||
ArraySetAsSeries(strMidBuffer, true);
|
||||
ArraySetAsSeries(strDownBuffer, true);
|
||||
ArraySetAsSeries(strPriceBuffer, true);
|
||||
ArraySetAsSeries(strStateBuffer, true);
|
||||
ArraySetAsSeries(strSMLowBuffer, true);
|
||||
ArraySetAsSeries(strSMHighBuffer, true);
|
||||
ArraySetAsSeries(strMidStateBuffer, true);
|
||||
|
||||
//
|
||||
mInputs = inputs;
|
||||
@@ -495,7 +783,6 @@ class XCX121XSTRHelper : public XCBaseHelper
|
||||
"",
|
||||
mInputs.showStr,
|
||||
mInputs.showVidya,
|
||||
mInputs.showStrMid,
|
||||
mInputs.showStrUpper,
|
||||
mInputs.showStrLower,
|
||||
mInputs.showStrSMLow,
|
||||
@@ -740,104 +1027,6 @@ class XCX121XSTRHelper : public XCBaseHelper
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
double GetSTRMid(
|
||||
int barIndex // Bar Index
|
||||
)
|
||||
{
|
||||
//
|
||||
if (barIndex < 0)
|
||||
{
|
||||
barIndex = 0;
|
||||
}
|
||||
|
||||
//
|
||||
Calculate(barIndex);
|
||||
|
||||
//
|
||||
int count = ArraySize(strMidBuffer);
|
||||
if (barIndex >= count)
|
||||
{
|
||||
barIndex = count - 1;
|
||||
}
|
||||
|
||||
//
|
||||
return strMidBuffer[barIndex];
|
||||
}
|
||||
|
||||
//
|
||||
int CopySTRMid(
|
||||
int start, // Start
|
||||
int count, // Number of Items for read
|
||||
double &buffer[], // Dest Buffer
|
||||
bool forceClean = true // Force To Clean buffer
|
||||
)
|
||||
{
|
||||
//
|
||||
// Update Calculations ...
|
||||
Calculate(start);
|
||||
|
||||
//
|
||||
// Copy Items ...
|
||||
return Copy(
|
||||
0,
|
||||
count,
|
||||
strMidBuffer,
|
||||
buffer,
|
||||
forceClean
|
||||
//
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
double GetSTRMidState(
|
||||
int barIndex // Bar Index
|
||||
)
|
||||
{
|
||||
//
|
||||
if (barIndex < 0)
|
||||
{
|
||||
barIndex = 0;
|
||||
}
|
||||
|
||||
//
|
||||
Calculate(barIndex);
|
||||
|
||||
//
|
||||
int count = ArraySize(strMidStateBuffer);
|
||||
if (barIndex >= count)
|
||||
{
|
||||
barIndex = count - 1;
|
||||
}
|
||||
|
||||
//
|
||||
return strMidStateBuffer[barIndex];
|
||||
}
|
||||
|
||||
//
|
||||
int CopySTRMidState(
|
||||
int start, // Start
|
||||
int count, // Number of Items for read
|
||||
double &buffer[], // Dest Buffer
|
||||
bool forceClean = true // Force To Clean buffer
|
||||
)
|
||||
{
|
||||
//
|
||||
// Update Calculations ...
|
||||
Calculate(start);
|
||||
|
||||
//
|
||||
// Copy Items ...
|
||||
return Copy(
|
||||
0,
|
||||
count,
|
||||
strMidStateBuffer,
|
||||
buffer,
|
||||
forceClean
|
||||
//
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
double GetSTRPrice(
|
||||
int barIndex // Bar Index
|
||||
@@ -1239,20 +1428,6 @@ class XCX121XSTRHelper : public XCBaseHelper
|
||||
conditions.strStateBuffer //
|
||||
);
|
||||
|
||||
//
|
||||
CopySTRMid(
|
||||
zIndex,
|
||||
loopback,
|
||||
conditions.strMidBuffer //
|
||||
);
|
||||
|
||||
//
|
||||
CopySTRMidState(
|
||||
zIndex,
|
||||
loopback,
|
||||
conditions.strMidStateBuffer //
|
||||
);
|
||||
|
||||
//
|
||||
CopySTRPrice(
|
||||
zIndex,
|
||||
@@ -1295,6 +1470,9 @@ class XCX121XSTRHelper : public XCBaseHelper
|
||||
int cIDX = 1;
|
||||
int pIDX = cIDX + 1;
|
||||
|
||||
//
|
||||
// STR ...
|
||||
|
||||
//
|
||||
bool isStrBullish = strStateBuffer[cIDX] > 0;
|
||||
bool isStrBullishPrev = strStateBuffer[pIDX] > 0;
|
||||
@@ -1309,9 +1487,202 @@ class XCX121XSTRHelper : public XCBaseHelper
|
||||
bool isStrSwitchedToBearish = isStrBearish &&
|
||||
!isStrBearishPrev;
|
||||
|
||||
//
|
||||
// VIDYA ...
|
||||
|
||||
//
|
||||
bool isRejectUpVidya = cBar.IsRejected(
|
||||
vidyaBuffer[cIDX],
|
||||
X_DIRECTION_BULLISH //
|
||||
);
|
||||
|
||||
//
|
||||
bool isClosedOverVidya = cBar.close > vidyaBuffer[cIDX];
|
||||
bool isClosedOverVidyaPrev = pBar.close > vidyaBuffer[pIDX];
|
||||
bool isCrossedOverVidya = isClosedOverVidya &&
|
||||
!isClosedOverVidyaPrev;
|
||||
|
||||
//
|
||||
bool isRejectDownVidya = cBar.IsRejected(
|
||||
vidyaBuffer[cIDX],
|
||||
X_DIRECTION_BEARISH //
|
||||
);
|
||||
|
||||
//
|
||||
bool isCloseUnderVidya = cBar.close < vidyaBuffer[cIDX];
|
||||
bool isCloseUnderVidyaPrev = pBar.close < vidyaBuffer[pIDX];
|
||||
bool isCrossedUnderVidya = isCloseUnderVidya &&
|
||||
!isCloseUnderVidyaPrev;
|
||||
|
||||
//
|
||||
// LMS ...
|
||||
|
||||
//
|
||||
bool isRejectUpLSM = cBar.IsRejected(
|
||||
strSMLowBuffer[cIDX],
|
||||
X_DIRECTION_BULLISH //
|
||||
);
|
||||
|
||||
//
|
||||
bool isCloseOverLSM = cBar.close > strSMLowBuffer[cIDX];
|
||||
bool isCloseOverLSMPrev = pBar.close > strSMLowBuffer[pIDX];
|
||||
bool isCrossedOverLSM = isCloseOverLSM &&
|
||||
!isCloseOverLSMPrev;
|
||||
|
||||
//
|
||||
bool isRejectDownLSM = cBar.IsRejected(
|
||||
strSMLowBuffer[cIDX],
|
||||
X_DIRECTION_BEARISH //
|
||||
);
|
||||
|
||||
//
|
||||
bool isCloseUnderLSM = cBar.close < strSMLowBuffer[cIDX];
|
||||
bool isCloseUnderLSMPrev = pBar.close < strSMLowBuffer[pIDX];
|
||||
bool isCrossedUnderLSM = isCloseUnderLSM &&
|
||||
!isCloseUnderLSMPrev;
|
||||
|
||||
//
|
||||
// HSM ..
|
||||
|
||||
//
|
||||
bool isRejectUpHSM = cBar.IsRejected(
|
||||
strSMHighBuffer[cIDX],
|
||||
X_DIRECTION_BULLISH //
|
||||
);
|
||||
|
||||
//
|
||||
bool isCloseOverHSM = cBar.close > strSMHighBuffer[cIDX];
|
||||
bool isCloseOverHSMPrev = pBar.close > strSMHighBuffer[pIDX];
|
||||
bool isCrossedOverHSM = isCloseOverHSM &&
|
||||
!isCloseOverHSMPrev;
|
||||
|
||||
//
|
||||
bool isRejectDownHSM = cBar.IsRejected(
|
||||
strSMHighBuffer[cIDX],
|
||||
X_DIRECTION_BEARISH //
|
||||
);
|
||||
|
||||
//
|
||||
bool isCloseUnderHSM = cBar.close > strSMHighBuffer[cIDX];
|
||||
bool isCloseUnderHSMPrev = pBar.close > strSMHighBuffer[pIDX];
|
||||
bool isCrossedUnderHSM = isCloseUnderHSM &&
|
||||
!isCloseUnderHSMPrev;
|
||||
|
||||
//
|
||||
// STR ...
|
||||
|
||||
//
|
||||
bool isRejectUpStr = cBar.IsRejected(
|
||||
strBuffer[cIDX],
|
||||
X_DIRECTION_BULLISH //
|
||||
);
|
||||
|
||||
//
|
||||
bool isCloseOverStr = cBar.close > strBuffer[cIDX];
|
||||
bool isCloseOverStrPrev = pBar.close > strBuffer[pIDX];
|
||||
bool isCrossedOverStr = isCloseOverStr &&
|
||||
!isCloseOverStrPrev;
|
||||
|
||||
//
|
||||
bool isRejectDownStr = cBar.IsRejected(
|
||||
strBuffer[cIDX],
|
||||
X_DIRECTION_BEARISH //
|
||||
);
|
||||
|
||||
//
|
||||
bool isCloseUnderStr = cBar.close < strBuffer[cIDX];
|
||||
bool isCloseUnderStrPrev = pBar.close < strBuffer[pIDX];
|
||||
bool isCrossedUnderStr = isCloseUnderStr &&
|
||||
!isCloseUnderStrPrev;
|
||||
|
||||
//
|
||||
// HSM / ViDYA ...
|
||||
|
||||
//
|
||||
bool isVidyaOverHSM = vidyaBuffer[cIDX] > strSMHighBuffer[cIDX];
|
||||
bool isVidyaOverHSMPrev = vidyaBuffer[pIDX] > strSMHighBuffer[pIDX];
|
||||
bool isVidyaCrossedOverHSM = isVidyaOverHSM &&
|
||||
!isVidyaOverHSMPrev;
|
||||
|
||||
//
|
||||
bool isVidyaUnderHSM = vidyaBuffer[cIDX] < strSMHighBuffer[cIDX];
|
||||
bool isVidyaUnderHSMPrev = vidyaBuffer[pIDX] < strSMHighBuffer[pIDX];
|
||||
bool isVidyaCrossedUnderHSM = isVidyaUnderHSM &&
|
||||
!isVidyaUnderHSMPrev;
|
||||
|
||||
//
|
||||
// LSM / VIDYA ...
|
||||
|
||||
//
|
||||
bool isVidyaOverLSM = vidyaBuffer[cIDX] > strSMLowBuffer[cIDX];
|
||||
bool isVidyaOverLSMPrev = vidyaBuffer[pIDX] > strSMLowBuffer[pIDX];
|
||||
bool isVidyaCrossedOverLSM = isVidyaOverLSM &&
|
||||
!isVidyaOverLSMPrev;
|
||||
|
||||
//
|
||||
bool isVidyaUnderLSM = vidyaBuffer[cIDX] < strSMLowBuffer[cIDX];
|
||||
bool isVidyaUnderLSMPrev = vidyaBuffer[pIDX] < strSMLowBuffer[pIDX];
|
||||
bool isVidyaCrossedUnderLSM = isVidyaUnderLSM &&
|
||||
!isVidyaUnderLSMPrev;
|
||||
|
||||
//
|
||||
// STR / VIDYA ...
|
||||
|
||||
//
|
||||
bool isVidyaOverStr = vidyaBuffer[cIDX] > strBuffer[cIDX];
|
||||
bool isVidyaOverStrPrev = vidyaBuffer[pIDX] > strBuffer[pIDX];
|
||||
bool isVidyaCrossedOverStr = isVidyaOverStr &&
|
||||
!isVidyaOverStrPrev;
|
||||
|
||||
//
|
||||
bool isVidyaUnderStr = vidyaBuffer[cIDX] < strBuffer[cIDX];
|
||||
bool isVidyaUnderStrPrev = vidyaBuffer[pIDX] < strBuffer[pIDX];
|
||||
bool isVidyaCrossedUnderStr = isVidyaUnderStr &&
|
||||
!isVidyaUnderStrPrev;
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
//
|
||||
conditions.isStrBullish = isStrBullish;
|
||||
conditions.isStrBearish = isStrBearish;
|
||||
conditions.isRejectUpLSM = isRejectUpLSM;
|
||||
conditions.isRejectUpHSM = isRejectUpHSM;
|
||||
conditions.isRejectUpStr = isRejectUpStr;
|
||||
conditions.isCloseOverHSM = isCloseOverHSM;
|
||||
conditions.isCloseOverLSM = isCloseOverLSM;
|
||||
conditions.isCloseOverStr = isCloseOverStr;
|
||||
conditions.isVidyaOverHSM = isVidyaOverHSM;
|
||||
conditions.isVidyaOverLSM = isVidyaOverLSM;
|
||||
conditions.isVidyaOverStr = isVidyaOverStr;
|
||||
conditions.isRejectDownLSM = isRejectDownLSM;
|
||||
conditions.isRejectDownHSM = isRejectDownHSM;
|
||||
conditions.isVidyaUnderStr = isVidyaUnderStr;
|
||||
conditions.isVidyaUnderHSM = isVidyaUnderHSM;
|
||||
conditions.isVidyaUnderLSM = isVidyaUnderLSM;
|
||||
conditions.isCloseUnderStr = isCloseUnderStr;
|
||||
conditions.isRejectDownStr = isRejectDownStr;
|
||||
conditions.isRejectUpVidya = isRejectUpVidya;
|
||||
conditions.isCloseUnderHSM = isCloseUnderHSM;
|
||||
conditions.isCloseUnderLSM = isCloseUnderLSM;
|
||||
conditions.isCrossedOverLSM = isCrossedOverLSM;
|
||||
conditions.isCrossedOverHSM = isCrossedOverHSM;
|
||||
conditions.isCrossedOverStr = isCrossedOverStr;
|
||||
conditions.isCrossedUnderHSM = isCrossedUnderHSM;
|
||||
conditions.isCrossedUnderLSM = isCrossedUnderLSM;
|
||||
conditions.isCrossedUnderStr = isCrossedUnderStr;
|
||||
conditions.isClosedOverVidya = isClosedOverVidya;
|
||||
conditions.isRejectDownVidya = isRejectDownVidya;
|
||||
conditions.isCloseUnderVidya = isCloseUnderVidya;
|
||||
conditions.isCrossedOverVidya = isCrossedOverVidya;
|
||||
conditions.isCrossedUnderVidya = isCrossedUnderVidya;
|
||||
conditions.isVidyaCrossedOverHSM = isVidyaCrossedOverHSM;
|
||||
conditions.isVidyaCrossedOverStr = isVidyaCrossedOverStr;
|
||||
conditions.isVidyaCrossedOverLSM = isVidyaCrossedOverLSM;
|
||||
conditions.isVidyaCrossedUnderHSM = isVidyaCrossedUnderHSM;
|
||||
conditions.isVidyaCrossedUnderLSM = isVidyaCrossedUnderLSM;
|
||||
conditions.isVidyaCrossedUnderStr = isVidyaCrossedUnderStr;
|
||||
conditions.isStrSwitchedToBullish = isStrSwitchedToBullish;
|
||||
conditions.isStrSwitchedToBearish = isStrSwitchedToBearish;
|
||||
|
||||
@@ -1343,13 +1714,11 @@ class XCX121XSTRHelper : public XCBaseHelper
|
||||
double atrBuffer[];
|
||||
double vidyaBuffer[];
|
||||
double strUpBuffer[];
|
||||
double strMidBuffer[];
|
||||
double strDownBuffer[];
|
||||
double strPriceBuffer[];
|
||||
double strStateBuffer[];
|
||||
double strSMLowBuffer[];
|
||||
double strSMHighBuffer[];
|
||||
double strMidStateBuffer[];
|
||||
|
||||
//
|
||||
void Calculate(
|
||||
@@ -1397,26 +1766,6 @@ class XCX121XSTRHelper : public XCBaseHelper
|
||||
//
|
||||
);
|
||||
|
||||
//
|
||||
CopyBuffer(
|
||||
mHandler,
|
||||
X121_XSTR_MID_LINE,
|
||||
barIndex,
|
||||
maxRequiredBars,
|
||||
strMidBuffer
|
||||
//
|
||||
);
|
||||
|
||||
//
|
||||
CopyBuffer(
|
||||
mHandler,
|
||||
X121_XSTR_MID_STATE_LINE,
|
||||
barIndex,
|
||||
maxRequiredBars,
|
||||
strMidStateBuffer
|
||||
//
|
||||
);
|
||||
|
||||
//
|
||||
// Price ...
|
||||
CopyBuffer(
|
||||
@@ -1513,12 +1862,6 @@ class XCX121XSTRHelper : public XCBaseHelper
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
strMidBuffer,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
strDownBuffer,
|
||||
@@ -1548,12 +1891,6 @@ class XCX121XSTRHelper : public XCBaseHelper
|
||||
strSMHighBuffer,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
strMidStateBuffer,
|
||||
maxAllowed //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user