Gold Customer
Joined: 6/30/2017 Posts: 1,227

Bruce,
Elder likes to plot a Price Channel he calls his "AutoEnvelope". It's basically a channel centered around an EMA that contains approximately 9095% of all prices "for the past two or three months" on a daily chart, with only the extreme price action protruding outside the channel. There's an example below.
I have the TC2000 Elderdisk, but for my friends that don't, what's the easiest/best way to plot an envelope that holds approx 9095% of the data? I played around with the Envelope Channel indicator for a couple of minutes until I realized the Width was expressed in % and not Standard Deviations. (I'm a decent programmer but kinda sucky at math.)
Not really interested in Bollinger Bands for this chart; Elder's AutoEnvelope is much smoother than BB's. It's main reason for living is to highlight when the market gets too manic or too depressive about a stock. It's also great for determining targets to exit a profitable trade.
Any thoughts?

Gold Customer
Joined: 6/30/2017 Posts: 1,227

QUOTE (AlexElder)
It's basically a channel centered around an EMA that contains approximately 9095% of all prices "for the past two or three months" on a daily chart, with only the extreme price action protruding outside the channel.
The above quote is from the Elderdisk documentation, but didn't sound quite right to me.
In his book, he says his AutoEnvelope goes back 100 bars, which sounds better, so I'd call that the default look back period.
Also, he uses a couple of EMAs but the most common seems to be 26 bars, so I'd consider that the default as well.
Folks will want to use their own parameters, but the 100 period look back and 26 period EMA centerline is as good a place to start as any.

Registered User Joined: 1/28/2005 Posts: 6,049

From the internet:
automatically sizes channels by calculating a standard deviation for the last 100 bars.
Base EMA (22)
Factor (27)
This is the number of standard deviations (expressed in the tenths) for creating the channel. Statistically, 2.7 is the proper size to use
Thanks

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

That is one seriously smooth channel. I really don't know how they do it.
If I were going to try to do something similar, I would start by just using a really long period for Bollinger Bands. So set the period to 100 to use a 100 period standand deviation. The problem is the centerline is also going to be based on a 100 period moving average, so it can be quite a bit away from price.
Also, price isn't "normal" in the statistical sense. It is generally trending. So you might want to use a better predicted value than the 100 period simple moving average used in the 100 period standard deviation.
You might also want to base the calculations on the largest deviation from the average instead of using the close (so use the high or low instead).
And to stabilize things a bit you might want to use the min or max of the deviation being used for the width over time instead of having it change each bar.
So let us start with a centerline of (and we will use this centerline as the predicted value):
XAVGC26
Using the maximum distance of price from this value at each point over the most recent 100 bars to calculate some sort of average (not standard) deviation might be written as follows if you used the highest value over the most recent 5 bars (a week on a daily chart).
MAX(SQR(AVG(GREATEST(ABS(H  XAVGC26), ABS(L  XAVGC26)) ^ 2, 100)), 5)
Now if this were a standard deviation (which it isn't) and the data were normal (which it isn't), then about 68% of the data would fall inside these bands if you used the first formula as the Indicator Line Formula of a Custom PCF Channel Indicator with the second formula being the Channel Width Formula.
Changing the Width Multiplier to 2 would make it so about 95% of the data fell within the lines and setting it to 3 would make it so about 99.7% of the data would fall within the lines. But again, this is not a standard deviation and the data is not actually normal.
Changing the moving average just involves replacing the XAVGC26 at all of the places it is used in both formulas.
Changing the period over which you are calcuating the deviation involves changing the 100 in the second formula.
Changing the period over which you are calculating the maximum value of the deviation involves changing the 5 in the second formula.
Bruce Personal Criteria Formulas TC2000 Support Articles

Gold Customer
Joined: 6/30/2017 Posts: 1,227

Diceman, sounds right.
A 22bar EMA is the one Elder typically uses on daily charts since there are around 21 or 22 trading days in a month. Then he goes and uses a 26bar EMA on other charts. Maybe because 26 weeks is a halfyear's worth of trading, and his wheelhouse is swing trading using daily & weekly charts.
That's his "slow" moving average. He usually recommends a 2:1 ratio between the "fast" and "slow" moving averages, and since he seems to use a 13 EMA pretty much all the time as the fast moving average, I tend to just use a 26bar moving average for all charts, all timeframes, for a clean 2:1 ratio. But that's just me. Any good indicator has adjustable parameters.
The 2.7 standard deviations sounds right, too. Or at least it sounds familiar. I took a lot of programming courses in school, but in hindsight I should've taken more stats courses. :)

Gold Customer
Joined: 6/30/2017 Posts: 1,227

Cool, thanks Bruce! Wow, that's awesome.
Knowing how the formula works, and especially how to change it, is great. Folks can tune it to their own needs.
Yeah, Elder's AutoEnvelope is pretty smooth. The example really wasn't a very volatile stock to begin with, but even "swingier" stocks still have a pretty stable channel. That's the whole point.
Here's another example, this time from the book. I don't know if it's his background as a trained psychiatrist, but Elder adopted Benjamin Graham's "Mr. Market" analogy of manic depressive behavior.
The M's on the chart show the market exhibiting manic behavior as price pops above the upper channel, far above value. The D's are depressive behavior when price plunges below the lower edge of the channel, far below value. You want around 95% of the data inside the channel so you don't freak out (technical trading term) on every swing high & low.
As I mentioned earlier, the stability of the lines also make good targets for exiting profitable trades.
Thanks again!
