How can I access the series (time[],open[],close[] etc )in the OnCalculate()
function from an EA ?
- Which function replaced the iMaOnArray in MT4?
- How to get close[] from within EA?
- Indicator prev calculated variable issue
Function OnCalculate is handler of event Calculate. This event is generating for indicators only (https://www.mql5.com/en/docs/runtime/event_fire).
So if you want to use series in your EA you should use CopyXXX functions (https://www.mql5.com/en/docs/series) to get data you want. For example to get High data you should use CopyHigh function, to get Time data use CopyTime function etc.You also can get all series data using CopyRates function.
Documentation on MQL5: MQL5 programs / Client Terminal Events
- www.mql5.com
MQL5 programs / Client Terminal Events - Documentation on MQL5
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