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)
The first error would indicate you have two programs trying to access a file at the same time. The way the code works is it opens a file in OnBarUpdate() and doesn't close it until OnTermination() ie you can not access the file until the Strategy is disabled.
It also looks like you are trying your own naming convention for the files. You might want to try the defaults first (UseDefaultFilename = true, in which case the Filename variable is not used by the code). It should look like "ES_12_10_5_Minute." Once it works with the defaults you can then play around to make it suit your needs.
Note I use this on NT7 and haven't tried it on 6.5. Also note declaration "using System.IO" needs to be up top.
EDIT: Just noted you referred to that code as an "Indicator." It is a Strategy. There may still be some older code of mine floating around this site as this was originally started as an Indicator. Suggest you use the one I posted, which is v3.10 released 22.2.2010.
Yes, I have used the indicator ExportChartData.cs and applied it to my chart.
There are not two programs trying to access the file. I have only applied the indicator and nothing else. I have not tried any own naming conventions, but this might be due to country settings. So far there are two error messages pointing to a problem with the code.
Prior to this I had tried the stategy, but it did not run either.
Sorry to hear that FT. I've got it running on three NT7 beta 21 installs (2 Win7/1 Server 2008R2) without any issue. If it gets figured out what the problem is I'll update my code to make it more robust.
These two tasks, exporting datas and opening a DDE connection between Excel and the charting app are so easy in Metatrader. Why must this be so complex in a more modern application ?
I fixed a bug in my ExportData code that would throw an exception if there was a space in the path name (such as "My Documents"), and added a Try/Catch block around the StreamWriter functions.
If anyone finds this using the "Search" function please note the ExportData code has been updated in the Downloads section. The URL is referenced in post #3.