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
+10
View File
@@ -3318,6 +3318,16 @@ class XCX121Helper : public XCBase
conditions.isStrLowerCrossedUnderDonLowLower = isStrLowerCrossedUnderDonLowLower; conditions.isStrLowerCrossedUnderDonLowLower = isStrLowerCrossedUnderDonLowLower;
conditions.isStrUpperCrossedUnderDonHighUpper = isStrUpperCrossedUnderDonHighUpper; conditions.isStrUpperCrossedUnderDonHighUpper = isStrUpperCrossedUnderDonHighUpper;
//
xpvConditions.Clean();
xhkConditions.Clean();
xatrConditions.Clean();
xstrConditions.Clean();
xcheConditions.Clean();
xdonConditions.Clean();
xvwapConditions.Clean();
xtrendConditions.Clean();
// //
return result; return result;
} }
+63 -14
View File
@@ -1112,6 +1112,14 @@ class XCX121XATRHelper : public XCBaseHelper
conditions.isRsiCrossedOverOverBought = isRsiCrossedOverOverBought; conditions.isRsiCrossedOverOverBought = isRsiCrossedOverOverBought;
conditions.isRsiCrossedUnderOverBought = isRsiCrossedUnderOverBought; conditions.isRsiCrossedUnderOverBought = isRsiCrossedUnderOverBought;
//
Cleanup();
//
zBar.Clean();
cBar.Clean();
pBar.Clean();
// //
return result; return result;
} }
@@ -1136,15 +1144,10 @@ class XCX121XATRHelper : public XCBaseHelper
double atrLowerRawBuffer[]; double atrLowerRawBuffer[];
// //
void Calculate() void Calculate(
int maxRequiredBars = 100 //
)
{ {
//
int totalBars = CountBars();
if (totalBars > 1000)
{
totalBars = 1000;
}
// //
// Buffers ... // Buffers ...
@@ -1154,7 +1157,7 @@ class XCX121XATRHelper : public XCBaseHelper
mHandler, mHandler,
X121_RSI_LINE, X121_RSI_LINE,
0, 0,
totalBars, maxRequiredBars,
rsiBuffer rsiBuffer
// //
); );
@@ -1167,7 +1170,7 @@ class XCX121XATRHelper : public XCBaseHelper
mHandler, mHandler,
X121_ATR_UPPER_LINE, X121_ATR_UPPER_LINE,
0, 0,
totalBars, maxRequiredBars,
atrUpperBuffer atrUpperBuffer
// //
); );
@@ -1177,7 +1180,7 @@ class XCX121XATRHelper : public XCBaseHelper
mHandler, mHandler,
X121_ATR_LOWER_LINE, X121_ATR_LOWER_LINE,
0, 0,
totalBars, maxRequiredBars,
atrLowerBuffer atrLowerBuffer
// //
); );
@@ -1187,7 +1190,7 @@ class XCX121XATRHelper : public XCBaseHelper
mHandler, mHandler,
X121_ATR_LINE, X121_ATR_LINE,
0, 0,
totalBars, maxRequiredBars,
atrBuffer atrBuffer
// //
); );
@@ -1197,7 +1200,7 @@ class XCX121XATRHelper : public XCBaseHelper
mHandler, mHandler,
X121_ATR_UPPER_RAW_LINE, X121_ATR_UPPER_RAW_LINE,
0, 0,
totalBars, maxRequiredBars,
atrUpperRawBuffer atrUpperRawBuffer
// //
); );
@@ -1207,11 +1210,57 @@ class XCX121XATRHelper : public XCBaseHelper
mHandler, mHandler,
X121_ATR_LOWER_RAW_LINE, X121_ATR_LOWER_RAW_LINE,
0, 0,
totalBars, maxRequiredBars,
atrLowerRawBuffer atrLowerRawBuffer
// //
); );
} }
//
void Cleanup(
int maxAllowed = 100 //
)
{
//
CleanupArray(
rsiBuffer,
maxAllowed //
);
//
CleanupArray(
atrUpperBuffer,
maxAllowed //
);
//
CleanupArray(
atrLowerBuffer,
maxAllowed //
);
//
CleanupArray(
atrBuffer,
maxAllowed //
);
//
CleanupArray(
atrUpperRawBuffer,
maxAllowed //
);
//
CleanupArray(
atrLowerRawBuffer,
maxAllowed //
);
//
}
//
}; };
// //
+77 -16
View File
@@ -1196,6 +1196,14 @@ class XCX121XCHEHelper : public XCBaseHelper
conditions.isClosedUnderCheMin = isClosedUnderCheMin; conditions.isClosedUnderCheMin = isClosedUnderCheMin;
conditions.isClosedUnderCheMax = isClosedUnderCheMax; conditions.isClosedUnderCheMax = isClosedUnderCheMax;
//
Cleanup();
//
zBar.Clean();
cBar.Clean();
pBar.Clean();
// //
return result; return result;
} }
@@ -1222,15 +1230,10 @@ class XCX121XCHEHelper : public XCBaseHelper
double se2StartBuffer[]; double se2StartBuffer[];
// //
void Calculate() void Calculate(
int maxRequiredBars = 100 //
)
{ {
//
int totalBars = CountBars();
if (totalBars > 1000)
{
totalBars = 1000;
}
// //
// Buffers ... // Buffers ...
@@ -1240,7 +1243,7 @@ class XCX121XCHEHelper : public XCBaseHelper
mHandler, mHandler,
X121_XCHE_LE_1_S_LINE, X121_XCHE_LE_1_S_LINE,
0, 0,
totalBars, maxRequiredBars,
le1StartBuffer // le1StartBuffer //
); );
@@ -1250,7 +1253,7 @@ class XCX121XCHEHelper : public XCBaseHelper
mHandler, mHandler,
X121_XCHE_LE_1_LINE, X121_XCHE_LE_1_LINE,
0, 0,
totalBars, maxRequiredBars,
le1Buffer // le1Buffer //
); );
@@ -1260,7 +1263,7 @@ class XCX121XCHEHelper : public XCBaseHelper
mHandler, mHandler,
X121_XCHE_LE_2_S_LINE, X121_XCHE_LE_2_S_LINE,
0, 0,
totalBars, maxRequiredBars,
le2StartBuffer // le2StartBuffer //
); );
@@ -1270,7 +1273,7 @@ class XCX121XCHEHelper : public XCBaseHelper
mHandler, mHandler,
X121_XCHE_LE_2_LINE, X121_XCHE_LE_2_LINE,
0, 0,
totalBars, maxRequiredBars,
le2Buffer // le2Buffer //
); );
@@ -1280,7 +1283,7 @@ class XCX121XCHEHelper : public XCBaseHelper
mHandler, mHandler,
X121_XCHE_SE_1_S_LINE, X121_XCHE_SE_1_S_LINE,
0, 0,
totalBars, maxRequiredBars,
se1StartBuffer // se1StartBuffer //
); );
@@ -1290,7 +1293,7 @@ class XCX121XCHEHelper : public XCBaseHelper
mHandler, mHandler,
X121_XCHE_SE_1_LINE, X121_XCHE_SE_1_LINE,
0, 0,
totalBars, maxRequiredBars,
se1Buffer // se1Buffer //
); );
@@ -1300,7 +1303,7 @@ class XCX121XCHEHelper : public XCBaseHelper
mHandler, mHandler,
X121_XCHE_SE_2_S_LINE, X121_XCHE_SE_2_S_LINE,
0, 0,
totalBars, maxRequiredBars,
se2StartBuffer // se2StartBuffer //
); );
@@ -1310,10 +1313,68 @@ class XCX121XCHEHelper : public XCBaseHelper
mHandler, mHandler,
X121_XCHE_SE_2_LINE, X121_XCHE_SE_2_LINE,
0, 0,
totalBars, maxRequiredBars,
se2Buffer // 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 //
);
//
}
//
}; };
// //
+77 -18
View File
@@ -1203,6 +1203,14 @@ class XCX121XDONHelper : public XCBaseHelper
conditions.isRejectedDonCloseUpper = isRejectedDonCloseUpper; conditions.isRejectedDonCloseUpper = isRejectedDonCloseUpper;
conditions.isRejectedDonCloseLower = isRejectedDonCloseLower; conditions.isRejectedDonCloseLower = isRejectedDonCloseLower;
//
Cleanup();
//
zBar.Clean();
cBar.Clean();
pBar.Clean();
// //
return result; return result;
} }
@@ -1229,24 +1237,17 @@ class XCX121XDONHelper : public XCBaseHelper
double donCloseLowerBuffer[]; double donCloseLowerBuffer[];
// //
void Calculate() void Calculate(
int maxRequiredBars = 100 //
)
{ {
//
int totalBars = CountBars();
if (totalBars > 1000)
{
totalBars = 1000;
}
//
// OPEN ...
// //
// Upper ... // Upper ...
CopyBuffer( CopyBuffer(
mHandler, mHandler,
X121_XDON_OPEN_UPPER_LINE, X121_XDON_OPEN_UPPER_LINE,
0, 0,
totalBars, maxRequiredBars,
donOpenUpperBuffer donOpenUpperBuffer
// //
); );
@@ -1257,7 +1258,7 @@ class XCX121XDONHelper : public XCBaseHelper
mHandler, mHandler,
X121_XDON_OPEN_LOWER_LINE, X121_XDON_OPEN_LOWER_LINE,
0, 0,
totalBars, maxRequiredBars,
donOpenLowerBuffer donOpenLowerBuffer
// //
); );
@@ -1271,7 +1272,7 @@ class XCX121XDONHelper : public XCBaseHelper
mHandler, mHandler,
X121_XDON_CLOSE_UPPER_LINE, X121_XDON_CLOSE_UPPER_LINE,
0, 0,
totalBars, maxRequiredBars,
donCloseUpperBuffer donCloseUpperBuffer
// //
); );
@@ -1282,7 +1283,7 @@ class XCX121XDONHelper : public XCBaseHelper
mHandler, mHandler,
X121_XDON_CLOSE_LOWER_LINE, X121_XDON_CLOSE_LOWER_LINE,
0, 0,
totalBars, maxRequiredBars,
donCloseLowerBuffer donCloseLowerBuffer
// //
); );
@@ -1296,7 +1297,7 @@ class XCX121XDONHelper : public XCBaseHelper
mHandler, mHandler,
X121_XDON_HIGH_UPPER_LINE, X121_XDON_HIGH_UPPER_LINE,
0, 0,
totalBars, maxRequiredBars,
donHighUpperBuffer donHighUpperBuffer
// //
); );
@@ -1307,7 +1308,7 @@ class XCX121XDONHelper : public XCBaseHelper
mHandler, mHandler,
X121_XDON_HIGH_LOWER_LINE, X121_XDON_HIGH_LOWER_LINE,
0, 0,
totalBars, maxRequiredBars,
donHighLowerBuffer donHighLowerBuffer
// //
); );
@@ -1321,7 +1322,7 @@ class XCX121XDONHelper : public XCBaseHelper
mHandler, mHandler,
X121_XDON_LOW_UPPER_LINE, X121_XDON_LOW_UPPER_LINE,
0, 0,
totalBars, maxRequiredBars,
donLowUpperBuffer donLowUpperBuffer
// //
); );
@@ -1332,11 +1333,69 @@ class XCX121XDONHelper : public XCBaseHelper
mHandler, mHandler,
X121_XDON_LOW_LOWER_LINE, X121_XDON_LOW_LOWER_LINE,
0, 0,
totalBars, maxRequiredBars,
donLowLowerBuffer donLowLowerBuffer
// //
); );
} }
//
void Cleanup(
int maxAllowed = 100 //
)
{
//
CleanupArray(
donOpenUpperBuffer,
maxAllowed //
);
//
CleanupArray(
donOpenLowerBuffer,
maxAllowed //
);
//
CleanupArray(
donHighUpperBuffer,
maxAllowed //
);
//
CleanupArray(
donHighLowerBuffer,
maxAllowed //
);
//
CleanupArray(
donLowUpperBuffer,
maxAllowed //
);
//
CleanupArray(
donLowLowerBuffer,
maxAllowed //
);
//
CleanupArray(
donCloseUpperBuffer,
maxAllowed //
);
//
CleanupArray(
donCloseLowerBuffer,
maxAllowed //
);
//
}
//
}; };
// //
+82 -18
View File
@@ -1218,9 +1218,9 @@ class XCX121XHKHelper : public XCBaseHelper
// //
bool isSMHKSwitchedToBearish = isSMHKBearish && bool isSMHKSwitchedToBearish = isSMHKBearish &&
!isSMHKBearishPrev; !isSMHKBearishPrev;
bool isRawHKSwitchedToBearish = isRawHKBearish && bool isRawHKSwitchedToBearish = isRawHKBearish &&
!isRawHKBearishPrev; !isRawHKBearishPrev;
// //
bool isClosedOverSMHK = cBar.close > smHKUp; bool isClosedOverSMHK = cBar.close > smHKUp;
@@ -1322,6 +1322,17 @@ class XCX121XHKHelper : public XCBaseHelper
conditions.isRejectedDownRawHK = isRejectedDownRawHK; conditions.isRejectedDownRawHK = isRejectedDownRawHK;
conditions.isRawHKBreakedDownSMHK = isRawHKBreakedDownSMHK; conditions.isRawHKBreakedDownSMHK = isRawHKBreakedDownSMHK;
//
Cleanup();
//
zBar.Clean();
cBar.Clean();
pBar.Clean();
//
rawHKCBar.Clean();
// //
return result; return result;
} }
@@ -1348,15 +1359,10 @@ class XCX121XHKHelper : public XCBaseHelper
double xhkSMCloseBuffer[]; double xhkSMCloseBuffer[];
// //
void Calculate() void Calculate(
int maxRequiredBars = 100 //
)
{ {
//
int totalBars = CountBars();
if (totalBars > 1000)
{
totalBars = 1000;
}
// //
// Buffers ... // Buffers ...
@@ -1366,7 +1372,7 @@ class XCX121XHKHelper : public XCBaseHelper
mHandler, mHandler,
X121_XHK_RAW_OPEN_LINE, X121_XHK_RAW_OPEN_LINE,
0, 0,
totalBars, maxRequiredBars,
xhkRawOpenBuffer xhkRawOpenBuffer
// //
); );
@@ -1377,7 +1383,7 @@ class XCX121XHKHelper : public XCBaseHelper
mHandler, mHandler,
X121_XHK_RAW_HIGH_LINE, X121_XHK_RAW_HIGH_LINE,
0, 0,
totalBars, maxRequiredBars,
xhkRawHighBuffer xhkRawHighBuffer
// //
); );
@@ -1388,7 +1394,7 @@ class XCX121XHKHelper : public XCBaseHelper
mHandler, mHandler,
X121_XHK_RAW_LOW_LINE, X121_XHK_RAW_LOW_LINE,
0, 0,
totalBars, maxRequiredBars,
xhkRawLowBuffer xhkRawLowBuffer
// //
); );
@@ -1399,7 +1405,7 @@ class XCX121XHKHelper : public XCBaseHelper
mHandler, mHandler,
X121_XHK_RAW_CLOSE_LINE, X121_XHK_RAW_CLOSE_LINE,
0, 0,
totalBars, maxRequiredBars,
xhkRawCloseBuffer xhkRawCloseBuffer
// //
); );
@@ -1410,7 +1416,7 @@ class XCX121XHKHelper : public XCBaseHelper
mHandler, mHandler,
X121_XHK_SM_OPEN_LINE, X121_XHK_SM_OPEN_LINE,
0, 0,
totalBars, maxRequiredBars,
xhkSMOpenBuffer xhkSMOpenBuffer
// //
); );
@@ -1421,7 +1427,7 @@ class XCX121XHKHelper : public XCBaseHelper
mHandler, mHandler,
X121_XHK_SM_HIGH_LINE, X121_XHK_SM_HIGH_LINE,
0, 0,
totalBars, maxRequiredBars,
xhkSMHighBuffer xhkSMHighBuffer
// //
); );
@@ -1432,7 +1438,7 @@ class XCX121XHKHelper : public XCBaseHelper
mHandler, mHandler,
X121_XHK_SM_LOW_LINE, X121_XHK_SM_LOW_LINE,
0, 0,
totalBars, maxRequiredBars,
xhkSMLowBuffer xhkSMLowBuffer
// //
); );
@@ -1443,11 +1449,69 @@ class XCX121XHKHelper : public XCBaseHelper
mHandler, mHandler,
X121_XHK_SM_CLOSE_LINE, X121_XHK_SM_CLOSE_LINE,
0, 0,
totalBars, maxRequiredBars,
xhkSMCloseBuffer xhkSMCloseBuffer
// //
); );
} }
//
void Cleanup(
int maxAllowed = 100 //
)
{
//
CleanupArray(
xhkRawOpenBuffer,
maxAllowed //
);
//
CleanupArray(
xhkRawHighBuffer,
maxAllowed //
);
//
CleanupArray(
xhkRawLowBuffer,
maxAllowed //
);
//
CleanupArray(
xhkRawCloseBuffer,
maxAllowed //
);
//
CleanupArray(
xhkSMOpenBuffer,
maxAllowed //
);
//
CleanupArray(
xhkSMHighBuffer,
maxAllowed //
);
//
CleanupArray(
xhkSMLowBuffer,
maxAllowed //
);
//
CleanupArray(
xhkSMCloseBuffer,
maxAllowed //
);
//
}
//
}; };
// //
+112 -21
View File
@@ -2070,6 +2070,14 @@ class XCX121XPVHelper : public XCBaseHelper
conditions.isRejectedPrevVale = isRejectedPrevVale; conditions.isRejectedPrevVale = isRejectedPrevVale;
conditions.isBreakedDownPrevVale = isBreakedDownPrevVale; conditions.isBreakedDownPrevVale = isBreakedDownPrevVale;
//
Cleanup();
//
zBar.Clean();
cBar.Clean();
pBar.Clean();
// //
return result; return result;
} }
@@ -2101,15 +2109,10 @@ class XCX121XPVHelper : public XCBaseHelper
double hLLBuffer[]; double hLLBuffer[];
// //
void Calculate() void Calculate(
int maxRequiredBars = 100 //
)
{ {
//
int totalBars = CountBars();
if (totalBars > 1000)
{
totalBars = 1000;
}
// //
// Buffers ... // Buffers ...
@@ -2119,7 +2122,7 @@ class XCX121XPVHelper : public XCBaseHelper
mHandler, mHandler,
X121_XPV_SAR_LINE, X121_XPV_SAR_LINE,
0, 0,
totalBars, maxRequiredBars,
sarBuffer sarBuffer
// //
); );
@@ -2133,7 +2136,7 @@ class XCX121XPVHelper : public XCBaseHelper
mHandler, mHandler,
X121_XPV_PEAK_LINE, X121_XPV_PEAK_LINE,
0, 0,
totalBars, maxRequiredBars,
peaksBuffer peaksBuffer
// //
); );
@@ -2144,7 +2147,7 @@ class XCX121XPVHelper : public XCBaseHelper
mHandler, mHandler,
X121_XPV_VALE_LINE, X121_XPV_VALE_LINE,
0, 0,
totalBars, maxRequiredBars,
valesBuffer valesBuffer
// //
); );
@@ -2158,7 +2161,7 @@ class XCX121XPVHelper : public XCBaseHelper
mHandler, mHandler,
X121_XPV_C_HH_LINE, X121_XPV_C_HH_LINE,
0, 0,
totalBars, maxRequiredBars,
cHHBuffer cHHBuffer
// //
); );
@@ -2169,7 +2172,7 @@ class XCX121XPVHelper : public XCBaseHelper
mHandler, mHandler,
X121_XPV_C_LL_LINE, X121_XPV_C_LL_LINE,
0, 0,
totalBars, maxRequiredBars,
cLLBuffer cLLBuffer
// //
); );
@@ -2183,7 +2186,7 @@ class XCX121XPVHelper : public XCBaseHelper
mHandler, mHandler,
X121_XPV_S_HH_LINE, X121_XPV_S_HH_LINE,
0, 0,
totalBars, maxRequiredBars,
sHHBuffer sHHBuffer
// //
); );
@@ -2194,7 +2197,7 @@ class XCX121XPVHelper : public XCBaseHelper
mHandler, mHandler,
X121_XPV_S_LL_LINE, X121_XPV_S_LL_LINE,
0, 0,
totalBars, maxRequiredBars,
sLLBuffer sLLBuffer
// //
); );
@@ -2208,7 +2211,7 @@ class XCX121XPVHelper : public XCBaseHelper
mHandler, mHandler,
X121_XPV_M_HH_LINE, X121_XPV_M_HH_LINE,
0, 0,
totalBars, maxRequiredBars,
mHHBuffer mHHBuffer
// //
); );
@@ -2219,7 +2222,7 @@ class XCX121XPVHelper : public XCBaseHelper
mHandler, mHandler,
X121_XPV_M_LL_LINE, X121_XPV_M_LL_LINE,
0, 0,
totalBars, maxRequiredBars,
mLLBuffer mLLBuffer
// //
); );
@@ -2233,7 +2236,7 @@ class XCX121XPVHelper : public XCBaseHelper
mHandler, mHandler,
X121_XPV_L_HH_LINE, X121_XPV_L_HH_LINE,
0, 0,
totalBars, maxRequiredBars,
lHHBuffer lHHBuffer
// //
); );
@@ -2244,7 +2247,7 @@ class XCX121XPVHelper : public XCBaseHelper
mHandler, mHandler,
X121_XPV_L_LL_LINE, X121_XPV_L_LL_LINE,
0, 0,
totalBars, maxRequiredBars,
lLLBuffer lLLBuffer
// //
); );
@@ -2258,7 +2261,7 @@ class XCX121XPVHelper : public XCBaseHelper
mHandler, mHandler,
X121_XPV_H_HH_LINE, X121_XPV_H_HH_LINE,
0, 0,
totalBars, maxRequiredBars,
hHHBuffer hHHBuffer
// //
); );
@@ -2269,11 +2272,99 @@ class XCX121XPVHelper : public XCBaseHelper
mHandler, mHandler,
X121_XPV_H_LL_LINE, X121_XPV_H_LL_LINE,
0, 0,
totalBars, maxRequiredBars,
hLLBuffer hLLBuffer
// //
); );
} }
//
void Cleanup(
int maxAllowed = 100 //
)
{
//
CleanupArray(
peaksBuffer,
maxAllowed //
);
//
CleanupArray(
valesBuffer,
maxAllowed //
);
//
CleanupArray(
sarBuffer,
maxAllowed //
);
//
CleanupArray(
cHHBuffer,
maxAllowed //
);
//
CleanupArray(
cLLBuffer,
maxAllowed //
);
//
CleanupArray(
sHHBuffer,
maxAllowed //
);
//
CleanupArray(
sLLBuffer,
maxAllowed //
);
//
CleanupArray(
mHHBuffer,
maxAllowed //
);
//
CleanupArray(
mLLBuffer,
maxAllowed //
);
//
CleanupArray(
lHHBuffer,
maxAllowed //
);
//
CleanupArray(
lLLBuffer,
maxAllowed //
);
//
CleanupArray(
hHHBuffer,
maxAllowed //
);
//
CleanupArray(
hLLBuffer,
maxAllowed //
);
//
}
//
}; };
// //
+63 -14
View File
@@ -947,6 +947,14 @@ class XCX121XSTRHelper : public XCBaseHelper
conditions.isStrSwitchedToBullish = isStrSwitchedToBullish; conditions.isStrSwitchedToBullish = isStrSwitchedToBullish;
conditions.isStrSwitchedToBearish = isStrSwitchedToBearish; conditions.isStrSwitchedToBearish = isStrSwitchedToBearish;
//
Cleanup();
//
zBar.Clean();
cBar.Clean();
pBar.Clean();
// //
return result; return result;
} }
@@ -971,15 +979,10 @@ class XCX121XSTRHelper : public XCBaseHelper
double strStateBuffer[]; double strStateBuffer[];
// //
void Calculate() void Calculate(
int maxRequiredBars = 100 //
)
{ {
//
int totalBars = CountBars();
if (totalBars > 1000)
{
totalBars = 1000;
}
// //
// Buffers ... // Buffers ...
@@ -989,7 +992,7 @@ class XCX121XSTRHelper : public XCBaseHelper
mHandler, mHandler,
X121_XSTR_LINE, X121_XSTR_LINE,
0, 0,
totalBars, maxRequiredBars,
strBuffer strBuffer
// //
); );
@@ -1000,7 +1003,7 @@ class XCX121XSTRHelper : public XCBaseHelper
mHandler, mHandler,
X121_XSTR_STATE_LINE, X121_XSTR_STATE_LINE,
0, 0,
totalBars, maxRequiredBars,
strStateBuffer strStateBuffer
// //
); );
@@ -1011,7 +1014,7 @@ class XCX121XSTRHelper : public XCBaseHelper
mHandler, mHandler,
X121_XSTR_PRICE_LINE, X121_XSTR_PRICE_LINE,
0, 0,
totalBars, maxRequiredBars,
strPriceBuffer strPriceBuffer
// //
); );
@@ -1022,7 +1025,7 @@ class XCX121XSTRHelper : public XCBaseHelper
mHandler, mHandler,
X121_XSTR_UP_LINE, X121_XSTR_UP_LINE,
0, 0,
totalBars, maxRequiredBars,
strUpBuffer strUpBuffer
// //
); );
@@ -1033,7 +1036,7 @@ class XCX121XSTRHelper : public XCBaseHelper
mHandler, mHandler,
X121_XSTR_DOWN_LINE, X121_XSTR_DOWN_LINE,
0, 0,
totalBars, maxRequiredBars,
strDownBuffer strDownBuffer
// //
); );
@@ -1046,11 +1049,57 @@ class XCX121XSTRHelper : public XCBaseHelper
mHandler, mHandler,
X121_XSTR_ATR_LINE, X121_XSTR_ATR_LINE,
0, 0,
totalBars, maxRequiredBars,
atrBuffer atrBuffer
// //
); );
} }
//
void Cleanup(
int maxAllowed = 100 //
)
{
//
CleanupArray(
strBuffer,
maxAllowed //
);
//
CleanupArray(
atrBuffer,
maxAllowed //
);
//
CleanupArray(
strPriceBuffer,
maxAllowed //
);
//
CleanupArray(
strUpBuffer,
maxAllowed //
);
//
CleanupArray(
strDownBuffer,
maxAllowed //
);
//
CleanupArray(
strStateBuffer,
maxAllowed //
);
//
}
//
}; };
// //
+77 -16
View File
@@ -1080,6 +1080,14 @@ class XCX121XTRENDHelper : public XCBaseHelper
conditions.isTrendSwitchedToBullish = isTrendSwitchedToBullish; conditions.isTrendSwitchedToBullish = isTrendSwitchedToBullish;
conditions.isTrendSwitchedToBearish = isTrendSwitchedToBearish; conditions.isTrendSwitchedToBearish = isTrendSwitchedToBearish;
//
Cleanup();
//
zBar.Clean();
cBar.Clean();
pBar.Clean();
// //
return result; return result;
} }
@@ -1106,15 +1114,10 @@ class XCX121XTRENDHelper : public XCBaseHelper
double downTBuffer[]; double downTBuffer[];
// //
void Calculate() void Calculate(
int maxRequiredBars = 100 //
)
{ {
//
int totalBars = CountBars();
if (totalBars > 1000)
{
totalBars = 1000;
}
// //
// Buffers ... // Buffers ...
@@ -1124,7 +1127,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
mHandler, mHandler,
X121_XTREND_UP_LINE, X121_XTREND_UP_LINE,
0, 0,
totalBars, maxRequiredBars,
upTrendBuffer upTrendBuffer
// //
); );
@@ -1135,7 +1138,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
mHandler, mHandler,
X121_XTREND_DOWN_LINE, X121_XTREND_DOWN_LINE,
0, 0,
totalBars, maxRequiredBars,
downTrendBuffer downTrendBuffer
// //
); );
@@ -1146,7 +1149,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
mHandler, mHandler,
X121_XTREND_MA_LINE, X121_XTREND_MA_LINE,
0, 0,
totalBars, maxRequiredBars,
maBuffer maBuffer
// //
); );
@@ -1157,7 +1160,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
mHandler, mHandler,
X121_XTREND_ADX_LINE, X121_XTREND_ADX_LINE,
0, 0,
totalBars, maxRequiredBars,
adxBuffer adxBuffer
// //
); );
@@ -1168,7 +1171,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
mHandler, mHandler,
X121_XTREND_ADX_P_LINE, X121_XTREND_ADX_P_LINE,
0, 0,
totalBars, maxRequiredBars,
adxPBuffer adxPBuffer
// //
); );
@@ -1179,7 +1182,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
mHandler, mHandler,
X121_XTREND_ADX_M_LINE, X121_XTREND_ADX_M_LINE,
0, 0,
totalBars, maxRequiredBars,
adxMBuffer adxMBuffer
// //
); );
@@ -1190,7 +1193,7 @@ class XCX121XTRENDHelper : public XCBaseHelper
mHandler, mHandler,
X121_XTREND_UP_T_LINE, X121_XTREND_UP_T_LINE,
0, 0,
totalBars, maxRequiredBars,
upTBuffer upTBuffer
// //
); );
@@ -1201,11 +1204,69 @@ class XCX121XTRENDHelper : public XCBaseHelper
mHandler, mHandler,
X121_XTREND_DOWN_T_LINE, X121_XTREND_DOWN_T_LINE,
0, 0,
totalBars, maxRequiredBars,
downTBuffer downTBuffer
// //
); );
} }
//
void Cleanup(
int maxAllowed = 100 //
)
{
//
CleanupArray(
upTrendBuffer,
maxAllowed //
);
//
CleanupArray(
downTrendBuffer,
maxAllowed //
);
//
CleanupArray(
maBuffer,
maxAllowed //
);
//
CleanupArray(
adxBuffer,
maxAllowed //
);
//
CleanupArray(
adxPBuffer,
maxAllowed //
);
//
CleanupArray(
adxMBuffer,
maxAllowed //
);
//
CleanupArray(
upTBuffer,
maxAllowed //
);
//
CleanupArray(
downTBuffer,
maxAllowed //
);
//
}
//
}; };
// //
+77 -16
View File
@@ -1309,6 +1309,14 @@ class XCX121XVWAPHelper : public XCBaseHelper
conditions.isVWapSwitchedToBearishState = isVWapSwitchedToBearishState; conditions.isVWapSwitchedToBearishState = isVWapSwitchedToBearishState;
conditions.isVWapSwitchedToNeuturalState = isVWapSwitchedToNeuturalState; conditions.isVWapSwitchedToNeuturalState = isVWapSwitchedToNeuturalState;
//
Cleanup();
//
zBar.Clean();
cBar.Clean();
pBar.Clean();
// //
return result; return result;
} }
@@ -1335,15 +1343,10 @@ class XCX121XVWAPHelper : public XCBaseHelper
double vwapSlowStateBuffer[]; double vwapSlowStateBuffer[];
// //
void Calculate() void Calculate(
int maxRequiredBars = 100 //
)
{ {
//
int totalBars = CountBars();
if (totalBars > 1000)
{
totalBars = 1000;
}
// //
// Buffers ... // Buffers ...
@@ -1353,7 +1356,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
mHandler, mHandler,
X121_XVWAP_FAST_LINE, X121_XVWAP_FAST_LINE,
0, 0,
totalBars, maxRequiredBars,
vwapFastBuffer vwapFastBuffer
// //
); );
@@ -1364,7 +1367,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
mHandler, mHandler,
X121_XVWAP_FAST_STATE_LINE, X121_XVWAP_FAST_STATE_LINE,
0, 0,
totalBars, maxRequiredBars,
vwapFastStateBuffer vwapFastStateBuffer
// //
); );
@@ -1375,7 +1378,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
mHandler, mHandler,
X121_XVWAP_MID_LINE, X121_XVWAP_MID_LINE,
0, 0,
totalBars, maxRequiredBars,
vwapMidBuffer vwapMidBuffer
// //
); );
@@ -1386,7 +1389,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
mHandler, mHandler,
X121_XVWAP_MID_STATE_LINE, X121_XVWAP_MID_STATE_LINE,
0, 0,
totalBars, maxRequiredBars,
vwapMidStateBuffer vwapMidStateBuffer
// //
); );
@@ -1397,7 +1400,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
mHandler, mHandler,
X121_XVWAP_SLOW_LINE, X121_XVWAP_SLOW_LINE,
0, 0,
totalBars, maxRequiredBars,
vwapSlowBuffer vwapSlowBuffer
// //
); );
@@ -1408,7 +1411,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
mHandler, mHandler,
X121_XVWAP_SLOW_STATE_LINE, X121_XVWAP_SLOW_STATE_LINE,
0, 0,
totalBars, maxRequiredBars,
vwapSlowStateBuffer vwapSlowStateBuffer
// //
); );
@@ -1419,7 +1422,7 @@ class XCX121XVWAPHelper : public XCBaseHelper
mHandler, mHandler,
X121_XVWAP_VOLUME_LINE, X121_XVWAP_VOLUME_LINE,
0, 0,
totalBars, maxRequiredBars,
vwapVolumeBuffer vwapVolumeBuffer
// //
); );
@@ -1430,11 +1433,69 @@ class XCX121XVWAPHelper : public XCBaseHelper
mHandler, mHandler,
X121_XVWAP_PRICE_LINE, X121_XVWAP_PRICE_LINE,
0, 0,
totalBars, maxRequiredBars,
vwapPriceBuffer 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 //
);
//
}
//
}; };
// //
File diff suppressed because it is too large Load Diff