This commit is contained in:
2024-12-30 03:08:21 +03:30
parent b5003968bc
commit 4094a92949
9 changed files with 833 additions and 267 deletions
@@ -92,7 +92,8 @@ class XCX121SMCBaseStrategy : public XCBaseAlert
/**
* Retrieve POI Drawer Instance Pointer ...
**/
XCPOIDrawer* GetDrawer() {
XCPOIDrawer *GetDrawer()
{
return mPOIDrawer;
}
@@ -423,7 +424,6 @@ class XCX121SMCBaseStrategy : public XCBaseAlert
// Update Last Issued Tick ...
mLastTick = cTick;
SaveTickData();
CleanupTicks();
//
// Update POIs ...
@@ -1015,35 +1015,6 @@ class XCX121SMCBaseStrategy : public XCBaseAlert
mBarTracker.Clean();
}
/**
* Cleanup Ticks Size ...
*/
void CleanupTicks()
{
//
int maxRequiredTicks = MaxAllowedSaveTicks();
int ticksCount = ArraySize(mTicks);
if (!IsValidSize(ticksCount) ||
ticksCount <= maxRequiredTicks)
{
return;
}
//
int removeCount = ticksCount - maxRequiredTicks;
if (!IsValidSize(removeCount))
{
return;
}
//
ArrayRemove(
mTicks,
0,
removeCount //
);
}
/**
* Add new Tick Data to Collection ...
*/
@@ -1057,11 +1028,30 @@ class XCX121SMCBaseStrategy : public XCBaseAlert
return;
}
//
int beforeCount = ArraySize(mTicks);
//
AddRef(
tick,
mTicks //
);
//
int afterCount = ArraySize(mTicks);
//
bool isAdded = afterCount == beforeCount + 1;
if (isAdded)
{
//
// Cleaning Up Unused Items ...
int maxAllowed = MaxAllowedSaveTicks();
CleanupArray(
mTicks,
maxAllowed //
);
}
}
/**