Login Page - Create Account

Support Board


Date/Time: Sun, 09 Mar 2025 01:34:22 +0000



Post From: Trade Activity Log taking a very long time to return data

[2022-02-22 22:00:26]
User888593 - Posts: 9
I have the TradeActivityLogs folder open, and I'm watching it after a new backtest has started. The files are disappearing one at a time, about one per second, from the oldest date to the youngest date; the Trade Activity Log Statistics page still has not updated (query count 3), and the Trade Service Log is still displaying old data since it returned, "Cleared trade data...".

Immediately after the last file in the TradeActivityLogs folder disappeared, The Trade Service Log updated. It now says, "TradeActivity files query time: 873.300234 seconds...," and the TradeActivityLogs folder is now filled with files whose dates correspond to the time period tested. The Trade Activity Log summary page is now blank, and the query count is zero. Entering dates and clicking Apply returns the results as usual.

It seems this >800 second delay is stemming from SC taking almost one second per file to delete each trade activity file from the previous backtest, rather than it deleting them all at once.

To test this, I emptied the TradeActivityLogs folder and ran the same test again. The results returned immediately after the backtest completed, proving that the issue is as follows:
1. Upon startup, the TradeActivityLog folder is empty. Upon completion of a backtest, the folder is full and results appear within one second.
2. When a subsequent backtest is started, SC begins deleting the prior TradeActivityLogs files one by one, taking between 0.5 and 1 second each.
3. When the final prior backtest log file is deleted and the newest backtest has finished, the TradeActivityLogs folder is immediately filled with files from the new backtest, and the results appear in the Trade Activity Log window.
4. The delay in the appearance of the new results corresponds directly with how many prior backtest files SC has to delete and how long it spends deleting each one. My backtest generated 1,252 files. The Trade Service Log reported that it took 873.300234 seconds to delete all of them, corresponding to 0.69 seconds per file.

I also verified that selecting Clear Trade Simulation Orders & Data deletes the files one at a time, taking around one second to delete one file.
Date Time Of Last Edit: 2022-02-22 22:26:20