Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 549
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
Is the following abbreviated construction in the code correct: a < b && ( c > d1 || c >d2 || c > d3) ?
This is to avoid writing: (a < b && c > d1) || (a < b && c > d2) etc. many times.
Is the following abbreviated construction in the code correct: a < b && ( c > d1 || c >d2 || c > d3) ?
This is to avoid writing: (a < b && c > d1) || (a < b && c > d2) and so on many times.
Of course it will do. The only thing I would do when writing such large constructions is to explicitly specify the priority brackets:
For MT4/5 compilers, we can do it without the specified brackets, because the existing priorities will not allow us to calculate the result of the expression in a different way. But these parentheses have two advantages:
Thank you, if
returned the falce, there is no symbol in Market Watch, how do I add it there?
Thank you, if
returned the falce, there is no symbol in Market Watch, how do I add it there?
SymbolSelect()
Everything is in the help. Cursor on function name and F1
SymbolSelect()
It's all in the help. Cursor on the function name and F1
Thank you.
What is the reason for this? I wrote a script which sets limit orders in MT5. When I send it to the chart in the terminal the orders are not set, although the result.retcode returns 10009(order executed)
What is the reason for this? I wrote a script which sets limit orders in MT5. When I send it to the chart in the terminal the orders are not set, although the result.retcode returns 10009 (order executed)
}
the log says: 2018.05.14 10:12:38.187 Trades '992940': sell limit 3.00 Si-6.18 at 62066 (62065) sl: 62331 tp: 61267 placed for execution
The log says: 2018.05.14 10:12:38.187 Trades '992940': sell limit 3.00 Si-6.18 at 62066 (62065) sl: 62331 tp: 61267 placed for execution
This is written in the general log. And what's in the "Experts" log? And not just one line, but the whole log. There is not much to see through the keyhole.
Besides, there is no check for return codes in the cited code. So it's not clear on what basis the conclusion about the error code is made.
To advise something, you need to have clearly reproducible steps (to see what you see), and there are none here. Cut out the problematic part of the code, run it yourself and then show exactly what is failing.
P. S. To insert the code, please use the "</>" icon or Alt+S.
At the end of the code alsoAlert(result.retcode);
in the general log:
2018.05.14 12:08:16.984 Scripts script LIMIT (Si-6.18,M15) loaded successfully
2018.05.14 12:08:17.187 Trades '992940': buy limit 3.00 Si-6.18 at 62091 (62092) sl: 61821 tp: 62905
2018.05.14 12:08:17.484 Trades '992940': accepted buy limit 3.00 Si-6.18 at 62091 (62092) sl: 61821 tp: 62905
2018.05.14 12:08:17.500 Trades '992940': buy limit 3.00 Si-6.18 at 62091 (62092) sl: 61821 tp: 62905 placed for execution
2018.05.14 12:08:17.546 Trades '992940': order #13235300 buy limit 3.00 / 3.00 Si-6.18 at 62091 done in 337.532 ms
2018.05.14 12:08:17.578 Scripts script LIMIT (Si-6.18,M15) removed
In the Experts column: 2018.05.14 12:08:17.578 LIMIT (Si-6.18,M15) Alert: 10009, nothing else