Indicator, Need advice on auto-control of DISTANCE between text (MT-4) - page 2

 
There is no good solution to this problem in MT4. One option is to use ATR with a period of 100 bars (and offset 1), the other option is to write a function that returns points depending on the time frame.
 
Dmitry Fedoseev:
There is no good solution to this problem in MT4. One option is to use ATR with a period of 100 bars (and offset 1), the second option is to write a function that returns points depending on the time frame.

In my opinion, a canvas is an absolutely cross-platform universal solution that has great opportunities as compared to graphical objects.

 

Why sign everything in words?
This would overload the perception - a lot of text on the chart.

I would make different character icons for each pattern (and select a character code in the parameters).

 
That's right, order on the schedule is important. But it needs to be done quickly without getting carried away with embellishments, and directing your energies to you know where
 

how to do it without a canvas, but according to the same principles:

1. you will need the current chart window height in pixels to determine the current indent: ChartGetInteger with CHART_HEIGHT_IN_PIXELS property

2. to determine the start of chart drawing: ChartTimePriceToXY

3. How to determine which area of the chart we are seeing now? ChartGetInteger with the CHART_VISIBLE_BARS and CHART_FIRST_VISIBLE_BAR properties

4. everything happens in OnChartEvent. we draw objects like OBJ_LABEL

Actually, it reminds me of an old whining (including mine) about a multi-line text... eh, if only...

 
Igor Zakharov:

how to do it without a canvas, but according to the same principles:

1. you will need the current chart window height in pixels to determine the current indent: ChartGetInteger with CHART_HEIGHT_IN_PIXELS property

2. to determine the start of chart drawing: ChartTimePriceToXY

3. How to determine which area of the chart we are seeing now? ChartGetInteger with the CHART_VISIBLE_BARS and CHART_FIRST_VISIBLE_BAR properties

4. everything happens in OnChartEvent. we are drawing objects like OBJ_LABEL

Actually, it reminds me of an old whining (including mine) about a multi-line text... eh, if only...

Does Canvas seem like a monster? And so it is necessary to create a Frankenstein...
A multiline comment is done at once.
 
Artyom Trishkin:
The multi-line commentary is done at once.

comment? is that the one in the top left corner? how does it help the author of the topic?

or do you mean some way to output multiline text linked to price/time? don't recall such an object in foursquare. can you teach me?

i don't understand the part about the canvas and the monster...

by the way, here's an example on canvas by Nikolay, almost exactly what the author needs, minimal edits:

https://www.mql5.com/ru/forum/329224#comment_14363671

 
Igor Zakharov:

how to do it without a canvas, but according to the same principles:

1. you will need the current chart window height in pixels to determine the current indent: ChartGetInteger with CHART_HEIGHT_IN_PIXELS property

2. to determine the start of chart drawing: ChartTimePriceToXY

3. How to determine which area of the chart we are seeing now? ChartGetInteger with the CHART_VISIBLE_BARS and CHART_FIRST_VISIBLE_BAR properties

4. everything happens in OnChartEvent. we are drawing objects like OBJ_LABEL

Actually, it reminds me of an old whining (including mine) about a multi-line text... eh, if only...

It's better to write a function, which returns the distance in price, but corresponds to a given number of pixels. Then in the OnChartEvent we should go through the visible part of the chart and adjust distances to text labels. With this approach, the amount of modifications is minimal and the difference between the indicator and the ordinary one is also minimal.

 
Artyom Trishkin:

In my opinion, kanvas is an absolutely cross-platform universal solution, which has huge possibilities in comparison with graphical objects.

No. No one needs it except a small handful of enthusiasts. And mostly people need it so that everything is simple, straightforward and understandable.

 
Dmitry Fedoseev:

No. No one needs it except a small handful of enthusiasts. And mostly people want it to be simple, straightforward and easy to understand.

It is easier and clearer to write/draw everything inventable-moveable-adjustable on canvas with a graphical object. The object is simple. But their ratio is a mess. But kanvas is also an object, but one object per candle - you just create a canvas and draw everything you need there. You don't have to think how to save line spacing when you change the chart period and vertical scale.
Reason: