Ive done some research on the topic. But the only 'recent' thing i could find was a script from 2011.11.29 13:46
https://www.mql5.com/en/code/712
But it gives me a lot of errors (very a lot) when i load it up to MetaEditor.
So i thought maybe there is now a standard function implemented to load a XML feed now 2 years later?
Edit: to fast to a post.. i can convert it to a csv and then open it in OpenFile() option. This will do i think
/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
But now ive to set arrays to variables. But what is the right way?
Or total something else?
1. I haven't check the XML script you gave, so maybe later.
2. Start counting elements of array from zero, not from 1.
3. In mql5, a datetime is actually an integer of number of second since Jan 1, 1970. So when you do this
TimeCurrent() + 30;
It mean TimeCurrent() plus 30 seconds, NOT plus 30 minutes, or plus 30 hours, but plus 30 seconds. If you want to ad - say 45 minutes to TimeCurrent(), do this :
int forty_five_minutes; forty_five_minutes = 45*60; TimeCurrent() + forty_five_minutes;
4. The result value of your .csv file reading is a string type, so you may assign that value to other string variable or convert the string value into anther type by using some conversion function
// make starting array datetime buy_time[]; string buy_type[]; int OnInit() { // set array information ArrayResize(buy_time,8); ArrayResize(buy_type,8); //--- ArrayFill(buy_time, 1, 1, "2012.01.19 10:45:00"); //--- ArrayFill(buy_type, 1, 1, "1"); // and so on // something like, like php.. buy_time[0] = StringToTime("2012.01.19 10:45:00"); buy_type[0] = "2"; buy_time[1] = StringToTime("2012.01.20 14:15:00"); buy_type[1] = "2";
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Ive done some research on the topic. But the only 'recent' thing i could find was a script from 2011.11.29 13:46
https://www.mql5.com/en/code/712
But it gives me a lot of errors (very a lot) when i load it up to MetaEditor.
So i thought maybe there is now a standard function implemented to load a XML feed now 2 years later?
Edit: to fast to a post.. i can convert it to a csv and then open it in OpenFile() option. This will do i think
/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#
But now ive to set arrays to variables. But what is the right way?
Or total something else?