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

Floating point error : Help!



PureBytes Links

Trading Reference Links

Hi !

I'm using TradeStation 8.1 build 2146.

When I try to insert an indicator that calls the following function, the
"TradeStation Events log" displays the following error message :

"Floating point invalid numbers in calculation"

I have found that the line "vv = Init(&moo[0]);" was the source of the
problem (I may be wrong) since if I put it between curly brackets to
comment it, I don't have the error message any longer, but this isn't
a real solution, I need this line to make the indicator work...

Question : How can I correct this function that used to work on
TradeStation 2000i to make my indicator work?

Thank you, I appreciate your help,

Bill J.

----------------------------- Function DING2k ----------------------------

DefineDLLFunc: "DING32.DLL", FLOAT, "Updt", FLOAT ,LPFLOAT ,LPFLOAT ;
DefineDLLFunc: "DING32.DLL", INT, "Init", LPFLOAT ;

Input: mm(NumericSeries);
Var  : i(0), out(0), one(True), vv(0);
Array: tab[100](0), moo[21](0);

IF one THEN 
  BEGIN
  vv = Init(&moo[0]);
  one = FALSE;
  FOR i = 99 DOWNTO 0 
    BEGIN
    out = Updt(mm[i], &tab[0], &moo[0]);
    END ;
  END
ELSE
  out = Updt(mm, &tab[0], &moo[0]);

DING2k = out;