which code can i use to parse my string row by row?
Your own :)
First of all. I have experience in these things, because I already wrote such a thing as you can see here.
Second. The WebRequest function inside MQL4 does NOT work in Indikator-Mode. Only Scripts and Expert-Advisors are supported as you can read here under "Note".
You need to write either an HTML or XML Parser (or some other mechanism) to retreive the values you need and then further deal with the data.
An option (how I solved it by using MQL4) only is this approach. And I have choosen this approach because the "schema" or "style" of the Website code is most likely always the same. The things that differ are the values (news, numbers etc.) between the "schema". Sadly MQL4 doesn't support regex or similar stuff. Only basic string operations:
Parse string from left side.
Parse string from right side.
Example:
<div style="news">Microsoft Information blah</div>
Now you string Find this part:
<div style="news">
You get an position integer back
Then you string Find this part:
</div>
You get another position integer back
Now you use the first and second position integers to cut out (Substring) the text between the lines.
This sounds fairly complicated but it isn't the overall code is quite simple at the end.
Hope I was able to get you going.
BTW: You need to apply a timer e.g. get news all 3-5 minutes. If you run such an Indicator in all "Terminals" then be sure that you encounter *freezes* because of web operations and presentation etc. This is not necessarily code related but more of requesting and responsing to web server (which can be under heavy load).
Hint:
1) I replace "</event>" by "|"
2) Now I split the whole file by '|' (only one char is allowed). // be aware of "|" and '|' !!
Now you have each event in one string
3) now split each event by '\n' and loop through the keywords..
hi
in my ea, i would like to read the forex news on 16/11/2015 from forexfactory calendar on 16/11/2015, i wrote this code:
from this line of code:
i get this output:
it's incomplete, where is my error?
- 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
in my ea, i would like to read the forex news on 16/11/2015 from forexfactory calendar on 16/11/2015, i wrote this code:
from this line of code:
i get this output:
it's incomplete, where is my error?