Bradford Hall:
I am struggling to get this to work. I want to be able to just plot data values associated with a csv file.
I've read others using external text files and have been going through the reference manual trying to learn how to do this and have not been able to glean any results.
I want to be able to plot values from a csv file as a histogram for the associated date-time. I can not get anything to show up when I fill in the csv file with values.
Could anybody please take a look at this code and show me the changes you need to properly import the data into the indicator window??
This seems like such a trivial thing but I can not figure out what I am overlooking.
I am struggling to get this to work. I want to be able to just plot data values associated with a csv file.
I've read others using external text files and have been going through the reference manual trying to learn how to do this and have not been able to glean any results.
I want to be able to plot values from a csv file as a histogram for the associated date-time. I can not get anything to show up when I fill in the csv file with values.
Could anybody please take a look at this code and show me the changes you need to properly import the data into the indicator window??
This seems like such a trivial thing but I can not figure out what I am overlooking.
Hi! I think it is missing FILE_ANSI option. And you don't need this:
FileSeek(handle,0,SEEK_SET);
A good idea is to debug the code. My guess is that t and data is rubbish. Maybe it is not finding the file. Add some Alert() Print() or Comment() to make it clear what is happening.
Here is a snippet that works. filename points to a file in ...\AppData\Roaming\MetaQuotes\Terminal\Common\Files
int filehandle=FileOpen(filename,FILE_READ|FILE_CSV|FILE_ANSI|FILE_COMMON,separator); if(filehandle!=INVALID_HANDLE) { while(!FileIsEnding(filehandle)) { //--- read the string CreationTime=FileReadString(filehandle,-1); symbol=FileReadString(filehandle,-1); Direction=FileReadString(filehandle,-1); Probability=FileReadString(filehandle,-1); Interval=FileReadString(filehandle,-1); Pattern=FileReadString(filehandle,-1); BreakoutPrice=FileReadString(filehandle,-1); ForecastPrice=FileReadString(filehandle,-1); if(OpenTrade()) { Alert(symbol+" trade opening success"); } else { Alert(symbol+" trade opening failure"); } } FileClose(filehandle); } else { string err= "File cannot Be Opened: Error= "+GetLastError(); Alert(err); } }
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I've read others using external text files and have been going through the reference manual trying to learn how to do this and have not been able to glean any results.
I want to be able to plot values from a csv file as a histogram for the associated date-time. I can not get anything to show up when I fill in the csv file with values.
Could anybody please take a look at this code and show me the changes you need to properly import the data into the indicator window??
This seems like such a trivial thing but I can not figure out what I am overlooking.