Creating custom charts

 

Just starting to look at MT5 as a possible platform for trading, so I currently have very little knowledge of it.

What I would like to do is to display charts with custom timeframes. I also want to make it dynamic, so I don't want to create a custom symbol set.

I can see that within the MQL5 directory structure, there are a bunch of controls (MQL5\Include\Controls), to enable the developer to create a dialog and then add specific controls to it, e.g. Button, CheckBox, etc, but I cannot find controls in this list to do with charts. There is one in the charts folder (MQL5\Include\Charts), but that appears to only allow the developer to use the set timeframes, as it makes use of ChartOpen().

There is also the option to draw directly to the canvas (CCanvas), which would then allow custom timeframes to be drawn, but a quick look at the code leads me to believe that I would also need to create my own buttons/checkboxes, etc, as the ones already mentioned use different technology, or am I wrong on this?

Is there a way that I can use the existing controls, but have the ability to also draw a custom chart with custom timeframes, e.g. use MQL5\Include\Controls\Dialog.mqh as a base, and then add MQL5\Include\Graphics\Graphic.mqh onto the dialog?

BTW I have not done any of this yet, I am only at the stage of trying to read about MQL5 and try to work out the best way forward.

If anyone knows of any examples, articles or documents that I can refer to, that would help a lot.

 
There is one summary post about custom symbols and custom datafeeds in Metatrader 5: post
How to Start with Metatrader 5 - How to Start with Metatrader 5, a summary of how to start with MT5 platform.
How to Start with Metatrader 5 - How to Start with Metatrader 5, a summary of how to start with MT5 platform.
  • 2017.04.07
  • Sergey Golubev
  • www.mql5.com
How to start with mt5, a summary. How to start with mt5 platform : summary. A very good article to learn how to use this site. If you are using linux, it'is possible to use mt5 , but with some limitations. This year, we have switched to the updated metatrader 5 featuring hedging
 
MT5MakesCents:
There is also the option to draw directly to the canvas (CCanvas), which would then allow custom timeframes to be drawn, but a quick look at the code leads me to believe that I would also need to create my own buttons/checkboxes, etc, as the ones already mentioned use different technology, or am I wrong on this?

You are thinking correctly. This is the most productive choice. But this is not an easy way.



Files:
Experts.zip  23 kb
 
Nikolai Semko #:

You are thinking correctly. This is the most productive choice. But this is not an easy way.



Thanks, that has been a great help.