
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
In fact, for a custom object, all the steps are the same as the steps in this example, and only the length and width of the object should be applied instead of the length and width of the chart?
@Nikolai Semko: You seem to do wonders with canvas in this thread - nice work! Let me challenge you with a question which I have not managed to get answered anywhere in the Web so far. Hope you'll know what is going on:
Whenever I setup my canvas with a call to CreateBitmapLabel the created, invisible graphical object covers my MT5 chart area in a way that I stop getting OHLC tooltips while hovering mouse over bars/candles. Setting up BitmapLabel to cover the whole chart (= what I intend to do) effectively prevents any candle tooltips to be displayed. Tried setting z-order of the bitmap object to negative values, setting its tooltip to "\n", sending the whole bitmap object to background, chart to foreground and/or making the object not selectable. None of this (in any combination) allowed me to get the tooltips back. Do you (or anyone reading this) know a way around it?
Would be so cool to use canvas in my indicator, yet I know my target users use the tooltips very often and won't accept them not working. Am I forced to use regular chart objects because of that?
@Nikolai Semko: You seem to do wonders with canvas in this thread - nice work! Let me challenge you with a question which I have not managed to get answered anywhere in the Web so far. Hope you'll know what is going on:
Whenever I setup my canvas with a call to CreateBitmapLabel the created, invisible graphical object covers my MT5 chart area in a way that I stop getting OHLC tooltips while hovering mouse over bars/candles. Setting up BitmapLabel to cover the whole chart (= what I intend to do) effectively prevents any candle tooltips to be displayed. Tried setting z-order of the bitmap object to negative values, setting its tooltip to "\n", sending the whole bitmap object to background, chart to foreground and/or making the object not selectable. None of this (in any combination) allowed me to get the tooltips back. Do you (or anyone reading this) know a way around it?
Would be so cool to use canvas in my indicator, yet I know my target users use the tooltips very often and won't accept them not working. Am I forced to use regular chart objects because of that?
It's an MT5 bug. MetaQuotes is already aware about it.
@Nikolai Semko: You seem to do wonders with canvas in this thread - nice work! Let me challenge you with a question which I have not managed to get answered anywhere in the Web so far. Hope you'll know what is going on:
Whenever I setup my canvas with a call to CreateBitmapLabel the created, invisible graphical object covers my MT5 chart area in a way that I stop getting OHLC tooltips while hovering mouse over bars/candles. Setting up BitmapLabel to cover the whole chart (= what I intend to do) effectively prevents any candle tooltips to be displayed. Tried setting z-order of the bitmap object to negative values, setting its tooltip to "\n", sending the whole bitmap object to background, chart to foreground and/or making the object not selectable. None of this (in any combination) allowed me to get the tooltips back. Do you (or anyone reading this) know a way around it?
Would be so cool to use canvas in my indicator, yet I know my target users use the tooltips very often and won't accept them not working. Am I forced to use regular chart objects because of that?
If you just need the OHLC tooltips is an easy task. You can draw it in your canvas, or separate small canvas. If you need it for for all the rest of the objects and indicators, it is impossible at this point.
@Nikolai Semko: You seem to do wonders with canvas in this thread - nice work! Let me challenge you with a question which I have not managed to get answered anywhere in the Web so far. Hope you'll know what is going on:
Whenever I setup my canvas with a call to CreateBitmapLabel the created, invisible graphical object covers my MT5 chart area in a way that I stop getting OHLC tooltips while hovering mouse over bars/candles. Setting up BitmapLabel to cover the whole chart (= what I intend to do) effectively prevents any candle tooltips to be displayed. Tried setting z-order of the bitmap object to negative values, setting its tooltip to "\n", sending the whole bitmap object to background, chart to foreground and/or making the object not selectable. None of this (in any combination) allowed me to get the tooltips back. Do you (or anyone reading this) know a way around it?
Would be so cool to use canvas in my indicator, yet I know my target users use the tooltips very often and won't accept them not working. Am I forced to use regular chart objects because of that?
Yes, unfortunately Alain is right.
I also agree with Samuel that in case of an urgent need to show tooltips, you can use the same or another canvas. In any case, I would do so if I needed it.
In this case, I would recommend my library iCanvas , which would greatly simplify such an implementation, since it automatically fills an instance of the Window (W) structure, which has parameters such as MouseBar and MousePrice.
Moreover, the iCanvas class significantly increases performance due to its own functions for translating the XY system into price-time and back.
Just in case, I am attaching the latest version of the iCanvas library
@Alain Verleyen, @Samuel Manoel De Souza, @Nikolai Semko: Thanks for valuable input. Putting it all together, I managed to work around the tooltips problem like below.
Basically, what is done here:
Results attached. Sharing it here if someone has a similar problem to mine when using canvas.
One downside (or feature? ;p) is that the bar is highlighted (=rectangle's border) when hovered over: a side effect of me not finding any chart object that'd nicely cover candles' body (for tooltip's hit test) while being invisible to user.
If you see any redundant parts or something that could've been done better/more efficient: all comments are welcome :)@Alain Verleyen, @Samuel Manoel De Souza, @Nikolai Semko: Thanks for valuable input. Putting it all together, I managed to work around the tooltips problem like below.
Basically, what is done here:
Results attached. Sharing it here if someone has a similar problem to mine when using canvas.
One downside (or feature? ;p) is that the bar is highlighted (=rectangle's border) when hovered over: a side effect of me not finding any chart object that'd nicely cover candles' body (for tooltip's hit test) while being invisible to user.
If you see any redundant parts or something that could've been done better/more efficient: all comments are welcome :)Solution without creating objects on canvas background
Solution without creating objects on canvas background
Thanks a lot! While I didn't use your solution as-is, I improved upon it and managed to simplify mine down to 50 LOC (2 functions), without using the iCanvas (btw. iCanvas is great, but using it solely for tooltips in my solution felt like employing a space shuttle to deliver pizza :)). Case closed.
😁👍