On every start of QS a log-file is generated, which is very helpful if you want to analyse potential problems.
As these log-files are not deleted automatically, the little script below - if you want to have a clean system - can do this deletion after a certain number of days that can be set through the variable "MinFileAgeInDays".
If you prefer, you can also add this script to your bookmark panel or you add it to the task manager to have it run, e.g. on every application start.
In case of any question, just let me know. Enjoy!
//--------- C# Remove old trace files -------------
int MinFileAgeInDays = 30;
string FilePattern = "Trace*.log";
Hmm, please add the following line to the script
Global.Trace1(App.Main.GetUserDatabasePath());
and check the output window and let me know the reported database path.
As the trace directory is derived from the UserDatabasePath, it might be that you have a different file structure.
My Database is on X:\....\Database\XXXXXX because i use QS on different computers in a network.
But my trace directory is on C:\Program Files\CTrading\QuantShare\Trace on every PC.
When discussing with QS support about making QS capable using network drives they said to me, that some data is still stored in a local drive even though the database is on X: (i. e. work spaces or short cuts).
So every time when changing a shortcut on one computer i have to change it on the others...
Therefore i have three trace folders on three computers. But all with the same path.
C:\Program Files\CTrading\QuantShare\Trace
How can i change your script with a hardcoded path?
Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.