Questions from Beginners MQL5 MT5 MetaTrader 5 - page 3

 
You haven't read carefully. You must have theory before practice, and it is better to study theory from a textbook... otherwise you will have to constantly refer to unstudied material when creating an advisor - you will end up wasting a lot of time... don't you understand... surely most of the audience have studied at universities and should know what article-based learning leads to... articles are good for improving skills and experience, but not for learning...
 
Yedelkin:

Well, wait for a textbook, "as from the sea of weather", and take care of your free time :D

There's a guy here who's going to give some feeble-minded lectures; maybe you're his potential audience? :)

There is no hurry, mt4 will last a long time. We will wait. :)

 

Hello.

Please advise why I can't get Bid? Here is the code in the script ...

#include <Trade\SymbolInfo.mqh>.

CSymbolInfo smb;

void OnStart()

{

smb.Name(_Symbol);

Alert("Spread by ",_Symbol," equals - ",smb.Spread()," points;)

Alert("Here's the bid - ",smb.Bid();

Alert("And here's the Bid + Spread - ",smb.Bid()+smb.Spread()*_Point);

}

And here is the answer for some reason...

Files:
33.jpg  64 kb
 
RedFish:

Hello.

Please tell me why I can't get Bid? Here is the code in the script ...

1. It is desirable to insert the code correctly. Otherwise there will be few people who want to go into details.

2. I myself don't work with standard classes but I have encountered a tip several times to use the Refresh() method before further data processing. It may help.

 
Yedelkin:

1. It is advisable to insert the code correctly. Otherwise there will be few people willing to go into details.

2. I don't work with standard classes myself, but I've encountered a tip several times to use the Refresh() method before further data processing. It may help.

Thank you.

1) Could you show me where I can learn how to correctly insert the code?

2. Refresh() doesn't help. Is there any other way to get Bid, just without standard structure?

 
RedFish:

Thank you.

1. can you show me where to learn how to insert the code correctly?

2. Refresh() doesn't help. Is there any other way to get Bid, just without the standard structure?

RefreshRates() helps:

#include <Trade\SymbolInfo.mqh>
//---
CSymbolInfo smb;
//---
void OnStart()
{
smb.Name(_Symbol);
smb.RefreshRates();
Alert("Спред на ",_Symbol," равен - ",smb.Spread()," пунктов.");
Alert("Вот бид - ",smb.Bid());
Alert("А вот бид + спред - ",smb.Bid()+smb.Spread()*_Point);
}
 
uncleVic:

RefreshRates() helps:

Yes it's working. Thank you.
 
RedFish:

Thank you.

1. can you show me where to learn how to insert the code correctly?

2. Refresh() doesn't help. Is there any other way to get Bid, but without standard structure?

1. Open the message composing window. There is a toolbar at the top. Click on the button "SRC" and insert the code.

2) You've been correctly advised here already. I just remembered to refresh :)

 
Please advise how to make a signals module on the volume indicator, so that it would give out only one signal when the volume exceeds a certain level.
 
Didn't the article help?
Reason: