Release memory taken by the (Print) Log is unneccessary and killing the bot after a few days of operation
Release memory taken by the (Print) Log is unneccessary and killing the bot after a few days of operation
25 Jul 2021, 12:38
On a scalping bod that works with a lot of open positions the mandatory ctrader Trading log is taken too much memory after a few days of operating.
(the cBot does >1000 of orders in a few days & many modifies per position each resulting in 2 PrintLog lines)
Asl old logentries are hardly ever used there is no need to keep them in fast accessible memory.
Suggesteion is to change the mandatory and Print() the messages to a log file and show only the last xxx (with a more.... on the bottom to load again xxx records from the file.)
Or else I'd like to have Log functions like:
void ClearLog(int keepRecordCount = 1000)
{
// Clear printlog but keep the last keepRecordCount records;
}
void ArchiveLog(string FileName, int keepRecordCount = 1000)
{
// Save record to file 'filename' and
// Clear printlog but keep the last keepRecordCount records;
}