I changed the place of the print statements and now the three values are the same. Are the print statements ading a lag ?
Here is what I changed:(also switch the print order so the open and SAR stay in same colums at the printout):
if (New_Bar) { dValue = NormalizeDouble(iSAR(NULL, 0, 0.02, 0.2, BarToCheck), Digits); dOpen = NormalizeDouble(iOpen(NULL, 0, BarToCheck), Digits); sTime = TimeToStr(iTime(NULL, 0, BarToCheck), TIME_DATE|TIME_SECONDS); log("===New Bar @:"+ sTime +"===="); log("Open :" +DoubleToStr(dOpen, Digits) +" VALUE :" +DoubleToStr(dValue, Digits) + " Time["+ BarToCheck +"]:" + sTime); dVal = dFunction1(dOpen, dValue); dOp = dFunction2(dOpen, dValue); log("dOp="+DoubleToStr(dOp,Digits)+" dVal="+DoubleToStr(dVal,Digits)); } return(0);
the output is now:
2010.09.17 - 01:45:00 - - - ===New Bar @:2010.09.17 01:45:00==== 2010.09.17 - 01:45:00 - - - Open :1.30756 VALUE :1.30626 Time[1]:2010.09.17 01:45:00 2010.09.17 - 01:45:00 - - - Function dOpen=1.30756 dValue=1.30626 2010.09.17 - 01:45:00 - - - Function dOpen=1.30756 dValue=1.30626 2010.09.17 - 01:45:00 - - - dOp=1.30756 dVal=1.30626 2010.09.17 - 01:50:00 - - - ===New Bar @:2010.09.17 01:50:00==== 2010.09.17 - 01:50:00 - - - Open :1.30752 VALUE :1.30635 Time[1]:2010.09.17 01:50:00 2010.09.17 - 01:50:00 - - - Function dOpen=1.30752 dValue=1.30635 2010.09.17 - 01:50:00 - - - Function dOpen=1.30752 dValue=1.30635 2010.09.17 - 01:50:00 - - - dOp=1.30752 dVal=1.30635 2010.09.17 - 01:55:00 - - - ===New Bar @:2010.09.17 01:55:00==== 2010.09.17 - 01:55:00 - - - Open :1.30741 VALUE :1.30644 Time[1]:2010.09.17 01:55:00 2010.09.17 - 01:55:00 - - - Function dOpen=1.30741 dValue=1.30644 2010.09.17 - 01:55:00 - - - Function dOpen=1.30741 dValue=1.30644 2010.09.17 - 01:55:00 - - - dOp=1.30741 dVal=1.30644 2010.09.17 - 02:00:00 - - - ===New Bar @:2010.09.17 02:00:00==== 2010.09.17 - 02:00:00 - - - Open :1.30776 VALUE :1.30657 Time[1]:2010.09.17 02:00:00 2010.09.17 - 02:00:00 - - - Function dOpen=1.30776 dValue=1.30657 2010.09.17 - 02:00:00 - - - Function dOpen=1.30776 dValue=1.30657 2010.09.17 - 02:00:00 - - - dOp=1.30776 dVal=1.30657 2010.09.17 - 02:05:00 - - - ===New Bar @:2010.09.17 02:05:00==== 2010.09.17 - 02:05:00 - - - Open :1.30771 VALUE :1.30668 Time[1]:2010.09.17 02:05:00 2010.09.17 - 02:05:00 - - - Function dOpen=1.30771 dValue=1.30668 2010.09.17 - 02:05:00 - - - Function dOpen=1.30771 dValue=1.30668 2010.09.17 - 02:05:00 - - - dOp=1.30771 dVal=1.30668
Never mind, I just realized the print is placed in the wrong position. The actual time is in the left side of the print out.
I guess too much coffe!! .I need a break:)
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
This is a simple expert to check indicators values. The expert get a iSAR indicator, send its output to a function. The function doesn't change it, just print it and returns same value back to start(). Back in start() the value is print it again. The same is done for Open() in a second function. How come the values change inside the functions and then change again after returned?. Here are the expert and its output.
Here is the output