I found that even the code above wasn't working 100% of the time. The problem was that I needed to normalizedouble the answer before comparing to the whole number. Everythings working fine now. That might have been what was throwing off the >= operator as well.
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
Code Example:
Here is an example of a printout from a logfile. The while statement should dump out on the second line - not the 6 line.
17:15:21 xxxxxx USDJPY,H1: vi : 11 : -1 >= 2
17:15:21 xxxxxx USDJPY,H1: vi : 10 : 2 >= 2
17:15:21 xxxxxx USDJPY,H1: vi : 9 : 1 >= 2
17:15:21 xxxxxx USDJPY,H1: vi : 8 : 1 >= 2
17:15:21 xxxxxx USDJPY,H1: vi : 7 : 1 >= 2
17:15:21 xxxxxx USDJPY,H1: vi : 6 : 3 >= 2
I made the slight modification in the following two lines, in order to remove the '=' sign from this equation. ">= St6" was changed to "> St6 -1". Now it works.
This is what was printed out afterwards in the log file:
17:51:20 xxxxxx USDJPY,H1: vi : 11 : -1 >= 2
17:51:20 xxxxxx USDJPY,H1: vi : 10 : 2 >= 2
The while statement dumped out where it was intended to, but why would I not be able to use the >= statement in this instance?