Fixing Flag Pattern detector

 

I am trying to fix an indicator which i converted into mq5 from mq4 however there is some error which breaks flags with error "array out of range" when i change period to 8 or switch timeframe, any help on fixing this is appreciated.


Files:
 

Its bit more than just  simple "array out of range" also  period has minimum size.

Second an auto converted code has no  "array out of range" but plotting is wrong.

Good luck use print and your brain

 
Jan4654 #:

Its bit more than just  simple "array out of range" also  period has minimum size.

Second an auto converted code has no  "array out of range" but plotting is wrong.

Good luck use print and your brain

Its not auto converted, however i am out of brain so posted in forum, Looking forward for more help on this. Thanks