Can anyone tell me why it print array out of range(number71,55)?Thx a lot(Want to calculate the average high minus low f or 20 days, the custom indicator in iCustom is the code itself)
The checks a trading robot must pass before publication in the Market
- www.mql5.com
Before any product is published in the Market, it must undergo compulsory preliminary checks in order to ensure a uniform quality standard. This article considers the most frequent errors made by developers in their technical indicators and trading robots. An also shows how to self-test a product before sending it to the Market.
- Why array out of series when I want to put array in smaller multitimeframe
- array out of range why?
- Array out of range
Good morning
In general, "out of ranges" are quite simple to resolve.
Either the array is not created, or you are trying to position yourself on an index that is outside the current size.
You can therefore look very easily with an ArrayPrint to see if it is created and if the index exists.
Otherwise do a print to see the value which gives the index.
Good luck
In general, "out of ranges" are quite simple to resolve.
Either the array is not created, or you are trying to position yourself on an index that is outside the current size.
You can therefore look very easily with an ArrayPrint to see if it is created and if the index exists.
Otherwise do a print to see the value which gives the index.
Good luck
Gerard Willia G J B M Dinh Sy #:
Good morning
In general, "out of ranges" are quite simple to resolve.
Either the array is not created, or you are trying to position yourself on an index that is outside the current size.
You can therefore look very easily with an ArrayPrint to see if it is created and if the index exists.
Otherwise do a print to see the value which gives the index.
Good luck
Good morning
In general, "out of ranges" are quite simple to resolve.
Either the array is not created, or you are trying to position yourself on an index that is outside the current size.
You can therefore look very easily with an ArrayPrint to see if it is created and if the index exists.
Otherwise do a print to see the value which gives the index.
Good luck
Thanks for your help, but still have question. I tried arrayprint and print the array[rates_total-1], it seems the handle works. But when I change timeframe it will print array out of range first then print the value. I tried arraysize but still can't find what's the problem, if it's able can you help me to find out the problem, thx!
I don't know.
You need to do tests in the code
All the print commands, Comment(), breakpoints to try to follow what's happening as best as possible.
Sorry I couldn't do more
You need to do tests in the code
All the print commands, Comment(), breakpoints to try to follow what's happening as best as possible.
Sorry I couldn't do more
Gerard Willia G J B M Dinh Sy #:
I don't know.
You need to do tests in the code
All the print commands, Comment(), breakpoints to try to follow what's happening as best as possible.
Sorry I couldn't do more
It seems that the problem is Time[] array, because after Copytime I use arraysize to print, no matter how i change timeframe it will run array out of range first and arraysize fixed to be period day, not sure if the reason is this. Do you have better way to put array into multitimeframe? Thanks.
I don't know.
You need to do tests in the code
All the print commands, Comment(), breakpoints to try to follow what's happening as best as possible.
Sorry I couldn't do more
kenny0779 # :
It seems that the problem is Time[] array, because after Copytime I use arraysize to print, no matter how i change timeframe it will run array out of range first and arraysize fixed to be period day, not sure if the reason is this. Do you have better way to put array into multitimeframe? Thanks.
It seems that the problem is Time[] array, because after Copytime I use arraysize to print, no matter how i change timeframe it will run array out of range first and arraysize fixed to be period day, not sure if the reason is this. Do you have better way to put array into multitimeframe? Thanks.
Good morning
If you are referring to this time[]
int OnCalculate ( const int rates_total, const int prev_calculated, const datetime &time[],
You can't do anything about it.
It's a system constant
kenny0779:
Can anyone tell me why it print array out of range(number71,55)?Thx a lot(Want to calculate the average high minus low f or 20 days, the custom indicator in iCustom is the code itself)
Why not just run the program in debug mode, then you can catch the error and see the array dimension and index.
Can anyone tell me why it print array out of range(number71,55)?Thx a lot(Want to calculate the average high minus low f or 20 days, the custom indicator in iCustom is the code itself)
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