Please I need assistance

 
Please I came across this indicator "NonLag_v7 created by" TrendLaboratory" here, and I am trying to turn it to an Expert Advisor but I have been having diverse challenges and error messages. the dominants' error is "out of array". If I try to maneuver to get pass the error, the Expert Advisor  will run very very slow if  run it on strategy tester. please someone help me fix this. attach is the  Expert Advisor. and the Indicator
Files:
 
Your topic has been moved to the section: MQL4 and MetaTrader 4
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
 

You are mixing Indicator functionality with EA functionality. That will not work.

You don't "convert" an Indicator into an EA. You call an Indicator via the iCustom function.

You can't use function like IndicatorBuffers(), SetIndexStyle(), SetIndexBuffer() in an EA. They are for Indicators only.

Please take some time to study examples of EAs in the CodeBase to improve your understanding.

iCustom - Technical Indicators - MQL4 Reference
iCustom - Technical Indicators - MQL4 Reference
  • docs.mql4.com
iCustom - Technical Indicators - MQL4 Reference