Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
If anyone had something like this or know what to do here please help me out.
Basically I made a copier of strategy orders from multiple windows using GlobalDictionary,
then once there are some changes in any of the strategies I write all the info from GlobalDictionary to a file. Usually this happens once in couple minutes, or once per hour, or once per 15 min.
The code is like this:
The 3rd party copies this file and then works with it (this happens once in 2 seconds). Once/twice per day I receive these errors:
and it shuts down the strategy right away. Anyway to prevent this?
I tried to do something like this:
but nothing works - still getting them
does anyone knows how to avoid these situations?
Thank You
Can you help answer these questions from other members on NexusFi?
Hmm, the catch (elsystem.Exception ex) should work and send you the error message, it should not disable the strategy.
You should try in another directory, create a C:\test directory and create an empty file in it, and avoid the FileDelete.
It can be a lock on the file, maybe the Windows events viewer saw something.
in this directory it works fine couple of days then suddenly this happens and catch is not picking up the error, not sure why. There is no logic when it happens - either once a day or once in couple of days randomly.
I use FileDelete since I need to have only few lines there, every-time fresh, without that the file will become big in size.
Do you know a method to write to a file from fresh without deleting it?
I am trying now the elsystem.io.StreamWriter function and it works without FileDelete - just not sure if I will have that error anymore, waiting for it to see if will crash
do you know any other way to catch all exceptions?