MetaStock™ Zone Forum & FAQ Artykuły Linki Elliott Waves EasyLanguage™ Zone

A B C D E F G H I J K L M N O P R S T U V W Y Z #

ADX - Rising
-----Original Message-----
From: owner-metastock@xxxxxxxxxxxxx [mailto:owner-metastock@xxxxxxxxxxxxx]On
Behalf Of Kevin Johnson
Sent: Thursday, February 01, 2001 3:26 PM
To: metastock@xxxxxxxxxxxxx
Subject: ADX rising...

I'm just learning MS's formula language. To this end I've been working on simple exercises to get my feet wet.

I'm currently attempting to write a bit of code (for a MS Expert) that as part of the Expert's criteria, requires that the ADX be rising.

I thought perhaps I could accomplish this by writing:
(in non-code language, for example's sake)

"want current ADX to be greater than the ADX 5 bars ago and ADX 5 bars ago to be greater than ADX 10 bars ago, etc."

I suppose I could do this using the "ref" function, i.e...

adx(14)>ref (adx(14), -5)

...and just keep stacking the prior periods (-5, -10, etc).

This would ensure that the ADX is rising, but I'm sure there is a more elegant way to pull this off, and perhaps with more control over the slope of the ADX.

Any ideas?

Thx, jade

RE: ADX rising...

* To: "MetaStock Listserver" <metastock@xxxxxxxxxxxxx>
* Subject: RE: ADX rising...
* From: "Dave Nadeau" <dave_nadeau@xxxxxxxxx>
* Date: Fri, 2 Feb 2001 22:08:53 -0700
* Importance: Normal
* Reply-To: metastock@xxxxxxxxxxxxx
* Sender: owner-metastock@xxxxxxxxxxxxx


As many people that there are with opinions on this, I believe that there are just as many solutions.

Here are some of my ideas:

First, your approach is correct. It will do the job that you want it to do.

I find that in learning something, it really helps me to think the problem through in a way that I wouldn't have used right away. Here's one idea: my first thought is to approach this in "clusters." By that I mean, you can take your formula below, and rather than adding a single comparison of coding for each new data point that you want to test 5 bars back, I'd make a variable out of your comparison, then test it five bars back, then make a variable out of that, and test it five bars back. This way you've at least minimized your coding.


This covers 20 bars into the past. It accomplishes the same thing, in another way, and I don't have to type ADX(14) so many times. <grin>

Now to test this to be "rising", I'm going to assume that you want each of the comparisons to be true.

You can say


Or more quickly, since each will be =1 if true:


As you look at the ADX() function, you'll see that it's fairly smooth. Compare this with the Vertical Horizontal Filter, VHF(), which does a similar function with less smoothing.

You might consider messing around with the linear regression function or the linear regression slope especially. Set an acceptable level for LinRegSlope(), and use that as your test for an increasing ADX(). Because of the smoothness of the ADX(), the Linear Regression Line will fit the curve fairly well.

Moving averages are another way to guage trend. You can compare the ADX() with a Moving average of itself. Do consider the lag in this sort of a system, and determine if it fits with the type of trading you are doing. If a line remains above a moving average, it is trending up. You could use:

ADX - Rising



I'm using 5 periods and 20 bars for the test just as an arbitrary example.

So these are just some of many ways to approach this problem. I'm sure other listmembers will have additional ideas.

Dave Nadeau
Fort Collins, CO


Source / From: TOP

Equis and MetaStock® and MetaStock Professional® are registered trademarks of Equis International. Achelis Binary Wave®, The DownLoader®,
Expert Advisor®, OptionScope®, Quotecenter® and Smart Charts® are trademarks of Equis International, a Thomson Reuters company.

TradeStation® Pro, TradeStation® 2000i, OptionStation®, SuperCharts®, PowerEditor® and EasyLanguage®
are registered trademarks of TradeStation Technologies, Inc. Other names and marks referred to are the property of their respective owners.

All information provided on this website is for educational purposes only. Trading involves risk, including possible loss of principal and other losses.

Ten i inne materiały na tej stronie zostały zamieszczone zostały jedynie w celach edukacyjnych, nie ponoszę żadnej odpowiedzialno¶ci za ich stosowanie.

Gra na giełdzie i rynkach walutowych (FOREX) niesie ze sob± ryzyko poważnych strat finansowych!