is it possible to create both indicator and EA on a single .mq5 file?

 

i have some experience creating an .ex4 and .ex5 EA, but i have ZERO experience creating indicators. i never use any visual graphical object either to my EA. so quick question:

1. is it possible to add a custom indicators to an EA?

2. just curious, based on programing side: are indicators is the same as EA but it only calculate the required result as signal (and show it, if any) without opening any order?

 
Abdul Arief Bogie Ardianto:
1. is it possible to add a custom indicators to an EA?

Yes. The best approach would be using iCustom function. This allows to invoke a indicator from EA code. But including indicator code inside EA is troublesome and I don't suggest it.

Abdul Arief Bogie Ardianto:
are indicators is the same as EA but it only calculate the required result as signal (and show it, if any) without opening any order?

From programming point of view custom indicators provide you with concept of buffers. Buffers are dynamically allocated arrays (automatically managed by the terminal) to reduce complexity of calculating values that your code requires to deliver a signal or plot something on chart. In general indicators do not open orders/positions but EAs do.

Reason: