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
like this:
This is unnecessary in MQL5.
And this is how those who
love to run into hidden errors (in general, all those who are too lazy to do basic checks)
Thank you. This option is more suitable.
Please, no problem, I'm in the same "Z" - very uncomfortable everything in MQL5
Is it like a multiplatform MT4 code? Gud, I write almost everything multiplatform these days.
Alexei, this is for those who are in a tank. But for others, CopyRates() is available in mql4. So forget all the iOpen and other nonsense. I don't even understand why they put it in mql5...
Do iOpen and other functions work by themselves, or do you still need CopyRates? I have Print(iOpen(0,CURRENT_PERIOD,1)); entry returns 0.0 without CopyRates (called from Init). Local history is there.
And where to place CopyRates if you need it and need to get data on bars all the time? In OnTick() on every tick, or in the function of a new bar?
And functions iOpen and others work by themselves, or do we still need CopyRates? My Print(iOpen(0,CURRENT_PERIOD,1)); entry returns 0.0 without CopyRates (called from Inite). The local history is there.
By themselves. Maybe the problem is that the named constant is incorrectly specified? Not CURRENT_PERIOD, but PERIOD_CURRENT. If it still gives 0, this is an error. It can be found out via GetLastError().
Do iOpen and other functions work by themselves, or do you still need CopyRates? I have Print(iOpen(0,CURRENT_PERIOD,1)); entry returns 0.0 without CopyRates (called from Init). The local history is there.
And where to place the CopyRates if it is required and we need to obtain the data on the bars all the time? In OnTick() on every tick, or in the new bar function?
Throw out ALL iXXXXXX functions - as said above - only CopyRates. There is an example of getting data in the help, though.
And you should get this data depending on your needs: whether you need values of zero (the rightmost bar on the chart) or not.
By themselves. Maybe the problem is that the named constant is incorrectly specified? Not CURRENT_PERIOD, but PERIOD_CURRENT. If it still gives 0, this is an error. It can be found out via GetLastError().
Throw out ALL iXXXXXX functions - as said above - only CopyRates. There is an example of getting data in the help.
And you should get this data depending on your needs: whether you need values of zero (the rightmost bar on the chart) or not.
Throw out ALL iXXXXXX functions - as said above - only CopyRates. There is an example of getting data in the help.
And you should get this data depending on your needs: whether you need values of zero (the rightmost bar on the chart) or not.
Oh Vladimir. Even though I blurted it out, I regretfully didn't make a reservation. If we need only the opening price or time, for example, there's no need to use CopyRates(), in this case CopyOpen or iOpen is quite enough... respectively CopyTime or iTime. It is chosen according to religious preferences.
And I will add my caveat: In terms of productivity costs, there is no discernible difference. Consequently, it is purely a matter of religious bias.