Hello,
i like to code an expert advisor based on indicators and want thess indicators also drawn into chart.
Is this possible ? My tests shown that this seems only be possible when running strategy tester using iMA, for instance.
But when attaching ExpertAdvisor to chart, no line is drawn even iMA created.
So basically i like to declare indicator lines in my ExpertAdvisor.
Is there somthing doing the trick ?
Thank you
Hi chinaski,
You can't, that's indicator jobs not EA. Attach EA to a chart, attach the indi as well and save your chart as MT5 template. Next time you want to run the EA, attach that template instead the EA.
:D
Hi chinaski,
You can't, that's indicator jobs not EA. Attach EA to a chart, attach the indi as well and save your chart as MT5 template. Next time you want to run the EA, attach that template instead the EA.
:D
Thank you for answer. No good news as it requires doublicate coding of same feature: one in indicator and one in EA. It is also a weakness in terms of visualisation.
Let's say you like to detect patterns also in the past (as to check quality), you can't do it with an indicator as indicators call OnCalculate only with very latest bar. You need to do this in EA, then
do backtest with visualisation. But this visualisation is very limited.
- www.mql5.com
Look at ChartIndicatorAdd function.
Thank you for answer. No good news as it requires doublicate coding of same feature: one in indicator and one in EA. It is also a weakness in terms of visualisation.
Let's say you like to detect patterns also in the past (as to check quality), you can't do it with an indicator as indicators call OnCalculate only with very latest bar. You need to do this in EA, then
do backtest with visualisation. But this visualisation is very limited.
Hi chinaski,
There's no need for double coding, you can use iCustom instead (https://www.mql5.com/en/docs/indicators/icustom).
Hi alexvd,
Thanks a lot for that, and I guess that's one of the reason we can't change any CI's input parameter inside-EA-on-the-fly-as-we-like-it like we doing it in MQL4, like scanning MA or MACD with different periods.
:D
- www.mql5.com
- 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 like to code an expert advisor based on indicators and want thess indicators also drawn into chart.
Is this possible ? My tests shown that this seems only be possible when running strategy tester using iMA, for instance.
But when attaching ExpertAdvisor to chart, no line is drawn even iMA created.
So basically i like to declare indicator lines in my ExpertAdvisor.
Is there somthing doing the trick ?
Thank you