[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CloseD(n) function inconsistency



PureBytes Links

Trading Reference Links

Can anyone help me with the following problem?
To replicate it:
Chart 2 intraday data streams and apply the following indicator.

Inputs:Dat(1);
Vars:String1("");
For Value1=1 to Dat begin    {PRINT YESTERDAY CLOSE }
 Print(T," CloseD(1) of Data(",Value1,")=",CloseD(1)of Data(Value1));
End;
Plot1(CloseD(1) of Data1,"");   {PLOT YESTERDAY CLOSES}
Plot2(CloseD(1) of Data2,"");
If AtCommentaryBar then     {SHOW YESTERDAY CLOSE WITHIN EXPERT
COMMENTARY}
  String1="CloseD(1) of Data1 "+NumToStr(CloseD(1) of Data1, 2)
  +NewLine+"CloseD(1) of Data2 "+NumToStr(CloseD(1) of Data2, 2);
If AtCommentaryBar then Commentary(String1);

It plots yesterday closes, if you leave the default value for Dat=1 ,
the plots are correct, the Print log returns the right values for
Data1's
yesterday close  but the expert commentary shows -1 as yesterday close
for both data streams on each bar but the first one.
But it's not ended here, if you select Dat=2 , the plots are correct but
Expert commentary shows -1 as yesterday closes  and the print log shows
0
as yesterday closes ,on each bar but the first one.
Why are there so evident differences????
I'm using TS4.

DON'T TRY IT DURING MARKET HOURS I HAD RESTART TS FEW TIMES PLAYING WITH
IT.

--
Best Regards

Massimo Ciarafoni

"No one can make you feel inferior without your consent."- Eleanor
Roosevelt