Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Platinum Customer
Joined: 12/31/2004 Posts: 16
|
How would I create/write a StockFinder condition to reflect/sort: Closing Price above the 200 Moving Average by 1.5% or more ?
|
|
Administration
Joined: 9/30/2004 Posts: 9,187
|
Create new RealCode conditon on a Daily chart using...
If price.close / price.avg(200) >= 1.015 then pass
If you're using an exponential moving average, then...
If price.close / price.xavg(200) >= 1.015 then pass
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You could try the following RealCode Condition (for a Simple Moving Average):
'|*****************************************************************|
'|*** StockFinder RealCode Condition - Version 5.0 www.worden.com
'|*** Copy and paste this header and code into StockFinder *********
'|*** Condition:Price above Moving Average
'|******************************************************************
'# MAperiod = UserInput.Integer = 200
'# byPercent = UserInput.Single = 1.5
If Price.Last >= (1 + byPercent / 100) * _
Price.AVGC(MAperiod) Then Pass
You can change Price.AVGC to Price.XAVGC if you want an Exponential Moving Average instead.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Platinum Customer
Joined: 12/31/2004 Posts: 16
|
How would I create/write the StockFinder condition to sort for: Closing Price BELOW the 200 Moving Average by at least 1.5% AND RSI ABOVE 70 for 2 Periods ? (Per the 12/21/10 Worden Webinar)
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
'|*****************************************************************|
'|*** StockFinder RealCode Condition - Version 5.0 www.worden.com
'|*** Copy and paste this header and code into StockFinder *********
'|*** Condition:Price below MA and RSI above 70
'|******************************************************************
'# RSI = indicator.Library.Relative Strength Index (RSI)
'# MAperiod = UserInput.Integer = 200
'# byPercent = UserInput.Single = 1.5
If Price.Last <= (1 - byPercent / 100) * _
Price.AVGC(MAperiod) AndAlso _
RSI.Value > 70 AndAlso _
RSI.Value(1) > 70 Then Pass
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |