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 |

Percentages within a moving average Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
ilbuildit
Posted : Wednesday, December 9, 2009 3:03:53 PM
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.
Bruce_L
Posted : Wednesday, December 9, 2009 3:29:50 PM


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