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

Re: Defining SwingLow (long)



PureBytes Links

Trading Reference Links

Yup, it's a bug in the Omega SwingHigh, SwingLow, SwingHighBar and
SwingLowBar functions. If you look at the code for SwingLow, you will
find:

  if Price1 >= Price[X] then

I sort of understand why they did it the way they did. They were trying
to write versatile functions. Most times it's not a problem on real
price data, especially at higher values of Stren. But you can write your
own functions for specific pivot requirements (less general purpose)
that will be more accurate and execute much faster without all the
loops.

I did a little test of omega's functions using the following indicator
and the data file that follows it. The bars where the swing highs and
lows were plotted are marked with H and L.

-----------
input: stren(1);

If SwingHighBar(1, c, Stren, Stren+1) = Stren then
  plot1[stren](c[stren]+1,"SH");

If SwingLowBar(1, c, Stren, Stren+1) = Stren then
  plot2[stren](c[stren]-1,"SL");
-----------

Date		Close	Stren=1	Stren=2	Stren=3	Stren=4	Stren=5
12/1/98		1					
12/2/98		2					
12/3/98		3					
12/4/98		4					
12/7/98		5					
12/8/98		6					
12/9/98		7					
12/10/98	8					
12/11/98	9					
12/14/98	10					
12/15/98	10	L				
12/16/98	11					
12/17/98	12					
12/18/98	13					
12/21/98	14					
12/22/98	15		
12/23/98	16		
12/24/98	17		
12/28/98	18		
12/29/98	19		
12/30/98	20		
12/31/98	20		
1/4/99		20	L	L
1/5/99		21		
1/6/99		22		
1/7/99		23		
1/8/99		24		
1/11/99		25		
1/12/99		26		
1/13/99		27		
1/14/99		28		
1/15/99		29			
1/19/99		30			
1/20/99		30			
1/21/99		30			
1/22/99		30	L	L	L
1/25/99		31			
1/26/99		32			
1/27/99		33			
1/28/99		34			
1/29/99		35			
2/1/99		36			
2/2/99		37			
2/3/99		38			
2/4/99		39			
2/5/99		40			
2/8/99		40			
2/9/99		40					
2/10/99		40					
2/11/99		40	L	L	L	L	
2/12/99		41					
2/16/99		42					
2/17/99		43					
2/18/99		44					
2/19/99		45					
2/22/99		46					
2/23/99		47					
2/24/99		48					
2/25/99		49					
2/26/99		50	H	H	H	H	H
3/1/99		49					
3/2/99		48					
3/3/99		47					
3/4/99		46				
3/5/99		45				
3/8/99		44				
3/9/99		43				
3/10/99		42				
3/11/99		41				
3/12/99		40				
3/15/99		40				
3/16/99		40				
3/17/99		40				
3/18/99		40	H	H	H	H
3/19/99		39				
3/22/99		38				
3/23/99		37				
3/24/99		36				
3/25/99		35				
3/26/99		34			
3/29/99		33			
3/30/99		32			
3/31/99		31			
4/1/99		30			
4/5/99		30			
4/6/99		30			
4/7/99		30	H	H	H
4/8/99		29			
4/9/99		28			
4/12/99		27			
4/13/99		26			
4/14/99		25			
4/15/99		24			
4/16/99		23			
4/19/99		22			
4/20/99		21		
4/21/99		20		
4/22/99		20		
4/23/99		20	H	H
4/26/99		19		
4/27/99		18		
4/28/99		17		
4/29/99		16		
4/30/99		15		
5/3/99		14		
5/4/99		13		
5/5/99		12		
5/6/99		11		
5/7/99		10		
5/10/99		10	H	
5/11/99		9		
5/12/99		8
5/13/99		7
5/14/99		6
5/17/99		5
5/18/99		4
5/19/99		3
5/20/99		2
5/21/99		1

-- 
   Dennis