Questions from Beginners MQL5 MT5 MetaTrader 5 - page 889

 
Vladimir Karputov:

Noone wants this rudiment - that's why they removed it.

That "nobody" is a very controversial statement. We didn't conduct a survey.

Alexey Viktorov:

And in MT5 you don't even need to write anything in the code. All you have to do is mark auto-update.

Thank you very much. Just what I need.

P.S. Unfortunately, not what I had in MT4. You will see all trades on the chart and you only need a specific EA. And they are displayed on all open charts of a particular currency pair, and you want them only on the chart the EA trades in. It is a pity.
 
Grigori.S.B:

That "to nobody" is a very controversial statement. No one has been polled.

For example, I purposely integrated into my Expert Advisor the possibility to delete all arrows and other nonsense that is drawn when triggering an order/position. They are absolutely useless there. If we had just removed the Bid line from the chart as it is possible to do in MT5, I would have removed it too.
So it depends on the situation...

 
Konstantin Nikitin:

For example, I purposely integrated into the Expert Advisor the possibility to delete all arrows and other nonsense that is drawn during triggering of orders/positions. They are absolutely useless there. If we could remove the Bid line from the chart, I would delete it too.
So it depends on the situation...

So what's the problem?

CHART_SHOW_BID_LINE

Display Bid values as a horizontal line on a chart

bool

CHART_SHOW_ASK_LINE

Display Ask values as a horizontal line in a chart

bool

CHART_SHOW_LAST_LINE

Display Last values as a horizontal line in a chart

bool

 
Alexey Viktorov:

So what's the problem?

CHART_SHOW_BID_LINE

Display Bid values as a horizontal line on a chart

bool

CHART_SHOW_ASK_LINE

Display Ask values as a horizontal line in a chart

bool

CHART_SHOW_LAST_LINE

Display Last values as a horizontal line in a chart

bool

In MT5 you can set this immediately in the profile. And do not show the Bid. In MT4 this is not the case.

 
Konstantin Nikitin:

In MT5 this can be set up immediately in the profile. And not to show the Bid. In MT4 this is not the case.

What do you mean it is not there?

https://docs.mql4.com/ru/constants/chartconstants/enum_chart_property#enum_chart_property_integer

Примеры работы с графиком - Константы графиков - Стандартные константы, перечисления и структуры - Справочник MQL4
Примеры работы с графиком - Константы графиков - Стандартные константы, перечисления и структуры - Справочник MQL4
  • docs.mql4.com
В этом разделе представлены примеры для работы со свойствами графика. Для каждого свойства приведены одна или две законченные функции, которые позволяют задавать/получать значение этого свойства. Эти функции можно использовать в своих MQL4 программах как есть. На рисунке показана графическая панель для наглядной демонстрации того, как изменение...
 
Alexey Viktorov:

What do you mean you don't?

https://docs.mql4.com/ru/constants/chartconstants/enum_chart_property#enum_chart_property_integer

Well, more clearly through the graph property. That is, by standard means.

MT4
MT5


Просмотр и настройка графиков - Графики котировок, технический и фундаментальный анализ - MetaTrader 5
Просмотр и настройка графиков - Графики котировок, технический и фундаментальный анализ - MetaTrader 5
  • www.metatrader5.com
Графики в торговой платформе отображают изменение котировок финансовых инструментов во времени. Они необходимы для проведения технического анализа и работы советников. Они позволяют трейдерам наглядно следить за котировками валют и акций в режиме реального времени и моментально реагировать на любое изменение ситуации на финансовых рынках...
 
Konstantin Nikitin:

Well, more clearly through the graph property. That is, by standard means.

If I wanted to use a standard symbol, I would have to open it in a new window.

Forum on trading, automated trading systems and strategy testing

FAQ from Beginners MQL5 MT5 MetaTrader 5

Konstantin Nikitin, 2018.06.25 15:01

The Expert Advisor is able to delete all arrows and other nonsense when an order/position triggers. They are absolutely useless there. If we had just removed the Bid line from the chart as it is possible to do in MT5, I would have removed it too.
So it depends on the situation.

Delete it with the script, what's the problem?


 

New type of trade operation Close By

For accounts with hedged position accounting, a new type of trading operation has been added - closing a position with a counter position.

Such a question-

Right now the code looks like this-

//+------------------------------------------------------------------+
//| Close Positions                                                  |
//+------------------------------------------------------------------+
void ClosePositions()
  {
   for(int i=PositionsTotal()-1;i>=0;i--) // returns the number of current orders
      if(m_position.SelectByIndex(i))     // selects the position by index for further access to its properties
         if(m_position.Symbol()==m_symbol.Name() && m_position.Magic()==m_magic)
            m_trade.PositionClose(m_position.Ticket()); // close a position by the specified symbol
  }
//+------------------------------------------------------------------+

As far as I understand it, how do Iclose a position counter?

 
Kisolen:

Hi. Explain the function call in if condition. Just calling a class function, how in that case should an if be executed or not. Because there is no condition here, the function will always return some value. Is this code correct at all?

Logical negation NOT(!)

Документация по MQL5: Основы языка / Операции и выражения / Логические операции
Документация по MQL5: Основы языка / Операции и выражения / Логические операции
  • www.mql5.com
//| Script program start function                                    | "Операция &&: Результат первого выражения false, поэтому второе выражение не вычислялось" //| функция всегда возвращает false                                   | //| функция всегда возвращает true                                    |
 
Alexey Viktorov:

Logical negation of NOT(!)

Thanks. I just didn't realise that a binary variable is returned. In that case it's understandable.

Reason: