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

Re: TS2Ki: Floating point invalid numbers in calculation


  • Date: Thu, 17 Dec 2009 10:19:25 -0500
  • From: Bob Fulks <omegalist@xxxxxxxxxxxx>
  • Subject: Re: TS2Ki: Floating point invalid numbers in calculation

PureBytes Links

Trading Reference Links

That code works OK in TS 8.6.

You might try:

  if CurrentBar = 1 then begin

instead of:

  if CurrentBar <= 1 then begin


Bob Fulks

At 01:39 AM 12/17/2009, alex@xxxxxxxxxxxxxx wrote:
>I'm getting this inexplicable error. I add a strategy to my chart in TS2000i. The strategy contains 1 signal that doesn't do anything except initialize some variables and print some dates to the debug window. And yet, it generates an error "Floating point invalid numbers in calculation".
>
>What's going on here?
>
>Here's my signal:
>=========================================
>Inputs:
>        peakspan(2),
>        maxoverlap(0.25),
>        maxlookback(60),
>        TF2bars(0),
>        TF3bars(0);
>
>Arrays:
>        TFbars[3](1);
>
>Variables:
>        tf(0), i(0), tlref(0), foundpeak(0), TLstart(0), TLend(0);
>
>if CurrentBar <= 1 then begin
>        TFbars[0] = 1;
>        TFbars[1] = TF2bars;
>        TFbars[2] = TF3bars;
>        ClearDebug;
>end;
>for tf = 0 to 2 begin
>        if TFbars[tf] > 0 then begin
>                print("begin ",date);
>                print("end  ",date);
>        end;
>end;
>========================================
>
>It used to be a lot bigger, but the above is what I end up with after commenting everything else out. I don't understand where the error is coming from.
>
>Anyone else ever seen this?
>-Alex