Adding Indicators to the mini charts in MT5

 

I was wondering if it is possible to add indicators to the mini charts that are available in MT5.  I Googled it and came up blank.  

 Pic below.

http://i.imgur.com/V8nKd5r.png

 
Yes it's possible but only by programming.
 

I made an example to demonstrate this, see this chart :

MetaTrader Trading Platform Screenshots

GBPCHF, D1, 2013.12.01

MetaQuotes Software Corp., MetaTrader 5, Demo

Example of a mini chart (object) with an indicator added

GBPCHF, D1, 2013.12.01, MetaQuotes Software Corp., MetaTrader 5, Demo

I added a chart object named "MiniChart", then I run the following code :

   //--- Get mini chart ID
   long miniChartID=ObjectGetInteger(0,"MiniChart",OBJPROP_CHART_ID);
   //--- Get inficator handle
   int maHandle=iMA("EURCHF",PERIOD_H1,12,0,MODE_SMA,PRICE_CLOSE);   
   //--- Add indicator ro mini chart
   if(miniChartID>0 && maHandle!=INVALID_HANDLE)
      ChartIndicatorAdd(miniChartID,0,maHandle);
Of course, the chart object can also be added by code if needed.
 
Thank you so much !!!
 

Sorry for such a noob question but how do you execute the above code? 

I can add a new mini chart via the drop down menu's (Insert/Objects/Graphical/Chart)

But I dont understand how to run the code to get the indicator appear.

 

Thank you.  

 
Innate:

Sorry for such a noob question but how do you execute the above code? 

I can add a new mini chart via the drop down menu's (Insert/Objects/Graphical/Chart)

But I dont understand how to run the code to get the indicator appear.

 

Thank you.  

Create a new script for example and copy and paste this code inside OnStart() function.
 
angevoyageur:
Create a new script for example and copy and paste this code inside OnStart() function.
Thank you for such a speedy reply. I should be able to get that sorted. Much appreciated!! 
 
Alain Verleyen:

I made an example to demonstrate this, see this chart :

I added a chart object named "MiniChart", then I run the following code :

Of course, the chart object can also be added by code if needed.


Hi, I need to add this indicator  in the chart how can I do ?... Idont need to se the candle grafic I just need the indicator 

Can you help me please?

(indicator is two times in the same window but with diferent configuration)

 
Could you please create this script so I can move it to the Script folder? I was unable to create it.