Delete text from chart

 

Good Evening!


I recently postet the following question:

https://www.mql5.com/en/forum/21665


As outlined in the post, I managed to get rid of the arrow objects as well as the green dotted order volume lines. However, I still struggle to get rid of the text added to the arrow/line at the left hand side of the Chart.

However, I realized that after removing the arrow and the order volume line objects, when looking at the objects (STRG+B) it shows no more remaining objects. So the text seems to be no object at all? Any ideas?


img


Here is a simple Code snippet you can run. As you can see, there are no objects left but the text still stays:


//+------------------------------------------------------------------+
//|                                                      ProjectName |
//|                                      Copyright 2012, CompanyName |
//|                                       http://www.companyname.net |
//+------------------------------------------------------------------+
#include <trade/trade.mqh>

CTrade         m_trade;
MqlTick        last_tick;
bool           trade=true;
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int OnInit() 
  {

   ChartSetInteger(0,CHART_COLOR_VOLUME,clrBlack);
   ChartRedraw();
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void OnTick() 
  {
   if(trade) 
     {
      m_trade.Sell(0.1,_Symbol,last_tick.ask,0,0,NULL);
      trade=false;
     }
   ObjectsDeleteAll(0,0,OBJ_ARROW_SELL);
   ObjectsDeleteAll(0,0,OBJ_ARROW_BUY);
   ObjectsDeleteAll(0,0,OBJ_TREND);

  }
//+------------------------------------------------------------------+
Problem in Strategy Tester Chart (Properties) ?
Problem in Strategy Tester Chart (Properties) ?
  • 2017.10.01
  • www.mql5.com
Hello, the following Code simply opens a sell order: This produces the following chart in the strategy tester: I am trying to get rid of the follow...
 

You do not have to delete any object, you just have to use this function:

ChartSetInteger(0, CHART_SHOW_TRADE_LEVELS, false);


Regards.

 

Hi Jose,

thanks for your reply.

I know this function which is also an option via Charts -> Properties -> Show -> Show trade Levels

However, using MQL5 Code or uncheck it via the Chart itself has no effect at all!


img


//+------------------------------------------------------------------+
//|                                                      ProjectName |
//|                                      Copyright 2012, CompanyName |
//|                                       http://www.companyname.net |
//+------------------------------------------------------------------+
#include <trade/trade.mqh>

CTrade         m_trade;
MqlTick        last_tick;
bool           trade=true;
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int OnInit()
  {
   ChartSetInteger(0,CHART_SHOW_TRADE_LEVELS,false);
   // ChartSetInteger(0,CHART_COLOR_VOLUME,clrBlack);
   // ChartRedraw();return(INIT_SUCCEEDED);
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void OnTick()
  {
   ChartSetInteger(0,CHART_SHOW_TRADE_LEVELS,false);
   if(trade)
     {
      m_trade.Sell(0.1,_Symbol,last_tick.ask,0,0,NULL);
      trade=false;
     }

   // ObjectsDeleteAll(0,0,OBJ_ARROW_SELL);
   // ObjectsDeleteAll(0,0,OBJ_ARROW_BUY);
   // ObjectsDeleteAll(0,0,OBJ_TREND);
  }
//+------------------------------------------------------------------+
 

I still tried different approaches with no off them succeeded. I think it is an mql5/Chart bug because as soon as I stop the backtester the text disappears as well. As written above, after deleting the arrow  und trend objects the backtester says there are no objects left. I believe the text is part of one of these objects but stay until the backtester is stopped. That's a bug in my opinion. 

 
wokl:

Hi Jose,

thanks for your reply.

I know this function which is also an option via Charts -> Properties -> Show -> Show trade Levels

However, using MQL5 Code or uncheck it via the Chart itself has no effect at all!



Yes, in visual backtesting it does not work. I think they have it disabled because the main function of the visual backtesting is to see the EA trading.

However, you can write to the Service Desk to be told if it is a bug or a feature.

Finally, if you want anyone to see how your EA works, you can disable visual backtesting.

Regards.
Reason: