[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 104

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
try it like this:
What exactly is not working?
the position does not open.
Try it this way:
Either I don't understand anything, or you misunderstood the problem.
there is a Close[2] price of 1.34529 and an Open[1] price of 1.34530
I have a condition to open the position.
Since 10 - 20 pips (in 5 digits) do not play a big role, I need to put it into the program,
If the Close price is 1.34529 and the Open price is 1.34530, the position can still be opened.
the position does not open.
???
then what does the price condition have to do with it?
look at the code next. there's another mistake.
Either I don't understand, or you've misunderstood the task.
......
10 - 20 ppts (in 5 digits) does not play a big role, you need to put it in the program
apparently you wrote your previous post first and then only wondered what you wanted to hear in response....
really, 10-20pts in 5 digits doesn't matter much, I showed how to correctly compare variables like double, I suspect your problem is not in making the right condition. Try formulating a clear unambiguous question first to get an unambiguous answer
apparently you wrote your previous post first and then only wondered what you wanted to hear in reply....
really, 10-20 pp in 5 digits is not a big deal, I showed how to correctly compare variables of type double, I suspect that your problem is not in making the right condition. Try formulating a clear unambiguous question first to get an unambiguous answer
Except, imho, it's wrong to compare doubles like that. For example, four digits, prices 1.00014 and 1.00016 are equivalent to 1.0001 and 1.0002, but 1.00016 to 1.00014 < Point
You mix up comparing doubles and rounding, you need a clear statement of the question: either round a 5-digit into a 4-digit and then do the analysis in the 4-digit, or just properly compare two doubles.
If you compare two double's then that part of the code I cited will work correctly for both 4 and 5 digits:
check it out: https://www.mql5.com/ru/articles/1561 and https://www.mql5.com/ru/forum/101433
SZZ: I made a mistake in my code: case should be closed by break, i.e. like this:
You mix up comparing doubles and rounding, you need a clear statement of the question: either round a 5-digit into a 4-digit and then do the analysis in the 4-digit, or just properly compare two doubles.
If you compare two double's then that part of the code I cited will work correctly for both 4 and 5 digits:
check it out: https://www.mql5.com/ru/articles/1561 and https://www.mql5.com/ru/forum/101433
ZS: I made a mistake in my code: case should be closed with break, i.e. like this:
Although you're probably right, it probably doesn't matter to the author. I count every pip, so I look at such situations from my own point of view.