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)
I'm trying to add some new functionality to my ExportData strategy. As it is, it will write the DateTime format to a file based on your systems settings. Current code is:
So Time[0] outputs a DateTime struct based on your Windows settings. I would like to add an enum that allows the user to choose an output format of choice, using (for example)
I know I can't use special characters in enums and I can work around that. My issue is that something as basic as this:
... outputs a blank file (actually one that only has carriage returns).
So I can hard-code the output DateTime format but any time I try to give the user an option that is called either in OnStartUp() or OnBarUpdate() I get a blank output file.
Any thoughts I what I could be doing wrong?
The following user says Thank You to MXASJ for this post:
Wild guess - the file isn't being opened or closed in the right order, maybe check your Print() statements to make sure they contain data, and if so, then it's definitely an issue with how the file is opened or closed as data is being written to it. Assuming you checked the Log tab for errors? The path resides in the Users\Documents directory (write access)?
Still needs a bit of testing and cleanup but if anyone wants to try my latest ExportData strategy and take a particular look at DateTime output formats that would be great. Open to suggestions on ways to make it better.
cs file attached.
The following 3 users say Thank You to MXASJ for this post: