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

Re: Using Arrays - how and when?



PureBytes Links

Trading Reference Links

Arrays are useful when you need to store a large or variable length series of
pivots. Thus if you will always refer to the last 3 pivots you could use
variables while if you need to track all pivots occuring during the last n
periods, you will need to use an array.

Dennis has already noted the correct syntax for SwingH/L. Also, be advised that
Omega's SwingHigh and SwingLow functions can and do return invalid swing points;
therefore I would not put money on them. Omega has ignored the problem. There
are some free and third party ($$) EL solutions floating around. I don't have
one to share as mine are in VB.

Earl

-----Original Message-----
From: Peter Iovanella <ivo1@xxxxxxxxx>
To: omega-list@xxxxxxxxxx <omega-list@xxxxxxxxxx>
Date: Thursday, May 07, 1998 4:34 PM
Subject: Using Arrays - how and when?


>Since the manual devotes a scant half-page to arrays, and since I still have
>barely a clue on how to implement them, and, moreover, since I think such
>information is vaguely important, I'd like to know exactly how and when
>their use is appropriate.  I have a feeling I'll have to use one in the
>system I'm writing, which is based on the identification of successive swing
>lows, and selling on subsequent breaks below those swing lows.  So, if a
>swing low is created on 3/1, and price breaks through that low on 3/4, a
>short position is initiated at the original swing low price.  If another
>swing low forms, on, say, 3/9, and that low is violated on 3/15, the system
>should add a larger number of contracts to the initial position.  On each
>subsequent swing low, should that low be violated at a later date, I want
>the system to add contracts to the position.  The quantity of the add-ons
>can remain constant, but it must be larger than the original entry position.
>So, if I start with two lots, I want to add 5 lots on each violation of each
>new swing low.  The statement I wrote to do this is
>
> IF Close < SwingLow[1] THEN begin;
> Sell 2 Contracts;
>
> IF MarketPosition < 0 AND SwingLow[1] <= SwingLow[2] THEN
> Sell 5 Contracts;
> end;
>
>But this doesn't work.  I've tried all other kinds of configurations, and
>the one that came closest was
>
>IF Close < SwingLow THEN begin;
>IF MarketPosition >= 0 THEN Sell 2 Contracts;
>IF MarketPosition < 0  AND SwingLow[1] < SwingLow[2]
>THEN Sell 5 Contracts;
>end;
>
>But this does not work, either.  It properly places the first entry, and the
>first add-on, but after that, it doesn't add any more contracts.  That's why
>I think I might need to use an array, and that's why I've provided all this
>info about what I'm trying to accomplish.  If anyone's got any input,
>general or specific (the more general, probably, the better), please send it
>my way.
>
>If the problem is with my sell statement, and I don't need to use an array
>to store past values of the SwingLows, by all means let me know how to
>change it so it works -- I'm pretty tired of this damn thing not working.
>
>Thanks again everyone.
>
>BJ
>