
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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).
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...
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...
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
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.
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.
No. No one needs it except a small handful of enthusiasts. And mostly people want it to be simple, straightforward and easy to understand.