How do i Simultaneously delete or add indicators for all charts? I have 20 over pairs and whenever i decide to add or remove an indicator say, a 50 MA, i would have to add them on all the 20 over charts one by one. How do do them simultaneously? thank you!
Read in the editor's reference (F1) about:
and so on.
To apply indicators to a chart open a new chart (ChartOpen()) wich uses the default template..
Save your setups to Templates and then apply a template to the Chart. When you apply a template, the current chart setup will be clear and the new template applied.
You can also setup complete Profiles for multiple charts, and thus be able to switch from one set of charts (with templates) to a completely different setup on all charts in just one step.
Hi Gooly and FMIC,
Thank you for your inputs! i will check them out and see if it works! I am not looking for same template upon opening new charts. but amending my existing charts so i'll check if the Help page helps me in doing so :)
Ive read the editor's reference but i cant find anything about simultaneously adding/deleting indicators on my charts. May i know where i can find that? or could you kindly teach me how it is done? i was using Esignal previously and when i add or delete indicators say Moving Averages or Bollinger Bands, all the other charts will be added or deleted as follows too. thanks!
What you are being told (a little elliptically) is that there is no good, standard way of achieving what you want. MQL4 does not have a ChartIndicatorAdd() function. The only way of adding an indicator to an existing chart is to apply a template to the chart, but this completely replaces everything on it - including not only the indicators, but also graphical objects and any running EA.
There's a DLL-call method for adding an indicator to a chart which I posted years ago (https://forum.mql4.com/20946) and which occasionally gets recycled by moderators and other users (e.g. https://www.mql5.com/en/forum/73391#comment_2257981), but it absolutely isn't reliable when cycling through multiple charts and trying to add an indicator to each of them.
Thank you for your input! Hmm do you know what i want to achieve anyway? its not that i dont know how to add an indicator to a chart. What i want is that, say i have 20 Currency Pairs on my MT4 and i want to add 20 Period Moving Average and 50 Period Moving Average and a Bollinger Band. How do i add them to all my 20 Currency Pairs at once?
And now what if i wish to delete the 20 Period Moving Average, how do i delete it on all my 20 charts at one go instead of individually going to every chart page and individually delete them?
How do i add them to all my 20 Currency Pairs at once?
You are on a programming forum, not a general-use MT4 forum, so I assume(d) that you are asking how to do this programmatically.
But the answer is the same regardless of whether you are asking how you do it manually, or how you write a piece of code to do it: it's not possible. MT4 doesn't provide any such facility in its own user interface and, through the lack of something like a ChartIndicatorAdd() function, it does not provide any way for third-parties to build this themselves.
... the only reliable way I can see of doing this would be very cumbersome: you shut down MT4; you run a utility which adds the indicators to the chart by modifying the .chr files on disk; and then you restart MT4. An evil and less reliable variant would be something inside MT4 which switched to a temporary profile; modified the .chr files on disk for the previous profile; and then switched back to that previous profile. But neither of these things is straightforward, and would be difficult to do solely through the MQL4 programming language.
... another variant which ought to be reliable, and wouldn't be impossibly hard, is to create a temporary template from each open chart; modify the .tpl files on disk to include the extra indicator; re-apply each template to each chart; and then delete each temporary template. But still not simple.
To add comments, please log in or register