PureBytes Links
Trading Reference Links
|
----- Message d'origine -----
De : Larry Wright <lwright@xxxxxxxxxx>
À : Gary Fritz <fritz@xxxxxxxx>
Cc : <omega-list@xxxxxxxxxx>
Envoyé : vendredi, mai 26, 2000 01:17
Objet : Re: EasyLang bug?
>
>
> On Thu, 25 May 2000, Gary Fritz wrote:
>
> > If I remember right, in TS4 you can work around this by using the
> > FileAppend function instead of print. Apparently it doesn't buffer
> > its output.
>
> Thanks for the tip. In the meantime, the problem was bugging me (no pun
> intended :-) so I started commenting out chunks of code until it ran. The
> results are interesting. The bad code (much abbreviated) is:
>
> print (x);
> if x=4 then begin
> (stuff)
> b=StandardError(stuff);
> (more stuff)
> end;
>
> If *ONLY* the b= line is commented out, it runs OK. If it is not
> commented, I get the div0 error.
>
> The interesting part is that x is = 0(it's an input and does not change at
> all), as verified also by the print statement immediately before the if
> x=4, and the if/end should NOT execute, as I read it.
>
Do you think that it makes sense to use this code ( below) with an input
I assume X= Lenght) set to ZERO ?
No?
So you got the answer...
Rgds
PO
{*******************************************************************
Description : This Function returns StandardError
Provided By : Omega Research, Inc. (c) Copyright 1999
********************************************************************}
Inputs: Price(Numeric), Length(Numeric), Smooth(Numeric);
Variables: BarNum(0), StdErr(0), AvgRatioDiff(0), SumRatio(0), SumAvgs(0),
SumSquares(0), BaseCalc(0), ModLength(0), TotalRatio(0);
BarNum = CurrentBar;
IF CurrentBar > Length Then Begin
SumAvgs = Summation(BarNum * Price, Length) - (Length * Average(BarNum,
Length) * Average(Price, Length));
SumSquares = Summation(Square(BarNum), Length) - (Length *
Square(Average(BarNum, Length)));
SumRatio = SumAvgs / SumSquares;
AvgRatioDiff = Average(Price, Length) - (SumRatio * Average(BarNum,
Length));
BaseCalc = (Summation(Square(Price), Length)) - ((AvgRatioDiff *
Summation(Price, Length))) - ((SumRatio * Summation(BarNum * Price,
Length)));
ModLength = Length - 2;
TotalRatio = (BaseCalc / ModLength);
IF TotalRatio > 0 Then
StdErr = SquareRoot(BaseCalc / ModLength)
Else
StdErr = StdErr[1];
StandardError = 2 * Average(StdErr, Smooth);
End;
> This same, exact chunk of code works OK in other routines, but NOT in this
> study.
>
> Sounds a bit like a TS100 Easy Lang bug to me - what do y'all think?
>
> Again, thanks for the tip re prints.
>
> Larry
>
>
|