Naim El Hajj: I have an indicator that I use in an EA, which does its calculations using many symbols, which means that while optimizing the EA, the indicator gets different results than on live.
| Fix your broken indicator. This is why I recommend:
Do not trade multiple currencies in one EA.
|
I don't use MQ's csv-file options!
I
- read the file totally (no error-check!!) and split it into lines:
ushort SepLine = StringGetCharacter("\n",0), SepItem = StringGetCharacter(";",0); int hdl = FileOpen(fName,FILE_READ|FILE_SHARE_READ|FILE_BIN|FILE_COMMON), sz = (int)FileSize(hdl), nL,i; string lines[],cells[],all = FileReadString(hdl,sz); nL = i = StringSplit(all,SepLine,lines);
- Now I can search on each line if what i need is part of the line
- Then I split only this line into cells
- But if you want to save everything remember that StringSplit() has eaten up all the seperators ("\n" and ";")
You have to add them again!
To me this way is a lot easier to handle and to manage with less code.

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
Hello,
I have an indicator that I use in an EA, which does its calculations using many symbols, which means that while optimizing the EA, the indicator gets different results than on live.
So what I'm trying to do is export the live indicator buffer to a csv file, which I was able to do, and then have another indicator import them, instead of doing the calculations.
I exported them in the following format Time[i];Buffer[i] to the csv, but I wonder how I could import them correctly.
Here's my current code, but I want to know how to get the second value of the row:
"ChangeofChange" is the buffer of course.
My problem is here:
I need to assign to it the second value of the csv rows
Thanks.