This commit is contained in:
2025-04-06 18:45:02 +03:30
parent ffcf43067e
commit 19a7cd7629
18 changed files with 1984 additions and 567 deletions
+942
View File
@@ -0,0 +1,942 @@
//
// Checking Conditions ...
//
// Retrieve Some Values ...
//
double peak = cXConditions.peaksBuffer[cIDX];
double peakZ = cXConditions.peaksBuffer[zIDX];
double peakP = cXConditions.peaksBuffer[pIDX];
double peakPP = cXConditions.peaksBuffer[ppIDX];
//
double vale = cXConditions.valesBuffer[cIDX];
double valeZ = cXConditions.valesBuffer[zIDX];
double valeP = cXConditions.valesBuffer[pIDX];
double valePP = cXConditions.valesBuffer[ppIDX];
//
double cSMHKOpen = cXConditions.xhkSMOpenBuffer[cIDX];
double cSMHKHigh = cXConditions.xhkSMHighBuffer[cIDX];
double cSMHKClose = cXConditions.xhkSMCloseBuffer[cIDX];
double cSMHKLow = cXConditions.xhkSMLowBuffer[cIDX];
double cSMHKMin = MathMin(cSMHKOpen, cSMHKClose);
double cSMHKMax = MathMax(cSMHKOpen, cSMHKClose);
//
double pSMHKOpen = cXConditions.xhkSMOpenBuffer[pIDX];
double pSMHKHigh = cXConditions.xhkSMHighBuffer[pIDX];
double pSMHKClose = cXConditions.xhkSMCloseBuffer[pIDX];
double pSMHKLow = cXConditions.xhkSMLowBuffer[pIDX];
double pSMHKMin = MathMin(pSMHKOpen, pSMHKClose);
double pSMHKMax = MathMax(pSMHKOpen, pSMHKClose);
//
double atrUpperSM = cXConditions.atrUpperSMBuffer[cIDX];
double atrLowerSM = cXConditions.atrLowerSMBuffer[cIDX];
//
double atrUpperSMZ = cXConditions.atrUpperSMBuffer[zIDX];
double atrLowerSMZ = cXConditions.atrLowerSMBuffer[zIDX];
//
double atrUpperSMP = cXConditions.atrUpperSMBuffer[pIDX];
double atrLowerSMP = cXConditions.atrLowerSMBuffer[pIDX];
//
double atrUpperSMPP = cXConditions.atrUpperSMBuffer[ppIDX];
double atrLowerSMPP = cXConditions.atrLowerSMBuffer[ppIDX];
//
double rsiChange = cXConditions.rsiChangeBuffer[cIDX];
double rsiChangeZ = cXConditions.rsiChangeBuffer[zIDX];
double rsiChangeP = cXConditions.rsiChangeBuffer[pIDX];
double rsiChangePP = cXConditions.rsiChangeBuffer[ppIDX];
//
double rsiChangeSM = cXConditions.rsiChangeSMBuffer[cIDX];
double rsiChangeSMZ = cXConditions.rsiChangeSMBuffer[zIDX];
double rsiChangeSMP = cXConditions.rsiChangeSMBuffer[pIDX];
double rsiChangeSMPP = cXConditions.rsiChangeSMBuffer[ppIDX];
//
double peaksGolden = cXConditions.peaksGoldenBuffer[cIDX];
double peaksGoldenZ = cXConditions.peaksGoldenBuffer[zIDX];
double peaksGoldenP = cXConditions.peaksGoldenBuffer[pIDX];
double peaksGoldenPP = cXConditions.peaksGoldenBuffer[ppIDX];
//
double valesGolden = cXConditions.valesGoldenBuffer[cIDX];
double valesGoldenZ = cXConditions.valesGoldenBuffer[zIDX];
double valesGoldenP = cXConditions.valesGoldenBuffer[pIDX];
double valesGoldenPP = cXConditions.valesGoldenBuffer[ppIDX];
//
double priceChange = cXConditions.priceChangeBuffer[cIDX];
double priceChangeZ = cXConditions.priceChangeBuffer[zIDX];
double priceChangeP = cXConditions.priceChangeBuffer[pIDX];
double priceChangePP = cXConditions.priceChangeBuffer[ppIDX];
//
double priceChangeSM = cXConditions.priceChangeSMBuffer[cIDX];
double priceChangeSMZ = cXConditions.priceChangeSMBuffer[zIDX];
double priceChangeSMP = cXConditions.priceChangeSMBuffer[pIDX];
double priceChangeSMPP = cXConditions.priceChangeSMBuffer[ppIDX];
//
//
//
//
// XHK ...
//
bool isPBarClosedOverSMHK =
//
pBar.IsBullish() &&
pBar.GetUp() > pSMHKMax &&
pBar.GetDown() < pSMHKMin
//
;
//
bool isPBarClosedUnderSMHK =
//
pBar.IsBearish() &&
pBar.GetUp() > pSMHKMax &&
pBar.GetDown() < pSMHKMin
//
;
//
bool isPBarBullishPriceChangeVPattern =
priceChangeP > priceChangePP &&
priceChangeP > priceChange;
//
bool isPBarBerishPriceChangeVPattern =
priceChangeP < priceChangePP &&
priceChangeP < priceChange;
//
bool isPBarPriceChangeOverPeak =
priceChangeP > peak &&
priceChangeP > peakP &&
priceChangeP > peakPP;
//
bool isPBarPriceChangeUnderVale =
priceChangeP < vale &&
priceChangeP < valeP &&
priceChangeP < valePP;
//
bool isPBarCloseOverPeaksGoldenZone =
pBar.close > peaksGoldenP;
//
bool isPBarCloseUnderValesGoldenZone =
pBar.close < valesGoldenP;
//
bool isPBarPriceChangeOverAtrUpper =
priceChangeP > atrUpperSMP;
//
bool isPBarPriceChangeUnderAtrLower =
priceChangeP < atrLowerSMP;
//
isBullish =
//
// false
//
hasSelectedBox &&
selectedBox.IsBullish() &&
cXConditions.isStrBullish
//
// cBar.IsBullish() &&
// isPBarPriceChangeUnderVale &&
// isPBarPriceChangeUnderAtrLower &&
// isPBarBerishPriceChangeVPattern &&
// isPBarCloseUnderValesGoldenZone
//
;
//
isBearish =
//
// false
//
hasSelectedBox &&
selectedBox.IsBearish() &&
cXConditions.isStrBearish
//
// cBar.IsBearish() &&
// isPBarPriceChangeOverPeak &&
// isPBarPriceChangeOverAtrUpper &&
// isPBarCloseOverPeaksGoldenZone &&
// isPBarBullishPriceChangeVPattern
//
;
/////////////////////////////////////////////////////////
//
double xhkSL;
ENUM_X_DIRECTION xhkDir;
bool isXHKPassed = IsHKConditionsPassed(
xhkSL,
xhkDir,
cHelper,
cXConditions,
barIndex //
);
bool isXHKBullish =
isXHKPassed &&
IsBullish(xhkDir);
bool isXHKBearish =
isXHKPassed &&
IsBearish(xhkDir);
/////////////////////////////////////////////////////////
//
bool IsRejectedBox(
XOHCL &bar, // CBar ...
XBoxZone &box,
X121Conditions &conditions //
)
{
//
bool result = false;
//
result =
bar.IsValid() &&
box.IsValid();
if (!result)
{
return result;
}
//
bool isBullish = box.IsBullish();
//
bool isBullishRejected =
isBullish &&
bar.IsRejected(
box.upper,
box.dir,
true, // Force Type ...
true // Force Pressure ...
);
//
bool isBearishRejected =
!isBullish &&
bar.IsRejected(
box.lower,
box.dir,
true, // Force Type ...
true // Force Pressure ...
);
//
result = isBullishRejected ||
isBearishRejected;
//
return result;
}
//
bool IsPeaksOrValesPassedBox(
XBoxZone &box,
X121Conditions &conditions //
)
{
//
bool result = false;
//
result = box.IsValid();
if (!result)
{
return result;
}
//
double peakZ = conditions.peaksBuffer[0];
double peakC = conditions.peaksBuffer[1];
double peakP = conditions.peaksBuffer[2];
double peakPP = conditions.peaksBuffer[3];
//
double valeZ = conditions.valesBuffer[0];
double valeC = conditions.valesBuffer[1];
double valeP = conditions.valesBuffer[2];
double valePP = conditions.valesBuffer[3];
//
double boxQ = ((box.upper - box.lower) / 100) * 25;
double upperQuarter = box.upper - boxQ;
double lowerQuarter = box.lower + boxQ;
//
bool isPPeakInsideUpperQ =
peakP < box.upper &&
peakP > upperQuarter;
//
bool isPValeInsideLowerQ =
valeP > box.lower &&
valeP < lowerQuarter;
//
bool isPPPeakInsideUpperQ =
peakPP < box.upper &&
peakPP > upperQuarter;
//
bool isPPValeInsideLowerQ =
valePP > box.lower &&
valePP < lowerQuarter;
//
result =
//
(box.IsBullish() &&
(isPValeInsideLowerQ ||
isPPValeInsideLowerQ) &&
(valeC == valeP ||
valeP == valePP))
//
||
//
(box.IsBearish() &&
(isPPeakInsideUpperQ ||
isPPPeakInsideUpperQ) &&
(peakC == peakP ||
peakP == peakPP))
//
;
//
return result;
}
//
bool IsX3MaPassedBox(
XOHCL &bar, // CBar ...
XBoxZone &box,
X121Conditions &conditions //
)
{
//
bool result = false;
//
result =
bar.IsValid() &&
box.IsValid();
if (!result)
{
return result;
}
//
double x3maFast = conditions.x3maFastBuffer[1];
double x3maMid = conditions.x3maMidBuffer[1];
double x3maSlow = conditions.x3maSlowBuffer[1];
//
bool isx3MaInsideBox =
//
// Fast ...
x3maFast < box.upper &&
x3maFast > box.lower
//
&&
//
// Mid ...
x3maMid < box.upper &&
x3maMid > box.lower
//
&&
//
// Slow ...
x3maSlow < box.upper &&
x3maSlow > box.lower
//
;
//
bool isX3maSwitchedToBullishOrdered =
bar.IsBullish() &&
box.IsBullish() &&
isx3MaInsideBox &&
bar.close > conditions.x3maFastBuffer[1] &&
conditions.isX3MaSwitchedToBullishOrdered;
//
bool isX3maSwitchedToBearishOrdered =
bar.IsBearish() &&
box.IsBearish() &&
isx3MaInsideBox &&
bar.close < conditions.x3maFastBuffer[1] &&
conditions.isX3MaSwitchedToBearishOrdered;
//
result = isX3maSwitchedToBullishOrdered ||
isX3maSwitchedToBearishOrdered;
//
return result;
}
//
// TODO: Complete this ...
bool IsActivatedBoxPassed(
XBoxZone &box,
X121Conditions &conditions //
)
{
//
bool result = false;
//
result = box.IsValid();
if (!result)
{
return result;
}
//
return result;
}
//
//
//
//
bool IsHKConditionsPassed(
double &sl,
ENUM_X_DIRECTION &dir,
XC121SMCCycleHelper *helper,
X121Conditions &conditions,
int barIndex = 0 //
)
{
//
bool result = false;
//
sl = 0;
dir = X_DIRECTION_NONE;
//
if (barIndex < 0)
{
barIndex = 0;
}
//
int zIDX = 0;
int cIDX = zIDX + 1;
int pIDX = cIDX + 1;
int ppIDX = pIDX + 1;
//
XOHCL zBar;
XOHCL cBar;
XOHCL pBar;
XOHCL ppBar;
//
// Retrieve Bars ...
result = zBar.Init(
conditions.symbol,
conditions.period,
barIndex //
);
result =
result &&
zBar.GetPreviousBar(cBar);
result =
result &&
cBar.GetPreviousBar(pBar);
result =
result &&
pBar.GetPreviousBar(ppBar);
if (!result)
{
//
zBar.Clean();
cBar.Clean();
pBar.Clean();
ppBar.Clean();
//
return result;
}
//
// Check PBar Swing ...
ENUM_X_DIRECTION pBarSwingDir;
bool isPBarSwing = helper
.mBarAnalyser
.IsSwing(
pBar,
pBarSwingDir,
3 //
);
//
bool isPBarSwingLow =
isPBarSwing &&
IsBullish(pBarSwingDir);
//
bool isPBarSwingHigh =
isPBarSwing &&
IsBearish(pBarSwingDir);
//
// Check PBar Rejection ...
ENUM_X_DIRECTION pBarRejectionDir;
bool isPBarRejected = helper
.mBarAnalyser
.IsRejected(
pBar,
pBarRejectionDir,
false,
true //
);
//
bool isPBarBullishRejected =
isPBarRejected &&
IsBullish(pBarRejectionDir);
//
bool isPBarBearishRejected =
isPBarRejected &&
IsBearish(pBarRejectionDir);
//
// Checking Str Incresing/Decreasing ...
//
bool isStrIncresing =
//
(conditions.strBuffer[zIDX] > conditions.strBuffer[cIDX] &&
conditions.strBuffer[zIDX] > conditions.strBuffer[pIDX] &&
conditions.strBuffer[zIDX] > conditions.strBuffer[ppIDX])
//
&&
//
(
//
(conditions.strBuffer[zIDX] > conditions.strBuffer[cIDX] &&
conditions.strBuffer[cIDX] > conditions.strBuffer[pIDX])
//
||
//
(conditions.strBuffer[cIDX] > conditions.strBuffer[pIDX] &&
conditions.strBuffer[pIDX] > conditions.strBuffer[ppIDX])
//
)
//
;
//
bool isStrDecreasing =
//
(conditions.strBuffer[zIDX] < conditions.strBuffer[cIDX] &&
conditions.strBuffer[zIDX] < conditions.strBuffer[pIDX] &&
conditions.strBuffer[zIDX] < conditions.strBuffer[ppIDX])
//
&&
//
(
//
(conditions.strBuffer[zIDX] < conditions.strBuffer[cIDX] &&
conditions.strBuffer[cIDX] < conditions.strBuffer[pIDX])
//
||
//
(conditions.strBuffer[cIDX] < conditions.strBuffer[pIDX] &&
conditions.strBuffer[pIDX] < conditions.strBuffer[ppIDX])
//
)
//
;
//
bool isBullish =
//
isPBarSwingLow &&
isStrIncresing &&
cBar.IsBullish() &&
cBar.low > pBar.low &&
cBar.open > pBar.low &&
zBar.open > cBar.low &&
// isPBarBullishRejected &&
conditions.isSarBullish &&
conditions.isStrBullish &&
conditions.isSMHKBullish
//
;
//
bool isBearish =
//
isPBarSwingHigh &&
isStrDecreasing &&
cBar.IsBearish() &&
cBar.high < pBar.high &&
cBar.open < pBar.high &&
zBar.open < cBar.high &&
// isPBarBearishRejected &&
conditions.isSarBearish &&
conditions.isStrBearish &&
conditions.isSMHKBearish
//
;
//
result = isBullish ||
isBearish;
if (result)
{
//
dir = isBullish
? X_DIRECTION_BULLISH
: X_DIRECTION_BEARISH;
//
// Selecting SL ...
sl =
isBullish
? cBar.low
: cBar.high;
}
//
// Cleanup Resources ...
zBar.Clean();
cBar.Clean();
pBar.Clean();
ppBar.Clean();
//
return result;
}
//
bool IsSARConditionsPassed(
double &sl,
ENUM_X_DIRECTION &dir,
XC121SMCCycleHelper *helper,
X121Conditions &conditions,
int barIndex = 0 //
)
{
//
bool result = false;
//
sl = 0;
dir = X_DIRECTION_NONE;
//
if (barIndex < 0)
{
barIndex = 0;
}
//
int zIDX = 0;
int cIDX = zIDX + 1;
int pIDX = cIDX + 1;
int ppIDX = pIDX + 1;
//
XOHCL zBar;
XOHCL cBar;
XOHCL pBar;
XOHCL ppBar;
//
// Retrieve Bars ...
result = zBar.Init(
conditions.symbol,
conditions.period,
barIndex //
);
result =
result &&
zBar.GetPreviousBar(cBar);
result =
result &&
cBar.GetPreviousBar(pBar);
result =
result &&
pBar.GetPreviousBar(ppBar);
if (!result)
{
//
zBar.Clean();
cBar.Clean();
pBar.Clean();
ppBar.Clean();
//
return result;
}
//
// Check PBar Swing ...
ENUM_X_DIRECTION pBarSwingDir;
bool isPBarSwing = helper
.mBarAnalyser
.IsSwing(
pBar,
pBarSwingDir,
3 //
);
//
bool isPBarSwingLow =
isPBarSwing &&
IsBullish(pBarSwingDir);
//
bool isPBarSwingHigh =
isPBarSwing &&
IsBearish(pBarSwingDir);
//
bool isBullish =
//
isPBarSwingLow &&
cBar.IsBullish() &&
cBar.low > pBar.low &&
cBar.open > pBar.low &&
zBar.open > cBar.low &&
conditions.isSarSwitchedToBullish
//
;
//
bool isBearish =
//
isPBarSwingHigh &&
isStrDecreasing &&
cBar.IsBearish() &&
cBar.high < pBar.high &&
cBar.open < pBar.high &&
zBar.open < cBar.high &&
conditions.isSarSwitchedToBearish
//
;
//
result = isBullish ||
isBearish;
if (result)
{
//
dir = isBullish
? X_DIRECTION_BULLISH
: X_DIRECTION_BEARISH;
//
// Selecting SL ...
sl =
isBullish
? cBar.low
: cBar.high;
}
//
// Cleanup Resources ...
zBar.Clean();
cBar.Clean();
pBar.Clean();
ppBar.Clean();
//
return result;
}
/////////////////////////////////////////////////////////
// //
// bool isPVPassed = IsPeaksOrValesPassedBox(
// iBox,
// cXConditions //
// );
// if (isPVPassed)
// {
// //
// selectedBox = iBox;
// iBox.Clean();
// break;
// }
//
// bool isx3MaPassed = IsX3MaPassedBox(
// cBar,
// iBox,
// cXConditions //
// );
// if (isx3MaPassed)
// {
// //
// selectedBox = iBox;
// iBox.Clean();
// break;
// }
//
// bool isRejected = IsRejectedBox(
// cBar,
// iBox,
// cXConditions //
// );
// if (isRejected)
// {
// //
// selectedBox = iBox;
// iBox.Clean();
// break;
// }
/////////////////////////////////////////////////////////
//
// Checking Bullish Fair Value Gaps ...
has = cState.HasBullishFairValueGaps();
if (has)
{
//
XBoxZone tmpBoxes[];
ToBox(
cState.bullishFairValueGaps,
tmpBoxes //
);
//
count = ArraySize(tmpBoxes);
has = IsValidSize(count);
if (has)
{
//
for (int i = 0; i < count; i++)
{
//
XBoxZone iBox = tmpBoxes[i];
bool isValid = IsBoxValid(
iBox,
0,
iBox.period //
);
if (!isValid)
{
//
iBox.Clean();
continue;
}
//
has = IsBoxExists(iBox);
if (!has)
{
//
AddRef(
iBox,
mWaitingBoxes //
);
}
//
iBox.Clean();
}
}
//
Clean(tmpBoxes);
}
//
// Checking Bearish Fair Value Gaps ...
has = cState.HasBearishFairValueGaps();
if (has)
{
//
XBoxZone tmpBoxes[];
ToBox(
cState.bearishFairValueGaps,
tmpBoxes //
);
//
count = ArraySize(tmpBoxes);
has = IsValidSize(count);
if (has)
{
//
for (int i = 0; i < count; i++)
{
//
XBoxZone iBox = tmpBoxes[i];
bool isValid = IsBoxValid(
iBox,
0,
iBox.period //
);
if (!isValid)
{
//
iBox.Clean();
continue;
;
}
//
has = IsBoxExists(iBox);
if (!has)
{
//
AddRef(
iBox,
mWaitingBoxes //
);
}
//
iBox.Clean();
}
}
//
Clean(tmpBoxes);
}
/////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////
+1 -1
View File
@@ -172,7 +172,7 @@ struct X121Conditions
string symbol;
ENUM_TIMEFRAMES period;
datetime time;
//
// XCC ...
+22 -18
View File
@@ -672,7 +672,7 @@ class XCX121X3MAHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(x3maFastBuffer);
@@ -695,7 +695,7 @@ class XCX121X3MAHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -724,7 +724,7 @@ class XCX121X3MAHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(x3maFastStateBuffer);
@@ -747,7 +747,7 @@ class XCX121X3MAHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -776,7 +776,7 @@ class XCX121X3MAHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(x3maMidBuffer);
@@ -799,7 +799,7 @@ class XCX121X3MAHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -828,7 +828,7 @@ class XCX121X3MAHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(x3maMidStateBuffer);
@@ -851,7 +851,7 @@ class XCX121X3MAHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -880,7 +880,7 @@ class XCX121X3MAHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(x3maSlowBuffer);
@@ -903,7 +903,7 @@ class XCX121X3MAHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -932,7 +932,7 @@ class XCX121X3MAHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(x3maSlowStateBuffer);
@@ -955,7 +955,7 @@ class XCX121X3MAHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -1311,18 +1311,22 @@ class XCX121X3MAHelper : public XCBaseHelper
//
void Calculate(
int barIndex = 0,
int maxRequiredBars = 100 //
)
{
//
// Buffers ...
if (barIndex < 0) {
barIndex = 0;
}
//
// FAST ...
CopyBuffer(
mHandler,
X121_X3MA_FAST_LINE,
0,
barIndex,
maxRequiredBars,
x3maFastBuffer
//
@@ -1333,7 +1337,7 @@ class XCX121X3MAHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_X3MA_FAST_STATE_LINE,
0,
barIndex,
maxRequiredBars,
x3maFastStateBuffer
//
@@ -1344,7 +1348,7 @@ class XCX121X3MAHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_X3MA_MID_LINE,
0,
barIndex,
maxRequiredBars,
x3maMidBuffer
//
@@ -1355,7 +1359,7 @@ class XCX121X3MAHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_X3MA_MID_STATE_LINE,
0,
barIndex,
maxRequiredBars,
x3maMidStateBuffer
//
@@ -1366,7 +1370,7 @@ class XCX121X3MAHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_X3MA_SLOW_LINE,
0,
barIndex,
maxRequiredBars,
x3maSlowBuffer
//
@@ -1377,7 +1381,7 @@ class XCX121X3MAHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_X3MA_SLOW_STATE_LINE,
0,
barIndex,
maxRequiredBars,
x3maSlowStateBuffer
//
+35 -30
View File
@@ -815,7 +815,7 @@ class XCX121XATRHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(rsiBuffer);
@@ -838,7 +838,7 @@ class XCX121XATRHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -867,7 +867,7 @@ class XCX121XATRHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(atrBuffer);
@@ -890,7 +890,7 @@ class XCX121XATRHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -916,7 +916,7 @@ class XCX121XATRHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(atrUpperBuffer);
@@ -939,7 +939,7 @@ class XCX121XATRHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -965,7 +965,7 @@ class XCX121XATRHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(atrLowerBuffer);
@@ -988,7 +988,7 @@ class XCX121XATRHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -1014,7 +1014,7 @@ class XCX121XATRHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(atrUpperSMBuffer);
@@ -1037,7 +1037,7 @@ class XCX121XATRHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -1063,7 +1063,7 @@ class XCX121XATRHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(atrLowerSMBuffer);
@@ -1086,7 +1086,7 @@ class XCX121XATRHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -1115,7 +1115,7 @@ class XCX121XATRHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(priceChangeBuffer);
@@ -1138,7 +1138,7 @@ class XCX121XATRHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -1164,7 +1164,7 @@ class XCX121XATRHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(priceChangeSMBuffer);
@@ -1187,7 +1187,7 @@ class XCX121XATRHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -1216,7 +1216,7 @@ class XCX121XATRHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(rsiChangeBuffer);
@@ -1239,7 +1239,7 @@ class XCX121XATRHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -1265,7 +1265,7 @@ class XCX121XATRHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(rsiChangeSMBuffer);
@@ -1288,7 +1288,7 @@ class XCX121XATRHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -1629,18 +1629,23 @@ class XCX121XATRHelper : public XCBaseHelper
//
void Calculate(
int barIndex = 0,
int maxRequiredBars = 100 //
)
{
//
// Buffers ...
if (barIndex < 0)
{
barIndex = 0;
}
//
// RSI ...
CopyBuffer(
mHandler,
X121_RSI_LINE,
0,
barIndex,
maxRequiredBars,
rsiBuffer
//
@@ -1651,7 +1656,7 @@ class XCX121XATRHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_ATR_LINE,
0,
barIndex,
maxRequiredBars,
atrBuffer //
);
@@ -1664,7 +1669,7 @@ class XCX121XATRHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_ATR_UPPER_LINE,
0,
barIndex,
maxRequiredBars,
atrUpperBuffer //
);
@@ -1674,7 +1679,7 @@ class XCX121XATRHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_ATR_LOWER_LINE,
0,
barIndex,
maxRequiredBars,
atrLowerBuffer //
);
@@ -1684,7 +1689,7 @@ class XCX121XATRHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_ATR_SM_UPPER_LINE,
0,
barIndex,
maxRequiredBars,
atrUpperSMBuffer //
);
@@ -1694,7 +1699,7 @@ class XCX121XATRHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_ATR_SM_LOWER_LINE,
0,
barIndex,
maxRequiredBars,
atrLowerSMBuffer //
);
@@ -1706,7 +1711,7 @@ class XCX121XATRHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_PRICE_CHANGE_LINE,
0,
barIndex,
maxRequiredBars,
priceChangeBuffer //
);
@@ -1715,7 +1720,7 @@ class XCX121XATRHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_PRICE_CHANGE_SM_LINE,
0,
barIndex,
maxRequiredBars,
priceChangeSMBuffer //
);
@@ -1727,7 +1732,7 @@ class XCX121XATRHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_RSI_CHANGE_LINE,
0,
barIndex,
maxRequiredBars,
rsiChangeBuffer //
);
@@ -1736,7 +1741,7 @@ class XCX121XATRHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_RSI_CHANGE_SM_LINE,
0,
barIndex,
maxRequiredBars,
rsiChangeSMBuffer //
);
+29 -24
View File
@@ -595,7 +595,7 @@ class XCX121XCHEHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(le1Buffer);
@@ -618,7 +618,7 @@ class XCX121XCHEHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -644,7 +644,7 @@ class XCX121XCHEHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(le1StartBuffer);
@@ -667,7 +667,7 @@ class XCX121XCHEHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -693,7 +693,7 @@ class XCX121XCHEHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(le2Buffer);
@@ -716,7 +716,7 @@ class XCX121XCHEHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -742,7 +742,7 @@ class XCX121XCHEHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(le2StartBuffer);
@@ -765,7 +765,7 @@ class XCX121XCHEHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -791,7 +791,7 @@ class XCX121XCHEHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(se1Buffer);
@@ -814,7 +814,7 @@ class XCX121XCHEHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -840,7 +840,7 @@ class XCX121XCHEHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(se1StartBuffer);
@@ -863,7 +863,7 @@ class XCX121XCHEHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -889,7 +889,7 @@ class XCX121XCHEHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(se2Buffer);
@@ -912,7 +912,7 @@ class XCX121XCHEHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -938,7 +938,7 @@ class XCX121XCHEHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(se2StartBuffer);
@@ -961,7 +961,7 @@ class XCX121XCHEHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -1218,18 +1218,23 @@ class XCX121XCHEHelper : public XCBaseHelper
//
void Calculate(
int barIndex = 0,
int maxRequiredBars = 100 //
)
{
//
// Buffers ...
if (barIndex < 0)
{
barIndex = 0;
}
//
// LE1 Start ...
CopyBuffer(
mHandler,
X121_XCHE_LE_1_S_LINE,
0,
barIndex,
maxRequiredBars,
le1StartBuffer //
);
@@ -1239,7 +1244,7 @@ class XCX121XCHEHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XCHE_LE_1_LINE,
0,
barIndex,
maxRequiredBars,
le1Buffer //
);
@@ -1249,7 +1254,7 @@ class XCX121XCHEHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XCHE_LE_2_S_LINE,
0,
barIndex,
maxRequiredBars,
le2StartBuffer //
);
@@ -1259,7 +1264,7 @@ class XCX121XCHEHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XCHE_LE_2_LINE,
0,
barIndex,
maxRequiredBars,
le2Buffer //
);
@@ -1269,7 +1274,7 @@ class XCX121XCHEHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XCHE_SE_1_S_LINE,
0,
barIndex,
maxRequiredBars,
se1StartBuffer //
);
@@ -1279,7 +1284,7 @@ class XCX121XCHEHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XCHE_SE_1_LINE,
0,
barIndex,
maxRequiredBars,
se1Buffer //
);
@@ -1289,7 +1294,7 @@ class XCX121XCHEHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XCHE_SE_2_S_LINE,
0,
barIndex,
maxRequiredBars,
se2StartBuffer //
);
@@ -1299,7 +1304,7 @@ class XCX121XCHEHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XCHE_SE_2_LINE,
0,
barIndex,
maxRequiredBars,
se2Buffer //
);
+14 -9
View File
@@ -520,7 +520,7 @@ class XCX121XDELTAHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(deltaBuffer);
@@ -543,7 +543,7 @@ class XCX121XDELTAHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -569,7 +569,7 @@ class XCX121XDELTAHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(deltaStateBuffer);
@@ -592,7 +592,7 @@ class XCX121XDELTAHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -618,7 +618,7 @@ class XCX121XDELTAHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(deltaMaBuffer);
@@ -641,7 +641,7 @@ class XCX121XDELTAHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -784,17 +784,22 @@ class XCX121XDELTAHelper : public XCBaseHelper
//
void Calculate(
int barIndex = 0,
int maxRequiredBars = 100 //
)
{
//
// Buffers ...
if (barIndex < 0)
{
barIndex = 0;
}
//
CopyBuffer(
mHandler,
X121_XDELTA_VOLUME_LINE,
0,
barIndex,
maxRequiredBars,
deltaBuffer
//
@@ -804,7 +809,7 @@ class XCX121XDELTAHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XDELTA_MA_LINE,
0,
barIndex,
maxRequiredBars,
deltaMaBuffer
//
@@ -814,7 +819,7 @@ class XCX121XDELTAHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XDELTA_STATE_LINE,
0,
barIndex,
maxRequiredBars,
deltaStateBuffer
//
+35 -27
View File
@@ -488,7 +488,7 @@ class XCX121XDONHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(donOpenUpperBuffer);
@@ -511,7 +511,7 @@ class XCX121XDONHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -540,7 +540,7 @@ class XCX121XDONHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(donOpenLowerBuffer);
@@ -563,7 +563,7 @@ class XCX121XDONHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -595,7 +595,7 @@ class XCX121XDONHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(donCloseUpperBuffer);
@@ -618,7 +618,7 @@ class XCX121XDONHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -647,7 +647,7 @@ class XCX121XDONHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(donCloseLowerBuffer);
@@ -670,7 +670,7 @@ class XCX121XDONHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -702,7 +702,7 @@ class XCX121XDONHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(donHighUpperBuffer);
@@ -725,7 +725,7 @@ class XCX121XDONHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -754,7 +754,7 @@ class XCX121XDONHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(donHighLowerBuffer);
@@ -777,7 +777,7 @@ class XCX121XDONHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -809,7 +809,7 @@ class XCX121XDONHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(donLowUpperBuffer);
@@ -832,7 +832,7 @@ class XCX121XDONHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -861,7 +861,7 @@ class XCX121XDONHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(donLowLowerBuffer);
@@ -884,7 +884,7 @@ class XCX121XDONHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -999,7 +999,7 @@ class XCX121XDONHelper : public XCBaseHelper
//
int cIDX = 1;
int pIDX = cIDX + 1;
//
Cleanup();
@@ -1019,26 +1019,34 @@ class XCX121XDONHelper : public XCBaseHelper
//
// Buffers ...
double donLowUpperBuffer[];
double donLowLowerBuffer[];
double donOpenUpperBuffer[];
double donOpenLowerBuffer[];
double donHighUpperBuffer[];
double donHighLowerBuffer[];
double donLowUpperBuffer[];
double donLowLowerBuffer[];
double donCloseUpperBuffer[];
double donCloseLowerBuffer[];
//
void Calculate(
int barIndex = 0,
int maxRequiredBars = 100 //
)
{
//
// Buffers ...
if (barIndex < 0)
{
barIndex = 0;
}
//
// Upper ...
CopyBuffer(
mHandler,
X121_XDON_OPEN_UPPER_LINE,
0,
barIndex,
maxRequiredBars,
donOpenUpperBuffer
//
@@ -1049,7 +1057,7 @@ class XCX121XDONHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XDON_OPEN_LOWER_LINE,
0,
barIndex,
maxRequiredBars,
donOpenLowerBuffer
//
@@ -1063,7 +1071,7 @@ class XCX121XDONHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XDON_CLOSE_UPPER_LINE,
0,
barIndex,
maxRequiredBars,
donCloseUpperBuffer
//
@@ -1074,7 +1082,7 @@ class XCX121XDONHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XDON_CLOSE_LOWER_LINE,
0,
barIndex,
maxRequiredBars,
donCloseLowerBuffer
//
@@ -1088,7 +1096,7 @@ class XCX121XDONHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XDON_HIGH_UPPER_LINE,
0,
barIndex,
maxRequiredBars,
donHighUpperBuffer
//
@@ -1099,7 +1107,7 @@ class XCX121XDONHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XDON_HIGH_LOWER_LINE,
0,
barIndex,
maxRequiredBars,
donHighLowerBuffer
//
@@ -1113,7 +1121,7 @@ class XCX121XDONHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XDON_LOW_UPPER_LINE,
0,
barIndex,
maxRequiredBars,
donLowUpperBuffer
//
@@ -1124,7 +1132,7 @@ class XCX121XDONHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XDON_LOW_LOWER_LINE,
0,
barIndex,
maxRequiredBars,
donLowLowerBuffer
//
+37 -26
View File
@@ -580,7 +580,7 @@ class XCX121XHKHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(xhkRawOpenBuffer);
@@ -603,7 +603,7 @@ class XCX121XHKHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -629,7 +629,7 @@ class XCX121XHKHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(xhkRawHighBuffer);
@@ -652,7 +652,7 @@ class XCX121XHKHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -678,7 +678,7 @@ class XCX121XHKHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(xhkRawLowBuffer);
@@ -701,7 +701,7 @@ class XCX121XHKHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -727,7 +727,7 @@ class XCX121XHKHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(xhkRawCloseBuffer);
@@ -750,7 +750,7 @@ class XCX121XHKHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -776,7 +776,7 @@ class XCX121XHKHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(xhkSMOpenBuffer);
@@ -799,7 +799,7 @@ class XCX121XHKHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -825,7 +825,7 @@ class XCX121XHKHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(xhkSMHighBuffer);
@@ -848,7 +848,7 @@ class XCX121XHKHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -874,7 +874,7 @@ class XCX121XHKHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(xhkSMLowBuffer);
@@ -897,7 +897,7 @@ class XCX121XHKHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -923,7 +923,7 @@ class XCX121XHKHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(xhkSMCloseBuffer);
@@ -946,7 +946,7 @@ class XCX121XHKHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -978,6 +978,9 @@ class XCX121XHKHelper : public XCBaseHelper
barIndex = 0;
}
//
Calculate(barIndex);
//
result = bar.Init(
GetSymbol(),
@@ -1017,6 +1020,9 @@ class XCX121XHKHelper : public XCBaseHelper
barIndex = 0;
}
//
Calculate(barIndex);
//
result = bar.Init(
GetSymbol(),
@@ -1282,14 +1288,14 @@ class XCX121XHKHelper : public XCBaseHelper
conditions.isClosedUnderRawHK = isClosedUnderRawHK;
conditions.isRawHKClosedOverSMHK = isRawHKClosedOverSMHK;
conditions.isRawHKClosedUnderSMHK = isRawHKClosedUnderSMHK;
//
Cleanup();
//
zBar.Clean();
cBar.Clean();
pBar.Clean();
pBar.Clean();
//
rawHKCBar.Clean();
@@ -1321,18 +1327,23 @@ class XCX121XHKHelper : public XCBaseHelper
//
void Calculate(
int barIndex = 0,
int maxRequiredBars = 100 //
)
{
//
// Buffers ...
if (barIndex < 0)
{
barIndex = 0;
}
//
// RAW Open ...
CopyBuffer(
mHandler,
X121_XHK_RAW_OPEN_LINE,
0,
barIndex,
maxRequiredBars,
xhkRawOpenBuffer
//
@@ -1343,7 +1354,7 @@ class XCX121XHKHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XHK_RAW_HIGH_LINE,
0,
barIndex,
maxRequiredBars,
xhkRawHighBuffer
//
@@ -1354,7 +1365,7 @@ class XCX121XHKHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XHK_RAW_LOW_LINE,
0,
barIndex,
maxRequiredBars,
xhkRawLowBuffer
//
@@ -1365,7 +1376,7 @@ class XCX121XHKHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XHK_RAW_CLOSE_LINE,
0,
barIndex,
maxRequiredBars,
xhkRawCloseBuffer
//
@@ -1376,7 +1387,7 @@ class XCX121XHKHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XHK_SM_OPEN_LINE,
0,
barIndex,
maxRequiredBars,
xhkSMOpenBuffer
//
@@ -1387,7 +1398,7 @@ class XCX121XHKHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XHK_SM_HIGH_LINE,
0,
barIndex,
maxRequiredBars,
xhkSMHighBuffer
//
@@ -1398,7 +1409,7 @@ class XCX121XHKHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XHK_SM_LOW_LINE,
0,
barIndex,
maxRequiredBars,
xhkSMLowBuffer
//
@@ -1409,7 +1420,7 @@ class XCX121XHKHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XHK_SM_CLOSE_LINE,
0,
barIndex,
maxRequiredBars,
xhkSMCloseBuffer
//
+20 -15
View File
@@ -572,7 +572,7 @@ class XCX121XICHHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(tenkanSenBuffer);
@@ -595,7 +595,7 @@ class XCX121XICHHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -621,7 +621,7 @@ class XCX121XICHHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(kijunSenBuffer);
@@ -644,7 +644,7 @@ class XCX121XICHHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -670,7 +670,7 @@ class XCX121XICHHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(chikouSpanBuffer);
@@ -693,7 +693,7 @@ class XCX121XICHHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -719,7 +719,7 @@ class XCX121XICHHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(senkouSpanABuffer);
@@ -742,7 +742,7 @@ class XCX121XICHHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -768,7 +768,7 @@ class XCX121XICHHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(senkouSpanBBuffer);
@@ -791,7 +791,7 @@ class XCX121XICHHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -1000,17 +1000,22 @@ class XCX121XICHHelper : public XCBaseHelper
//
void Calculate(
int barIndex = 0,
int maxRequiredBars = 100 //
)
{
//
// Buffers ...
if (barIndex < 0)
{
barIndex = 0;
}
//
CopyBuffer(
mHandler,
X121_XICH_KIJUNSEN_LINE,
0,
barIndex,
maxRequiredBars,
kijunSenBuffer
//
@@ -1020,7 +1025,7 @@ class XCX121XICHHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XICH_TENKANSEN_LINE,
0,
barIndex,
maxRequiredBars,
tenkanSenBuffer
//
@@ -1030,7 +1035,7 @@ class XCX121XICHHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XICH_CHIKOUSPAN_LINE,
0,
barIndex,
maxRequiredBars,
chikouSpanBuffer
//
@@ -1040,7 +1045,7 @@ class XCX121XICHHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XICH_SENKOUSPANA_LINE,
0,
barIndex,
maxRequiredBars,
senkouSpanABuffer
//
@@ -1050,7 +1055,7 @@ class XCX121XICHHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XICH_SENKOUSPANB_LINE,
0,
barIndex,
maxRequiredBars,
senkouSpanBBuffer
//
+14 -9
View File
@@ -442,7 +442,7 @@ class XCX121XMASHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(upperBuffer);
@@ -465,7 +465,7 @@ class XCX121XMASHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -494,7 +494,7 @@ class XCX121XMASHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(midBuffer);
@@ -517,7 +517,7 @@ class XCX121XMASHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -546,7 +546,7 @@ class XCX121XMASHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(lowerBuffer);
@@ -569,7 +569,7 @@ class XCX121XMASHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -719,18 +719,23 @@ class XCX121XMASHelper : public XCBaseHelper
//
void Calculate(
int barIndex = 0,
int maxRequiredBars = 100 //
)
{
//
// Buffers ...
if (barIndex < 0)
{
barIndex = 0;
}
//
// FAST ...
CopyBuffer(
mHandler,
X121_XMAS_UPPER_LINE,
0,
barIndex,
maxRequiredBars,
upperBuffer
//
@@ -741,7 +746,7 @@ class XCX121XMASHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XMAS_MID_LINE,
0,
barIndex,
maxRequiredBars,
midBuffer
//
@@ -752,7 +757,7 @@ class XCX121XMASHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XMAS_LOWER_LINE,
0,
barIndex,
maxRequiredBars,
lowerBuffer
//
+81 -77
View File
@@ -842,7 +842,7 @@ class XCX121XPVHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(sarBuffer);
@@ -865,7 +865,7 @@ class XCX121XPVHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -897,7 +897,7 @@ class XCX121XPVHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(peaksBuffer);
@@ -920,7 +920,7 @@ class XCX121XPVHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -949,7 +949,7 @@ class XCX121XPVHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(valesBuffer);
@@ -972,7 +972,7 @@ class XCX121XPVHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -1001,7 +1001,7 @@ class XCX121XPVHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(swingLowsBuffer);
@@ -1024,7 +1024,7 @@ class XCX121XPVHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -1053,7 +1053,7 @@ class XCX121XPVHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(swingHighsBuffer);
@@ -1076,7 +1076,7 @@ class XCX121XPVHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -1105,7 +1105,7 @@ class XCX121XPVHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(trendBuffer);
@@ -1128,7 +1128,7 @@ class XCX121XPVHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -1157,7 +1157,7 @@ class XCX121XPVHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(trendColorBuffer);
@@ -1180,7 +1180,7 @@ class XCX121XPVHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -1209,7 +1209,7 @@ class XCX121XPVHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(trendStateBuffer);
@@ -1232,7 +1232,7 @@ class XCX121XPVHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -1261,7 +1261,7 @@ class XCX121XPVHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(supportsBuffer);
@@ -1284,7 +1284,7 @@ class XCX121XPVHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -1313,7 +1313,7 @@ class XCX121XPVHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(resistancesBuffer);
@@ -1336,7 +1336,7 @@ class XCX121XPVHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -1365,7 +1365,7 @@ class XCX121XPVHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(peaksGoldenBuffer);
@@ -1388,7 +1388,7 @@ class XCX121XPVHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -1417,7 +1417,7 @@ class XCX121XPVHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(valesGoldenBuffer);
@@ -1440,7 +1440,7 @@ class XCX121XPVHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -1472,7 +1472,7 @@ class XCX121XPVHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(cHHBuffer);
@@ -1495,7 +1495,7 @@ class XCX121XPVHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -1524,7 +1524,7 @@ class XCX121XPVHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(cLLBuffer);
@@ -1547,7 +1547,7 @@ class XCX121XPVHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -1579,7 +1579,7 @@ class XCX121XPVHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(sHHBuffer);
@@ -1602,7 +1602,7 @@ class XCX121XPVHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -1631,7 +1631,7 @@ class XCX121XPVHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(sLLBuffer);
@@ -1654,7 +1654,7 @@ class XCX121XPVHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -1686,7 +1686,7 @@ class XCX121XPVHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(mHHBuffer);
@@ -1709,7 +1709,7 @@ class XCX121XPVHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -1738,7 +1738,7 @@ class XCX121XPVHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(mLLBuffer);
@@ -1761,7 +1761,7 @@ class XCX121XPVHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -1793,7 +1793,7 @@ class XCX121XPVHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(lHHBuffer);
@@ -1816,7 +1816,7 @@ class XCX121XPVHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -1845,7 +1845,7 @@ class XCX121XPVHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(lLLBuffer);
@@ -1868,7 +1868,7 @@ class XCX121XPVHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -1900,7 +1900,7 @@ class XCX121XPVHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(hHHBuffer);
@@ -1923,7 +1923,7 @@ class XCX121XPVHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -1952,7 +1952,7 @@ class XCX121XPVHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(hLLBuffer);
@@ -1975,7 +1975,7 @@ class XCX121XPVHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -2004,7 +2004,7 @@ class XCX121XPVHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(fractalsUpperBuffer);
@@ -2027,7 +2027,7 @@ class XCX121XPVHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -2056,7 +2056,7 @@ class XCX121XPVHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(fractalsLowerBuffer);
@@ -2079,7 +2079,7 @@ class XCX121XPVHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -2352,7 +2352,7 @@ class XCX121XPVHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
for (int i = 0; i < barIndex + loopback; i++)
@@ -2407,7 +2407,7 @@ class XCX121XPVHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
for (int i = 0; i < barIndex + loopback; i++)
@@ -2462,7 +2462,7 @@ class XCX121XPVHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
for (int i = 0; i < barIndex + loopback; i++)
@@ -2517,7 +2517,7 @@ class XCX121XPVHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
for (int i = 0; i < barIndex + loopback; i++)
@@ -2891,18 +2891,22 @@ class XCX121XPVHelper : public XCBaseHelper
//
void Calculate(
int barIndex = 0,
int maxRequiredBars = 100 //
)
{
//
// Buffers ...
int calculatedBars = BarsCalculated(mHandler);
if (barIndex < 0)
{
barIndex = 0;
}
//
CopyBuffer(
mHandler,
X121_XPV_SAR_LINE,
0,
barIndex,
maxRequiredBars,
sarBuffer //
);
@@ -2911,7 +2915,7 @@ class XCX121XPVHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XPV_C_HH_LINE,
0,
barIndex,
maxRequiredBars,
cHHBuffer //
);
@@ -2920,7 +2924,7 @@ class XCX121XPVHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XPV_C_LL_LINE,
0,
barIndex,
maxRequiredBars,
cLLBuffer //
);
@@ -2929,7 +2933,7 @@ class XCX121XPVHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XPV_S_HH_LINE,
0,
barIndex,
maxRequiredBars,
sHHBuffer //
);
@@ -2938,7 +2942,7 @@ class XCX121XPVHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XPV_S_LL_LINE,
0,
barIndex,
maxRequiredBars,
sLLBuffer //
);
@@ -2947,7 +2951,7 @@ class XCX121XPVHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XPV_M_HH_LINE,
0,
barIndex,
maxRequiredBars,
mHHBuffer //
);
@@ -2956,7 +2960,7 @@ class XCX121XPVHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XPV_M_LL_LINE,
0,
barIndex,
maxRequiredBars,
mLLBuffer //
);
@@ -2965,7 +2969,7 @@ class XCX121XPVHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XPV_L_HH_LINE,
0,
barIndex,
maxRequiredBars,
lHHBuffer //
);
@@ -2974,7 +2978,7 @@ class XCX121XPVHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XPV_L_LL_LINE,
0,
barIndex,
maxRequiredBars,
lLLBuffer //
);
@@ -2983,7 +2987,7 @@ class XCX121XPVHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XPV_H_HH_LINE,
0,
barIndex,
maxRequiredBars,
hHHBuffer //
);
@@ -2992,7 +2996,7 @@ class XCX121XPVHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XPV_H_LL_LINE,
0,
barIndex,
maxRequiredBars,
hLLBuffer //
);
@@ -3001,7 +3005,7 @@ class XCX121XPVHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XPV_TREND_LINE,
0,
barIndex,
maxRequiredBars,
trendBuffer //
);
@@ -3010,7 +3014,7 @@ class XCX121XPVHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XPV_PEAK_LINE,
0,
barIndex,
maxRequiredBars,
peaksBuffer //
);
@@ -3019,7 +3023,7 @@ class XCX121XPVHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XPV_VALE_LINE,
0,
barIndex,
maxRequiredBars,
valesBuffer //
);
@@ -3028,7 +3032,7 @@ class XCX121XPVHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XPV_SUPPORT_LINE,
0,
barIndex,
maxRequiredBars,
supportsBuffer //
);
@@ -3037,7 +3041,7 @@ class XCX121XPVHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XPV_SWING_LOW_LINE,
0,
barIndex,
maxRequiredBars,
swingLowsBuffer //
);
@@ -3046,7 +3050,7 @@ class XCX121XPVHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XPV_SWING_HIGH_LINE,
0,
barIndex,
maxRequiredBars,
swingHighsBuffer //
);
@@ -3055,7 +3059,7 @@ class XCX121XPVHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XPV_TREND_COLOR_LINE,
0,
barIndex,
maxRequiredBars,
trendColorBuffer //
);
@@ -3064,7 +3068,7 @@ class XCX121XPVHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XPV_TREND_STATE_LINE,
0,
barIndex,
maxRequiredBars,
trendStateBuffer //
);
@@ -3073,7 +3077,7 @@ class XCX121XPVHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XPV_PEAK_GOLDEN_ZONE_LINE,
0,
barIndex,
maxRequiredBars,
peaksGoldenBuffer //
);
@@ -3082,7 +3086,7 @@ class XCX121XPVHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XPV_VALE_GOLDEN_ZONE_LINE,
0,
barIndex,
maxRequiredBars,
valesGoldenBuffer //
);
@@ -3091,7 +3095,7 @@ class XCX121XPVHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XPV_RESISTANCE_LINE,
0,
barIndex,
maxRequiredBars,
resistancesBuffer //
);
@@ -3100,7 +3104,7 @@ class XCX121XPVHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XPV_FRACTALS_UPPER_LINE,
0,
barIndex,
maxRequiredBars,
fractalsUpperBuffer //
);
@@ -3109,7 +3113,7 @@ class XCX121XPVHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XPV_FRACTALS_LOWER_LINE,
0,
barIndex,
maxRequiredBars,
fractalsLowerBuffer //
);
+23 -18
View File
@@ -499,7 +499,7 @@ class XCX121XSTRHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(atrBuffer);
@@ -522,7 +522,7 @@ class XCX121XSTRHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -548,7 +548,7 @@ class XCX121XSTRHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(strBuffer);
@@ -571,7 +571,7 @@ class XCX121XSTRHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -597,7 +597,7 @@ class XCX121XSTRHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(strStateBuffer);
@@ -620,7 +620,7 @@ class XCX121XSTRHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -646,7 +646,7 @@ class XCX121XSTRHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(strPriceBuffer);
@@ -669,7 +669,7 @@ class XCX121XSTRHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -695,7 +695,7 @@ class XCX121XSTRHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(strUpBuffer);
@@ -718,7 +718,7 @@ class XCX121XSTRHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -744,7 +744,7 @@ class XCX121XSTRHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(strDownBuffer);
@@ -767,7 +767,7 @@ class XCX121XSTRHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -1011,18 +1011,23 @@ class XCX121XSTRHelper : public XCBaseHelper
//
void Calculate(
int barIndex = 0,
int maxRequiredBars = 100 //
)
{
//
// Buffers ...
if (barIndex < 0)
{
barIndex = 0;
}
//
// STR ...
CopyBuffer(
mHandler,
X121_XSTR_LINE,
0,
barIndex,
maxRequiredBars,
strBuffer
//
@@ -1033,7 +1038,7 @@ class XCX121XSTRHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XSTR_STATE_LINE,
0,
barIndex,
maxRequiredBars,
strStateBuffer
//
@@ -1044,7 +1049,7 @@ class XCX121XSTRHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XSTR_PRICE_LINE,
0,
barIndex,
maxRequiredBars,
strPriceBuffer
//
@@ -1055,7 +1060,7 @@ class XCX121XSTRHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XSTR_UP_LINE,
0,
barIndex,
maxRequiredBars,
strUpBuffer
//
@@ -1066,7 +1071,7 @@ class XCX121XSTRHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XSTR_DOWN_LINE,
0,
barIndex,
maxRequiredBars,
strDownBuffer
//
@@ -1079,7 +1084,7 @@ class XCX121XSTRHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XSTR_ATR_LINE,
0,
barIndex,
maxRequiredBars,
atrBuffer
//
+29 -24
View File
@@ -552,7 +552,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(upTrendBuffer);
@@ -575,7 +575,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -604,7 +604,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(downTrendBuffer);
@@ -627,7 +627,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -656,7 +656,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(downTrendBuffer);
@@ -679,7 +679,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -708,7 +708,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(adxBuffer);
@@ -731,7 +731,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -760,7 +760,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(adxPBuffer);
@@ -783,7 +783,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -812,7 +812,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(adxMBuffer);
@@ -835,7 +835,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -864,7 +864,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(upTBuffer);
@@ -887,7 +887,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -916,7 +916,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(downTBuffer);
@@ -939,7 +939,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -1146,18 +1146,23 @@ class XCX121XTRENDHelper : public XCBaseHelper
//
void Calculate(
int barIndex = 0,
int maxRequiredBars = 100 //
)
{
//
// Buffers ...
if (barIndex < 0)
{
barIndex = 0;
}
//
// Up Trend ...
CopyBuffer(
mHandler,
X121_XTREND_UP_LINE,
0,
barIndex,
maxRequiredBars,
upTrendBuffer
//
@@ -1168,7 +1173,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XTREND_DOWN_LINE,
0,
barIndex,
maxRequiredBars,
downTrendBuffer
//
@@ -1179,7 +1184,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XTREND_MA_LINE,
0,
barIndex,
maxRequiredBars,
maBuffer
//
@@ -1190,7 +1195,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XTREND_ADX_LINE,
0,
barIndex,
maxRequiredBars,
adxBuffer
//
@@ -1201,7 +1206,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XTREND_ADX_P_LINE,
0,
barIndex,
maxRequiredBars,
adxPBuffer
//
@@ -1212,7 +1217,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XTREND_ADX_M_LINE,
0,
barIndex,
maxRequiredBars,
adxMBuffer
//
@@ -1223,7 +1228,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XTREND_UP_T_LINE,
0,
barIndex,
maxRequiredBars,
upTBuffer
//
@@ -1234,7 +1239,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XTREND_DOWN_T_LINE,
0,
barIndex,
maxRequiredBars,
downTBuffer
//
+16 -12
View File
@@ -646,7 +646,7 @@ class XCX121XVOLUMEHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(bullishVolumeBuffer);
@@ -669,7 +669,7 @@ class XCX121XVOLUMEHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -695,7 +695,7 @@ class XCX121XVOLUMEHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(bullishVolumeMaBuffer);
@@ -718,7 +718,7 @@ class XCX121XVOLUMEHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -747,7 +747,7 @@ class XCX121XVOLUMEHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(bearishVolumeBuffer);
@@ -770,7 +770,7 @@ class XCX121XVOLUMEHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -796,7 +796,7 @@ class XCX121XVOLUMEHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(bearishVolumeMaBuffer);
@@ -819,7 +819,7 @@ class XCX121XVOLUMEHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -1071,17 +1071,21 @@ class XCX121XVOLUMEHelper : public XCBaseHelper
//
void Calculate(
int barIndex = 0,
int maxRequiredBars = 100 //
)
{
//
// Buffers ...
if (barInex < 0) {
barIndex = 0;
}
//
CopyBuffer(
mHandler,
X121_XVOLUME_BULLISH_LINE,
0,
barIndex,
maxRequiredBars,
bullishVolumeBuffer
//
@@ -1091,7 +1095,7 @@ class XCX121XVOLUMEHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XVOLUME_BULLISH_MA_LINE,
0,
barIndex,
maxRequiredBars,
bullishVolumeMaBuffer
//
@@ -1101,7 +1105,7 @@ class XCX121XVOLUMEHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XVOLUME_BEARISH_LINE,
0,
barIndex,
maxRequiredBars,
bearishVolumeBuffer
//
@@ -1111,7 +1115,7 @@ class XCX121XVOLUMEHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XVOLUME_BEARISH_MA_LINE,
0,
barIndex,
maxRequiredBars,
bearishVolumeMaBuffer
//
+29 -24
View File
@@ -683,7 +683,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(vwapFastBuffer);
@@ -706,7 +706,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -735,7 +735,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(vwapFastStateBuffer);
@@ -758,7 +758,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -787,7 +787,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(vwapMidBuffer);
@@ -810,7 +810,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -839,7 +839,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(vwapMidStateBuffer);
@@ -862,7 +862,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -891,7 +891,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(vwapSlowBuffer);
@@ -914,7 +914,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -943,7 +943,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(vwapSlowStateBuffer);
@@ -966,7 +966,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -995,7 +995,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(vwapVolumeBuffer);
@@ -1018,7 +1018,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -1047,7 +1047,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
}
//
Calculate();
Calculate(barIndex);
//
int count = ArraySize(vwapPriceBuffer);
@@ -1070,7 +1070,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
{
//
// Update Calculations ...
Calculate();
Calculate(start);
//
// Copy Items ...
@@ -1442,18 +1442,23 @@ class XCX121XVWAPHelper : public XCBaseHelper
//
void Calculate(
int barIndex = 0,
int maxRequiredBars = 100 //
)
{
//
// Buffers ...
if (barIndex < 0)
{
barIndex = 0;
}
//
// FAST ...
CopyBuffer(
mHandler,
X121_XVWAP_FAST_LINE,
0,
barIndex,
maxRequiredBars,
vwapFastBuffer
//
@@ -1464,7 +1469,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XVWAP_FAST_STATE_LINE,
0,
barIndex,
maxRequiredBars,
vwapFastStateBuffer
//
@@ -1475,7 +1480,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XVWAP_MID_LINE,
0,
barIndex,
maxRequiredBars,
vwapMidBuffer
//
@@ -1486,7 +1491,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XVWAP_MID_STATE_LINE,
0,
barIndex,
maxRequiredBars,
vwapMidStateBuffer
//
@@ -1497,7 +1502,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XVWAP_SLOW_LINE,
0,
barIndex,
maxRequiredBars,
vwapSlowBuffer
//
@@ -1508,7 +1513,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XVWAP_SLOW_STATE_LINE,
0,
barIndex,
maxRequiredBars,
vwapSlowStateBuffer
//
@@ -1519,7 +1524,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XVWAP_VOLUME_LINE,
0,
barIndex,
maxRequiredBars,
vwapVolumeBuffer
//
@@ -1530,7 +1535,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
CopyBuffer(
mHandler,
X121_XVWAP_PRICE_LINE,
0,
barIndex,
maxRequiredBars,
vwapPriceBuffer
//
+63 -117
View File
@@ -108,11 +108,6 @@ class XCX121SMCXINDSignalDetector : public XCBase
//
int loopback = 10;
//
int idx = -1;
int count = 0;
bool has = false;
//
mConditions.symbol = symbol;
mConditions.period = period;
@@ -209,6 +204,7 @@ class XCX121SMCXINDSignalDetector : public XCBase
double point = 0;
double targets[];
XBoxZone signalBox;
XBoxZone signalZone;
bool hasSignalBox = false;
ENUM_X_DIRECTION signalBoxDir = X_DIRECTION_NONE;
ENUM_X121SMC_XIND_PROVIDERS signalProvider = X121SMC_XIND_PROVIDER_NONE;
@@ -219,6 +215,7 @@ class XCX121SMCXINDSignalDetector : public XCBase
//
int waitingBoxesCount = UpdateWaitingBoxes(
X_CYCLE_ANALYSE,
X_CYCLE_DECISION,
provider //
);
@@ -228,27 +225,26 @@ class XCX121SMCXINDSignalDetector : public XCBase
DrawBoxes(drawer);
//
if (hasWaitingBoxes)
// Detect Signal Boxes ...
hasSignalBox = HasXINDConditions(
mWaitingBoxes,
mActivatedBoxes,
mBreakedBoxes,
X_CYCLE_DECISION,
signalBox,
signalZone,
signalBoxDir,
provider,
zIndex //
);
if (hasSignalBox)
{
//
hasSignalBox = HasXPVConditions(
mWaitingBoxes,
mActivatedBoxes,
mBreakedBoxes,
X_CYCLE_DECISION,
signalBox,
signalBoxDir,
provider,
zIndex //
);
if (hasSignalBox)
{
//
signalProvider = X121SMC_XIND_PROVIDER_XSTR;
signalProvider = X121SMC_XIND_PROVIDER_XIND;
//
MakeSignalBoxUnAvailable(signalBox);
}
//
MakeSignalBoxUnAvailable(signalBox);
MakeSignalBoxUnAvailable(signalZone);
}
//
@@ -329,7 +325,7 @@ class XCX121SMCXINDSignalDetector : public XCBase
//
// Select and Provide SL Based on ...
double iAtr = 0;
if (signalProvider == X121SMC_XIND_PROVIDER_XSTR)
if (signalProvider == X121SMC_XIND_PROVIDER_XIND)
{
//
iAtr = provider.decisionXConditions.atrBuffer[1];
@@ -445,7 +441,8 @@ class XCX121SMCXINDSignalDetector : public XCBase
bool DetectSignalTrigger(
X121SMCStrategyXINDSignalConditions &conditions,
X121SMCStrategySignalProviderData &provider,
int maxAllowedSetupAge = 60)
int maxAllowedSetupAge = 60 //
)
{
//
bool result = false;
@@ -1095,6 +1092,7 @@ class XCX121SMCXINDSignalDetector : public XCBase
*/
int UpdateWaitingBoxes(
ENUM_X_CYCLES cycle,
ENUM_X_CYCLES vCycle,
X121SMCStrategySignalProviderData &provider //
)
{
@@ -1137,113 +1135,61 @@ class XCX121SMCXINDSignalDetector : public XCBase
// Detecting New Boxes ...
//
// Checking Bullish Fair Value Gaps ...
has = cState.HasBullishFairValueGaps();
XBoxZone tmpBoxes[];
count = cState.FairValueGapsAsBox(tmpBoxes);
has = IsValidSize(count);
if (has)
{
//
XBoxZone tmpBoxes[];
ToBox(
cState.bullishFairValueGaps,
tmpBoxes //
);
//
count = ArraySize(tmpBoxes);
has = IsValidSize(count);
if (has)
for (int i = 0; i < count; i++)
{
//
for (int i = 0; i < count; i++)
{
//
XBoxZone iBox = tmpBoxes[i];
bool isValid = IsBoxValid(
iBox,
0,
iBox.period //
);
if (!isValid)
{
//
iBox.Clean();
continue;
}
XBoxZone iBox = tmpBoxes[i];
//
has = IsBoxExists(iBox);
if (!has)
{
//
AddRef(
iBox,
mWaitingBoxes //
);
}
//
iBox.Clean();
}
}
//
Clean(tmpBoxes);
}
//
// Checking Bearish Fair Value Gaps ...
has = cState.HasBearishFairValueGaps();
if (has)
{
//
XBoxZone tmpBoxes[];
ToBox(
cState.bearishFairValueGaps,
tmpBoxes //
);
//
count = ArraySize(tmpBoxes);
has = IsValidSize(count);
if (has)
{
//
for (int i = 0; i < count; i++)
// Regular Validation of Boxes ...
bool isValid = IsBoxValid(
iBox,
0,
iBox.period //
);
if (!isValid)
{
//
XBoxZone iBox = tmpBoxes[i];
bool isValid = IsBoxValid(
iBox,
0,
iBox.period //
);
if (!isValid)
{
//
iBox.Clean();
continue;
;
}
//
has = IsBoxExists(iBox);
if (!has)
{
//
AddRef(
iBox,
mWaitingBoxes //
);
}
iBox.Clean();
continue;
}
//
// Conditional Validation of FVG Boxes ...
isValid = IsFVGBoxValid(
iBox,
vCycle,
provider //
);
if (!isValid)
{
//
iBox.Clean();
continue;
}
}
//
Clean(tmpBoxes);
//
has = IsBoxExists(iBox);
if (!has)
{
//
AddRef(
iBox,
mWaitingBoxes //
);
}
//
iBox.Clean();
}
}
Clean(tmpBoxes);
//
// Update Times ...
+581 -129
View File
@@ -31,7 +31,7 @@
enum ENUM_X121SMC_XIND_PROVIDERS
{
X121SMC_XIND_PROVIDER_NONE,
X121SMC_XIND_PROVIDER_XSTR,
X121SMC_XIND_PROVIDER_XIND,
X121SMC_XIND_PROVIDER_XTKKUMO,
};
@@ -223,17 +223,469 @@ struct X121SMCStrategyXINDSignalConditions
//
// Extension Functions ...
//
// Validate FVG BOXes ...
//
bool IsFVGBoxValid(
XBoxZone &box,
ENUM_X_CYCLES cycle,
X121SMCStrategySignalProviderData &provider //
)
{
//
bool result = false;
//
result = box.IsValid();
if (!result)
{
return result;
}
//
// Fil Selected Data ...
XPOIState cState;
X121Conditions cXConditions;
XPOIStateEvents cStateEvents;
XC121SMCCycleHelper *cHelper;
X121SMCCycleConditions cConditions;
result = provider.SelectCycle(
cycle,
cState,
cStateEvents,
cXConditions,
cHelper,
cConditions //
);
if (!result)
{
//
cState.Clean();
ZeroMemory(cHelper);
cConditions.Clean();
cXConditions.Clean();
cStateEvents.Clean();
//
return result;
}
//
bool isBoxBullish = box.IsBullish();
//
int count = 0;
bool has = false;
//
XBoxZone tmpBoxes[];
count = cState.FairValueGapsAsBox(tmpBoxes);
has = IsValidSize(count);
//
// Check Must Contains Inner Cycle FVG ...
XBoxZone selectedBox;
bool hasSelectedBox = false;
if (has)
{
//
for (int i = 0; i < count; i++)
{
//
XBoxZone iBox = tmpBoxes[i];
//
// Regular Validation of Boxes ...
bool isValid = IsBoxValid(
iBox,
0,
iBox.period //
);
bool isTypePassed = iBox.dir == box.dir;
bool isFromPssed = iBox.from >= box.from;
bool isPlacePassed =
IsBoxInsideOr(
iBox,
box //
) &&
(isBoxBullish
? iBox.lower >= box.lower
: iBox.upper <= box.upper);
has =
isValid &&
isFromPssed &&
isTypePassed &&
isPlacePassed;
if (!has)
{
//
iBox.Clean();
continue;
}
//
has =
!hasSelectedBox
? true
: isBoxBullish
? selectedBox.upper > iBox.upper
: selectedBox.lower < iBox.lower;
if (has)
{
//
selectedBox = iBox;
hasSelectedBox = selectedBox.IsValid();
}
//
iBox.Clean();
}
}
//
result = hasSelectedBox;
//
if (result)
{
//
//
// From Index ...
int fromIndex = GetBarIndex(
selectedBox.symbol,
selectedBox.period,
selectedBox.from //
) + 1;
result = IsValidIndex(fromIndex);
//
// To Index ...
int toIndex = GetBarIndex(
selectedBox.symbol,
selectedBox.period,
selectedBox.to //
);
if (toIndex < 1)
{
toIndex = 1;
}
result = IsValidIndex(toIndex);
//
// Now we Have Retrieve X121Conditions between from and to Indexes ...
// for Check States ...
//
bool hasNewValeUnderLast = false;
bool isStrSwitchedToBullish = false;
bool isSarSwitchedToBullish = false;
bool hasValueGoldenZoneBreak = false;
bool isSMHKSwitchedToBullish = false;
bool isVWapSwitchedToBullishState = false;
bool isX3MaSwitchedToBullishState = false;
bool isVWapSwitchedToBullishOrdered = false;
bool isX3MaSwitchedToBullishOrdered = false;
//
bool hasNewPeakOverLast = false;
bool isStrSwitchedToBearish = false;
bool isSarSwitchedToBearish = false;
bool hasPeakGoldenZoneBreak = false;
bool isSMHKSwitchedToBearish = false;
bool isVWapSwitchedToBearishState = false;
bool isX3MaSwitchedToBearishState = false;
bool isVWapSwitchedToBearishOrdered = false;
bool isX3MaSwitchedToBearishOrdered = false;
//
for (int i = fromIndex; i >= toIndex; i--)
{
//
XOHCL iBar;
has = iBar.Init(
cState.symbol,
cState.period,
i //
);
X121Conditions iConditions;
has = has &&
cHelper.mX121Helper.GetConditions(
iConditions,
i //
);
if (!has)
{
continue;
}
//
// Bullish ...
//
if (!hasNewValeUnderLast)
{
hasNewValeUnderLast = iConditions.isNewValeUnderLast;
}
//
if (!isStrSwitchedToBullish)
{
isStrSwitchedToBullish = iConditions.isStrSwitchedToBullish;
}
//
if (!isSarSwitchedToBullish)
{
isSarSwitchedToBullish = iConditions.isSarSwitchedToBullish;
}
//
if (!hasValueGoldenZoneBreak)
{
//
hasValueGoldenZoneBreak =
iBar.IsBullish() &&
iBar.GetUp() > iConditions.valesGoldenBuffer[1] &&
iBar.GetDown() < iConditions.valesGoldenBuffer[1];
}
//
if (!isSMHKSwitchedToBullish)
{
isSMHKSwitchedToBullish = iConditions.isSMHKSwitchedToBullish;
}
//
if (!isVWapSwitchedToBullishState)
{
isVWapSwitchedToBullishState = iConditions.isVWapSwitchedToBullishState;
}
//
if (!isX3MaSwitchedToBullishState)
{
isX3MaSwitchedToBullishState = iConditions.isX3MaSwitchedToBullishState;
}
//
if (!isVWapSwitchedToBullishOrdered)
{
isVWapSwitchedToBullishOrdered = iConditions.isVWapSwitchedToBullishOrdered;
}
//
if (!isX3MaSwitchedToBullishOrdered)
{
isX3MaSwitchedToBullishOrdered = iConditions.isX3MaSwitchedToBullishOrdered;
}
//
// Bearish ...
//
if (!hasNewPeakOverLast)
{
hasNewPeakOverLast = iConditions.isNewPeakOverLast;
}
//
if (!isStrSwitchedToBearish)
{
isStrSwitchedToBearish = iConditions.isStrSwitchedToBearish;
}
//
if (!isSarSwitchedToBearish)
{
isSarSwitchedToBearish = iConditions.isSarSwitchedToBearish;
}
//
if (!hasPeakGoldenZoneBreak)
{
//
hasPeakGoldenZoneBreak =
iBar.IsBearish() &&
iBar.GetUp() > iConditions.peaksGoldenBuffer[1] &&
iBar.GetDown() < iConditions.peaksGoldenBuffer[1];
}
//
if (!isSMHKSwitchedToBearish)
{
isSMHKSwitchedToBearish = iConditions.isSMHKSwitchedToBearish;
}
//
if (!isVWapSwitchedToBearishState)
{
isVWapSwitchedToBearishState = iConditions.isVWapSwitchedToBearishState;
}
//
if (!isX3MaSwitchedToBearishState)
{
isX3MaSwitchedToBearishState = iConditions.isX3MaSwitchedToBearishState;
}
//
if (!isVWapSwitchedToBearishOrdered)
{
isVWapSwitchedToBearishOrdered = iConditions.isVWapSwitchedToBearishOrdered;
}
//
if (!isX3MaSwitchedToBearishOrdered)
{
isX3MaSwitchedToBearishOrdered = iConditions.isX3MaSwitchedToBearishOrdered;
}
//
iConditions.Clean();
}
//
// Bullish Conditions Summary ...
//
bool hasBullishOrConditions =
hasNewValeUnderLast ||
isStrSwitchedToBullish ||
isSarSwitchedToBullish ||
hasValueGoldenZoneBreak ||
isSMHKSwitchedToBullish ||
isVWapSwitchedToBullishState ||
isX3MaSwitchedToBullishState ||
isVWapSwitchedToBullishOrdered ||
isX3MaSwitchedToBullishOrdered;
//
bool hasBullishAndConditions =
hasNewValeUnderLast &&
hasValueGoldenZoneBreak &&
(isStrSwitchedToBullish ||
isSarSwitchedToBullish ||
isSMHKSwitchedToBullish ||
isVWapSwitchedToBullishState ||
isX3MaSwitchedToBullishState ||
isVWapSwitchedToBullishOrdered ||
isX3MaSwitchedToBullishOrdered);
//
// Bearish Conditions Summary ...
//
bool hasBearishOrConditions =
hasNewPeakOverLast ||
isStrSwitchedToBearish ||
isSarSwitchedToBearish ||
hasPeakGoldenZoneBreak ||
isSMHKSwitchedToBearish ||
isVWapSwitchedToBearishState ||
isX3MaSwitchedToBearishState ||
isVWapSwitchedToBearishOrdered ||
isX3MaSwitchedToBearishOrdered;
//
bool hasBearishAndConditions =
hasNewPeakOverLast &&
hasPeakGoldenZoneBreak &&
(isStrSwitchedToBearish ||
isSarSwitchedToBearish ||
isSMHKSwitchedToBearish ||
isVWapSwitchedToBearishState ||
isX3MaSwitchedToBearishState ||
isVWapSwitchedToBearishOrdered ||
isX3MaSwitchedToBearishOrdered);
//
bool isBullish =
isBoxBullish &&
!hasBearishOrConditions &&
hasBullishAndConditions;
//
bool isBearish =
!isBoxBullish &&
!hasBullishOrConditions &&
hasBearishAndConditions;
//
result = isBullish ||
isBearish;
//
if (result)
{
//
XCBoxObject *iBoxObj;
XCBoxObject *iInBoxObj;
//
has = provider
.verificationCycleHelper
.mPOIDrawer
.DrawBox(
box,
iBoxObj //
);
if (has)
{
//
iBoxObj.BoxWidth(2);
iBoxObj.BoxStyle(STYLE_SOLID);
}
//
has = provider
.verificationCycleHelper
.mPOIDrawer
.DrawBox(
selectedBox,
iInBoxObj //
);
if (has)
{
//
iInBoxObj.BoxWidth(2);
iInBoxObj.BoxStyle(STYLE_DASH);
}
//
Print("Inside Selected Box ...");
}
}
//
// Cleanup Resources ...
//
cState.Clean();
Clean(tmpBoxes);
selectedBox.Clean();
ZeroMemory(cHelper);
cConditions.Clean();
cXConditions.Clean();
cStateEvents.Clean();
//
return result;
}
//
// Signalling Conditions Parsers ...
//
// Detect Signals Based On XPV Indicator Golden Zones ...
bool HasXPVConditions(
bool HasXINDConditions(
XBoxZone &waitingBoxes[],
XBoxZone &ctivtedBoxes[],
XBoxZone &activatedBoxes[],
XBoxZone &breakedBoxes[],
ENUM_X_CYCLES cycle,
XBoxZone &box,
XBoxZone &zone,
ENUM_X_DIRECTION &dir,
X121SMCStrategySignalProviderData &provider,
int barIndex = 0 //
@@ -244,8 +696,15 @@ bool HasXPVConditions(
//
box.Clean();
zone.Clean();
dir = X_DIRECTION_NONE;
//
// Checking Required Zone Boxes for Signalling ...
int waitingBoxesCount = ArraySize(waitingBoxes);
int breakedBoxesCount = ArraySize(breakedBoxes);
int activatedBoxesCount = ArraySize(activatedBoxes);
//
// Fil Selected Data ...
XPOIState cState;
@@ -336,115 +795,97 @@ bool HasXPVConditions(
}
//
// Checking Conditions ...
//
// Retrieve Some Values ...
//
double peak = cXConditions.peaksBuffer[cIDX];
double peakZ = cXConditions.peaksBuffer[zIDX];
double peakP = cXConditions.peaksBuffer[pIDX];
double peakPP = cXConditions.peaksBuffer[ppIDX];
//
double vale = cXConditions.valesBuffer[cIDX];
double valeZ = cXConditions.valesBuffer[zIDX];
double valeP = cXConditions.valesBuffer[pIDX];
double valePP = cXConditions.valesBuffer[ppIDX];
//
double cSMHKOpen = cXConditions.xhkSMOpenBuffer[cIDX];
double cSMHKHigh = cXConditions.xhkSMHighBuffer[cIDX];
double cSMHKClose = cXConditions.xhkSMCloseBuffer[cIDX];
double cSMHKLow = cXConditions.xhkSMLowBuffer[cIDX];
double cSMHKMin = MathMin(cSMHKOpen, cSMHKClose);
double cSMHKMax = MathMax(cSMHKOpen, cSMHKClose);
//
double pSMHKOpen = cXConditions.xhkSMOpenBuffer[pIDX];
double pSMHKHigh = cXConditions.xhkSMHighBuffer[pIDX];
double pSMHKClose = cXConditions.xhkSMCloseBuffer[pIDX];
double pSMHKLow = cXConditions.xhkSMLowBuffer[pIDX];
double pSMHKMin = MathMin(pSMHKOpen, pSMHKClose);
double pSMHKMax = MathMax(pSMHKOpen, pSMHKClose);
//
double atrUpperSM = cXConditions.atrUpperSMBuffer[cIDX];
double atrLowerSM = cXConditions.atrLowerSMBuffer[cIDX];
//
double atrUpperSMZ = cXConditions.atrUpperSMBuffer[zIDX];
double atrLowerSMZ = cXConditions.atrLowerSMBuffer[zIDX];
//
double atrUpperSMP = cXConditions.atrUpperSMBuffer[pIDX];
double atrLowerSMP = cXConditions.atrLowerSMBuffer[pIDX];
//
double atrUpperSMPP = cXConditions.atrUpperSMBuffer[ppIDX];
double atrLowerSMPP = cXConditions.atrLowerSMBuffer[ppIDX];
//
double rsiChange = cXConditions.rsiChangeBuffer[cIDX];
double rsiChangeZ = cXConditions.rsiChangeBuffer[zIDX];
double rsiChangeP = cXConditions.rsiChangeBuffer[pIDX];
double rsiChangePP = cXConditions.rsiChangeBuffer[ppIDX];
//
double rsiChangeSM = cXConditions.rsiChangeSMBuffer[cIDX];
double rsiChangeSMZ = cXConditions.rsiChangeSMBuffer[zIDX];
double rsiChangeSMP = cXConditions.rsiChangeSMBuffer[pIDX];
double rsiChangeSMPP = cXConditions.rsiChangeSMBuffer[ppIDX];
//
double peaksGolden = cXConditions.peaksGoldenBuffer[cIDX];
double peaksGoldenZ = cXConditions.peaksGoldenBuffer[zIDX];
double peaksGoldenP = cXConditions.peaksGoldenBuffer[pIDX];
double peaksGoldenPP = cXConditions.peaksGoldenBuffer[ppIDX];
//
double valesGolden = cXConditions.valesGoldenBuffer[cIDX];
double valesGoldenZ = cXConditions.valesGoldenBuffer[zIDX];
double valesGoldenP = cXConditions.valesGoldenBuffer[pIDX];
double valesGoldenPP = cXConditions.valesGoldenBuffer[ppIDX];
//
double priceChange = cXConditions.priceChangeBuffer[cIDX];
double priceChangeZ = cXConditions.priceChangeBuffer[zIDX];
double priceChangeP = cXConditions.priceChangeBuffer[pIDX];
double priceChangePP = cXConditions.priceChangeBuffer[ppIDX];
//
double priceChangeSM = cXConditions.priceChangeSMBuffer[cIDX];
double priceChangeSMZ = cXConditions.priceChangeSMBuffer[zIDX];
double priceChangeSMP = cXConditions.priceChangeSMBuffer[pIDX];
double priceChangeSMPP = cXConditions.priceChangeSMBuffer[ppIDX];
//
//
//
//
// XHK ...
//
bool isPBarClosedOverSMHK =
// Select Waiting Box ...
XBoxZone selectedBox;
bool hasSelectedBox = false;
bool useWaitingBoxes = false;
bool useActivtedBoxes = false;
bool useBreakedBoxes = false;
if (useWaitingBoxes && IsValidSize(waitingBoxesCount))
{
//
pBar.IsBullish() &&
pBar.GetUp() > pSMHKMax &&
pBar.GetDown() < pSMHKMin
for (int i = 0; i < waitingBoxesCount; i++)
{
//
XBoxZone iBox = waitingBoxes[i];
//
iBox.Clean();
}
//
;
hasSelectedBox = selectedBox.IsValid();
if (!hasSelectedBox)
{
selectedBox.Clean();
}
}
if (useActivtedBoxes && !hasSelectedBox && IsValidSize(activatedBoxesCount))
{
//
for (int i = 0; i < activatedBoxesCount; i++)
{
//
XBoxZone iBox = activatedBoxes[i];
//
iBox.Clean();
}
//
hasSelectedBox = selectedBox.IsValid();
if (!hasSelectedBox)
{
selectedBox.Clean();
}
}
if (useBreakedBoxes && !hasSelectedBox && IsValidSize(breakedBoxesCount))
{
//
for (int i = 0; i < breakedBoxesCount; i++)
{
//
XBoxZone iBox = breakedBoxes[i];
//
iBox.Clean();
}
//
hasSelectedBox = selectedBox.IsValid();
if (!hasSelectedBox)
{
selectedBox.Clean();
}
}
//
bool isPBarClosedUnderSMHK =
XCPOIDrawer *drawer = provider.visionCycleHelper.mPOIDrawer;
if (hasSelectedBox)
{
//
pBar.IsBearish() &&
pBar.GetUp() > pSMHKMax &&
pBar.GetDown() < pSMHKMin
//
;
selectedBox.to = zBar.time;
XCBoxObject *iObj;
has = drawer.DrawBox(
selectedBox,
iObj //
);
if (has)
{
//
iObj.BoxColor(clrCornflowerBlue);
iObj.BoxStyle(STYLE_SOLID);
iObj.BoxWidth(2);
//
Print("Selected Box ...");
}
}
ZeroMemory(drawer);
//
//
//
//
//
@@ -458,6 +899,7 @@ bool HasXPVConditions(
//
false
//
//
;
//
@@ -465,6 +907,7 @@ bool HasXPVConditions(
//
false
//
//
;
//
@@ -492,7 +935,8 @@ bool HasXPVConditions(
//
// Usually is Preffered SL ...
double pivot = 0;
double pivot =
0;
//
// Usually is Current Price or Entry Price ...
@@ -514,28 +958,31 @@ bool HasXPVConditions(
: point;
//
XCPOIDrawer *drawer = provider.visionCycleHelper.mPOIDrawer;
bool drawBoxes = true;
if (drawBoxes)
{
//
if (box.IsValid())
{
//
XCBoxObject *iObj;
bool isCreated = drawer.DrawBox(
box,
iObj //
);
zone = selectedBox;
//
if (isCreated)
{
//
// TODO: ...
}
}
}
//
// XCPOIDrawer *drawer = provider.visionCycleHelper.mPOIDrawer;
// bool drawBoxes = true;
// if (drawBoxes)
// {
// //
// if (box.IsValid())
// {
// //
// XCBoxObject *iObj;
// bool isCreated = drawer.DrawBox(
// box,
// iObj //
// );
// //
// if (isCreated)
// {
// //
// // TODO: ...
// }
// }
// }
}
//
@@ -556,6 +1003,7 @@ bool HasXPVConditions(
cConditions.Clean();
cConditions.Clean();
ZeroMemory(cHelper);
selectedBox.Clean();
cStateEvents.Clean();
cXConditions.Clean();
@@ -563,4 +1011,8 @@ bool HasXPVConditions(
return result;
}
//
//
//
//
@@ -960,7 +960,7 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
//
bool showAll = false;
int swingLength = 17;
int swingLength = 14;
//
x121Inputs.showRSI = showAll || false;
@@ -996,11 +996,14 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
//
// Presentations ...
x121Inputs.xpvInputs.showSar = showAll || false;
x121Inputs.xpvInputs.showSar = showAll || true;
x121Inputs.xpvInputs.showPeaks = showAll || true;
x121Inputs.xpvInputs.showVales = showAll || true;
x121Inputs.xpvInputs.showTrend = showAll || false;
x121Inputs.xpvInputs.showSupports = showAll || false;
x121Inputs.xpvInputs.showGoldenZones = showAll || false;
x121Inputs.xpvInputs.showSwingLows = showAll || false;
x121Inputs.xpvInputs.showSwingHighs = showAll || false;
x121Inputs.xpvInputs.showGoldenZones = showAll || true;
x121Inputs.xpvInputs.showResistances = showAll || false;
//
@@ -1015,7 +1018,7 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
//
// Presentations ...
x121Inputs.xhkInputs.drawRawXHKCandles = showAll || false;
x121Inputs.xhkInputs.drawSmoothedXHKCandles = showAll || false;
x121Inputs.xhkInputs.drawSmoothedXHKCandles = showAll || true;
//
// XMAS ...
@@ -1036,7 +1039,7 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
//
// Configurations ...
x121Inputs.xatrInputs.atrMultiplier = 1.5;
x121Inputs.xatrInputs.atrMultiplier = 2;
x121Inputs.xatrInputs.rsiLength = swingLength;
x121Inputs.xatrInputs.atrLength = swingLength;
x121Inputs.xatrInputs.priceChangeSmoothingLength = swingLength;
@@ -1049,7 +1052,7 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
x121Inputs.xatrInputs.showAtrUpper = showAll || false;
x121Inputs.xatrInputs.showAtrLower = showAll || false;
x121Inputs.xatrInputs.showRSIChange = showAll || false;
x121Inputs.xatrInputs.showPriceChange = showAll || false;
x121Inputs.xatrInputs.showPriceChange = showAll || true;
x121Inputs.xatrInputs.showSmoothedAtrUpper = showAll || false;
x121Inputs.xatrInputs.showSmoothedAtrLower = showAll || false;
x121Inputs.xatrInputs.showSmoothedRSIChange = showAll || false;
@@ -1060,11 +1063,13 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
//
// Configurations ...
x121Inputs.xstrInputs.strMultiplier = 5;
x121Inputs.xstrInputs.strLength = swingLength;
x121Inputs.xstrInputs.strAppliedTo = PRICE_TYPICAL;
//
// Presentations ...
x121Inputs.xstrInputs.showStr = showAll || false;
x121Inputs.xstrInputs.showStr = showAll || true;
x121Inputs.xstrInputs.showStrUpper = showAll || false;
x121Inputs.xstrInputs.showStrLower = showAll || false;
@@ -1086,6 +1091,7 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
//
// Configurations ...
x121Inputs.x3maInputs.x3maMaMethod = MODE_SMA;
x121Inputs.x3maInputs.x3maFastMALength = swingLength;
x121Inputs.x3maInputs.x3maMidMALength = (swingLength * 2);
x121Inputs.x3maInputs.x3maSlowMALength = 50;