Tooltips disappear when terminal restarts !!

 

Hi

I have written an indicator which stores some data in tooltip field of objects , 

It works fine but until the user closes and opens the metatrader

When user closes metatrader5 and reopens it , the tooltip is completely gone 

Could someone please help me and see if they also have the same problem

By the way I have tried other fields , but the only field which is available on all objects , is Tooltip

Tnx alot

 
Mehdi Sobhani: I have written an indicator which stores some data in tooltip field of objects, It works fine but until the user closes and opens the metatrader, When user closes metatrader5 and reopens it , the tooltip is completely gone. Could someone please help me and see if they also have the same problem By the way I have tried other fields , but the only field which is available on all objects , is Tooltip.

I've never used that field before, but if you suspect it is a "bug", then create a small sample test code to reproduce the problem, which other users can test on their setups.

If several users have the same problem, then we can present the findings to the developers so that they can fix the bugs.

Out of curiosity, on which build of MT5 is this happening on? Is it an official build or on a beta build?

 

I decided to test it myself and can confirm that on MetaTrader 5 build 3320, the tooltip text is not saved in the ".chr" files, meaning that on a restart the tooltip text is lost.

I use the following test Script to the test the issue:

void OnStart()
{
   string sName = "TestTooltip" + (string) TimeCurrent();
   ObjectCreate( 0, sName, OBJ_ARROW_CHECK, 0, 
      iTime( _Symbol, _Period, 0 ), iClose( _Symbol, _Period, 0 ) );
   ObjectSetInteger( 0, sName, OBJPROP_HIDDEN, false );
   ObjectSetString( 0, sName, OBJPROP_TOOLTIP, "This is a tooltip" );
};

I also decided to test this on MetaTrader 4 build 1356, and the results were similar — the tooltip text is not saved in the ".chr" files.

My conclusion, is that this is in fact a bug that has existed for a very long time, given that after searching the forum, I found that this has been seen before:

Forum on trading, automated trading systems and testing trading strategies

[bug?] Tooltip values lost on restart of Terminal

stamat, 2012.07.05 19:56

I experience the following behavior in MT5:

1. When an object is created it receives automatically set Name and Tooltip values. 

2. After an object Tooltip value is changed via ObjectSetString(), the Tooltip value it remains the changed until MT5 Terminal is restarted.

3. On Terminal restart, the object's Tooltip value is for some reason automatically reverted to whatever is the object Name.

 

Why is there no consistency of tooltip values in between MT5 sessions?

Forum on trading, automated trading systems and testing trading strategies

After restart MT5 deletes object tooltip [MetaTrader 5 Bug]

Jürgen Rothstein, 2020.01.28 11:56

Dear MQL5 Community/Administrators/Developers,

There is a bug on MT5 when assigning a tooltip to a graphical object, it gets deleted after restarting the terminal.

It can be reproduced by following the below described steps:

  1. Create a graphical object (OBJ_LABEL, OBJ_ARROW, OBJ_TREND, etc...) using ObjectCreate or using the ChartObjectsTxtControls.mqh library
  2. Assign a tooltip to it using ObjectSetString (OBJPROP_TOOLTIP)
  3. Hover your mouse on the created object in order to display the tooltip
  4. Restart the MT5 terminal
  5. Hover your move on the object once again

The terminal will not display the tooltip that has been set earlier.

I hope there will be a fix soon.

Thanks
Kind Regards


 

Note to moderators (I've just tagged a few) : @Sergey Golubev@Vladimir Karputov@Carl Schreiber, @Eleni Anna Branou

Where can we post this bug report, so that the developers can take note of it and have it fixed?

 

It's not a mistake. It has always been so.


If you want to use 'tooltip' after reboot - implement your own script for saving and retrieving information from files.

 
Vladimir Karputov #: It's not a mistake. It has always been so. If you want to use 'tooltip' after reboot - implement your own script for saving and retrieving information from files.

It is a mistake. It is a bug. The documentation does not mention such a useless situation. It seems more like MetaQuotes is just not bothered to fix it.

 
Fernando Carreiro # :

It is a mistake. It is a bug. The documentation does not mention such a useless situation. It seems more like MetaQuotes is just not bothered to fix it.

You have the right to think whatever you want. I gave you an answer..

 
Fernando Carreiro # :

It is a mistake. It is a bug. The documentation does not mention such a useless situation. It seems more like MetaQuotes is just not bothered to fix it.

Forum on trading, automated trading systems and testing trading strategies

Errors, bugs, questions

Slava , 2015.09.15 11:30

Since the OBJPROP_TOOLTIP property cannot be set to an object manually through the properties dialog (but only automatically or programmatically), it is not stored in the chart settings .

 
Vladimir Karputov #:

That is just MetaQuotes trying to cover up their mistake and not take responsibility. There are several other properties that can only be modified programmatically and not via the normal user interface, and yet they ARE saved in the chart file. However, I'm not going to argue my point any further, because it will just fall on MetaQuotes deaf ears as always.

 

Hi

really tnx  @Fernando Carreiro & @Vladimir Karputov ,


Finally, I created a CSV file with ChartID  name , and saved the names and tooltips of objects in it on terminal closure, and reloaded them in oninit () .

and here is the code if someone other needed to use them :

void SaveTooltipsTofile(string StrFileName,int IntSubWindow)
  {
   string StrObjName,StrObjToolTip;
   int IntFileHandle=FileOpen(StrFileName,FILE_REWRITE|FILE_WRITE|FILE_CSV);
   for(int i=0; i<ObjectsTotal(ChartID(),IntSubWindow); i++)
     {
      StrObjName=ObjectName(ChartID(),i,IntSubWindow);
      StrObjToolTip=ObjectGetString(ChartID(),StrObjName,OBJPROP_TOOLTIP);
      FileWrite(IntFileHandle,StrObjName);
      FileWrite(IntFileHandle,StrObjToolTip);
      FileWrite(IntFileHandle,"--");
     }
   FileClose(IntFileHandle);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void LoadTooltipsFromfile(string StrFileName)
  {
   string StrObjName,StrObjToolTip;
   int IntFileHandle=FileOpen(StrFileName,FILE_READ|FILE_CSV);
   while(!FileIsEnding(IntFileHandle))
     {
      StrObjName= FileReadString(IntFileHandle);
      StrObjToolTip= FileReadString(IntFileHandle);
      FileReadString(IntFileHandle);
      ObjectSetString(ChartID(),StrObjName,OBJPROP_TOOLTIP,StrObjToolTip);
     }
   FileClose(IntFileHandle);
  }