I know there are classes that can be used to draw graphics on the chart, I am developing an indicator that will have lots of graphics and trying to run it becomes very slow, its not an option. So I need to know how I can use if possible the windows api to completely redraw the entire chart, put my custom components. I basically want to hack the entire chart frame and if possible detach it and draw buttons, bordered panels, tabs and text boxes and still have the same access to the chart data API? Any clues, is it possible?
I don't think it is possible to use WinAPI to Draw onto the MT4 Charts as they are application-centric. So you will have to use MT4's own Chart Graphic Objects or use the pixel based Canvas class which just uses a normal Bitmap Resource placed on the chart.
The only alternative I see for a a very fast graphical charting system, is to implement your own and totally recreate it as a separate system (as a ".dll") and have an EA continuously feed it the Bar and Tick Data accordingly. However, I do think that will be a rather huge undertaking.
Instead of using Chart Objects, can you not make it use "buffers" instead (at least for the most part)?
Is such a graphical and complex indicator really worth it? Does it really make you trade better? Is it profitable? If the answer is NO to any of these questions, then maybe you should just abide by the well know K.I.S.S. principle.
I have written code that uses extremely large amounts of graphics and not noticed any slowdown.
I quite often see in other people's code that they needlessly delete and re-draw graphics every tick for no reason. Make sure that you are not doing this.
You did not answer GumRai's comments which are in my opinion very pertinent. Although I have never coded complex graphics myself, I have seen such "works of art" using only built-in functionality, and they worked very well and without any slow-down. So his suggestion that you review your code for needless delete/redraw cycles seems very sensible and astute.
To add comments, please log in or register