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.
I was right about checking the level against zero. I moved the crossing conditions to the beginning of the code and it all worked. Thank you!
afsmerinostra: 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.
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?
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
Select in the history of trade by position ID and in the properties of trades there is opening and closing. Not only time, but also price and reason for closing and something else.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
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.