Hi. I'm not a newbie programmer. But, I'm a serious newbie to mql5 and never did anything with mql4.
I am writing an indicator that simply detect engulfing Bull and Bear patterns and then I want to send along the price to an EA.
But, I'm having a crazy issue where this thing just keeps spitting out an array out of range message. It strangely (to me anyway) seems to occur after 51 iterations of a for(i... loop.
Here's the code... I hope someone out there can point me in the right direction... Thanks in advance.
Actually, to add a little clarity...
When the indicator is attached to a chart, the array out of range message occurs on the last bar only.
When referenced in an EA, it gives the message after 51 iterations of a for loop.
Further, the size of SELLBuffer 906 and BUYBuffer is 1016. And, as stated in the documentation the dynamic buffers can not be resized. These seem like terribly small sizes for all of the technical work done over large windows. I am missing something here, I am sure.
Ok. It appears that I was moving one bar into the future (lol) by looping to rates_total and not (rates_total - 1). Am I correct?
The array message is gone from the indicator. And, when it is called my an EA, there is no more array error message after 51 iterations of i. However, i resorts to the value '1' again. And, them loops through to 51, and then resets itself to 1 ... over and over again. I am not doing this with my code. It's just one for loop that should be running up to around 1000.
So, I'm still confused, but making progress. haha.
// int buyreturn;