Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1486

 

Please help me, I can not add gold to my symbols, I have tried everything, please tell me how to fix the situation

 

Good morning and good mood, everyone!

I have a problem. The essence of the problem is that the script, the code of which is below, outputs the correct values:

//--- Input parameters
input string Symb_buy ="AUDCHFrfd"; //Символ для открытия длинной позиции
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//---
   double price_sess_open=SymbolInfoDouble(Symb_buy,SYMBOL_SESSION_OPEN);
   double price_curr=SymbolInfoDouble(Symb_buy,SYMBOL_BID);
   Print("Цена открытия сессии = ",price_sess_open);
   Print("Цена текущая = ",price_curr);
  }
//+------------------------------------------------------------------+

Result:

2023.12.20 08:54:24.224 10 (AUDCHFrfd,H1)       Цена открытия сессии = 0.58191
2023.12.20 08:54:24.224 10 (AUDCHFrfd,H1)       Цена текущая = 0.58293

Now I paste the part of the code highlighted in yellow into the EA function and get the session opening price equal to 0.0:

I don't understand why this happens?

Regards, Vladimir.

 
MrBrooklin #:

Good morning and good mood, everyone!

I have a problem. The essence of the problem is that the script code below outputs correct values:

Result:

Now I insert the part of the code highlighted in yellow into the EA function and get the session opening price equal to 0.0:

I don't understand why this happens?

Regards, Vladimir.

Apparently, the variable name is repeated in two different places. Look in the middle column of the debugger, from which function the variable value is given.

 
Alexey Viktorov #:

Apparently, the variable name is repeated in two different places. Look in the middle column of the debugger, from which function the variable value is given.

Hi Alexey, thanks for the hint. I'll look at it later and write.

Regards, Vladimir.

 
MrBrooklin #:
Look in the middle column of the debugger, from which function the variable value is given.

Alexey, could you please tell me which middle column in the debugger we are talking about? In the picture shown in the previous message, is this column missing? I just can't figure out where or where to look. ((

Regards, Vladimir.

 
MrBrooklin #:

Alexey, could you tell me which middle column in the debugger we are talking about? In the picture shown in the previous post, is this column missing? I just can't figure out where or where to look. ((

Regards, Vladimir.

.

 
Alexey Viktorov #:

Alexey, there's something wrong with this SymbolInfoDouble(Symbol(),SYMBOL_SESSION_OPEN); The most interesting thing is that I run it in a completely empty Expert Advisor and get zeros.


How can this be, it works in the script, but in the Expert Advisor does not want to? I have already written to the topic with errors and bugs. Waiting for an answer from there. ((

Regards, Vladimir.

 
Hello everyone! please tell me how to withdraw money from the platform? let's say I have already made enough profit and I want to withdraw it to my card - how do I do it?
 
Maria Van #:
Hello everyone! please tell me how to withdraw money from the platform? let's say I have already made enough profit and I want to withdraw it to my card - how do I do it?

Hi. You need to contact your forex-dealer, with whom you have a contract.

Regards, Vladimir.

 
MrBrooklin #:

Alexey, there is some bullshit with this SymbolInfoDouble(Symbol(),SYMBOL_SESSION_OPEN); The most interesting thing is that I run it in a completely empty EA and get zeros.


How can this be, it works in the script, but in the Expert Advisor does not want to? I have already written to the topic with errors and bugs. Waiting for an answer from there. ((

Regards, Vladimir.

Vladimir, before writing about bugs, you should check everything on MQ demo. It works without problems in my Expert Advisor. Accordingly, no one will react to it....