Comment Block - pseudo delete
-
I still have not discovered a way to delete, ie completely remove a comment blcok from the chart.
I can update values by feeding variables into the value fields.
I am trying to pseudo turn comments off by inserting a "." and changing the text color to match the background, however although my color variable successfully sets the start text color it fails to update the color when the color variable is changed and comment vlock re-run.
Is this a bug, intended or am I doing something wrong ?
I have tried using both string and color variables to change the color.
-
if you use constants and variables in blocks, and then maybe change the dropdown without deleting variable and constants that was input into any spots, that will still leave values within the block. You must right click to remove always.
Easiest way to test what I mean, make up a constant for an MA. Input the constant into the MA portion of a condition block. update the block and close it. Now go back into the blck and change it to a different indicator. Update the block and close. Now go and try to delete the MA constant. You will not be able to.
Maybe something like this is causing your issues
-
@mantadiver Do you mean you want to delete the text shown by a 'comment' block from screen? AFAIK that is not possible. What you can do is using text blocks insted and then delete the texts one by one or by colour.
-
Thank you both for your input, @TipsyWisdom, tried your suggestion but didn't notice any change.
@l-andorrà the text blocks work well, it's just that I use a fair few and lining everything up / making changes takes time whereas the Comment block takes care of simple alignment and has the advantage of being manually moveable.
My "solution" which is a cludge is as follows:-
- Make sure all variables used in the comment block are "string".
- Convert any numbers to string e.g Value / Text(code input) DoubleToString(AccountEquity())
- Create a variable to specify the font ie. Verdana
- Then to delete the comment text from screen I change the font variable to "Wingdings"
- Finally for each text field change Value / Text(code input) to CharToString(32)
Wingdings charachter 32 is blank and this successfully removed the text from the screen.
I then created a button to turn the comment block on / off and so far it works.
I am not familiar enough with MQL to appreciate why a comment block cannot be deleted (yet?) but this workaround seems to work.
-
@mantadiver Very interesting. Thanks for sharing.
-
@mantadiver said in Comment Block - pseudo delete:
I am not familiar enough with MQL to appreciate why a comment block cannot be deleted (yet?) but this workaround seems to work.
^ this makes me think that maybe comments are displayed as an overlay, rather than being an object on the chart, if that makes sense?
-
@tipsywisdom Your probably right, they are not found it the object list.