Folks, please advise, as I know the robot is activated every time a tick changes. How to make it activate only when a new candle opens, i.e. when the opening price of the candle appears.
Folks, please advise, as I know the robot is activated every time a tick changes. How to make it activate only when a new candle opens, i.e. when the opening price of the candle appears.
Thank you all for the tips.
To quote the moderator "The function returns true when a new bar appears on M15. Use only in EA."
1. when performing any operations with normalized variables of double type, they behave like variables of int type (the result is a normalized number), or
the result should be normalized?
2. In the help, it is written: "Two non-normalized floating-point numbers cannot be linked using the == or != operations". Can I compare a normalized and a non-normalized
number? Can the operations >= and <= be used?
Any numbers can be compared with each other using >= and <=. After NormalizeDouble is normalized, it is already possible to compare as == or !=. However, you need to see if it makes sense to compare numbers like this, e.g. 10 decimal places, it's just not realistic to find a situation where they would be equal or unequal.
Folks, please advise, as I know the robot is activated every time a tick changes. How to make it activate only when a new candle opens, i.e. when the opening price of the candle appears.
Thank you all for the tips.
I am also a beginner, but I think I need to declare a variable of datetime type on global level (for example datetime TIME;) , in init()and checkat the beginning of start() if TIME== Time[0] -- return(0); if not -- TIME= Time[0];. In this case, expert will execute start() only once at opening of a new bar.
paladin80: Any numbers can be compared with each other using >= and <=. After NormalizeDouble is normalized, it is possible to compare them as == or !=. However, you need to see if it makes sense to compare numbers with e.g. 10 decimal places, it is unrealistic to find a situation where they would be equal or unequal.
Thanks you very much for the answer. Just to clarify a question: after normalization the number in computer memory remains the same and only its representation changes. or the number itself changes?
Thank you very much for your answer. Just to clarify a question: after normalization the number in the computer memory remains the same and only its representation changes, or the number itself changes?
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.
I am a beginner.
Folks, please advise, as I know the robot is activated every time a tick changes. How to make it activate only when a new candle opens, i.e. when the opening price of the candle appears.
Thank you all for the tips.
I am a beginner.
Folks, please advise, as I know the robot is activated every time a tick changes. How to make it activate only when a new candle opens, i.e. when the opening price of the candle appears.
Thank you all for the tips.
To quote the moderator "The function returns true when a new bar appears on M15. Use only in EA."
To quote the moderator "The function returns true when a new bar appears on M15. Use only in EA."
Thank you very much.
Thank you very much.
To quote the moderator "The function returns true when a new bar appears on M15. Use only in EA."
I'm still learning. And in this function, how can you determine the opening price of a candle.
Questions for the pros from the dummies:
1. when performing any operations with normalized variables of double type, they behave like variables of int type (the result is a normalized number), or
the result should be normalized?
2. In the help, it is written: "Two non-normalized floating-point numbers cannot be linked using the == or != operations". Can I compare a normalized and a non-normalized
number? Can the operations >= and <= be used?
I'm still learning. And in this function how can you determine the opening price of a candle.
This function only detects when a candle appears. To find the opening price, use iOpen. Something like this:
I am a beginner.
Folks, please advise, as I know the robot is activated every time a tick changes. How to make it activate only when a new candle opens, i.e. when the opening price of the candle appears.
Thank you all for the tips.
I am also a beginner, but I think I need to declare a variable of datetime type on global level (for example datetime TIME;) , in init()and check at the beginning of start() if TIME== Time[0] -- return(0); if not -- TIME= Time[0];. In this case, expert will execute start() only once at opening of a new bar.
Any numbers can be compared with each other using >= and <=. After NormalizeDouble is normalized, it is possible to compare them as == or !=. However, you need to see if it makes sense to compare numbers with e.g. 10 decimal places, it is unrealistic to find a situation where they would be equal or unequal.
Thanks you very much for the answer. Just to clarify a question: after normalization the number in computer memory remains the same and only its representation changes. or the number itself changes?
Thank you very much for your answer. Just to clarify a question: after normalization the number in the computer memory remains the same and only its representation changes, or the number itself changes?
After normalisation the number changes, e.g:
Another thing is when you print it out, with DoubleToStr, e.g.:
And if you print it out after normalisation, it goes like this:
This function only detects when a candle appears. To find the opening price, use iOpen. Something like this:
Thank you, you are very helpful