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

Re: "Infinite loop" error - Need EasyLanguage Expert.



PureBytes Links

Trading Reference Links

That is incredibly inefficient code. It actually could be working but taking forever to finish. Why would you ever reset the array size on every bar?

You might simply declare a big array 

   array: indicator[10000](0);

   indicator[CurrentBar] = CCI(10);

If you need to increase the array size, do it is steps of 1000, not every bar.

   Var: AMax(10000);

   if CurrentBar >= AMax then begin
      AMax = AMax + 1000;
      Array_SetMaxIndex(Indicator,AMax);
   end;

Bob Fulks



At 05:21 AM 8/26/2005, Christian wrote:

>Any other suggestion?
>
>------------------ Example - Just Cut & Paste ------------------
>[InfiniteLoopDetect = FALSE]
>{ New in TradeStation 8.1 - It should help but it doesn't.... }
>
>var :   ind(0);
>array : float Indicator[](0);
>
>if CurrentBar > MaxBarsBack then
>  begin
>  ind=ind[1] + 1;
>  Array_SetMaxIndex(Indicator,ind);
>  Indicator[ind]= CCI(10);
>  end;
>
>if LastBarOnChart then
>  value1=SortArray(Indicator,ind,1);
>------------------------------------------------------------------------