Features of the mql5 language, subtleties and tricks - page 166

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I do not advise you to write it this way. If the system fails to allocate the required amount of memory to the array, the program will continue to run quietly, leading to unpredictable consequences.
I do not advise you to write it this way. If the system fails to allocate the required amount of memory for the array, the program will continue to run quietly, leading to unpredictable consequences.
I necessarily put it for the real account.
Forum on trading, automated trading systems and testing trading strategies
Libraries: HistoryTicks
fxsaber, 2019.09.10 18:58
Forum on trading, automated trading systems and trading strategy testing
Libraries: HistoryTicks
fxsaber, 2018.12.10 13:55
If you write the following line in the beginning of any MT4/5 Expert Advisorthen get a detailed notification in case there is an error when running ArrayResize or ArrayCopy.
This allows you to see hard to identify problems in passing information through arrays, but even more importantly, get a message that the EA has stopped due to an array out of range(not the EA's fault). For example, because of a lack of memory or some other failure. In other words, you will know right away that an abnormal stopping of the EA took place, rather than accidentally notice it a few hours later.
The HistoryTicks library already contains this line (no need to add it), because the main purpose of the tools - fighting Expert Advisors on real accounts.
In the Terminal journal, there was only such a record in another project.
Thanks to the inserted line, the details of what has happened can be seen in the user log
Please suggest an analog of MQL4 function MarketInfo(asymbol, MODE_MARGIN_REQUIRED) in MQL5.
I need to get the amount of free funds needed to open 1 lot to buy.
I tried different variants of SymbolInfoDouble(symbol, ...) function in MQL5, I can't find the right variant, it returns 0 everywhere.
Please suggest an analog of MQL4 function MarketInfo(asymbol, MODE_MARGIN_REQUIRED) in MQL5.
I need to get the amount of free funds needed to open 1 lot to buy.
I tried different variants of SymbolInfoDouble(symbol, ...) function in MQL5, I can't find the right variant, it returns 0 everywhere.
https://www.mql5.com/ru/articles/2555#not_enough_money
https://www.mql5.com/ru/articles/2555#not_enough_money
I'm sorry, I didn't understand why I needed this link. I didn't see the answer to my question there.
I'm sorry, I didn't understand why I needed this link. I didn't see the answer to my question there.
What exactly didn't you see in the article?
Examples of checking:
MQL5
What exactly didn't you see in the article?
Examples of checking:
MQL5
You need to getthe amount of free funds needed to open 1 lot to buy.
What does the check in the article have to do with it?
Need to getthe amount of available funds needed to open 1 lot to buy.
What does the check from the article have to do with it?
Because the article teaches diligent study of the material.
The example even gives you the full function to check before sending the trade order.
One:
and immediately the reference:
ACCOUNT_MARGIN_FREE
Size of free funds in the account in the deposit currency, available for position opening
AccountInfoDouble
and two is the minimum check:
Need to getthe amount of available funds needed to open 1 lot to buy.
What does the check from the article have to do with it?
didn't think you would have trouble reading the short code, then read the helphttps://www.mql5.com/ru/docs/trading/ordercalcmargin
While the article teaches diligent study of the material.
The example even gives the full function of checking before sending a trade order.
One:
and right away the reference:
ACCOUNT_MARGIN_FREE
Size of free funds in the account in the deposit currency, available for position opening
AccountInfoDouble
and two - minimum check:
Size of free funds in the account in the currency of deposit available to open the position I do not need
I calculate the lot size as % of the balance.
I need to get the amount ofavailable funds needed to open 1 lot to buy.