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);
}
/////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////
+22 -18
View File
@@ -672,7 +672,7 @@ class XCX121X3MAHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(x3maFastBuffer); int count = ArraySize(x3maFastBuffer);
@@ -695,7 +695,7 @@ class XCX121X3MAHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -724,7 +724,7 @@ class XCX121X3MAHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(x3maFastStateBuffer); int count = ArraySize(x3maFastStateBuffer);
@@ -747,7 +747,7 @@ class XCX121X3MAHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -776,7 +776,7 @@ class XCX121X3MAHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(x3maMidBuffer); int count = ArraySize(x3maMidBuffer);
@@ -799,7 +799,7 @@ class XCX121X3MAHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -828,7 +828,7 @@ class XCX121X3MAHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(x3maMidStateBuffer); int count = ArraySize(x3maMidStateBuffer);
@@ -851,7 +851,7 @@ class XCX121X3MAHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -880,7 +880,7 @@ class XCX121X3MAHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(x3maSlowBuffer); int count = ArraySize(x3maSlowBuffer);
@@ -903,7 +903,7 @@ class XCX121X3MAHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -932,7 +932,7 @@ class XCX121X3MAHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(x3maSlowStateBuffer); int count = ArraySize(x3maSlowStateBuffer);
@@ -955,7 +955,7 @@ class XCX121X3MAHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -1311,18 +1311,22 @@ class XCX121X3MAHelper : public XCBaseHelper
// //
void Calculate( void Calculate(
int barIndex = 0,
int maxRequiredBars = 100 // int maxRequiredBars = 100 //
) )
{ {
// //
// Buffers ... // Buffers ...
if (barIndex < 0) {
barIndex = 0;
}
// //
// FAST ... // FAST ...
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_X3MA_FAST_LINE, X121_X3MA_FAST_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
x3maFastBuffer x3maFastBuffer
// //
@@ -1333,7 +1337,7 @@ class XCX121X3MAHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_X3MA_FAST_STATE_LINE, X121_X3MA_FAST_STATE_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
x3maFastStateBuffer x3maFastStateBuffer
// //
@@ -1344,7 +1348,7 @@ class XCX121X3MAHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_X3MA_MID_LINE, X121_X3MA_MID_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
x3maMidBuffer x3maMidBuffer
// //
@@ -1355,7 +1359,7 @@ class XCX121X3MAHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_X3MA_MID_STATE_LINE, X121_X3MA_MID_STATE_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
x3maMidStateBuffer x3maMidStateBuffer
// //
@@ -1366,7 +1370,7 @@ class XCX121X3MAHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_X3MA_SLOW_LINE, X121_X3MA_SLOW_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
x3maSlowBuffer x3maSlowBuffer
// //
@@ -1377,7 +1381,7 @@ class XCX121X3MAHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_X3MA_SLOW_STATE_LINE, X121_X3MA_SLOW_STATE_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
x3maSlowStateBuffer x3maSlowStateBuffer
// //
+35 -30
View File
@@ -815,7 +815,7 @@ class XCX121XATRHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(rsiBuffer); int count = ArraySize(rsiBuffer);
@@ -838,7 +838,7 @@ class XCX121XATRHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -867,7 +867,7 @@ class XCX121XATRHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(atrBuffer); int count = ArraySize(atrBuffer);
@@ -890,7 +890,7 @@ class XCX121XATRHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -916,7 +916,7 @@ class XCX121XATRHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(atrUpperBuffer); int count = ArraySize(atrUpperBuffer);
@@ -939,7 +939,7 @@ class XCX121XATRHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -965,7 +965,7 @@ class XCX121XATRHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(atrLowerBuffer); int count = ArraySize(atrLowerBuffer);
@@ -988,7 +988,7 @@ class XCX121XATRHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -1014,7 +1014,7 @@ class XCX121XATRHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(atrUpperSMBuffer); int count = ArraySize(atrUpperSMBuffer);
@@ -1037,7 +1037,7 @@ class XCX121XATRHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -1063,7 +1063,7 @@ class XCX121XATRHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(atrLowerSMBuffer); int count = ArraySize(atrLowerSMBuffer);
@@ -1086,7 +1086,7 @@ class XCX121XATRHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -1115,7 +1115,7 @@ class XCX121XATRHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(priceChangeBuffer); int count = ArraySize(priceChangeBuffer);
@@ -1138,7 +1138,7 @@ class XCX121XATRHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -1164,7 +1164,7 @@ class XCX121XATRHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(priceChangeSMBuffer); int count = ArraySize(priceChangeSMBuffer);
@@ -1187,7 +1187,7 @@ class XCX121XATRHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -1216,7 +1216,7 @@ class XCX121XATRHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(rsiChangeBuffer); int count = ArraySize(rsiChangeBuffer);
@@ -1239,7 +1239,7 @@ class XCX121XATRHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -1265,7 +1265,7 @@ class XCX121XATRHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(rsiChangeSMBuffer); int count = ArraySize(rsiChangeSMBuffer);
@@ -1288,7 +1288,7 @@ class XCX121XATRHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -1629,18 +1629,23 @@ class XCX121XATRHelper : public XCBaseHelper
// //
void Calculate( void Calculate(
int barIndex = 0,
int maxRequiredBars = 100 // int maxRequiredBars = 100 //
) )
{ {
// //
// Buffers ... // Buffers ...
if (barIndex < 0)
{
barIndex = 0;
}
// //
// RSI ... // RSI ...
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_RSI_LINE, X121_RSI_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
rsiBuffer rsiBuffer
// //
@@ -1651,7 +1656,7 @@ class XCX121XATRHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_ATR_LINE, X121_ATR_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
atrBuffer // atrBuffer //
); );
@@ -1664,7 +1669,7 @@ class XCX121XATRHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_ATR_UPPER_LINE, X121_ATR_UPPER_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
atrUpperBuffer // atrUpperBuffer //
); );
@@ -1674,7 +1679,7 @@ class XCX121XATRHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_ATR_LOWER_LINE, X121_ATR_LOWER_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
atrLowerBuffer // atrLowerBuffer //
); );
@@ -1684,7 +1689,7 @@ class XCX121XATRHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_ATR_SM_UPPER_LINE, X121_ATR_SM_UPPER_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
atrUpperSMBuffer // atrUpperSMBuffer //
); );
@@ -1694,7 +1699,7 @@ class XCX121XATRHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_ATR_SM_LOWER_LINE, X121_ATR_SM_LOWER_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
atrLowerSMBuffer // atrLowerSMBuffer //
); );
@@ -1706,7 +1711,7 @@ class XCX121XATRHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_PRICE_CHANGE_LINE, X121_PRICE_CHANGE_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
priceChangeBuffer // priceChangeBuffer //
); );
@@ -1715,7 +1720,7 @@ class XCX121XATRHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_PRICE_CHANGE_SM_LINE, X121_PRICE_CHANGE_SM_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
priceChangeSMBuffer // priceChangeSMBuffer //
); );
@@ -1727,7 +1732,7 @@ class XCX121XATRHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_RSI_CHANGE_LINE, X121_RSI_CHANGE_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
rsiChangeBuffer // rsiChangeBuffer //
); );
@@ -1736,7 +1741,7 @@ class XCX121XATRHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_RSI_CHANGE_SM_LINE, X121_RSI_CHANGE_SM_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
rsiChangeSMBuffer // rsiChangeSMBuffer //
); );
+29 -24
View File
@@ -595,7 +595,7 @@ class XCX121XCHEHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(le1Buffer); int count = ArraySize(le1Buffer);
@@ -618,7 +618,7 @@ class XCX121XCHEHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -644,7 +644,7 @@ class XCX121XCHEHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(le1StartBuffer); int count = ArraySize(le1StartBuffer);
@@ -667,7 +667,7 @@ class XCX121XCHEHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -693,7 +693,7 @@ class XCX121XCHEHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(le2Buffer); int count = ArraySize(le2Buffer);
@@ -716,7 +716,7 @@ class XCX121XCHEHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -742,7 +742,7 @@ class XCX121XCHEHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(le2StartBuffer); int count = ArraySize(le2StartBuffer);
@@ -765,7 +765,7 @@ class XCX121XCHEHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -791,7 +791,7 @@ class XCX121XCHEHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(se1Buffer); int count = ArraySize(se1Buffer);
@@ -814,7 +814,7 @@ class XCX121XCHEHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -840,7 +840,7 @@ class XCX121XCHEHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(se1StartBuffer); int count = ArraySize(se1StartBuffer);
@@ -863,7 +863,7 @@ class XCX121XCHEHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -889,7 +889,7 @@ class XCX121XCHEHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(se2Buffer); int count = ArraySize(se2Buffer);
@@ -912,7 +912,7 @@ class XCX121XCHEHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -938,7 +938,7 @@ class XCX121XCHEHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(se2StartBuffer); int count = ArraySize(se2StartBuffer);
@@ -961,7 +961,7 @@ class XCX121XCHEHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -1218,18 +1218,23 @@ class XCX121XCHEHelper : public XCBaseHelper
// //
void Calculate( void Calculate(
int barIndex = 0,
int maxRequiredBars = 100 // int maxRequiredBars = 100 //
) )
{ {
// //
// Buffers ... // Buffers ...
if (barIndex < 0)
{
barIndex = 0;
}
// //
// LE1 Start ... // LE1 Start ...
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XCHE_LE_1_S_LINE, X121_XCHE_LE_1_S_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
le1StartBuffer // le1StartBuffer //
); );
@@ -1239,7 +1244,7 @@ class XCX121XCHEHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XCHE_LE_1_LINE, X121_XCHE_LE_1_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
le1Buffer // le1Buffer //
); );
@@ -1249,7 +1254,7 @@ class XCX121XCHEHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XCHE_LE_2_S_LINE, X121_XCHE_LE_2_S_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
le2StartBuffer // le2StartBuffer //
); );
@@ -1259,7 +1264,7 @@ class XCX121XCHEHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XCHE_LE_2_LINE, X121_XCHE_LE_2_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
le2Buffer // le2Buffer //
); );
@@ -1269,7 +1274,7 @@ class XCX121XCHEHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XCHE_SE_1_S_LINE, X121_XCHE_SE_1_S_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
se1StartBuffer // se1StartBuffer //
); );
@@ -1279,7 +1284,7 @@ class XCX121XCHEHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XCHE_SE_1_LINE, X121_XCHE_SE_1_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
se1Buffer // se1Buffer //
); );
@@ -1289,7 +1294,7 @@ class XCX121XCHEHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XCHE_SE_2_S_LINE, X121_XCHE_SE_2_S_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
se2StartBuffer // se2StartBuffer //
); );
@@ -1299,7 +1304,7 @@ class XCX121XCHEHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XCHE_SE_2_LINE, X121_XCHE_SE_2_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
se2Buffer // se2Buffer //
); );
+14 -9
View File
@@ -520,7 +520,7 @@ class XCX121XDELTAHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(deltaBuffer); int count = ArraySize(deltaBuffer);
@@ -543,7 +543,7 @@ class XCX121XDELTAHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -569,7 +569,7 @@ class XCX121XDELTAHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(deltaStateBuffer); int count = ArraySize(deltaStateBuffer);
@@ -592,7 +592,7 @@ class XCX121XDELTAHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -618,7 +618,7 @@ class XCX121XDELTAHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(deltaMaBuffer); int count = ArraySize(deltaMaBuffer);
@@ -641,7 +641,7 @@ class XCX121XDELTAHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -784,17 +784,22 @@ class XCX121XDELTAHelper : public XCBaseHelper
// //
void Calculate( void Calculate(
int barIndex = 0,
int maxRequiredBars = 100 // int maxRequiredBars = 100 //
) )
{ {
// //
// Buffers ... // Buffers ...
if (barIndex < 0)
{
barIndex = 0;
}
// //
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XDELTA_VOLUME_LINE, X121_XDELTA_VOLUME_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
deltaBuffer deltaBuffer
// //
@@ -804,7 +809,7 @@ class XCX121XDELTAHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XDELTA_MA_LINE, X121_XDELTA_MA_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
deltaMaBuffer deltaMaBuffer
// //
@@ -814,7 +819,7 @@ class XCX121XDELTAHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XDELTA_STATE_LINE, X121_XDELTA_STATE_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
deltaStateBuffer deltaStateBuffer
// //
+34 -26
View File
@@ -488,7 +488,7 @@ class XCX121XDONHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(donOpenUpperBuffer); int count = ArraySize(donOpenUpperBuffer);
@@ -511,7 +511,7 @@ class XCX121XDONHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -540,7 +540,7 @@ class XCX121XDONHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(donOpenLowerBuffer); int count = ArraySize(donOpenLowerBuffer);
@@ -563,7 +563,7 @@ class XCX121XDONHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -595,7 +595,7 @@ class XCX121XDONHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(donCloseUpperBuffer); int count = ArraySize(donCloseUpperBuffer);
@@ -618,7 +618,7 @@ class XCX121XDONHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -647,7 +647,7 @@ class XCX121XDONHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(donCloseLowerBuffer); int count = ArraySize(donCloseLowerBuffer);
@@ -670,7 +670,7 @@ class XCX121XDONHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -702,7 +702,7 @@ class XCX121XDONHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(donHighUpperBuffer); int count = ArraySize(donHighUpperBuffer);
@@ -725,7 +725,7 @@ class XCX121XDONHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -754,7 +754,7 @@ class XCX121XDONHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(donHighLowerBuffer); int count = ArraySize(donHighLowerBuffer);
@@ -777,7 +777,7 @@ class XCX121XDONHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -809,7 +809,7 @@ class XCX121XDONHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(donLowUpperBuffer); int count = ArraySize(donLowUpperBuffer);
@@ -832,7 +832,7 @@ class XCX121XDONHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -861,7 +861,7 @@ class XCX121XDONHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(donLowLowerBuffer); int count = ArraySize(donLowLowerBuffer);
@@ -884,7 +884,7 @@ class XCX121XDONHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -1019,26 +1019,34 @@ class XCX121XDONHelper : public XCBaseHelper
// //
// Buffers ... // Buffers ...
double donLowUpperBuffer[];
double donLowLowerBuffer[];
double donOpenUpperBuffer[]; double donOpenUpperBuffer[];
double donOpenLowerBuffer[]; double donOpenLowerBuffer[];
double donHighUpperBuffer[]; double donHighUpperBuffer[];
double donHighLowerBuffer[]; double donHighLowerBuffer[];
double donLowUpperBuffer[];
double donLowLowerBuffer[];
double donCloseUpperBuffer[]; double donCloseUpperBuffer[];
double donCloseLowerBuffer[]; double donCloseLowerBuffer[];
// //
void Calculate( void Calculate(
int barIndex = 0,
int maxRequiredBars = 100 // int maxRequiredBars = 100 //
) )
{ {
//
// Buffers ...
if (barIndex < 0)
{
barIndex = 0;
}
// //
// Upper ... // Upper ...
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XDON_OPEN_UPPER_LINE, X121_XDON_OPEN_UPPER_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
donOpenUpperBuffer donOpenUpperBuffer
// //
@@ -1049,7 +1057,7 @@ class XCX121XDONHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XDON_OPEN_LOWER_LINE, X121_XDON_OPEN_LOWER_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
donOpenLowerBuffer donOpenLowerBuffer
// //
@@ -1063,7 +1071,7 @@ class XCX121XDONHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XDON_CLOSE_UPPER_LINE, X121_XDON_CLOSE_UPPER_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
donCloseUpperBuffer donCloseUpperBuffer
// //
@@ -1074,7 +1082,7 @@ class XCX121XDONHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XDON_CLOSE_LOWER_LINE, X121_XDON_CLOSE_LOWER_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
donCloseLowerBuffer donCloseLowerBuffer
// //
@@ -1088,7 +1096,7 @@ class XCX121XDONHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XDON_HIGH_UPPER_LINE, X121_XDON_HIGH_UPPER_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
donHighUpperBuffer donHighUpperBuffer
// //
@@ -1099,7 +1107,7 @@ class XCX121XDONHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XDON_HIGH_LOWER_LINE, X121_XDON_HIGH_LOWER_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
donHighLowerBuffer donHighLowerBuffer
// //
@@ -1113,7 +1121,7 @@ class XCX121XDONHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XDON_LOW_UPPER_LINE, X121_XDON_LOW_UPPER_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
donLowUpperBuffer donLowUpperBuffer
// //
@@ -1124,7 +1132,7 @@ class XCX121XDONHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XDON_LOW_LOWER_LINE, X121_XDON_LOW_LOWER_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
donLowLowerBuffer donLowLowerBuffer
// //
+35 -24
View File
@@ -580,7 +580,7 @@ class XCX121XHKHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(xhkRawOpenBuffer); int count = ArraySize(xhkRawOpenBuffer);
@@ -603,7 +603,7 @@ class XCX121XHKHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -629,7 +629,7 @@ class XCX121XHKHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(xhkRawHighBuffer); int count = ArraySize(xhkRawHighBuffer);
@@ -652,7 +652,7 @@ class XCX121XHKHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -678,7 +678,7 @@ class XCX121XHKHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(xhkRawLowBuffer); int count = ArraySize(xhkRawLowBuffer);
@@ -701,7 +701,7 @@ class XCX121XHKHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -727,7 +727,7 @@ class XCX121XHKHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(xhkRawCloseBuffer); int count = ArraySize(xhkRawCloseBuffer);
@@ -750,7 +750,7 @@ class XCX121XHKHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -776,7 +776,7 @@ class XCX121XHKHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(xhkSMOpenBuffer); int count = ArraySize(xhkSMOpenBuffer);
@@ -799,7 +799,7 @@ class XCX121XHKHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -825,7 +825,7 @@ class XCX121XHKHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(xhkSMHighBuffer); int count = ArraySize(xhkSMHighBuffer);
@@ -848,7 +848,7 @@ class XCX121XHKHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -874,7 +874,7 @@ class XCX121XHKHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(xhkSMLowBuffer); int count = ArraySize(xhkSMLowBuffer);
@@ -897,7 +897,7 @@ class XCX121XHKHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -923,7 +923,7 @@ class XCX121XHKHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(xhkSMCloseBuffer); int count = ArraySize(xhkSMCloseBuffer);
@@ -946,7 +946,7 @@ class XCX121XHKHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -978,6 +978,9 @@ class XCX121XHKHelper : public XCBaseHelper
barIndex = 0; barIndex = 0;
} }
//
Calculate(barIndex);
// //
result = bar.Init( result = bar.Init(
GetSymbol(), GetSymbol(),
@@ -1017,6 +1020,9 @@ class XCX121XHKHelper : public XCBaseHelper
barIndex = 0; barIndex = 0;
} }
//
Calculate(barIndex);
// //
result = bar.Init( result = bar.Init(
GetSymbol(), GetSymbol(),
@@ -1321,18 +1327,23 @@ class XCX121XHKHelper : public XCBaseHelper
// //
void Calculate( void Calculate(
int barIndex = 0,
int maxRequiredBars = 100 // int maxRequiredBars = 100 //
) )
{ {
// //
// Buffers ... // Buffers ...
if (barIndex < 0)
{
barIndex = 0;
}
// //
// RAW Open ... // RAW Open ...
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XHK_RAW_OPEN_LINE, X121_XHK_RAW_OPEN_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
xhkRawOpenBuffer xhkRawOpenBuffer
// //
@@ -1343,7 +1354,7 @@ class XCX121XHKHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XHK_RAW_HIGH_LINE, X121_XHK_RAW_HIGH_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
xhkRawHighBuffer xhkRawHighBuffer
// //
@@ -1354,7 +1365,7 @@ class XCX121XHKHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XHK_RAW_LOW_LINE, X121_XHK_RAW_LOW_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
xhkRawLowBuffer xhkRawLowBuffer
// //
@@ -1365,7 +1376,7 @@ class XCX121XHKHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XHK_RAW_CLOSE_LINE, X121_XHK_RAW_CLOSE_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
xhkRawCloseBuffer xhkRawCloseBuffer
// //
@@ -1376,7 +1387,7 @@ class XCX121XHKHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XHK_SM_OPEN_LINE, X121_XHK_SM_OPEN_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
xhkSMOpenBuffer xhkSMOpenBuffer
// //
@@ -1387,7 +1398,7 @@ class XCX121XHKHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XHK_SM_HIGH_LINE, X121_XHK_SM_HIGH_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
xhkSMHighBuffer xhkSMHighBuffer
// //
@@ -1398,7 +1409,7 @@ class XCX121XHKHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XHK_SM_LOW_LINE, X121_XHK_SM_LOW_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
xhkSMLowBuffer xhkSMLowBuffer
// //
@@ -1409,7 +1420,7 @@ class XCX121XHKHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XHK_SM_CLOSE_LINE, X121_XHK_SM_CLOSE_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
xhkSMCloseBuffer xhkSMCloseBuffer
// //
+20 -15
View File
@@ -572,7 +572,7 @@ class XCX121XICHHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(tenkanSenBuffer); int count = ArraySize(tenkanSenBuffer);
@@ -595,7 +595,7 @@ class XCX121XICHHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -621,7 +621,7 @@ class XCX121XICHHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(kijunSenBuffer); int count = ArraySize(kijunSenBuffer);
@@ -644,7 +644,7 @@ class XCX121XICHHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -670,7 +670,7 @@ class XCX121XICHHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(chikouSpanBuffer); int count = ArraySize(chikouSpanBuffer);
@@ -693,7 +693,7 @@ class XCX121XICHHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -719,7 +719,7 @@ class XCX121XICHHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(senkouSpanABuffer); int count = ArraySize(senkouSpanABuffer);
@@ -742,7 +742,7 @@ class XCX121XICHHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -768,7 +768,7 @@ class XCX121XICHHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(senkouSpanBBuffer); int count = ArraySize(senkouSpanBBuffer);
@@ -791,7 +791,7 @@ class XCX121XICHHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -1000,17 +1000,22 @@ class XCX121XICHHelper : public XCBaseHelper
// //
void Calculate( void Calculate(
int barIndex = 0,
int maxRequiredBars = 100 // int maxRequiredBars = 100 //
) )
{ {
// //
// Buffers ... // Buffers ...
if (barIndex < 0)
{
barIndex = 0;
}
// //
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XICH_KIJUNSEN_LINE, X121_XICH_KIJUNSEN_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
kijunSenBuffer kijunSenBuffer
// //
@@ -1020,7 +1025,7 @@ class XCX121XICHHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XICH_TENKANSEN_LINE, X121_XICH_TENKANSEN_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
tenkanSenBuffer tenkanSenBuffer
// //
@@ -1030,7 +1035,7 @@ class XCX121XICHHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XICH_CHIKOUSPAN_LINE, X121_XICH_CHIKOUSPAN_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
chikouSpanBuffer chikouSpanBuffer
// //
@@ -1040,7 +1045,7 @@ class XCX121XICHHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XICH_SENKOUSPANA_LINE, X121_XICH_SENKOUSPANA_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
senkouSpanABuffer senkouSpanABuffer
// //
@@ -1050,7 +1055,7 @@ class XCX121XICHHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XICH_SENKOUSPANB_LINE, X121_XICH_SENKOUSPANB_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
senkouSpanBBuffer senkouSpanBBuffer
// //
+14 -9
View File
@@ -442,7 +442,7 @@ class XCX121XMASHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(upperBuffer); int count = ArraySize(upperBuffer);
@@ -465,7 +465,7 @@ class XCX121XMASHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -494,7 +494,7 @@ class XCX121XMASHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(midBuffer); int count = ArraySize(midBuffer);
@@ -517,7 +517,7 @@ class XCX121XMASHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -546,7 +546,7 @@ class XCX121XMASHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(lowerBuffer); int count = ArraySize(lowerBuffer);
@@ -569,7 +569,7 @@ class XCX121XMASHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -719,18 +719,23 @@ class XCX121XMASHelper : public XCBaseHelper
// //
void Calculate( void Calculate(
int barIndex = 0,
int maxRequiredBars = 100 // int maxRequiredBars = 100 //
) )
{ {
// //
// Buffers ... // Buffers ...
if (barIndex < 0)
{
barIndex = 0;
}
// //
// FAST ... // FAST ...
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XMAS_UPPER_LINE, X121_XMAS_UPPER_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
upperBuffer upperBuffer
// //
@@ -741,7 +746,7 @@ class XCX121XMASHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XMAS_MID_LINE, X121_XMAS_MID_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
midBuffer midBuffer
// //
@@ -752,7 +757,7 @@ class XCX121XMASHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XMAS_LOWER_LINE, X121_XMAS_LOWER_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
lowerBuffer lowerBuffer
// //
+81 -77
View File
@@ -842,7 +842,7 @@ class XCX121XPVHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(sarBuffer); int count = ArraySize(sarBuffer);
@@ -865,7 +865,7 @@ class XCX121XPVHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -897,7 +897,7 @@ class XCX121XPVHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(peaksBuffer); int count = ArraySize(peaksBuffer);
@@ -920,7 +920,7 @@ class XCX121XPVHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -949,7 +949,7 @@ class XCX121XPVHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(valesBuffer); int count = ArraySize(valesBuffer);
@@ -972,7 +972,7 @@ class XCX121XPVHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -1001,7 +1001,7 @@ class XCX121XPVHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(swingLowsBuffer); int count = ArraySize(swingLowsBuffer);
@@ -1024,7 +1024,7 @@ class XCX121XPVHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -1053,7 +1053,7 @@ class XCX121XPVHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(swingHighsBuffer); int count = ArraySize(swingHighsBuffer);
@@ -1076,7 +1076,7 @@ class XCX121XPVHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -1105,7 +1105,7 @@ class XCX121XPVHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(trendBuffer); int count = ArraySize(trendBuffer);
@@ -1128,7 +1128,7 @@ class XCX121XPVHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -1157,7 +1157,7 @@ class XCX121XPVHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(trendColorBuffer); int count = ArraySize(trendColorBuffer);
@@ -1180,7 +1180,7 @@ class XCX121XPVHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -1209,7 +1209,7 @@ class XCX121XPVHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(trendStateBuffer); int count = ArraySize(trendStateBuffer);
@@ -1232,7 +1232,7 @@ class XCX121XPVHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -1261,7 +1261,7 @@ class XCX121XPVHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(supportsBuffer); int count = ArraySize(supportsBuffer);
@@ -1284,7 +1284,7 @@ class XCX121XPVHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -1313,7 +1313,7 @@ class XCX121XPVHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(resistancesBuffer); int count = ArraySize(resistancesBuffer);
@@ -1336,7 +1336,7 @@ class XCX121XPVHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -1365,7 +1365,7 @@ class XCX121XPVHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(peaksGoldenBuffer); int count = ArraySize(peaksGoldenBuffer);
@@ -1388,7 +1388,7 @@ class XCX121XPVHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -1417,7 +1417,7 @@ class XCX121XPVHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(valesGoldenBuffer); int count = ArraySize(valesGoldenBuffer);
@@ -1440,7 +1440,7 @@ class XCX121XPVHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -1472,7 +1472,7 @@ class XCX121XPVHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(cHHBuffer); int count = ArraySize(cHHBuffer);
@@ -1495,7 +1495,7 @@ class XCX121XPVHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -1524,7 +1524,7 @@ class XCX121XPVHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(cLLBuffer); int count = ArraySize(cLLBuffer);
@@ -1547,7 +1547,7 @@ class XCX121XPVHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -1579,7 +1579,7 @@ class XCX121XPVHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(sHHBuffer); int count = ArraySize(sHHBuffer);
@@ -1602,7 +1602,7 @@ class XCX121XPVHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -1631,7 +1631,7 @@ class XCX121XPVHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(sLLBuffer); int count = ArraySize(sLLBuffer);
@@ -1654,7 +1654,7 @@ class XCX121XPVHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -1686,7 +1686,7 @@ class XCX121XPVHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(mHHBuffer); int count = ArraySize(mHHBuffer);
@@ -1709,7 +1709,7 @@ class XCX121XPVHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -1738,7 +1738,7 @@ class XCX121XPVHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(mLLBuffer); int count = ArraySize(mLLBuffer);
@@ -1761,7 +1761,7 @@ class XCX121XPVHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -1793,7 +1793,7 @@ class XCX121XPVHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(lHHBuffer); int count = ArraySize(lHHBuffer);
@@ -1816,7 +1816,7 @@ class XCX121XPVHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -1845,7 +1845,7 @@ class XCX121XPVHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(lLLBuffer); int count = ArraySize(lLLBuffer);
@@ -1868,7 +1868,7 @@ class XCX121XPVHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -1900,7 +1900,7 @@ class XCX121XPVHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(hHHBuffer); int count = ArraySize(hHHBuffer);
@@ -1923,7 +1923,7 @@ class XCX121XPVHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -1952,7 +1952,7 @@ class XCX121XPVHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(hLLBuffer); int count = ArraySize(hLLBuffer);
@@ -1975,7 +1975,7 @@ class XCX121XPVHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -2004,7 +2004,7 @@ class XCX121XPVHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(fractalsUpperBuffer); int count = ArraySize(fractalsUpperBuffer);
@@ -2027,7 +2027,7 @@ class XCX121XPVHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -2056,7 +2056,7 @@ class XCX121XPVHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(fractalsLowerBuffer); int count = ArraySize(fractalsLowerBuffer);
@@ -2079,7 +2079,7 @@ class XCX121XPVHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -2352,7 +2352,7 @@ class XCX121XPVHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
for (int i = 0; i < barIndex + loopback; i++) 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++) 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++) 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++) for (int i = 0; i < barIndex + loopback; i++)
@@ -2891,18 +2891,22 @@ class XCX121XPVHelper : public XCBaseHelper
// //
void Calculate( void Calculate(
int barIndex = 0,
int maxRequiredBars = 100 // int maxRequiredBars = 100 //
) )
{ {
// //
// Buffers ... // Buffers ...
int calculatedBars = BarsCalculated(mHandler); if (barIndex < 0)
{
barIndex = 0;
}
// //
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XPV_SAR_LINE, X121_XPV_SAR_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
sarBuffer // sarBuffer //
); );
@@ -2911,7 +2915,7 @@ class XCX121XPVHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XPV_C_HH_LINE, X121_XPV_C_HH_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
cHHBuffer // cHHBuffer //
); );
@@ -2920,7 +2924,7 @@ class XCX121XPVHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XPV_C_LL_LINE, X121_XPV_C_LL_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
cLLBuffer // cLLBuffer //
); );
@@ -2929,7 +2933,7 @@ class XCX121XPVHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XPV_S_HH_LINE, X121_XPV_S_HH_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
sHHBuffer // sHHBuffer //
); );
@@ -2938,7 +2942,7 @@ class XCX121XPVHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XPV_S_LL_LINE, X121_XPV_S_LL_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
sLLBuffer // sLLBuffer //
); );
@@ -2947,7 +2951,7 @@ class XCX121XPVHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XPV_M_HH_LINE, X121_XPV_M_HH_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
mHHBuffer // mHHBuffer //
); );
@@ -2956,7 +2960,7 @@ class XCX121XPVHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XPV_M_LL_LINE, X121_XPV_M_LL_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
mLLBuffer // mLLBuffer //
); );
@@ -2965,7 +2969,7 @@ class XCX121XPVHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XPV_L_HH_LINE, X121_XPV_L_HH_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
lHHBuffer // lHHBuffer //
); );
@@ -2974,7 +2978,7 @@ class XCX121XPVHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XPV_L_LL_LINE, X121_XPV_L_LL_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
lLLBuffer // lLLBuffer //
); );
@@ -2983,7 +2987,7 @@ class XCX121XPVHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XPV_H_HH_LINE, X121_XPV_H_HH_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
hHHBuffer // hHHBuffer //
); );
@@ -2992,7 +2996,7 @@ class XCX121XPVHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XPV_H_LL_LINE, X121_XPV_H_LL_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
hLLBuffer // hLLBuffer //
); );
@@ -3001,7 +3005,7 @@ class XCX121XPVHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XPV_TREND_LINE, X121_XPV_TREND_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
trendBuffer // trendBuffer //
); );
@@ -3010,7 +3014,7 @@ class XCX121XPVHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XPV_PEAK_LINE, X121_XPV_PEAK_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
peaksBuffer // peaksBuffer //
); );
@@ -3019,7 +3023,7 @@ class XCX121XPVHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XPV_VALE_LINE, X121_XPV_VALE_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
valesBuffer // valesBuffer //
); );
@@ -3028,7 +3032,7 @@ class XCX121XPVHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XPV_SUPPORT_LINE, X121_XPV_SUPPORT_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
supportsBuffer // supportsBuffer //
); );
@@ -3037,7 +3041,7 @@ class XCX121XPVHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XPV_SWING_LOW_LINE, X121_XPV_SWING_LOW_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
swingLowsBuffer // swingLowsBuffer //
); );
@@ -3046,7 +3050,7 @@ class XCX121XPVHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XPV_SWING_HIGH_LINE, X121_XPV_SWING_HIGH_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
swingHighsBuffer // swingHighsBuffer //
); );
@@ -3055,7 +3059,7 @@ class XCX121XPVHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XPV_TREND_COLOR_LINE, X121_XPV_TREND_COLOR_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
trendColorBuffer // trendColorBuffer //
); );
@@ -3064,7 +3068,7 @@ class XCX121XPVHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XPV_TREND_STATE_LINE, X121_XPV_TREND_STATE_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
trendStateBuffer // trendStateBuffer //
); );
@@ -3073,7 +3077,7 @@ class XCX121XPVHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XPV_PEAK_GOLDEN_ZONE_LINE, X121_XPV_PEAK_GOLDEN_ZONE_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
peaksGoldenBuffer // peaksGoldenBuffer //
); );
@@ -3082,7 +3086,7 @@ class XCX121XPVHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XPV_VALE_GOLDEN_ZONE_LINE, X121_XPV_VALE_GOLDEN_ZONE_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
valesGoldenBuffer // valesGoldenBuffer //
); );
@@ -3091,7 +3095,7 @@ class XCX121XPVHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XPV_RESISTANCE_LINE, X121_XPV_RESISTANCE_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
resistancesBuffer // resistancesBuffer //
); );
@@ -3100,7 +3104,7 @@ class XCX121XPVHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XPV_FRACTALS_UPPER_LINE, X121_XPV_FRACTALS_UPPER_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
fractalsUpperBuffer // fractalsUpperBuffer //
); );
@@ -3109,7 +3113,7 @@ class XCX121XPVHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XPV_FRACTALS_LOWER_LINE, X121_XPV_FRACTALS_LOWER_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
fractalsLowerBuffer // fractalsLowerBuffer //
); );
+23 -18
View File
@@ -499,7 +499,7 @@ class XCX121XSTRHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(atrBuffer); int count = ArraySize(atrBuffer);
@@ -522,7 +522,7 @@ class XCX121XSTRHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -548,7 +548,7 @@ class XCX121XSTRHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(strBuffer); int count = ArraySize(strBuffer);
@@ -571,7 +571,7 @@ class XCX121XSTRHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -597,7 +597,7 @@ class XCX121XSTRHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(strStateBuffer); int count = ArraySize(strStateBuffer);
@@ -620,7 +620,7 @@ class XCX121XSTRHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -646,7 +646,7 @@ class XCX121XSTRHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(strPriceBuffer); int count = ArraySize(strPriceBuffer);
@@ -669,7 +669,7 @@ class XCX121XSTRHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -695,7 +695,7 @@ class XCX121XSTRHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(strUpBuffer); int count = ArraySize(strUpBuffer);
@@ -718,7 +718,7 @@ class XCX121XSTRHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -744,7 +744,7 @@ class XCX121XSTRHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(strDownBuffer); int count = ArraySize(strDownBuffer);
@@ -767,7 +767,7 @@ class XCX121XSTRHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -1011,18 +1011,23 @@ class XCX121XSTRHelper : public XCBaseHelper
// //
void Calculate( void Calculate(
int barIndex = 0,
int maxRequiredBars = 100 // int maxRequiredBars = 100 //
) )
{ {
// //
// Buffers ... // Buffers ...
if (barIndex < 0)
{
barIndex = 0;
}
// //
// STR ... // STR ...
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XSTR_LINE, X121_XSTR_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
strBuffer strBuffer
// //
@@ -1033,7 +1038,7 @@ class XCX121XSTRHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XSTR_STATE_LINE, X121_XSTR_STATE_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
strStateBuffer strStateBuffer
// //
@@ -1044,7 +1049,7 @@ class XCX121XSTRHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XSTR_PRICE_LINE, X121_XSTR_PRICE_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
strPriceBuffer strPriceBuffer
// //
@@ -1055,7 +1060,7 @@ class XCX121XSTRHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XSTR_UP_LINE, X121_XSTR_UP_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
strUpBuffer strUpBuffer
// //
@@ -1066,7 +1071,7 @@ class XCX121XSTRHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XSTR_DOWN_LINE, X121_XSTR_DOWN_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
strDownBuffer strDownBuffer
// //
@@ -1079,7 +1084,7 @@ class XCX121XSTRHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XSTR_ATR_LINE, X121_XSTR_ATR_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
atrBuffer atrBuffer
// //
+29 -24
View File
@@ -552,7 +552,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(upTrendBuffer); int count = ArraySize(upTrendBuffer);
@@ -575,7 +575,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -604,7 +604,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(downTrendBuffer); int count = ArraySize(downTrendBuffer);
@@ -627,7 +627,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -656,7 +656,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(downTrendBuffer); int count = ArraySize(downTrendBuffer);
@@ -679,7 +679,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -708,7 +708,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(adxBuffer); int count = ArraySize(adxBuffer);
@@ -731,7 +731,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -760,7 +760,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(adxPBuffer); int count = ArraySize(adxPBuffer);
@@ -783,7 +783,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -812,7 +812,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(adxMBuffer); int count = ArraySize(adxMBuffer);
@@ -835,7 +835,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -864,7 +864,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(upTBuffer); int count = ArraySize(upTBuffer);
@@ -887,7 +887,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -916,7 +916,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(downTBuffer); int count = ArraySize(downTBuffer);
@@ -939,7 +939,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -1146,18 +1146,23 @@ class XCX121XTRENDHelper : public XCBaseHelper
// //
void Calculate( void Calculate(
int barIndex = 0,
int maxRequiredBars = 100 // int maxRequiredBars = 100 //
) )
{ {
// //
// Buffers ... // Buffers ...
if (barIndex < 0)
{
barIndex = 0;
}
// //
// Up Trend ... // Up Trend ...
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XTREND_UP_LINE, X121_XTREND_UP_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
upTrendBuffer upTrendBuffer
// //
@@ -1168,7 +1173,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XTREND_DOWN_LINE, X121_XTREND_DOWN_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
downTrendBuffer downTrendBuffer
// //
@@ -1179,7 +1184,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XTREND_MA_LINE, X121_XTREND_MA_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
maBuffer maBuffer
// //
@@ -1190,7 +1195,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XTREND_ADX_LINE, X121_XTREND_ADX_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
adxBuffer adxBuffer
// //
@@ -1201,7 +1206,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XTREND_ADX_P_LINE, X121_XTREND_ADX_P_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
adxPBuffer adxPBuffer
// //
@@ -1212,7 +1217,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XTREND_ADX_M_LINE, X121_XTREND_ADX_M_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
adxMBuffer adxMBuffer
// //
@@ -1223,7 +1228,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XTREND_UP_T_LINE, X121_XTREND_UP_T_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
upTBuffer upTBuffer
// //
@@ -1234,7 +1239,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XTREND_DOWN_T_LINE, X121_XTREND_DOWN_T_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
downTBuffer downTBuffer
// //
+16 -12
View File
@@ -646,7 +646,7 @@ class XCX121XVOLUMEHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(bullishVolumeBuffer); int count = ArraySize(bullishVolumeBuffer);
@@ -669,7 +669,7 @@ class XCX121XVOLUMEHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -695,7 +695,7 @@ class XCX121XVOLUMEHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(bullishVolumeMaBuffer); int count = ArraySize(bullishVolumeMaBuffer);
@@ -718,7 +718,7 @@ class XCX121XVOLUMEHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -747,7 +747,7 @@ class XCX121XVOLUMEHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(bearishVolumeBuffer); int count = ArraySize(bearishVolumeBuffer);
@@ -770,7 +770,7 @@ class XCX121XVOLUMEHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -796,7 +796,7 @@ class XCX121XVOLUMEHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(bearishVolumeMaBuffer); int count = ArraySize(bearishVolumeMaBuffer);
@@ -819,7 +819,7 @@ class XCX121XVOLUMEHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -1071,17 +1071,21 @@ class XCX121XVOLUMEHelper : public XCBaseHelper
// //
void Calculate( void Calculate(
int barIndex = 0,
int maxRequiredBars = 100 // int maxRequiredBars = 100 //
) )
{ {
// //
// Buffers ... // Buffers ...
if (barInex < 0) {
barIndex = 0;
}
// //
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XVOLUME_BULLISH_LINE, X121_XVOLUME_BULLISH_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
bullishVolumeBuffer bullishVolumeBuffer
// //
@@ -1091,7 +1095,7 @@ class XCX121XVOLUMEHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XVOLUME_BULLISH_MA_LINE, X121_XVOLUME_BULLISH_MA_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
bullishVolumeMaBuffer bullishVolumeMaBuffer
// //
@@ -1101,7 +1105,7 @@ class XCX121XVOLUMEHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XVOLUME_BEARISH_LINE, X121_XVOLUME_BEARISH_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
bearishVolumeBuffer bearishVolumeBuffer
// //
@@ -1111,7 +1115,7 @@ class XCX121XVOLUMEHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XVOLUME_BEARISH_MA_LINE, X121_XVOLUME_BEARISH_MA_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
bearishVolumeMaBuffer bearishVolumeMaBuffer
// //
+29 -24
View File
@@ -683,7 +683,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(vwapFastBuffer); int count = ArraySize(vwapFastBuffer);
@@ -706,7 +706,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -735,7 +735,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(vwapFastStateBuffer); int count = ArraySize(vwapFastStateBuffer);
@@ -758,7 +758,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -787,7 +787,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(vwapMidBuffer); int count = ArraySize(vwapMidBuffer);
@@ -810,7 +810,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -839,7 +839,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(vwapMidStateBuffer); int count = ArraySize(vwapMidStateBuffer);
@@ -862,7 +862,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -891,7 +891,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(vwapSlowBuffer); int count = ArraySize(vwapSlowBuffer);
@@ -914,7 +914,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -943,7 +943,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(vwapSlowStateBuffer); int count = ArraySize(vwapSlowStateBuffer);
@@ -966,7 +966,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -995,7 +995,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(vwapVolumeBuffer); int count = ArraySize(vwapVolumeBuffer);
@@ -1018,7 +1018,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -1047,7 +1047,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
} }
// //
Calculate(); Calculate(barIndex);
// //
int count = ArraySize(vwapPriceBuffer); int count = ArraySize(vwapPriceBuffer);
@@ -1070,7 +1070,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
{ {
// //
// Update Calculations ... // Update Calculations ...
Calculate(); Calculate(start);
// //
// Copy Items ... // Copy Items ...
@@ -1442,18 +1442,23 @@ class XCX121XVWAPHelper : public XCBaseHelper
// //
void Calculate( void Calculate(
int barIndex = 0,
int maxRequiredBars = 100 // int maxRequiredBars = 100 //
) )
{ {
// //
// Buffers ... // Buffers ...
if (barIndex < 0)
{
barIndex = 0;
}
// //
// FAST ... // FAST ...
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XVWAP_FAST_LINE, X121_XVWAP_FAST_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
vwapFastBuffer vwapFastBuffer
// //
@@ -1464,7 +1469,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XVWAP_FAST_STATE_LINE, X121_XVWAP_FAST_STATE_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
vwapFastStateBuffer vwapFastStateBuffer
// //
@@ -1475,7 +1480,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XVWAP_MID_LINE, X121_XVWAP_MID_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
vwapMidBuffer vwapMidBuffer
// //
@@ -1486,7 +1491,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XVWAP_MID_STATE_LINE, X121_XVWAP_MID_STATE_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
vwapMidStateBuffer vwapMidStateBuffer
// //
@@ -1497,7 +1502,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XVWAP_SLOW_LINE, X121_XVWAP_SLOW_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
vwapSlowBuffer vwapSlowBuffer
// //
@@ -1508,7 +1513,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XVWAP_SLOW_STATE_LINE, X121_XVWAP_SLOW_STATE_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
vwapSlowStateBuffer vwapSlowStateBuffer
// //
@@ -1519,7 +1524,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XVWAP_VOLUME_LINE, X121_XVWAP_VOLUME_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
vwapVolumeBuffer vwapVolumeBuffer
// //
@@ -1530,7 +1535,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XVWAP_PRICE_LINE, X121_XVWAP_PRICE_LINE,
0, barIndex,
maxRequiredBars, maxRequiredBars,
vwapPriceBuffer vwapPriceBuffer
// //
+63 -117
View File
@@ -108,11 +108,6 @@ class XCX121SMCXINDSignalDetector : public XCBase
// //
int loopback = 10; int loopback = 10;
//
int idx = -1;
int count = 0;
bool has = false;
// //
mConditions.symbol = symbol; mConditions.symbol = symbol;
mConditions.period = period; mConditions.period = period;
@@ -209,6 +204,7 @@ class XCX121SMCXINDSignalDetector : public XCBase
double point = 0; double point = 0;
double targets[]; double targets[];
XBoxZone signalBox; XBoxZone signalBox;
XBoxZone signalZone;
bool hasSignalBox = false; bool hasSignalBox = false;
ENUM_X_DIRECTION signalBoxDir = X_DIRECTION_NONE; ENUM_X_DIRECTION signalBoxDir = X_DIRECTION_NONE;
ENUM_X121SMC_XIND_PROVIDERS signalProvider = X121SMC_XIND_PROVIDER_NONE; ENUM_X121SMC_XIND_PROVIDERS signalProvider = X121SMC_XIND_PROVIDER_NONE;
@@ -219,6 +215,7 @@ class XCX121SMCXINDSignalDetector : public XCBase
// //
int waitingBoxesCount = UpdateWaitingBoxes( int waitingBoxesCount = UpdateWaitingBoxes(
X_CYCLE_ANALYSE,
X_CYCLE_DECISION, X_CYCLE_DECISION,
provider // provider //
); );
@@ -228,27 +225,26 @@ class XCX121SMCXINDSignalDetector : public XCBase
DrawBoxes(drawer); DrawBoxes(drawer);
// //
if (hasWaitingBoxes) // Detect Signal Boxes ...
hasSignalBox = HasXINDConditions(
mWaitingBoxes,
mActivatedBoxes,
mBreakedBoxes,
X_CYCLE_DECISION,
signalBox,
signalZone,
signalBoxDir,
provider,
zIndex //
);
if (hasSignalBox)
{ {
// //
hasSignalBox = HasXPVConditions( signalProvider = X121SMC_XIND_PROVIDER_XIND;
mWaitingBoxes,
mActivatedBoxes,
mBreakedBoxes,
X_CYCLE_DECISION,
signalBox,
signalBoxDir,
provider,
zIndex //
);
if (hasSignalBox)
{
//
signalProvider = X121SMC_XIND_PROVIDER_XSTR;
// //
MakeSignalBoxUnAvailable(signalBox); MakeSignalBoxUnAvailable(signalBox);
} MakeSignalBoxUnAvailable(signalZone);
} }
// //
@@ -329,7 +325,7 @@ class XCX121SMCXINDSignalDetector : public XCBase
// //
// Select and Provide SL Based on ... // Select and Provide SL Based on ...
double iAtr = 0; double iAtr = 0;
if (signalProvider == X121SMC_XIND_PROVIDER_XSTR) if (signalProvider == X121SMC_XIND_PROVIDER_XIND)
{ {
// //
iAtr = provider.decisionXConditions.atrBuffer[1]; iAtr = provider.decisionXConditions.atrBuffer[1];
@@ -445,7 +441,8 @@ class XCX121SMCXINDSignalDetector : public XCBase
bool DetectSignalTrigger( bool DetectSignalTrigger(
X121SMCStrategyXINDSignalConditions &conditions, X121SMCStrategyXINDSignalConditions &conditions,
X121SMCStrategySignalProviderData &provider, X121SMCStrategySignalProviderData &provider,
int maxAllowedSetupAge = 60) int maxAllowedSetupAge = 60 //
)
{ {
// //
bool result = false; bool result = false;
@@ -1095,6 +1092,7 @@ class XCX121SMCXINDSignalDetector : public XCBase
*/ */
int UpdateWaitingBoxes( int UpdateWaitingBoxes(
ENUM_X_CYCLES cycle, ENUM_X_CYCLES cycle,
ENUM_X_CYCLES vCycle,
X121SMCStrategySignalProviderData &provider // X121SMCStrategySignalProviderData &provider //
) )
{ {
@@ -1137,113 +1135,61 @@ class XCX121SMCXINDSignalDetector : public XCBase
// Detecting New Boxes ... // Detecting New Boxes ...
// //
// Checking Bullish Fair Value Gaps ... XBoxZone tmpBoxes[];
has = cState.HasBullishFairValueGaps(); count = cState.FairValueGapsAsBox(tmpBoxes);
has = IsValidSize(count);
if (has) if (has)
{ {
// //
XBoxZone tmpBoxes[]; for (int i = 0; i < count; i++)
ToBox(
cState.bullishFairValueGaps,
tmpBoxes //
);
//
count = ArraySize(tmpBoxes);
has = IsValidSize(count);
if (has)
{ {
// //
for (int i = 0; i < count; i++) XBoxZone iBox = tmpBoxes[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++) // Regular Validation of Boxes ...
bool isValid = IsBoxValid(
iBox,
0,
iBox.period //
);
if (!isValid)
{ {
// //
XBoxZone iBox = tmpBoxes[i]; iBox.Clean();
bool isValid = IsBoxValid( continue;
iBox, }
0,
iBox.period //
);
if (!isValid)
{
//
iBox.Clean();
continue;
;
}
//
has = IsBoxExists(iBox);
if (!has)
{
//
AddRef(
iBox,
mWaitingBoxes //
);
}
//
// Conditional Validation of FVG Boxes ...
isValid = IsFVGBoxValid(
iBox,
vCycle,
provider //
);
if (!isValid)
{
// //
iBox.Clean(); iBox.Clean();
continue;
} }
}
// //
Clean(tmpBoxes); has = IsBoxExists(iBox);
if (!has)
{
//
AddRef(
iBox,
mWaitingBoxes //
);
}
//
iBox.Clean();
}
} }
Clean(tmpBoxes);
// //
// Update Times ... // Update Times ...
+581 -129
View File
@@ -31,7 +31,7 @@
enum ENUM_X121SMC_XIND_PROVIDERS enum ENUM_X121SMC_XIND_PROVIDERS
{ {
X121SMC_XIND_PROVIDER_NONE, X121SMC_XIND_PROVIDER_NONE,
X121SMC_XIND_PROVIDER_XSTR, X121SMC_XIND_PROVIDER_XIND,
X121SMC_XIND_PROVIDER_XTKKUMO, X121SMC_XIND_PROVIDER_XTKKUMO,
}; };
@@ -223,17 +223,469 @@ struct X121SMCStrategyXINDSignalConditions
// //
// Extension Functions ... // 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 ... // Signalling Conditions Parsers ...
// //
// Detect Signals Based On XPV Indicator Golden Zones ... // Detect Signals Based On XPV Indicator Golden Zones ...
bool HasXPVConditions( bool HasXINDConditions(
XBoxZone &waitingBoxes[], XBoxZone &waitingBoxes[],
XBoxZone &ctivtedBoxes[], XBoxZone &activatedBoxes[],
XBoxZone &breakedBoxes[], XBoxZone &breakedBoxes[],
ENUM_X_CYCLES cycle, ENUM_X_CYCLES cycle,
XBoxZone &box, XBoxZone &box,
XBoxZone &zone,
ENUM_X_DIRECTION &dir, ENUM_X_DIRECTION &dir,
X121SMCStrategySignalProviderData &provider, X121SMCStrategySignalProviderData &provider,
int barIndex = 0 // int barIndex = 0 //
@@ -244,8 +696,15 @@ bool HasXPVConditions(
// //
box.Clean(); box.Clean();
zone.Clean();
dir = X_DIRECTION_NONE; 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 ... // Fil Selected Data ...
XPOIState cState; XPOIState cState;
@@ -336,115 +795,97 @@ bool HasXPVConditions(
} }
// //
// Checking Conditions ... // Select Waiting Box ...
XBoxZone selectedBox;
// bool hasSelectedBox = false;
// Retrieve Some Values ... bool useWaitingBoxes = false;
bool useActivtedBoxes = false;
// bool useBreakedBoxes = false;
double peak = cXConditions.peaksBuffer[cIDX]; if (useWaitingBoxes && IsValidSize(waitingBoxesCount))
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() && for (int i = 0; i < waitingBoxesCount; i++)
pBar.GetUp() > pSMHKMax && {
pBar.GetDown() < pSMHKMin //
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() && selectedBox.to = zBar.time;
pBar.GetUp() > pSMHKMax && XCBoxObject *iObj;
pBar.GetDown() < pSMHKMin 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 false
// //
//
; ;
// //
@@ -465,6 +907,7 @@ bool HasXPVConditions(
// //
false false
// //
//
; ;
// //
@@ -492,7 +935,8 @@ bool HasXPVConditions(
// //
// Usually is Preffered SL ... // Usually is Preffered SL ...
double pivot = 0; double pivot =
0;
// //
// Usually is Current Price or Entry Price ... // Usually is Current Price or Entry Price ...
@@ -514,28 +958,31 @@ bool HasXPVConditions(
: point; : point;
// //
XCPOIDrawer *drawer = provider.visionCycleHelper.mPOIDrawer; zone = selectedBox;
bool drawBoxes = true;
if (drawBoxes)
{
//
if (box.IsValid())
{
//
XCBoxObject *iObj;
bool isCreated = drawer.DrawBox(
box,
iObj //
);
// //
if (isCreated) // XCPOIDrawer *drawer = provider.visionCycleHelper.mPOIDrawer;
{ // bool drawBoxes = true;
// // if (drawBoxes)
// TODO: ... // {
} // //
} // if (box.IsValid())
} // {
// //
// XCBoxObject *iObj;
// bool isCreated = drawer.DrawBox(
// box,
// iObj //
// );
// //
// if (isCreated)
// {
// //
// // TODO: ...
// }
// }
// }
} }
// //
@@ -556,6 +1003,7 @@ bool HasXPVConditions(
cConditions.Clean(); cConditions.Clean();
cConditions.Clean(); cConditions.Clean();
ZeroMemory(cHelper); ZeroMemory(cHelper);
selectedBox.Clean();
cStateEvents.Clean(); cStateEvents.Clean();
cXConditions.Clean(); cXConditions.Clean();
@@ -564,3 +1012,7 @@ bool HasXPVConditions(
} }
// //
//
//
//
@@ -960,7 +960,7 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
// //
bool showAll = false; bool showAll = false;
int swingLength = 17; int swingLength = 14;
// //
x121Inputs.showRSI = showAll || false; x121Inputs.showRSI = showAll || false;
@@ -996,11 +996,14 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
// //
// Presentations ... // Presentations ...
x121Inputs.xpvInputs.showSar = showAll || false; x121Inputs.xpvInputs.showSar = showAll || true;
x121Inputs.xpvInputs.showPeaks = showAll || true; x121Inputs.xpvInputs.showPeaks = showAll || true;
x121Inputs.xpvInputs.showVales = showAll || true; x121Inputs.xpvInputs.showVales = showAll || true;
x121Inputs.xpvInputs.showTrend = showAll || false;
x121Inputs.xpvInputs.showSupports = 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; x121Inputs.xpvInputs.showResistances = showAll || false;
// //
@@ -1015,7 +1018,7 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
// //
// Presentations ... // Presentations ...
x121Inputs.xhkInputs.drawRawXHKCandles = showAll || false; x121Inputs.xhkInputs.drawRawXHKCandles = showAll || false;
x121Inputs.xhkInputs.drawSmoothedXHKCandles = showAll || false; x121Inputs.xhkInputs.drawSmoothedXHKCandles = showAll || true;
// //
// XMAS ... // XMAS ...
@@ -1036,7 +1039,7 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
// //
// Configurations ... // Configurations ...
x121Inputs.xatrInputs.atrMultiplier = 1.5; x121Inputs.xatrInputs.atrMultiplier = 2;
x121Inputs.xatrInputs.rsiLength = swingLength; x121Inputs.xatrInputs.rsiLength = swingLength;
x121Inputs.xatrInputs.atrLength = swingLength; x121Inputs.xatrInputs.atrLength = swingLength;
x121Inputs.xatrInputs.priceChangeSmoothingLength = swingLength; x121Inputs.xatrInputs.priceChangeSmoothingLength = swingLength;
@@ -1049,7 +1052,7 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
x121Inputs.xatrInputs.showAtrUpper = showAll || false; x121Inputs.xatrInputs.showAtrUpper = showAll || false;
x121Inputs.xatrInputs.showAtrLower = showAll || false; x121Inputs.xatrInputs.showAtrLower = showAll || false;
x121Inputs.xatrInputs.showRSIChange = showAll || false; x121Inputs.xatrInputs.showRSIChange = showAll || false;
x121Inputs.xatrInputs.showPriceChange = showAll || false; x121Inputs.xatrInputs.showPriceChange = showAll || true;
x121Inputs.xatrInputs.showSmoothedAtrUpper = showAll || false; x121Inputs.xatrInputs.showSmoothedAtrUpper = showAll || false;
x121Inputs.xatrInputs.showSmoothedAtrLower = showAll || false; x121Inputs.xatrInputs.showSmoothedAtrLower = showAll || false;
x121Inputs.xatrInputs.showSmoothedRSIChange = showAll || false; x121Inputs.xatrInputs.showSmoothedRSIChange = showAll || false;
@@ -1060,11 +1063,13 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
// //
// Configurations ... // Configurations ...
x121Inputs.xstrInputs.strMultiplier = 5;
x121Inputs.xstrInputs.strLength = swingLength; x121Inputs.xstrInputs.strLength = swingLength;
x121Inputs.xstrInputs.strAppliedTo = PRICE_TYPICAL;
// //
// Presentations ... // Presentations ...
x121Inputs.xstrInputs.showStr = showAll || false; x121Inputs.xstrInputs.showStr = showAll || true;
x121Inputs.xstrInputs.showStrUpper = showAll || false; x121Inputs.xstrInputs.showStrUpper = showAll || false;
x121Inputs.xstrInputs.showStrLower = showAll || false; x121Inputs.xstrInputs.showStrLower = showAll || false;
@@ -1086,6 +1091,7 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
// //
// Configurations ... // Configurations ...
x121Inputs.x3maInputs.x3maMaMethod = MODE_SMA;
x121Inputs.x3maInputs.x3maFastMALength = swingLength; x121Inputs.x3maInputs.x3maFastMALength = swingLength;
x121Inputs.x3maInputs.x3maMidMALength = (swingLength * 2); x121Inputs.x3maInputs.x3maMidMALength = (swingLength * 2);
x121Inputs.x3maInputs.x3maSlowMALength = 50; x121Inputs.x3maInputs.x3maSlowMALength = 50;