unify the two in a single code

 
Hello, how can I put the source code of an indicator, inside the source code of an EA. The idea is to unify the two in a single code. can someone help me? thank you
 

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.
          Detailed explanation of iCustom - MQL4 programming forum (2017)

 
inver61:
Hello, how can I put the source code of an indicator, inside the source code of an EA. The idea is to unify the two in a single code. can someone help me? thank you

why do you need this? You can call and use the indicator with the iCustom command at any time in the EA.