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

Rule for ADX Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
Qbear
Posted : Tuesday, June 26, 2012 3:49:20 PM
Registered User
Joined: 10/7/2004
Posts: 16

In SF4 how can I write a rule for ADX declining or equal to yesterday? ADX is a rounded indicator so it is not uncommon for it to be exactly equal to yesterday. The rule writing menu in SF4 doesnt allow for identifying when an indicator is equal to yesterday from what I can see. The end result would be to create one rule for when ADX is rising (easy, already done) indicating a trending market, and another rule for when ADX is equal to OR decling from yesterday's value indicating a trading-range market.

Bruce_L
Posted : Tuesday, June 26, 2012 4:17:00 PM


Worden Trainer

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

One option would be to create a RealCode Rule based on the ADX Rising Rule you already have. Drag and drop into the Code tab of the RealCode Editor to create something similar to the first line of the following RealCode Rule:

'# SC = condition.ScanCondition
If SC.Value = False Then Pass

Another option would be to create RealCode Rule based directly on ADX by dragging and dropping it into the Code tab of the RealCode Editor ot create something similar to the first line of the following RealCode Rule:

'# AL = indicator.ADXLine.2
If AL.Value <= AL.Value(1) Then Pass


-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Qbear
Posted : Tuesday, June 26, 2012 6:29:00 PM
Registered User
Joined: 10/7/2004
Posts: 16

I tried both and came up empty - not a real code expert. Could you clarify a bit?

Qbear
Posted : Tuesday, June 26, 2012 7:12:03 PM
Registered User
Joined: 10/7/2004
Posts: 16

OK, I got it, Bruce! After looking at the second option again and playing around, I got it! Thanks for the help!

Bruce_L
Posted : Wednesday, June 27, 2012 8:13:23 AM


Worden Trainer

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

You're welcome. I am happy to read you figured it out.



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