Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

RealCode Condition passes 20 out of 50 period Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
bobbyd
Posted : Tuesday, November 27, 2012 5:02:12 PM
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?

Bruce_L
Posted : Tuesday, November 27, 2012 5:10:51 PM


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
bobbyd
Posted : Tuesday, November 27, 2012 5:21:38 PM
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

bobbyd
Posted : Tuesday, November 27, 2012 8:05:33 PM
Registered User
Joined: 2/12/2005
Posts: 11

Bruce,

Any updates, please?

Thanks

Bruce_L
Posted : Wednesday, November 28, 2012 8:25:05 AM


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
Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.