A Sample: Chart metrics, https://www.mql5.com/en/forum/112633/page7#276861
Thank you for providing this link, but I can's see how to use this code. Can you give an example?
adamp wrote >>
I need someones help, because I am stuck since a few hours now with the following task:
A graphical object is attached to a chart - an arrow in this case. This object needs a time and a price as coordinate.
Now I wanna convert the time and price coordinate into a pixel based coordinate. Any idea how this can be achieved?
I was thinking about using WindowPriceMin / Max, WindowsFirstVisibleBar and WindowBarsPerChart, but don't know exactly how.
To help me with this problem, I also have written a DLL that gives me the width and height of the current chart window in pixels.
But still no idea how to solve it... maybe sitting too long in front of this. Any help appreciated :-)
I need someones help, because I am stuck since a few hours now with the following task:
A graphical object is attached to a chart - an arrow in this case. This object needs a time and a price as coordinate.
Now I wanna convert the time and price coordinate into a pixel based coordinate. Any idea how this can be achieved?
I was thinking about using WindowPriceMin / Max, WindowsFirstVisibleBar and WindowBarsPerChart, but don't know exactly how.
To help me with this problem, I also have written a DLL that gives me the width and height of the current chart window in pixels.
But still no idea how to solve it... maybe sitting too long in front of this. Any help appreciated :-)
"I also have written a DLL that gives me the width and height of the current chart window in pixels."
Really? Can you post the code in your DLL that got the width and height of the current chart in pixels? I've been trying to figure this EXACT problem out. I may be able to solve it if I can see how you got the chart size in pixels.
This library already helped me a lot. Now I know how many bars are left on the right hand side of the chart shift.
Together with the bars on the left, min and max price, I can calculate a good approximation of the position.
I am very excited how accurate this will be. But seems promising so far.
Together with the bars on the left, min and max price, I can calculate a good approximation of the position.
I am very excited how accurate this will be. But seems promising so far.
adamp wrote >>
This library already helped me a lot. Now I know how many bars are left on the right hand side of the chart shift.
Together with the bars on the left, min and max price, I can calculate a good approximation of the position.
I am very excited how accurate this will be. But seems promising so far.
This library already helped me a lot. Now I know how many bars are left on the right hand side of the chart shift.
Together with the bars on the left, min and max price, I can calculate a good approximation of the position.
I am very excited how accurate this will be. But seems promising so far.
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
A graphical object is attached to a chart - an arrow in this case. This object needs a time and a price as coordinate.
Now I wanna convert the time and price coordinate into a pixel based coordinate. Any idea how this can be achieved?
I was thinking about using WindowPriceMin / Max, WindowsFirstVisibleBar and WindowBarsPerChart, but don't know exactly how.
To help me with this problem, I also have written a DLL that gives me the width and height of the current chart window in pixels.
But still no idea how to solve it... maybe sitting too long in front of this. Any help appreciated :-)