Download MetaTrader 5

I add text to my chart and then switch timeframes, come back and the text is gone. How can i make it stay?

To add comments, please log in or register
What is the best place to find a programmer? Freelance service!
jakubdonovan36
237
jakubdonovan36 2016.11.11 17:42 
Hi, i have an issue. I add text to my chart and then switch timeframes, come back and the text is gone. How can i make it stay?
Carl Schreiber
6590
Carl Schreiber 2016.11.11 18:06  
Have you confirmed by looking in the list of objects (Ctrl-B) that it is gone?
whroeder1
14514
whroeder1 2016.11.11 18:15  
  1. A badly coded indicator/EA deleted all objects on deinit
  2. Or you added text (which move with the bars) instead of a label
jakubdonovan36
237
jakubdonovan36 2016.11.11 18:29  
whroeder1:
  1. A badly coded indicator/EA deleted all objects on deinit
  2. Or you added text (which move with the bars) instead of a label
Yeah, Text. I need it to stay in place so i can keep track of what happened in the past.  Is there a way to make it stay?
Marco vd Heijden
Moderator
4701
Marco vd Heijden 2016.11.11 19:09  
Did you have some code maybe it gets deleted upon timeframe switch ?
jakubdonovan36
237
jakubdonovan36 2016.11.11 19:17  
Marco vd Heijden:
Did you have some code maybe it gets deleted upon timeframe switch ?
Yeah, when i look into the objects list, the text is no longer there.
whroeder1
14514
whroeder1 2016.11.11 20:26  
jakubdonovan36: Yeah, when i look into the objects list, the text is no longer there.
What part of "A badly coded indicator/EA deleted all objects on deinit" was unclear? Fix your broken indicator.
jakubdonovan36
237
jakubdonovan36 2016.11.11 21:29  
whroeder1:
What part of "A badly coded indicator/EA deleted all objects on deinit" was unclear? Fix your broken indicator.

I figured out which indicator it is. It's called "daysofweeklabels"   but I can't code. How would i fix this? what is "deinit"

Keith Watford
Moderator
9624
Keith Watford 2016.11.12 04:59  

On lines 168 and 184 you have


    Obj_Name=Time[pos];

You should add a prefix

eg. change them  to


    Obj_Name="DWlabels"+Time[pos];

Then lines 88 and 89 (in deinit)


ObjectsDeleteAll(0,OBJ_VLINE);
ObjectsDeleteAll(0, OBJ_TEXT);

should be replaced with the single line


ObjectsDeleteAll(0,"DWlabels",EMPTY,EMPTY);
To add comments, please log in or register