You are trying to assign to ExtMapBuffer1[K] the value of K+1. At the beginning K is equal to Bars, and K+1 will be Bars+1. The array of an indicator cannot be bigger than bars.
Try to change the code in this way
K=Bars-1;
Please, consider the use of IndicatorCounted() in order to avoid indicator to recalculate ALL bars for each new tick, it will be very resources heavy.
You should stop using the old event handlers and IndicatorCounted()
and start using the new ones.
Event Handling Functions - Functions - Language Basics - MQL4 Reference
How to do your lookbacks correctly.
Event Handling Functions - Functions - Language Basics - MQL4 Reference
How to do your lookbacks correctly.

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
Hello
I have a problem with the following coding.
I know the problem is because of using the following code :
When I use it, I have the error : 2019.11.16 12:03:11.915 2017.01.02 00:00:00 S_R EURUSD,H1: array out of range (75,43)
Can you help me solve the problem?
thanks