Registered User Joined: 3/12/2007 Posts: 10
|
Can you please help with the the code for the following rule?
Price at the close must be lower than the day before for 4 out of the last 5 days.
Thanks for your help.
Gio
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Please try the following RealCode Rule:
Static Count As Integer
If isFirstBar Then
Count = 0
Else If Price.Last < Price.Last(1) Then
Count += 1
End If
If CurrentIndex >= 6 AndAlso _
Price.Last(5) < Price.Last(6 ) Then
Count -= 1
End If
If CurrentIndex >= 5 Then
If Count >= 4 Then Pass
Else
SetIndexInvalid
End If
-Bruce Personal Criteria Formulas TC2000 Support Articles
|