Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

Attention: Discussion forums are read-only for extended maintenance until further notice.
Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Close higher than Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
haschade
Posted : Saturday, February 2, 2013 5:01:25 PM
Registered User
Joined: 8/21/2007
Posts: 181

I'd like to be able to specify a condition where the weekly close is higher than X percent of the previous 52 week closes.

 

For instance, I'd like to identify if the weekly close is higher than 65% of the previous 52 closes.

 

Is that possible?

Bruce_L
Posted : Monday, February 4, 2013 10:17:10 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

Please try using the following RealCode Condition with a Weekly Bar Interval:

'|*****************************************************************|
'|*** StockFinder RealCode Condition - Version 5.0 www.worden.com 
'|*** Copy and paste this header and code into StockFinder *********
'|*** Condition:Close Above
'|******************************************************************
'# Period = UserInput.Integer = 52
'# Percent = UserInput.Single = 65
Dim Count As Integer = 0
Dim Threshold As Single = Period * Percent / 100
If CurrentIndex >= Period Then
	For i As Integer = 1 To Period
		If Price.Last > Price.Last(i) Then
			Count += 1
			If Count >= Threshold Then
				Pass
				Exit For
			End If
		End If
	Next
Else
	SetIndexInvalid
End If


-Bruce
Personal Criteria Formulas
TC2000 Support Articles
haschade
Posted : Monday, February 4, 2013 10:31:43 AM
Registered User
Joined: 8/21/2007
Posts: 181

As always Bruce, thanks.  That is perfect.

Bruce_L
Posted : Monday, February 4, 2013 10:43:01 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

You're welcome.



-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.