| Welcome Guest, please  sign in  to participate in a discussion. | Search | 	Active Topics | | 
	
	
	| Registered User Joined: 10/7/2004
 Posts: 16
 
 | I am trying to program the following into Realcode but I keep getting errors.  Can you assist, please? 
 RSI drops for three days in a row
 RSI on day 1 is less than 60
 
 This is part of a Connors' ETF strategy that I am trying to code into StockFinder.
 
 Thanks for your help.
 | 
	|  | 
	
	
	| Registered User Joined: 10/7/2004
 Posts: 886
 
 | '# WR = indicator.Library.Wilders RSI If WR.value(3) < 60 _And WR.Value(3) > WR.Value(2) _
 And WR.Value(2) > WR.Value(1) _
 And WR.Value(1) > WR.Value Then pass
 
 You'll need to edit the condition to change the default value of the RSI to, I'm assumming, 2, which is what Connor's uses.
 
 Bob
 | 
	|  | 
	
	
	| Registered User Joined: 12/31/2005
 Posts: 2,499
 
 | QUOTE (bobre1) 
'# WR = indicator.Library.Wilders RSI If WR.value(3) < 60 _And WR.Value(3) > WR.Value(2) _
 And WR.Value(2) > WR.Value(1) _
 And WR.Value(1) > WR.Value Then pass
 
 You'll need to edit the condition to change the default value of the RSI to, I'm assumming, 2, which is what Connor's uses.
 
 Bob
 A couple minor points:
 
 Day 1 might be 2 days ago, so the above could would then be
 
 If WR.value(2) < 60 _
 And WR.Value(3) > WR.Value(2) _
 And WR.Value(2) > WR.Value(1) _
 And WR.Value(1) > WR.Value Then
 pass
 end if
 
 or day 1 could be the latest bar, if so then it would be
 
 If WR.value < 60 _
 And WR.Value(3) > WR.Value(2) _
 And WR.Value(2) > WR.Value(1) _
 And WR.Value(1) > WR.Value Then
 pass
 end if
 
 
 Lastly, the code would be slightly faster using AndAlso in place of And
 
 If WR.value(2) < 60 _
 AndAlso WR.Value(3) > WR.Value(2) _
 AndAlso WR.Value(2) > WR.Value(1) _
 AndAlso  WR.Value(1) > WR.Value Then
 pass
 end if
 
 
 | 
	|  | 
	
	
	| Registered User Joined: 1/14/2006
 Posts: 436
 
 | Bill - Have you taken Connors class? | 
	|  | 
| Guest-1 |