Khuman Bakhramirad:
why the bool logic is returning a number when i set Percentage_greater_than a small number like 0.001 or even zero ? its so strange...
and when i put this line into a bool variable i get false even though it should be definitely true:
((wick / (body + tail + wick)) >= (Percentage_greater_than / 100))
Showing as double, looks like a bug in the debugger.
Also, never use equality to compare floats/doubles.
https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html
if((body + tail + wick) != 0)This will be 99.99999999% of the time true, it might have other unintended consequences.
I also recomend that you create extra variables to avoid repeating the same expression over and over like the:
(body + tail + wick)
Thank you for report.
Fixed.
Fixed.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
why the bool logic is returning a number when i set Percentage_greater_than a small number like 0.001 or even zero ? its so strange...
and when i put this line into a bool variable i get false even though it should be definitely true: