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
+77 -16
View File
@@ -1309,6 +1309,14 @@ class XCX121XVWAPHelper : public XCBaseHelper
conditions.isVWapSwitchedToBearishState = isVWapSwitchedToBearishState;
conditions.isVWapSwitchedToNeuturalState = isVWapSwitchedToNeuturalState;
//
Cleanup();
//
zBar.Clean();
cBar.Clean();
pBar.Clean();
//
return result;
}
@@ -1335,15 +1343,10 @@ class XCX121XVWAPHelper : public XCBaseHelper
double vwapSlowStateBuffer[];
//
void Calculate()
void Calculate(
int maxRequiredBars = 100 //
)
{
//
int totalBars = CountBars();
if (totalBars > 1000)
{
totalBars = 1000;
}
//
// Buffers ...
@@ -1353,7 +1356,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
mHandler,
X121_XVWAP_FAST_LINE,
0,
totalBars,
maxRequiredBars,
vwapFastBuffer
//
);
@@ -1364,7 +1367,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
mHandler,
X121_XVWAP_FAST_STATE_LINE,
0,
totalBars,
maxRequiredBars,
vwapFastStateBuffer
//
);
@@ -1375,7 +1378,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
mHandler,
X121_XVWAP_MID_LINE,
0,
totalBars,
maxRequiredBars,
vwapMidBuffer
//
);
@@ -1386,7 +1389,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
mHandler,
X121_XVWAP_MID_STATE_LINE,
0,
totalBars,
maxRequiredBars,
vwapMidStateBuffer
//
);
@@ -1397,7 +1400,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
mHandler,
X121_XVWAP_SLOW_LINE,
0,
totalBars,
maxRequiredBars,
vwapSlowBuffer
//
);
@@ -1408,7 +1411,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
mHandler,
X121_XVWAP_SLOW_STATE_LINE,
0,
totalBars,
maxRequiredBars,
vwapSlowStateBuffer
//
);
@@ -1419,7 +1422,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
mHandler,
X121_XVWAP_VOLUME_LINE,
0,
totalBars,
maxRequiredBars,
vwapVolumeBuffer
//
);
@@ -1430,11 +1433,69 @@ class XCX121XVWAPHelper : public XCBaseHelper
mHandler,
X121_XVWAP_PRICE_LINE,
0,
totalBars,
maxRequiredBars,
vwapPriceBuffer
//
);
}
//
void Cleanup(
int maxAllowed = 100 //
)
{
//
CleanupArray(
vwapFastBuffer,
maxAllowed //
);
//
CleanupArray(
vwapMidBuffer,
maxAllowed //
);
//
CleanupArray(
vwapSlowBuffer,
maxAllowed //
);
//
CleanupArray(
vwapVolumeBuffer,
maxAllowed //
);
//
CleanupArray(
vwapPriceBuffer,
maxAllowed //
);
//
CleanupArray(
vwapFastStateBuffer,
maxAllowed //
);
//
CleanupArray(
vwapMidStateBuffer,
maxAllowed //
);
//
CleanupArray(
vwapSlowStateBuffer,
maxAllowed //
);
//
}
//
};
//