This week-end I ran into a strange problem, that I kindly request you to have a look at.
I responded to another forum member's question from my Mac and the MQL-code I typed in came out as:
staticdatetimeprevtime=0; // previously recorded time of current bar; static(!) variable, such that value is remembered on successive calls... if(prevtime != Time[0]){// are we in a new bar?prevtime = Time[0]; // remember new time ... // perform the calculations we want to}else{return(0); // do nothing }
After trying several things to fix this problem, I gave it a try from a Windows machine and the result is as expected.
staticdatetimeprevtime=0; // previously recorded time of current bar; static(!) variable, such that value is remembered on successive calls
...
if(prevtime != Time[0]){// are we in a new bar?prevtime = Time[0]; // remember new time
... // perform the calculations we want to}else{return(0); // do nothing }
I assume it has something to do with the different ways in which Windows and Mac OS X or UNIX/Linux indicate an EOL/end of line (CR + LF vs. LF).
This week-end I ran into a strange problem, that I kindly request you to have a look at.
I responded to another forum member's question from my Mac and the MQL-code I typed in came out as:
After trying several things to fix this problem, I gave it a try from a Windows machine and the result is as expected.
I assume it has something to do with the different ways in which Windows and Mac OS X or UNIX/Linux indicate an EOL/end of line (CR + LF vs. LF).
Could you please check this issue?
Thanks in advance!
Cheers!
Max