Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1137

 
Vladimir Karputov:

By the way, why draw exactly with the Horizontal Line graphical object? Wouldn't it be better to do it with an indicator andDRAW_ARROW style?

Something like this display:

Would it work if these were separate lines for each hour and not linked together in a broken line?
 
Snajper007:
Will it work so that these are separate lines for each hour and not connected in a broken line?

Don't: if you use only one graphical construction (in the picture above two graphical constructions are used), the indicator will draw only one icon per bar. This method will avoid problems with a huge number of horizontal lines.

 
Vladimir Karputov:

Don't: if you use only one graphical construction (in the picture above two graphical constructions are used), the indicator will draw only one icon per bar. This method will avoid problems with a huge number of horizontal lines.

I tried to implement the idea as an indicator. But I got a solid line. I.e. it was calculated from the 1st bar up to the 11th one, and when a new bar appeared, the line was just completed.

My knowledge in this field is probably insufficient...(

 

I dare to repeat the question... The Expert Advisor creates an indicator window. An attempt is made to change the height of this window from the Expert Advisor, but nothing happens. I am using this method:

input int   wndheight   =  100;     //Высота окна индикатора

void OnChartEvent(const int id,const long &lparam,const double &dparam,const string &sparam)
  {
   if(id==CHARTEVENT_OBJECT_CLICK)
     {
      if(sparam=="ИмяОбъекта")
        {
         IndicatorSetInteger(INDICATOR_HEIGHT,wndheight);
        }
     }
  }

Help me to understand what is wrong?

 
График USDCHF, M5, 2019.10.14 19:11 UTC, Forex Club International Limited, MetaTrader 4, Demo
График USDCHF, M5, 2019.10.14 19:11 UTC, Forex Club International Limited, MetaTrader 4, Demo
  • www.mql5.com
Символ: USDCHF. Период графика: M5. Брокер: Forex Club International Limited. Торговая платформа: MetaTrader 4. Режим торговли: Demo. Дата: 2019.10.14 19:11 UTC.
 
Snajper007:

in the code base, called

Mid Bar H1

 
Anzhela Sityaeva:

I dare to repeat the question... The Expert Advisor creates an indicator window. An attempt is made to change the height of this window from the Expert Advisor, but nothing happens. This method is used:

Please help to understand what is wrong?

The Expert Advisor cannot create an indicator window.

If you want to change the window of an already placed indicator in the chart, you should find the number of the window by its short name and try to change its height. But this is just a theory, because I've never done it, as I don't need to.

 
Iurii Tokman:

in the code base, called

Mid Bar H1

Thank you! Everything works.
 
Snajper007:
Thank you! It's working.

please.

 
Alexey Viktorov:

Expert cannot create an indicator window.

If we want to change the window of an indicator, which has already been placed in the chart, we should find the number of the window by the short name of the indicator and try to change its height. It is only a theory, because I have never done it.

The Expert Advisor still creates a window using ChartIndicatorAdd and the indicator blank, then it displays its information there.

Thank you for the idea, we will try it.

Reason: