Discussion of article "Manual charting and trading toolkit (Part III). Optimization and new tools"

MetaQuotes
Moderator
245459

New article Manual charting and trading toolkit (Part III). Optimization and new tools has been published:

In this article, we will further develop the idea of drawing graphical objects on charts using keyboard shortcuts. New tools have been added to the library, including a straight line plotted through arbitrary vertices, and a set of rectangles that enable the evaluation of the reversal time and level. Also, the article shows the possibility to optimize code for improved performance. The implementation example has been rewritten, allowing the use of Shortcuts alongside other trading programs. Required code knowledge level: slightly higher than a beginner.

The first feature is related to the line shift effect on smaller timeframes. If you draw lines in a usual way, then something like this will appear when you switch between timeframes:

D1 line ends H4 line ends

The left edge of the line which exactly coincides with an extremum at D1 is shifted to the left at H4 and thus it does not coincide with the extremum. This is an obvious effect because the extremum of a day does not have to fall on the day beginning. If you need higher accuracy, when drawing manually, you can plot the line approximately and then switch to lower timeframes in order to adjust the edges.

This solution can be utilized if you have one or two charts. What if you have 20 of them? Or even 100? This can be annoying.

Since the program has an automated drawing function, we can entrust this chore to the program when drawing every object.

Author: Oleh Fedorov

Oleh Fedorov
2386
Oleh Fedorov  

There are some problems can be for compiling English version. In file "Utilites.mqh" translator change space symbol by something else.

So, if you see error "Declaration without type" due compilation, make double click on string with this message - IDE will opening this string in editor. Then you need for select ONE wrong symbol (as usual it will be between main code and comments) and press Ctrl+H or select Search -> Replace in main menu.

In the top line (Search) IDE will insert "wrong" symbol, and in bottom line (replace) you will need to insert simple space. Then press "Replace all" button...

Well, last operation will be Compile (Ctrl+F7).

How to fix errors ""

And I will try to send right file to moderator as soon as possible.