Hi all,
i was studying the article of interaction between matlab and metatrader via csv file.
I create the code in matlab, and matlab create a new txt file with results (In this case, moving average of period 5).
When i try to plot this moving average in Metatrader, i have a error, because it no appear nothing.
I use the following code for this step:
And the data of results in txt file has the form:
1.11535,1.11536,1.11536,1.11536,1.11534,1.11531,1.11527,1.11523,1.11520,1.11519,1.11518,1.11518,1.11519,1.11520,1.11523,NaN,NaN,NaN,NaN
which may be the error?
Thank you very much!!
Hi,
someone can help me??
Thank you very much!!!
Hi,
someone can help me??
Thank you very much!!!
The delimited sign is "," but for some reason, the txt file is deleted before read. Can someone say me if the code is well?
Thank you very much
Hi all,
i was studying the article of interaction between matlab and metatrader via csv file.
I create the code in matlab, and matlab create a new txt file with results (In this case, moving average of period 5).
When i try to plot this moving average in Metatrader, i have a error, because it no appear nothing.
I use the following code for this step:
And the data of results in txt file has the form:
1.11535,1.11536,1.11536,1.11536,1.11534,1.11531,1.11527,1.11523,1.11520,1.11519,1.11518,1.11518,1.11519,1.11520,1.11523,NaN,NaN,NaN,NaN
which may be the error?
Thank you very much!!
Hi castann86,
I took a quick look at the code for you (didn't try it yet)...
And there seems to be a big difference in the MatLab Text Results file and the Write To File section that looks like it's writing regular Market Data to file...
The MatLab results...looks like the MA price data for x-bars (?) and some strange NaN's at the end...and has 19 fields.
The Market Data has 7 fields...
They don't match...and I assume the file structures should match in order for MT4 to read the MatLab values properly...but I am not sure what you are trying to do...
Also...regarding the files being deleted before you can see it...
There are 2 places in your code that use "FileDelete"...
You can blank those FileDelete code lines out temporarily (use //)...so the files don't get deleted and you can see the results...
You can always un-blank the lines later when you are done testing.
Hope this helps you get a few steps closer to some good solutions...
Robert
Hello,
you are declaring
double ExtMap[];
and then you are going straight to
ArrayInitialize( ExtMap, EMPTY_VALUE);
But ExtMap has no size; either write e.g.
double ExtMap[100];
in the first place, or use ArrayResize before ArrayInitialize
- Add print statements before and inside your if's and find out what is happening.
- Check your return codes (FileOpen and FileDelete) What are Function return values ? How do I use them ? - MQL4 forum and Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi all,
i was studying the article of interaction between matlab and metatrader via csv file.
I create the code in matlab, and matlab create a new txt file with results (In this case, moving average of period 5).
When i try to plot this moving average in Metatrader, i have a error, because it no appear nothing.
I use the following code for this step:
And the data of results in txt file has the form:
1.11535,1.11536,1.11536,1.11536,1.11534,1.11531,1.11527,1.11523,1.11520,1.11519,1.11518,1.11518,1.11519,1.11520,1.11523,NaN,NaN,NaN,NaN
which may be the error?
Thank you very much!!