What Custom Indicators CAN'T do ?

 
Hi all, 

I guess what I really need to plan my next project is a generalized list of what custom indicators CAN'T do. vs what EA's CAN'T do. 

Or at least some main feature differences that might guide me in deciding EA vs Indicator. 

Please advise
Thanks
 
Agent86: Hi all, I guess what I really need to plan my next project is a generalized list of what custom indicators CAN'T do. vs what EA's CAN'T do. Or at least some main feature differences that might guide me in deciding EA vs Indicator. Please advise
Thanks

An indicator can't trade! Only EAs, Scripts and Services (only on MT5) can carry out trading operations!

And also very importantly, it can't make coffee! 😂

 
Fernando Carreiro #:

An indicator can't trade! Only EAs, Scripts and Services (only on MT5) can carry out trading operations!

And also very importantly, it can't make coffee! 😂

LOL thanks.

So that part I actually did know about. But what about the objects, text labels, arrow pointers, and other graphic things ? Any limits on indicators vs EA's on this ? 

And can an EA show indicators on the chart ? If not then it seem I need a combination of both for my next project to both show a custom indicator and features of the EA too ? 

What do you think ? 
Thanks

 
Agent86 #: But what about the objects, text labels, arrow pointers, and other graphic things ? Any limits on indicators vs EA's on this? And can an EA show indicators on the chart ? If not then it seem I need a combination of both for my next project to both show a custom indicator and features of the EA too ? 

Yes, EAs and Scripts can place all types of graphic objects on the chart.

On MT5 they can also add Indicators to charts, but not on MT4. On MT4 you can apply a Template but that would consequently remove the EA.

However, both on MT4 and MT5, an EA you can access the data from any Indicator even if not present on the chart itself. That is usually how EAs work, by accessing the data from indicators (or normal OHLC data), in order to calculate entries and exits.

Also, note that any indicators on a Chart will work totally independently of what an EA may be accessing. There is no communication or synchronisation between them. This is a very important note. An EA may be accessing an SMA20 and yet there can be a EMA50 on the chart but no SMA20. They are totally independent of each other.

 
An indicator can't do webrequests too, that gave me quite a headache when I tried (it can communicate with services which can do the webrequests, if you know how to do that)
 
Thanks all. 

This is exactly what I needed to know. 
 
Is there reason to use OnCalculate in an EA vs OnTick ? 
 
Agent86 #: Is there reason to use OnCalculate in an EA vs OnTick ? 

Indicators use OnCalculate() and EAs use OnTick(). You can't do it the other way round. OnCalculate is not available on EAs and OnTick is not available on Indicators.

 
Fernando Carreiro #:

Indicators use OnCalculate() and EAs use OnTick(). You can't do it the other way round. OnCalculate is not available on EAs and OnTick is not available on Indicators.

This is what I thought from reading some online docs but wanted to confirm THANKS. 

Assuming most of my EA code will then be in OnTick() or OnInit() where should indicators be ? 

double   histo_1  = iCustom(Symbol(),NULL,"MACD True",2,1);


What logic is there to put indicator data in Ontick() vs OnInit() ? 

For example, I assume this code should be in Ontick() ? 

I guess I'm still confused about structure of code. If comparisons regarding indicator data etc ? OnTick() is where I've mostly been working and OnInit() just for some startup declarations etc. ? Is this what I should be doing ? 


Thanks



 
Agent86 #: Assuming most of my EA code will then be in OnTick() or OnInit() where should indicators be?


What logic is there to put indicator data in Ontick() vs OnInit()? 

For example, I assume this code should be in Ontick() ? 

I guess I'm still confused about structure of code. If comparisons regarding indicator data etc ? OnTick() is where I've mostly been working and OnInit() just for some startup declarations etc. ? Is this what I should be doing ? 

On MT4, calling iCusom() or other iFunctions() for indicators and OHLC data should be processed by OnTick(). In fact, 99% of your code should be processed by OnTick() and very little in OnInit() which is only for initial startup.

 
Agent86:
Hi all, 

I guess what I really need to plan my next project is a generalized list of what custom indicators CAN'T do. vs what EA's CAN'T do. 

Or at least some main feature differences that might guide me in deciding EA vs Indicator. 

Please advise
Thanks

So your next project is actually learning mql .. :))) 

Reason: