array out of range
You must check the result returned by the Copy*** function ( CopyRates and CopyOpen ) . Follow the link and read the documentation.
Add: Since you want to receive data from someone else's timeframe, you really need to study the documentation Organizing Data Access.
- www.mql5.com
You are not checking if CopyOpen is returning enough data or if an error occurred. You are just assuming that it worked and that enough data was copied. Check the value returned by the function.
EDIT: The same applies to CopyRates that Vladimir mentioned above.
- www.mql5.com
Hello, I'm new to coding, can you help me solve this code, the EA closes when I change the period to D1 or higher, the error is "array out of range": double open_price = price_open[0]; I use different times for different objects for intraday trading.