Generally you don't convert indicators into EAs. You USE indicators in EAs, by using the iCustom function. There are only some special cases when converting an Indicator into internal code of an EA has benefits. Other than that, it is better to separate the two and just use iCustom to collect the data being generated by the indicator.

- www.mql5.com
-
Don't try to do that. There are no buffers, no IndicatorCounted() or prev_calculated. No way to know if older bars have changed or been added (history update.)
Just get the value(s) of the indicator(s) into EA/indicator (using iCustom) and do what you want with it.
(MT4) Detailed explanation of iCustom - MQL4 programming forum (2017) -
MT4: Learn to code it.
MT5: Begin learning to code it.If you don't learn MQL4/5, there is no common language for us to communicate. If we tell you what you need, you can't code it. If we give you the code, you don't know how to integrate it into your code.
Or pay (Freelance) someone to code it. Top of every page is the link Freelance.
Hiring to write script - General - MQL5 programming forum (2019)We're not going to code it for you (although it could happen if you are lucky or the problem is interesting.) We are willing to help you when you post your attempt (using CODE button) and state the nature of your problem.
No free help (2017)

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello, i have been solving this problem for several weeks now ,I need your help. How can i convert the indicator below to EA ? I'm lost when it comes to using OnTIck function.