Seeking help to debug array out of range error ...
BarHigh = High[limit]; // (BH)
I think that you will find that the array size is limit, so elements 0 to limit-1
Why have you posted in "Trading Systems"? Your question does not relate to the section.
I will move your topic to the EA section.
In future please post in a relevant section.
I think that you will find that the array size is limit, so elements 0 to limit-1
Why have you posted in "Trading Systems"? Your question does not relate to the section.
I will move your topic to the EA section.
In future please post in a relevant section.
Thanks Keith for highlighting to set ArraySize.
I have updated the code with following, however it did not help. Still getting the same error.
Will take care in future about relevant section.
double High[], Low[]; ArrayResize(High,barLookBack); ArraySetAsSeries(High,true); int copiedH = CopyHigh(_Symbol,PERIOD_M1,barStart,limit,High); if(copiedH < 0) Print(__FUNCTION__," ",__LINE__,": Error copying High[]"); ArrayResize(Low,barLookBack); ArraySetAsSeries(Low,true); int copiedL = CopyLow(_Symbol,PERIOD_M1,barStart,limit,High); if(copiedL < 0) Print(__FUNCTION__," ",__LINE__,": Error copying Low[]");
The changes that you have made are not relevant.
BarHigh = High[limit]; // (BH)
I think that you will find that the array size is limit, so elements 0 to limit-1
so High[limit] will be out of range.
Please help me debug "array out of range in 'FxEATestHighLow2.mq5' (68,20)" error in the following code ...