Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 2/12/2005 Posts: 11
|
I want to create a Realcode condition that passes if following condition is true 20 times in past 50 period.
(price.Close < price.MinLow(50, 1) )
Ideas?
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Just right-click on the Condition and select Edit. This will allow you to set the Condition to Passing 20 of the Last 50.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 2/12/2005 Posts: 11
|
Bruce,
I understand that the visual editing of icons lets me change one perticular condition.
Though, I need to test this condition in conjunction with several other conditions in RealCode.
Any suggestions for Realcode?
Thanks
|
|
Registered User Joined: 2/12/2005 Posts: 11
|
Bruce,
Any updates, please?
Thanks
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Your request came in after I logged out for the day. It is relatively rare that I answer any additional questions after 5:00 PM ET. Please try the following RealCode Condition:
'|*****************************************************************|
'|*** StockFinder RealCode Condition - Version 5.0 www.worden.com
'|*** Copy and paste this header and code into StockFinder *********
'|*** Condition:Trues of Total Example
'|******************************************************************
'# Trues = UserInput.Integer = 20
'# Total = UserInput.Integer = 50
Static Past As New List(Of Boolean)
Static Count As Integer
If isFirstBar Then
Past.Clear
Count = 0
End If
If Price.Last < Price.MinLow(50, 1) Then
Past.Add(True)
Count += 1
Else
Past.Add(False)
End If
If Past.Count = Total Then
If Count >= Trues Then
Pass
End If
If Past(0) = True Then
Count -= 1
End If
Past.RemoveAt(0)
Else
SetIndexInvalid
End If
If isLastBar Then
Past.Clear
End If
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |