incorrect start position ArrayMinimum function, please help !

 

Hello everyone,

Attached an indicator code which give very good signals for the trend direction but as far as it runs it keep showing  

incorrect start position x for ArrayMinimum function

I hope some one can direct me to solve this but without affecting the code or how it works,

I didn't found any Print or GetLastError in the code so I don't know why/how it show those messages in Experts tab 

Thank you in advance 

When I added code to check size of array like follows:

for 1 dimintion arrays

       if(i <ArraySize(priceHi))
            double max = priceHi[ArrayMaximum(priceHi,lookBackPeriod,i)]-min;

for many dimensional arrays

  if(r-pstX <ArrayRange(wrkBuffer,1)&&r <ArrayRange(wrkBuffer,1)
      &&TripleDF<ArrayRange(wrkBuffer,2) &&TripleK<ArrayRange(wrkBuffer,2) )        
            wrkBuffer[r][TripleDF] =  wrkBuffer[r-pstX][TripleDF]+alpha*(wrkBuffer[r][TripleK]-wrkBuffer[r-pstX][TripleDF]);

I get rid of errors showing in expert tab but the indicator didn't return correct data and even didn't draw on screen, see in screenshot above the below windows is the indicator with my conditions, the above one is the one with the errors, with errors but works !!

Documentation on MQL5: Array Functions / ArrayMinimum
Documentation on MQL5: Array Functions / ArrayMinimum
  • www.mql5.com
ArrayMinimum - Array Functions - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
MOHAMED AMR MOHAMED OSAMA I ABDELWAHAB:

Topics concerning MT4 and MQL4 have their own section.

In future please post in the correct section.

I have moved your topic to the MQL4 and Metatrader 4 section.


 
Keith Watford:

Topics concerning MT4 and MQL4 have their own section.

In future please post in the correct section.

I have moved your topic to the MQL4 and Metatrader 4 section.


I navigated to mql4.com then login and post my question, now I just went through the same process again, I just found that after login I been redirected to mql5.com !!

 
MOHAMED AMR MOHAMED OSAMA I ABDELWAHAB: I navigated to mql4.com then login and post my question, now I just went through the same process again, I just found that after login I been redirected to mql5.com !!

The MQL5 forum is divided into sections. It is the last one of the list:

  • General
  • Trading Systems
  • Trading stocks, futures, options and other exchange instruments
  • Expert Advisors and Automated Trading
  • Technical Indicators
  • Articles, Library comments
  • MQL4 and MetaTrader 4
 
Fernando Carreiro:

The MQL5 forum is divided into sections. It is the last one of the list:

  • General
  • Trading Systems
  • Trading stocks, futures, options and other exchange instruments
  • Expert Advisors and Automated Trading
  • Technical Indicators
  • Articles, Library comments
  • MQL4 and MetaTrader 4

Got it, thank you