ChartIndicatorAdd() in MT4

 

It would be stunning add this function to MT4, meanwhile how Can I achieve this sort of thing in MT4. What I really need is overlay to different indicators (BB and RSI) in the same sub window from code. Thanks.

 
Jhojan Alberto Tobon Monsalve:

It would be stunning add this function to MT4, meanwhile how Can I achieve this sort of thing in MT4. What I really need is overlay to different indicators (BB and RSI) in the same sub window from code. Thanks.

Probably the only way is to make use of ChartApplyTemplate()...

ChartApplyTemplate - Chart Operations - MQL4 Reference
ChartApplyTemplate - Chart Operations - MQL4 Reference
  • docs.mql4.com
Applies a specific template from a specified file to the chart. The command is added to chart message queue and executed only after all previous commands have been processed. The Expert Advisor will be unloaded and will not be able to continue operating in case of successful loading of a new template to the chart it is attached to. Live Trading...
 
Seng Joo Thio:

Probably the only way is to make use of ChartApplyTemplate()...

Thanks Seng but that is not what I require. The image below represents better my desire.


This is perfectly possible in MT5 but not in MT4 I think because MT5 manages these indicators through  handlers  and MT4 gives us directly the value of the indicator. So I think the only way is to redimension the BB in terms of RSI.  Thank you anyway. 


 Hopefully someone from the official development team of Metaquotes see this post. That is truly my target with this post.

 
Jhojan Alberto Tobon Monsalve:

Thanks Seng but that is not what I require. The image below represents better my desire.

This is perfectly possible in MT5 but not in MT4 I think because MT5 manages these indicators through  handlers  and MT4 gives us directly the value of the indicator. So I think the only way is to redimension the BB in terms of RSI.  Thank you anyway. 

Hopefully someone from the official development team of Metaquotes see this post. That is truly my target with this post.

Right, because there are various iXXXOnArray() functions (where Bands is one of those XXX) in MT4 that can achieve the overlap you want easily, so I didn't think that was your key point.

So my earlier answer was in direct response your mentioning of the need to "overlay... ... from code", which MT4 does not support (i.e. while we can easily code indicators with such overlapping in place, we cannot display it on a chart from code), other than the use of ChartApplyTemplate().

 
Seng Joo Thio:

Right, because there are various iXXXOnArray() functions (where Bands is one of those XXX) in MT4 that can achieve the overlap you want easily, so I didn't think that was your key point.


Thank you Seng, As I mentioned in my first post "overlap 2 indicators in the same "sub window " what is different of "main window" or "main chart"". Thank you anyway.
 
Jhojan Alberto Tobon Monsalve:
Thank you Seng, As I mentioned in my first post "overlap 2 indicators in the same "sub window " what is different of "main window" or "main chart"". Thank you anyway.

They're the same - if you can display the lines in main window/chart, you can display them in sub window, no issue at all. There will be some issue the other way round, but can also be managed though.

 
Seng Joo Thio:

They're the same - if you can display the lines in main window/chart, you can display them in sub window, no issue at all. There will be some issue the other way round, but can also be managed though.

Yes, I know that, I needed both in the sub window (separate window) as displayed in the image. Regarding the iBandsArray(), how would you use iBandsOnArray() to plot it together with RSI both in the same separated window? 

 
Jhojan Alberto Tobon Monsalve:

Yes, I know that, I needed both in the sub window (separate window) as displayed in the image. Regarding the iBandsArray(), how would you use iBandsOnArray() to plot it together with RSI both in the same separated window? 

I've quickly put together the key parts (not elegant, but serves to demonstrate the possibility) and attached.

Files:
 
Seng Joo Thio:

I've quickly put together the key parts (not elegant, but serves to demonstrate the possibility) and attached.

But this way you are using the RSI for calculating the BB what is incorrect what I need is overlapping the real BB calculated with real prices ( the normal BB). Any idea?

 
Jhojan Alberto Tobon Monsalve:

But this way you are using the RSI for calculating the BB what is incorrect what I need is overlapping the real BB calculated with real prices ( the normal BB). Any idea?

It's just an array - replace rsi values with prices. 
 
Seng Joo Thio:
It's just an array - replace rsi values with prices. 

Thank you Seng, but if I do that the BB values dosen´t match the RSI values Do you know what I mean? So the indicator is not shown properly.

Reason: