Questions from Beginners MQL5 MT5 MetaTrader 5 - page 759

 
Vitaly Muzichenko:

Can you tell me how to remove the markers after closing a position so that they are not displayed?

Is it possible to remove them programmatically?

Thank you!


Settings -> Options -> Trade:

  • Show trades on the chart in real time- if this option is enabled, all trades performed by the trader will be automatically marked on the chart asBuying(buy trade) andFor sale(sell trade) icons. When putting the mouse cursor over such an icon, a tooltip containing information about the deal will be shown: ticket, deal type, volume, symbol, opening price and price at the cursor point.
It can always be removed programmatically, as these are graphical objects Arrow and TrandLine.
Настройки платформы - Начало работы - Справка по MetaTrader 5
Настройки платформы - Начало работы - Справка по MetaTrader 5
  • www.metatrader5.com
Торговая платформа обладает множеством настроек, что позволяет организовать работу в ней так, как это удобно именно вам. Выполните команду...
 
Vladimir Karputov:

Settings -> Options -> Trade:

  • Show trades on the chart in real time- if this option is enabled, all trades made by the trader will be automatically marked on the chart with an appropriate icon (buy deal) and (sell deal). If you put the mouse cursor over such an icon, a tooltip containing information about the deal will appear: ticket, deal type, volume, symbol, opening price and price at the cursor point.
You can always remove it programmatically, because it is the Arrow and TrandLine graphical objects.

I meant to delete programmatically in the following way:CHART_SHOW_OHLC,CHART_SHOW_BID_LINE, ..., but not by removal of graphical objects

Thank you!
 
Vitaly Muzichenko:

I meant to remove programmatically like this:CHART_SHOW_OHLC,CHART_SHOW_BID_LINE, ..., not by deleting graph objects

Thank you!

There seems to be no such property in the program. Everything is left up to the user (manual operation only).

 

Good afternoon!

Can you tell me, is it possible to inherit a class and an interface in MQL?

I need to do something like this:

class Order : public CObject, Deserializable {

 
Vitaly Muzichenko:

Can you tell me how to remove the markers after closing a position so that they are not displayed?

Is it possible to remove them programmatically?

Thank you!

Is it in the terminal or in the tester?

You must uncheck it in the terminal

In the tester, I don't think so...

 

How bad is it to do it this way, or is there no difference in load?

ChartRedraw every second:

int OnInit()
 {
  EventSetTimer(1);
 ...
 }

void OnTimer()
 {
   ...
   SetLabel(...);
  ChartRedraw(0);
 }
 
Vitaly Muzichenko:

How bad is it to do it this way, or is there no difference in load?

ChartRedraw every second:


It would be better to put it into OnTrade() handler. After all, arrows appear only when a trade occurs...

 
Vitaly Muzichenko:

How bad is it to do it this way, or is there no difference in load?

ChartRedraw every second:

Well, in principle, you've already answered above - you only need to redraw when it's required. Let's put it this way: you don't take money out of your wallet at regular intervals, but only when you need it ;)

 
Dennis Kirichenko:

It's better to put it into OnTrade() handler. After all, arrows appear only when trades occur...

Yes, arrows do appear).

It is a totally different program, and it has nothing to do with arrows.

PS. The objects are drawn by timer every second, so there is such a task, otherwise the objects will not be redrawn withoutChartRedraw.

 
Vitaly Muzichenko:

Yes, the arrows do appear.)

This is a completely different programme and has nothing to do with arrows.

PS. The objects are drawn by timer every second, that's why it is such a task, otherwise withoutChartRedraw the objects are not redrawn.

But it is worth to think how to redraw them when they are required. Or is it really necessary to redraw the chart every second?

Reason: