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

Re: EL Help



PureBytes Links

Trading Reference Links

I think I would use an array. The code below uses two arrays, one to store the values of the swinghighs and one to store the bar numbers of the swinghighs. (Alternately, you could only store the bar numbers if you wanted and retrieve the values when you needed them.)

If you only need three values, it is probably easier to move the old values in the array. (Alternately you could use a ring buffer.)

Keep in mind that the swinghighs are only known after "strength" bars have passed so have a lag, by definition.

Bob Fulks

----

Sample code (not verified):

Value1 = SwingHigh(1, H, Strength, Strength + 1);

if Value1 > 0 then begin   {If a swinghigh}
   VArray[3] = VArray[2];  {Move old values in the array}
   VArray[2] = VArray[1];
   VArray[1] = Value1;     {Load new swinghigh}
   BArray[3] = BArray[2];  {Move old values in the array}
   BArray[2] = BArray[1];
   BArray[1] = CurrentBar - Strength;  {Load BarNumber of swinghigh}
end;


At 1:54 PM +1000 7/25/99, Murray Gray wrote:

>Not sure whether this will be a hard one or not but I 
>have an idea for a system and need to get a little 
>help with how to code a particular pattern to search for.
>
>Here's some rules for the pattern I'm looking for:
>
>1. Need to find two swing highs (or lows) to signal a 
>   change in trend in a bearish market. (Can be daily or 
>   intraday bars).
>2. Each of the swinghighs must be X points above the highs
>   on either side of it.  This pattern could occur within 
>   3 bars, or more.
>3. The "two swinghigh" pattern must to be 2 days or more
>   apart.
>
>Seeing as this 2 swinghigh change-of-trend pattern could
>all occur within 6 bars, 10 bars, or in 20 bars, how can 
>I code this in EL?  Should I have some kind of array? 
>Or maybe a sort of loop?
>
>If you have any questions or if I can clarify any of 
>these rules please let me know. Would appreciate any 
>help.




  • References: