try to cleanup unused items in indicator's Helper Classes ...
This commit is contained in:
@@ -946,6 +946,14 @@ class XCX121XSTRHelper : public XCBaseHelper
|
||||
conditions.isStrBearish = isStrBearish;
|
||||
conditions.isStrSwitchedToBullish = isStrSwitchedToBullish;
|
||||
conditions.isStrSwitchedToBearish = isStrSwitchedToBearish;
|
||||
|
||||
//
|
||||
Cleanup();
|
||||
|
||||
//
|
||||
zBar.Clean();
|
||||
cBar.Clean();
|
||||
pBar.Clean();
|
||||
|
||||
//
|
||||
return result;
|
||||
@@ -971,15 +979,10 @@ class XCX121XSTRHelper : public XCBaseHelper
|
||||
double strStateBuffer[];
|
||||
|
||||
//
|
||||
void Calculate()
|
||||
void Calculate(
|
||||
int maxRequiredBars = 100 //
|
||||
)
|
||||
{
|
||||
//
|
||||
int totalBars = CountBars();
|
||||
if (totalBars > 1000)
|
||||
{
|
||||
totalBars = 1000;
|
||||
}
|
||||
|
||||
//
|
||||
// Buffers ...
|
||||
|
||||
@@ -989,7 +992,7 @@ class XCX121XSTRHelper : public XCBaseHelper
|
||||
mHandler,
|
||||
X121_XSTR_LINE,
|
||||
0,
|
||||
totalBars,
|
||||
maxRequiredBars,
|
||||
strBuffer
|
||||
//
|
||||
);
|
||||
@@ -1000,7 +1003,7 @@ class XCX121XSTRHelper : public XCBaseHelper
|
||||
mHandler,
|
||||
X121_XSTR_STATE_LINE,
|
||||
0,
|
||||
totalBars,
|
||||
maxRequiredBars,
|
||||
strStateBuffer
|
||||
//
|
||||
);
|
||||
@@ -1011,7 +1014,7 @@ class XCX121XSTRHelper : public XCBaseHelper
|
||||
mHandler,
|
||||
X121_XSTR_PRICE_LINE,
|
||||
0,
|
||||
totalBars,
|
||||
maxRequiredBars,
|
||||
strPriceBuffer
|
||||
//
|
||||
);
|
||||
@@ -1022,7 +1025,7 @@ class XCX121XSTRHelper : public XCBaseHelper
|
||||
mHandler,
|
||||
X121_XSTR_UP_LINE,
|
||||
0,
|
||||
totalBars,
|
||||
maxRequiredBars,
|
||||
strUpBuffer
|
||||
//
|
||||
);
|
||||
@@ -1033,7 +1036,7 @@ class XCX121XSTRHelper : public XCBaseHelper
|
||||
mHandler,
|
||||
X121_XSTR_DOWN_LINE,
|
||||
0,
|
||||
totalBars,
|
||||
maxRequiredBars,
|
||||
strDownBuffer
|
||||
//
|
||||
);
|
||||
@@ -1046,11 +1049,57 @@ class XCX121XSTRHelper : public XCBaseHelper
|
||||
mHandler,
|
||||
X121_XSTR_ATR_LINE,
|
||||
0,
|
||||
totalBars,
|
||||
maxRequiredBars,
|
||||
atrBuffer
|
||||
//
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
void Cleanup(
|
||||
int maxAllowed = 100 //
|
||||
)
|
||||
{
|
||||
//
|
||||
CleanupArray(
|
||||
strBuffer,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
atrBuffer,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
strPriceBuffer,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
strUpBuffer,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
strDownBuffer,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
CleanupArray(
|
||||
strStateBuffer,
|
||||
maxAllowed //
|
||||
);
|
||||
|
||||
//
|
||||
}
|
||||
|
||||
//
|
||||
};
|
||||
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user