Abdelrahman Ahmed: How to change this part of the code from int start() (which returns
value) to be void OnTick (which don't returns values) ?
You don't! OnTick is for EAs. Your code is an indicator.
You should stop using the old event handlers and IndicatorCounted() and start using the new ones.
Event Handling Functions - Functions - Language Basics - MQL4 Reference
How to do your lookbacks correctly.
Event Handling Functions - Functions - Language Basics - MQL4 Reference
How to do your lookbacks correctly.
William Roeder:
You don't! OnTick is for EAs. Your code is an indicator.
thank you for clarifying, I understand that OnTick is for EA, Mainly I want to create EA from this indicator which coded by the old event handlers! so how can i use this indicator to build my EA ?
this indicator draw a custom 4 array moving averages , I want to create EA conditions related to this indicator to open orders !
i know how to code the conditions to open orders ! but i can't take any data from that code , that's why the EA is not working !
Abdelrahman Ahmed: ! but i can't take any data from that code ,
Just get the value(s) of the indicator(s) into the EA (using iCustom) and do what you want with it. You should encapsulate your iCustom calls to make your code self-documenting.
Detailed explanation of iCustom - MQL4 programming forum
William Roeder:
Just get the value(s) of the indicator(s) into the EA (using iCustom) and do what you want with it.
You should encapsulate your iCustom calls to make your code self-documenting.
Detailed explanation of iCustom - MQL4 programming forum
Just get the value(s) of the indicator(s) into the EA (using iCustom) and do what you want with it.
You should encapsulate your iCustom calls to make your code self-documenting.
Detailed explanation of iCustom - MQL4 programming forum
thank you :) I'll found out how to use iCustom :)

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I have an old code MQL4 indicator, I want to use it to create EA but in new MQL4 language.
How to change this part of the code from int start() (which returns value) to be void OnTick (which don't returns values) ?