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

RE: Unusual Array Call



PureBytes Links

Trading Reference Links

It seems that you use a 2 dimension array MyArray[100,2](0)and pass it to the EL
fuction
If I remember, You may only pass  1 dimension array to an EL function that
should only accept 1 dimension arrays.
The result that you get  are dependant of the returnes value of the undocumented
" Myclose" function, that could return something not related to the array
populated inside the function.


Sincerely,

Pierre Orphelin
www.sirtrade.com
TradeStation Technologies representative in France
Safir-X neurofuzzy logic trading system builder

To subscribe to our FREE trading system newsletter:
http://www.sirtrade.com/newsletter.htm





> -----Message d'origine-----
> De : Gene Pope [mailto:gene@xxxxxxxxxxxxx]
> Envoyé : mercredi 25 septembre 2002 06:27
> À : omega-list@xxxxxxxxxx
> Objet : Unusual Array Call
>
>
> Here's a query that doesn't appear in the manual... ;~)
>
> Please examine the following indicator code that is applied to a 500 bar
> chart:
>
> --------------------------------------------------------------------------
>
> Input:  Price((H+L+C)/3);
>
> Vars:  ALoopCount(0), MyClose(0), CallFunction(0);
>
> Array: MyArray[100,2](0);   {100x2 array filled with 0's}
>
> MyClose = Close;
> Print(ALoopCount, MyClose);
> CallFunction = MyFunction(Price, MyArray);
> ALoopCount = ALoopCount+1;
>
> If MyArray[1,2] > 0 then begin  {Wait for MyArray to fill up}
>     Print(ALoopCount);              {Print Final ALoopCount}
>     Print(CurrentBar);                {Print How many bars we sent to the
> Function, = ALoopCount}
>     For XX = CurrentBar-1 downto 0 begin
>         Print(MyClose[XX]);
>     end;
> end;
>
> --------------------------------------------------------------------------
>
> Now the Function's inputs are:
>
> Price(numericSimple);
> MyArray(numericArrayRef);
>
> So, what I intend to happen is for MyFunction to be called on every bar. All
> the code after the If...Then is ignored until MyArray is filled. MyFunction
> always waits for the LastBarOnChart before it populates MyArray.
>
> So after the first run through the data, the following should be true:
>
> 1) MyArray is filled, and is available to the calling code. And indeed, it
> is.
> 2) MyClose, a serial variable, should be populated going back to the very
> first bar.
>
> Here's the puzzle:
>
> The first Print Statement correctly shows 500 values of MyClose with the
> matching ALoopCount. So that part of the code did indeed execute on every
> bar.
>
> The ALoopCount and CurrentBar Print statements show that the current bar is
> still at 500 after the If...then statement, which I'd expect.
>
> However, the second Print Statement inside the XX loop, shows only one value
> for MyClose for the entire 500 values (and it's not 0, and it's not from the
> lastbaronchart either), as if MyClose forgot it's history.
>
> Any takers?
>
> Best regards,
>
> Gene Pope
>
>
>
>
>