try to cleanup unused items in indicator's Helper Classes ...

This commit is contained in:
2025-02-12 14:24:18 +03:30
parent 28eb1233b1
commit 9f21ad0dd8
10 changed files with 11240 additions and 138 deletions
+78 -17
View File
@@ -1128,7 +1128,7 @@ class XCX121XCHEHelper : public XCBaseHelper
!isCheBullishPrev;
bool isCheSwitchedToBearish = isCheBearish &&
!isCheBearishPrev;
//
double ches[];
double prevCheLE1 = le1Buffer[pIDX];
@@ -1196,6 +1196,14 @@ class XCX121XCHEHelper : public XCBaseHelper
conditions.isClosedUnderCheMin = isClosedUnderCheMin;
conditions.isClosedUnderCheMax = isClosedUnderCheMax;
//
Cleanup();
//
zBar.Clean();
cBar.Clean();
pBar.Clean();
//
return result;
}
@@ -1222,15 +1230,10 @@ class XCX121XCHEHelper : public XCBaseHelper
double se2StartBuffer[];
//
void Calculate()
void Calculate(
int maxRequiredBars = 100 //
)
{
//
int totalBars = CountBars();
if (totalBars > 1000)
{
totalBars = 1000;
}
//
// Buffers ...
@@ -1240,7 +1243,7 @@ class XCX121XCHEHelper : public XCBaseHelper
mHandler,
X121_XCHE_LE_1_S_LINE,
0,
totalBars,
maxRequiredBars,
le1StartBuffer //
);
@@ -1250,7 +1253,7 @@ class XCX121XCHEHelper : public XCBaseHelper
mHandler,
X121_XCHE_LE_1_LINE,
0,
totalBars,
maxRequiredBars,
le1Buffer //
);
@@ -1260,7 +1263,7 @@ class XCX121XCHEHelper : public XCBaseHelper
mHandler,
X121_XCHE_LE_2_S_LINE,
0,
totalBars,
maxRequiredBars,
le2StartBuffer //
);
@@ -1270,7 +1273,7 @@ class XCX121XCHEHelper : public XCBaseHelper
mHandler,
X121_XCHE_LE_2_LINE,
0,
totalBars,
maxRequiredBars,
le2Buffer //
);
@@ -1280,7 +1283,7 @@ class XCX121XCHEHelper : public XCBaseHelper
mHandler,
X121_XCHE_SE_1_S_LINE,
0,
totalBars,
maxRequiredBars,
se1StartBuffer //
);
@@ -1290,7 +1293,7 @@ class XCX121XCHEHelper : public XCBaseHelper
mHandler,
X121_XCHE_SE_1_LINE,
0,
totalBars,
maxRequiredBars,
se1Buffer //
);
@@ -1300,7 +1303,7 @@ class XCX121XCHEHelper : public XCBaseHelper
mHandler,
X121_XCHE_SE_2_S_LINE,
0,
totalBars,
maxRequiredBars,
se2StartBuffer //
);
@@ -1310,10 +1313,68 @@ class XCX121XCHEHelper : public XCBaseHelper
mHandler,
X121_XCHE_SE_2_LINE,
0,
totalBars,
maxRequiredBars,
se2Buffer //
);
}
//
void Cleanup(
int maxAllowed = 100 //
)
{
//
CleanupArray(
le1Buffer,
maxAllowed //
);
//
CleanupArray(
se1Buffer,
maxAllowed //
);
//
CleanupArray(
le2Buffer,
maxAllowed //
);
//
CleanupArray(
se2Buffer,
maxAllowed //
);
//
CleanupArray(
le1StartBuffer,
maxAllowed //
);
//
CleanupArray(
se1StartBuffer,
maxAllowed //
);
//
CleanupArray(
le2StartBuffer,
maxAllowed //
);
//
CleanupArray(
se2StartBuffer,
maxAllowed //
);
//
}
//
};
//