Please help, cannot find why my custom indicator make MT4 freeze

 

Hi,


My custom RSI indicator with divergency freeze, and I don't know why. It freezes when you change timeframe or when you change profiles...

Please find the file attached.

Code Profiling - Creating Programs - MetaTrader 5
Code Profiling - Creating Programs - MetaTrader 5
  • www.metatrader5.com
Profiling is a process of gathering application features, such as an execution time of its individual fragments (functions, lines). MetaEditor has integrated means of code profiling allowing a programmer to optimize a source code. Profiling can be performed on the normal chart of the trading platform, as well as using history data in the...
Files:
 

Moved to right section.

 
Charly Oudy:

Hi,


My custom RSI indicator with divergency freeze, and I don't know why. It freezes when you change timeframe or when you change profiles...

Please find the file attached.

Nothing happen on my MT4.
 
Charly Oudy: My custom RSI indicator with divergency freeze, and I don't know why.

You have an infinite loop.

You have loops inside loops inside loops and they all use the same index variable.

   int    i,pos;
   :
   for(i=1; i<=InpRSIPeriod; i++)

delete those common variables, and make them unique to each loop

   for(int i=1; i<=InpRSIPeriod; i++)