Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1389

 

I have the following question.

There is an object - a button(OBJ_BUTTON). But for some reason it works in a strange way - it switches to the pressed state when the mouse button is released (Click Up), and also switches to the pressed state when the mouse button is released (Click Up).

Is it possible to make a button move to the pressed state when the mouse button is pressed (Click Down), and to the depressed state when the mouse button is released? The way the buttons usually work.

 
MQL_User #:

I have the following question.

There is an object - a button(OBJ_BUTTON). But for some reason it works in a strange way - it switches to the pressed state when the mouse button is released (Click Up), and also switches to the pressed state when the mouse button is released (Click Up).

Is it possible to make a button move to the pressed state when the mouse button is pressed (Click Down), and to the depressed state when the mouse button is released? The way buttons usually work, by the way.

Your question is confusing. See how buttons work in the example provided with the terminal: MQL5\Experts\Examples\Controls\Controls.mq5


 

Good afternoon to all.

The MT5 terminal suddenly started giving Alert with a large number of decimal places. Like in Print.

Can you tell me the reason?

 
Alexey Viktorov #:

When you check something after hours, check it in the script.

Thank you, but it's the same in the script. I tried it all the way before asking the question, but the result is the same.

#include <Trade\SymbolInfo.mqh>  
#include <Trade\AccountInfo.mqh>

CSymbolInfo    m_symbol;                     // symbol info object
CAccountInfo   m_account;                    // account info object

//string s_n;

//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+

void OnStart()

  {

   m_symbol.Name(Symbol());
   
   const string this_symbol = m_symbol.Name();
   //ENUM_ORDER_TYPE order_type = ORDER_TYPE_BUY;
   double order_volume =  0;
   double order_price = 0;
   double Price_Min_Lot = 0;
   
   
   order_volume = 1;
   order_price = m_symbol.Ask();
   Price_Min_Lot = m_account.MarginCheck(this_symbol, ORDER_TYPE_BUY, order_volume, order_price);
   Print("Требуемая маржа =", Price_Min_Lot);
     
  }
//+------------------------------------------------------------------+

It outputs: "Margin Requirement =1.797693134862316e+308" . Is there any other way to get the margin?

 
-IMXO- #:

Thank you, but the script is the same. I tried it all the way before asking the question, but the result is the same.

Outputs: "Required margin =1.797693134862316e+308". Is there any other way to get the margin?

Do you get any other information from the symbol? Did you check it?

 
-IMXO- #:

Thank you, but the script is the same. I tried it all the way before asking the question, but the result is the same.

Outputs: "Required margin =1.797693134862316e+308". Is there any other way to get the margin?

Just in case - do you have this symbol in MarketWatch? If not, there is very limited information on the symbol.

 
Nauris Zukas #:

Do you get any other information from the symbol at all? Have you checked?

I checked, you can get balance from the same class, for example, MarginCheck and FreeMarginCheck show the same thing. In general, there are problems with everything related to margin in both "CAccountInfo" and "CSymbolinfo"
 
JRandomTrader #:

Just in case - do you have this symbol connected to MarketWatch? If not, there is very limited information on the symbol.

Is "MarketWatch" in the terminal "market overview", the window with the list of instruments? If so, it is connected.
 
-IMXO- #:
Is there any other way to get the margin?

You can. But with the use of SB I can't suggest it. I don't use it.

 
Alexey Viktorov #:

You can. But with the use of SB I can't suggest it. I don't use it.

Can you please tell me how? What is "SB"?
Reason: