Registered User Joined: 6/22/2005 Posts: 87
|
Would like to have three rules pertaining to a moving average for sorting and scanning.
Price 10% or less above/below a moving average.
Price 10% or less above a moving average.
Price 10% or less below a moving average.
Would this have to be realcode? I can't figure a way with just a choice available when I drag a moving average on top of price action to scan and sort.
Thank you in advance.
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
While it would be possible to create this with Drag and Drop through a series of Drag and Drop Indicators and Rules, it would be easier to do so using RealCode Rules. You would Drag and Drop the Moving Average into the Code tab of the RealCode Editor to create something similar to the first line of each of the following RealCode Rules:
QUOTE (ilbuildit) Price 10% or less above/below a moving average.
'# MA = indicator.MovingAverage
If System.Math.Abs(Price.Last / MA.Value - 1) <= .1 Then Pass
QUOTE (ilbuildit) Price 10% or less above a moving average.
'# MA = indicator.MovingAverage
If Price.Last > MA.Value AndAlso _
Price.Last / MA.Value <= 1.1 Then Pass
QUOTE (ilbuildit) Price 10% or less below a moving average.
'# MA = indicator.MovingAverage
If Price.Last < MA.Value AndAlso _
Price.Last / MA.Value >= .9 Then Pass
-Bruce Personal Criteria Formulas TC2000 Support Articles
|