Questions from Beginners MQL4 MT4 MetaTrader 4 - page 192

 
And is it possible to use a font that is not in MT? I need Montserrat.
 

Good afternoon!

How is error 132 caught? Only by GetLastError() or by MarketInfo(Symb,MODE_TRADEALLOWED) also?

 

Afternoon. I am using the function (see below). Can't figure out how to make a flag to be formed only in case of 2 pending (up and down)

//+------------------------------------------------------------------+ //+----------------------------------------------------------------------------+ //|  Автор    : Ким Игорь В. aka KimIV,  http://www.kimiv.ru                   | //+----------------------------------------------------------------------------+ //|  Версия   : 06.08.2008                                                     | //|  Описание : Возвращает флаг наличия ордера или позиции в истории за сегодня| //+----------------------------------------------------------------------------+ //|  Параметры:                                                                | //|    sy - наименование инструмента   (""   - любой символ,                   | //|                                     NULL - текущий символ)                 | //|    op - операция                   (-1   - любая позиция)                  | //|    mn - MagicNumber                (-1   - любой магик)                    | //+----------------------------------------------------------------------------+

//+------------------------------------------------------------------+ //|                                                                  | //+------------------------------------------------------------------+ bool ExistInHistoryToDay(string sy="", int op=-1, int mn=-1)   {    int i, k=OrdersHistoryTotal();

   if(sy=="0")sy=Symbol();    for(i=0; i<k; i++)      {       if(OrderSelect(i, SELECT_BY_POS, MODE_HISTORY))         {          if(OrderSymbol()==sy || sy=="")            {             if(op<0 || OrderType()==op)               {                if(mn<0 || OrderMagicNumber()==mn)                  {                   if(TimeDay(OrderOpenTime())==Day()                      &&  TimeMonth(OrderOpenTime())==Month()                      &&  TimeYear(OrderOpenTime())==Year())                      return(True);                                       }               }            }         }      }    return(False);   } //+------------------------------------------------------------------+

 
Andrey Sokolov:

Greetings

Could you please tell me if it is possible to set font thickness on text objects?

FoundTextSetFont (Sets font for text output by drawing methods)https://docs.mql4.com/ru/objects/textsetfont

, which has flags to set font thickness, but can't figure out how to use it.

This is for the TextOut function. You could try setting the font name plus " Bold", in your case "Montserrat Bold".
 

Can you tell me how to draw a "Button" object with transparency without using third-party libraries?

I couldn't find it on the forum

 
Vitaly Muzichenko:

Can you tell me how to draw a "Button" object with transparency without using third-party libraries?

I couldn't find it on the forum

On a canvas to draw on.

 
Artyom Trishkin:

Draw on the kanvas.

Is there an example in the documentation of how to get the state "Pressed/Unpressed"?

 
Vitaly Muzichenko:

Is there an example in the documentation of how to get the "Pressed/Removed" status?

From a drawn button? I haven't looked for one - I don't know. It's easier for me to make one myself.

 
Artyom Trishkin:

The drawn button? I haven't looked, I don't know. It's easier for me to make it myself.

Thanks, so I'll draw a classic one, I know how to work with it.

 
Vitaly Muzichenko:

Can you tell me how to draw a "Button" object with transparency without using third-party libraries?

I couldn't find it on the forum

I would try to take a resource fromCBmpButton and apply transparency to the resource, it should probably work