- Do you really expect an answer? We have no idea what condition(i) is. There are no mind readers here and our crystal balls are cracked.
- Do you really expect an answer? "Why MQL4 works" what way? There are no mind readers here and our crystal balls are cracked.
- Do you really expect an answer? "What issue?" There are no mind readers here and our crystal balls are cracked.
- Likely you are using a variable value from the previous iteration, which means you can't process bar zero more than once, ever. Put it in a buffer so you can restore it, or only process bar zero once, or save and restore them when processing bar zero.
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
Hello,
When I check how indicator run in Tester, the buffer show up wrong value. Here is the code.
Somehow MQL4 read the "condition(i)" incorrectly. I check, check, check, go back to the original indicator to make sure that it works fine.
Finally, I figure out 1 way to correct it. Simply, create a buffer to track that condition."new_buffer[i]=condition(i);"
Then MQL4 works correctly.
However, I find it quite stupid somehow.
Can you tell me why MQL4 works that way and is the any better way to fix this issue?
Thank you.
HHCFX