Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1303
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
Good time,
Please help me to find a bug... I copy bar values (BarsCount) from the indicator buffer in the script, then I loop around values, detect a signal and print them to Print(); it seems to be simple, but it's not so easy... I get all signals as I wanted except for crossing zero line.
Maybe this is not allowed in the script? I attached the code and a screenshot of the log... Thank you very much!
The crossing can only be defined by comparing the value of the previous array index with zero and the value of the current array index with zero. That is, it was above zero and became below zero. Or vice versa, it was lower and became higher.
And be sure to read through the documentation how if tlse if works.
If your code contains one condition, all following ones will not be processed.
An intersection can only be defined by comparing the previous array index to zero and the current one to zero. I.e. it was above zero and became below zero. Or vice versa, it was lower and became higher.
And be sure to read through the documentation how if tlse if works.
If your code contains one condition, all following ones will not be processed.
Everything was right about checking the level relative to zero. I moved the intersection conditions to the beginning of the code, and everything works. Thank you!
Generally, you need to clean up else, they are only needed when the conditions are mutually exclusive and the overlap is separate conditions.
It says: Why didn't you deign to return the value?
It says: Why didn't you deign to return the value?
Exactly!!! Oh my gosh)))
It says: why didn't you deign to return the value?
Thank you!!!
and datetimeOrderOpenTime(); How can I get this data programmatically in mql5 for already closed positions? That is, the time of opening and closing of a closed position?
In mql4 there are functions
and datetimeOrderOpenTime(); How can I get this data programmatically in mql5 for already closed positions? That is, the time of opening and closing of closed positions
Can you give me a hint? This entry:
var1=(var<10)?1:0;
What it means, how to interpret it, options for use. Parameters.