2021 Oct
2021 Oct
WHEN BACKTESTS
MEET REALITY
Part 2: Evaluating live
strategy performance 8
CAPTURING
OPPORTUNITY
By fading the news 14
CYCLE/TREND
ANALYTICS
The MAD indicator 20
LINEAR REGRESSION
OF PRICE AND TIME
Part 2: The regression adaptive
moving average (RAMA) 24
INTERVIEW
David Lundgren 30
THE DIRECTIONAL
CROSS STRATEGY
A trend-following approach 40
OCTOBER 2021
Take Control of Your Trading with the
Professional Traders’ Starter Kit ™
Stocks & Commodities magazine
5
only
$
Digital Working
Edition Money
ibkr.com/progateway
Member - NYSE, FINRA, SIPC – *Interactive Brokers rated #1, Best Online Broker according to Barron’s Best Online Brokers Survey
of 2021: February 26, 2021. For more information see, ibkr.com/info - Barron’s is a registered trademark of Dow Jones & Co. Inc.
[1] IBKR Lite provides commission-free trades in US exchange-listed stocks and ETFs routed to select market makers. IBKR may
charge non-commission related fees. For more information, see ibkr.com/liteinfo 08-IB21-1485CH1476
CONTENTS OCTOBER 2021, VOLUME 39 NUMBER 11
Futures, foreign currency and options trading contains substantial risk and is not for every investor. Only
risk capital should be used for trading and only those with sufficient risk capital should consider trading.
FUTURES FOR YOU
INSIDE THE FUTURES WORLD
Want to find out how the futures markets really work? Carley Garner is
the senior strategist for DeCarley Trading, a division of Zaner, where she
also works as a broker. She has written five books on futures and options
trading, with the latest being Trading Commodity Options...With Creativ-
ity (July 2020), as well as A Trader’s First Book On Commodities (third
edition, October 2017) and Higher Probability Commodity Trading (July
2016). Garner also authors widely distributed e-newsletters; for a free
subscription, visit www.DeCarleyTrading.com. To submit a question, email
her at [email protected] or via www.DeCarleyTrading.com.
Selected questions will appear in a future issue of S&C.
Carley Garner
IS IT VIABLE TO TRADE COVERED sense to sell an additional call option futures contract is always 1.0 and the
CALLS IN COMMODITIES? (PART 2) to create a trade with an even bigger delta of a particular option will always
Last month we covered (no pun in- risk buffer. be less than 1.0 (with the exception
tended) the topic of covered calls in I would generally advise against of extreme volatility events in which
commodities. To summarize, covered selling the second call option with the options can react wildly to changes
calls can be a great strategy for those same strike price because doing so is in circumstances). For instance, if an
looking to participate in the futures overkill and creates a neutral position option delta is .50, the options price
market but require some room for rather than a bullish position. In this will fluctuate half as much as the
error. However, without some modi- example, a trader could have opted to underlying futures contract; a ten-
fication from the stock version of the sell the September $27.00 call option point move in the futures contract
practice, trading covered calls in for about 65 cents. This version of should equate to a five-point move
futures can be extremely risky; this the trade offers a risk buffer of $1.65 in the option.
is because the underlying futures con- if the trade is held to expiration! If The delta of the position, known
tract is leveraged and unless enough you have done the math, you know at as the net delta, is the sum of all of
premium is collected for the short expiration the trader breaks even at the components of the trade. This
call option, the strategy provides a $24.35 but makes money anywhere net delta gives traders an idea of how
false sense of security to the trader. volatile their position is and how it
As every trader eventually learns, will react to changes in the underlying
As every trader
complacency and overconfidence futures contract. For instance, using
tend to lead to peril. eventually learns, the example above, a trader long a
Let’s revisit the example used in last complacency and silver futures contract which has a
month’s column: A trader purchased overconfidence tend delta of 1.0, a short an at-the-money
a September silver futures contract at to lead to peril. call option ($26.00 strike) with a
$26.00 and simultaneously sold a call delta of .50, and a short a $27.00 call
option with a strike price of $26.00 above (until reaching the risk zone of with a delta of .35, carries a net delta
for $1.00. This gives the trader a risk the additional short call, which I will of .15 (1 − .50 − .35). This means
buffer to be wrong by $1.00 at expira- outline shortly). Below $24.35, the for each penny silver moves up or
tion before the position is a loser. In trader faces theoretically unlimited down, the trader makes or loses .15
other words, if held to expiration 48 risk similar to that of being long a cents. In the case of silver, each cent
days later and the price of silver was at futures contract. is worth $50 to a trader, so this po-
$25.00, the trade would merely break When trading covered calls, any sition would make or lose $7.50 per
even before transaction costs, which other form of futures versus options penny change in the price of silver.
isn’t a bad deal for being wrong by a spread, or even option spreads, it is As you can imagine, this is far more
dollar. As great as this sounds, a lot imperative that traders pay attention comfortable for the risk-averse than
can happen in 48 days and anyone to their delta. As a reminder, the delta making or losing $50 per penny. The
who has traded silver knows it can is the rate of change of a strategy price of silver can move quickly, so
travel a dollar in a single trading relative to a one lot price change in don’t let the small point value fool
session, or less. Thus, it might make the underlying. Thus, the delta of a you into complacency.
6 • October 2021 • Technical Analysis of Stocks & Commodities
FUTURES
Thrive With AbleTrend
With a lower delta, bigger down- Buy on Blue and Sell on Red
side risk buffer, and higher overall
profit potential, the trader employing
the modified strategy of selling two
calls against a single long futures
contract is creating an environ- Blue Dot Signals Buy
ment in which emotional turmoil Guidance Trend Direction Confirms
is mitigated. Accordingly, I believe Signaled on 5/27, Up over 170%
such a strategy promotes better
decision-making. Further, selling
option premium against futures
positions creates a strategy that Support Dots Trail the Price Up
stands to benefit from time-value Confirming the Trend
erosion, enabling a trader to turn Keeps You in the Trade
a profit even if the futures market
trades sideways.
That said, there is a drawback to
the strategy. Because the trader is
selling twice as many options as he
is long futures, there is theoretically
unlimited risk on the upside. In other
words, the trader can be too right in Triple Confirmed Buy/Sell Signals
the direction of the market. In this
case, the additional risk at expiration
occurs if the price of silver is above
$28.65; at that level, the trader is Traders Rave Over AbleTrend
exposed to risk similar to being short
a futures contract from that price.
Accordingly, any trader wishing to
ABLETREND 7.0 COLLECTED BY
participate in this strategy should be SINCE 1994
contract. SHOWN IN AN ACTUAL PERFORMANCE RECORD, THESE RESULTS DO NOT REPRESENT ACTUAL TRADING. ALSO, BECAUSE THESE TRADES HAVE NOT ACTUAL-
LY BEEN EXECUTED, THESE RESULTS MAY HAVE UNDER-OR OVER-COMPENSATED FOR THE IMPACT, IF ANY, OF CERTAIN MARKET FACTORS, SUCH AS LACK OF
LIQUIDITY. SIMULATED OR HYPOTHETICAL TRADING PROGRAMS IN GENERAL ARE ALSO SUBJECT TO THE FACT THAT THEY ARE DESIGNED WITH THE BENEFIT
OF HINDSIGHT. NO REPRESENTATION IS BEING MADE THAT ANY ACCOUNT WILL OR IS LIKELY TO ACHIEVE PROFITS OR LOSSES SIMILAR TO THESE BEING
SHOWN. THE TESTIMONIAL MAY NOT BE REPRESENTATIVE OF THE EXPERIENCE OF OTHER CLIENTS AND THE TESTIMONIAL IS NO GUARANTEE OF FUTURE
PERFORMANCE OR SUCCESS. TECHNICAL ANALYSIS OF STOCKS & COMMODITIES LOGO AND AWARD ARE TRADEMARKS OF TECHNICAL ANALYSIS, INC.
Being able to predict with some accuracy the live survived all reality checks and rendered the test
trading behavior of a trading strategy is important worthless. On the other hand, the $2,000 loss might
to your bottom line. Last time in part 1, we looked at be just a random fluctuation. You need to find the real
some important facets and components of backtesting reason the strategy is losing money, and you need to do
a trading strategy before you take it live. Here in part this rather quickly and with some degree of accuracy.
2, we continue by presenting an objective method of After all, before losing any more money, you want
evaluating your strategy in live trading so you can to determine whether to pull out and abandon the
determine when you may need to correct course. system, or whether to grit your teeth and wait out a
I
rough spot.
magine: You have developed a new trading There are several methods you could use to help
strategy. It passed all tests with flying colors, you determine what may be going wrong with your
including the “reality check” described in strategy. Here, I’ll examine some approaches you could
part 1 of this article. You did everything right and take, and I’ll propose what may be a good solution.
have all reason to assume that backtest results will
be reproduced in live trading. But after letting the The likeliness of loss
system run live for two months, you notice that it is When looking at a typical profit curve of a live trad-
down by $2,000. That’s real money, the equivalent ing system (Figure 1), we notice that it consists of
of a decent bicycle. two main components: an upward trend, and random
Most algorithmic traders are familiar with this wiggles that superimpose the trend. It can be described
scenario. That’s why many prefer to run a new with this formula:
strategy for some time in paper-trading mode. But
that is normally not a good idea, since you would
have to paper-trade for at least a year to get some
statistically meaningful result. And by losing a year’s R = Accumulated profit
return, paper-trading could be a lot more expensive = Performance factor
than risking real money. Paper accounts are useful —that is, the “alpha” of the strategy
for testing whether the script is bug-free,
but not good for determining what the live
performance will be.
Several reasons can cause a strategy to lose
money in live trading. Maybe the exploited
market inefficiency just disappeared. Markets
change from time to time, but it would be a
strange coincidence if that happened right at
the start of live trading of your strategy. A
FIGURE 1: EUR/CHF VOLATILITY STRATEGY, LIVE 12-MONTH PROFIT CURVE.
more likely possibility is a mistake during Although this is an obviously profitable system, it was frequently underwater in the first
KEN SMITH
development, resulting in backtest bias that six weeks, and had drawdown durations up to four months.
Suppose we started live trading eight weeks ago. 1. Determine the length l and depth D of the current
The system was losing from the first day and so far it drawdown, and the overall live trading period t.
has accumulated a 200-pip loss. The backtest ran over 2. Place a sample window of same size l at the start of
300 weeks and produced a 2,000-pip profit. The worst the backtest equity curve (Figure 2).
backtest drawdown was 400 pips. Thus, the left side of the 3. Determine the loss D' from start to end of the win-
inequation is −200, the right side is 2,000/300 × 8 − 400
= −346. Which means that all is fine and we can continue
trading. Or can we?
There are some serious problems with the approach of There are methods you can use to
trying to compare the live drawdown with the maximum help you determine what may be
drawdown in the backtest. First, the maximum backtest going wrong with your strategy.
drawdown is a unique event and thus more or less random.
Even worse, the maximum drawdown normally grows
10 • October 2021 • Technical Analysis of Stocks & Commodities
Reach your trading goals
WHAT THEY SAY MATTERS shades of gray. These days, I would would go bust and take his customers
In the trading world, people will strongly advise you not to put too down with him. This would happen
sometimes use tricks to give the much weight into seeing and believ- periodically, maybe every two years
illusion of trading success. It’s why ing “real traders making real trades,” or so. But his business would soon
it’s often said in educational spaces because we can’t always believe our flourish again because he would
and in this magazine to be sure to eyes. feign trustworthiness with falsified
do your due diligence and avoid Here’s an example. For some years brokerage statements.
guru-seeking. I was an admirer of a trader who, Even a real-money trading compe-
I used to publish a financial news- like me, frequently traded large lots tition has its pitfalls. A competition
letter that gave trading recommen- of German bunds, DAX, and S&P must have certain controls and regula-
dations. I wanted to be completely futures in a discretionary way. And tions in place to prevent misconduct.
transparent about it, so we would he seemed to do this in a public A competitor should not be allowed
show our actual brokerage settlement way during live presentations. But it to open multiple accounts in which
reports for the same trades we were turned out to be only for show. During he takes opposite positions. If that
recommending to our readers. I was his presentations, trades were appar- is allowed to happen, one of these
proud to be “a real trader making real ently artificially inserted into a demo accounts would likely eventually be
trades.” But then a law passed in Italy platform by someone working behind closed for margin calls while the other
that prevented financial journalists the scenes, so that just the good trades account will show brilliant results.
from trading the same stocks they were shown and the bad trades were My outlook today is that in this
write about. So our newsletter could deleted. It was an act. field, it matters what someone says.
no longer approach it that way. Of As another example, I once ob- They must be willing to acknowledge
course, such laws have a purpose and served some unrealistic-looking what is and what is not possible. You
are intended to help curb the so-called trades being made between two ac- should never believe it if someone
“pump and dump” scheme that could counts on what were illiquid stocks. tells you that you can simply become
hurt investors. However, our efforts It turned out that the accounts were rich trading the markets without any
in our newsletter to provide trade actually owned by the same person, risk or pain. That is never true. Sure,
transparency tells you how much I so it was the same person simply perhaps once a decade or so, the
tried during my career to distinguish taking opposite sides of the trade. market gives some generous gifts.
myself by simply showing the trades So the profits being touted weren’t (Bitcoin is one example of late.) But
I was executing. It’s also the reason so “magic” after all. you must be lucky or clever enough
that I managed a real-money trading These days, it’s also very easy to to grasp those gifts, because when
championship over the course of a “Photoshop” documents, equity lines, the market gives gifts, it does not
decade. My feeling then was that and settlement reports, so we can’t last forever. You must be quick to
there are two classes of players in always believe our eyes. I once sub- reap the profits.
our industry: One that is willing to scribed to a recommendation service So take the gifts, and skip the grifts.
show their real records and one that and I traded options for some years A good idea, observation, or clever
is just talk. with great success. But as we know, trading technique can be thought up
However, my outlook has evolved. volatility will inevitably explode in by anyone, whether or not they have
The older I get, the more I feel like the market, and whenever that hap- guru status.
there is no black & white but rather pened, the person running this service
October 2021 • Technical Analysis of Stocks & Commodities • 13
A Market-Neutral Trading Strategy
Capturing Opportunity By
Fading The News
Is there an opportunity to sell a rally following a stock change their recommendations the day after an earnings
upgrade or other bullish news on a company? Here’s a announcement or after a new statement of “guidance”
test to find out. is released by a company. If the earnings were good,
the recommendation increases in bullishness, and if the
by Perry J. Kaufman earnings were poor, just the opposite. It does not seem
very insightful.
J
ust like most of you, I watch the financial
news and listen to their recommenda- After the fact
tions. Sometimes the stock price jumps What is important to keep in mind about upgrades and
after an upgrade or falls following a downgrades is that we see the recommendations after the
downgrade. My trading platform shows fact. When a major brokerage house tells you that they
daily upgrades and downgrades, plus have changed stock X from a hold to a buy, you can be
a score next to a news item indicating sure you are the last to know. They have already notified
whether the reaction should be bullish their clients. We would expect that.
or bearish. If clients have been notified of an upgrade, we should
CHART COLLAGE: CHRISTINE MORRISON
How accurate are those recommendations? I have see a bump up, some sort of rally. If the stock has low
DMITRY NIKOLAEV/SHUTTERSTOCK/
no idea. It would take a huge effort to track the results, volume, the bump should be bigger. Then there are
and I expect that analysts do not keep a record of their traders who get onboard the same advice by watching
accuracy. Once they give advice, they move on. Their the volume increase and the price rally. They may only
advice could change the next day. hold it for a few hours, but that can be enough.
In fact, I have noticed that analysts sometimes will
14 • October 2021 • Technical Analysis of Stocks & Commodities
TRADING STRATEGIES
All Trades Long Trades Short Trades All Trades Long Trades Short Trades
Total Net Profit $7,526 $3,248 $4,279 Total Net Profit $8,744 $7,923 $821
Profit Factor 1.11 1.05 3.4 Profit Factor 1.22 1.2 2.73
Total Trades 817 801 16 Total Trades 566 559 7
Percent Profitable 43.2% 42.8% 62.5% Percent Profitable 45.1% 44.7% 71.4%
Max Drawdown ($6,525) ($7,573) ($760) Max Drawdown ($3,007) ($2,894) ($1,187)
FIGURE 4: TRADE STATISTICS (WFC). This shows Wells Fargo (WFC) FIGURE 6: TRADE STATISTICS (PFE). Pfizer (PFE) using a ±3.5% entry
results using a ±5% entry trigger. As with TSLA, the short sales were trigger. Consistent with the previous tests, the short stock trades outperform
more reliable. here also, even with few opportunities.
gap was a positive 4%. big move, most likely the stock and index will move the
While there are only 15 short sales of TSLA, they are same way, offsetting each other.
much more reliable and produce a larger profit per trade, There are many trades that are long the stock and
shown in the table in Figure 2. short the index. That is good because you do not need
to borrow stock for a short sale, and there is little cost
Wells Fargo to selling an ETF. But each long stock trade produces
The entry trigger was 5%, slightly higher than TSLA. small gains, while a few short sales in the stock are both
In this case, the equity index leg netted zero and all the very reliable and have much larger gains.
profits were made in the long and short stock position I was disappointed that there were so few short sales
(see Figure 3). As with TSLA, the short sales were more of the stocks because my concept was to sell stocks on
reliable, as seen in the table in Figure 4. an upgrade. It would be good to see if you could increase
the number of short sales, perhaps by changing the entry
Pfizer criterion to be different for buys and sells.
Each stock has its own personality. Pfizer (PFE) tests Because the trades are active for only a short time,
preferred an entry difference of ±3.5%, indicating lower you can track multiple stocks and take the first trade
overall volatility. Both the stock and equity index legs
of the trade were profitable (Figure 5).
To show the consistency, and perhaps the robustness of
the concept, the short stock trades continue to outperform, To show the consistency and
even with few opportunities (Figure 6). perhaps the robustness of
the concept, the short stock
Summing it up trades continue to outperform,
The benefit of this approach is that it is market neutral. even with few opportunities.
Once in the trade, it is only important that the stock
price and index price converge. If the market makes a
October 2021 • Technical Analysis of Stocks & Commodities • 17
available. That way, your investment is not idle and your
total return is the sum of all trades.
If nothing else, this tells you not to chase the price Look for a difference of
when it moves up following an upgrade announcement. more than 5% in today’s
You will be able to enter at a better price.
stock price move compared
Perry J. Kaufman is a trader and financial engineer. to the selected index.
He is the author of many books on trading and market
analysis, including the sixth edition (2020) of Trading
Systems and Methods (with the first edition published Further reading
in 1978 as a seminal book in the field of technical Kaufman, Perry J. [2020]. Kaufman Constructs Trading
analysis), and Kaufman Constructs Trading Systems Systems (print and ebook editions), Amazon.
(2020). For questions or comments, please go to www. [2020]. Trading Systems and Methods, 6th Edi-
kaufmansignals.com. tion, Wiley.
[1995]. Smarter Trading, McGraw-Hill
The code given in this article is available in the Article
Code section of our website, Traders.com.
I
across a range of input parameters and yet has the
have been conducting a research project that elegance of simplicity.
I started as a way to gain insight into the
characteristics of cycles in market data. (See An oscillator-style indicator
my May 2021 S&C article, “A Technical De- When I began my research project, I wanted to display
scription Of Market Data For Traders,” and my an oscillator in a way that would demonstrate how the
February 2021 article, “Creating More Robust oscillator would behave as the length of the moving
PROSTOCKSTUDIO/SHUTTERSTOCK/
Trading Strategies With The FM Demodula- average was varied. This could provide some of the
CHART COLLAGE: NIKKI MORR
tor”). Ultimately, the research led to my development of insights into the characteristics of cycles that I was
a new trend indicator—the moving average difference looking for. The idea was to display the oscillator in a
(MAD) oscillator. range of colors as a function of the length of the mov-
In this article, I will demonstrate this new indicator, ing average.
20 • October 2021 • Technical Analysis of Stocks & Commodities
INDICATORS
Cycle mode
In the code given in the “Cycle/Trend
Analytics” sidebar, which is code to display
the oscillator in a color scheme, the default
mode is “cycle.” In that mode, price, which
starts as the close, is overwritten as a 30-bar
period sine wave. A cyan line is plotted to
show the input price. The difference between
two moving averages was added later, so
that line will be ignored for now. Moving
FIGURE 2: TREND MODE. The cycle/trend analytic shows the strength of the trend as the
averages and the oscillator (osc) array were width of the displays. The amount of separation between the reddest line and the yellowest
computed over a range from 5 to 30 bars. line reflects the strength of the trend. When the red line is on top, the trend is up. When the
Each osc was assigned a value for the color red line is on the bottom, the trend is down.
green from 255 to 0 as the length was varied
from 5 to 30. This value, combined with
the color red, produced a net color of bright
yellow when the length is 5 and a color of
bright red when the length is 30.
The resulting display for the “cycle”
mode is shown in Figure 1. The indicator
output leads the input by almost 90 degrees
for the shortest moving average. This is
no great surprise, because a short moving
average is almost like the price, but delayed
a small amount. It looks like a momentum
function when the difference is taken. But
a momentum is analogous to a derivative FIGURE 3: MAD INDICATOR, EMINI S&P 500 FUTURES CONTINUOUS CONTRACT,
in calculus, and the derivative of a sine 12/1/2019 TO 7/1/2021. The MAD (moving average difference) indicator displays the
wave is a cosine wave. In other words, the trend as an oscillator scaled as a percentage of price.
indicator output leads the phase of the input
by about 90 degrees. when the length of the moving average is greater than
The indicator output is exactly in phase with the price a half cycle period.
input when the length of the moving average is one half
the cycle period. Again, this is no surprise, because the Trend mode
summation of a sine wave over a half cycle period is The surprise comes when changing the CTMode input
exactly in phase with the price cycle in the same frame from “cycle” to “trend” in the operation of the code.
of reference. The indicator has a relatively lagging phase This input change causes the block of code containing a
October 2021 • Technical Analysis of Stocks & Commodities • 21
theoretical sine wave data input to be ignored when the The surprising result (to me) is that the predominant
code runs. In this case, the value of price as the close effect is that the amount of separation between the reddest
is not overwritten, and we see the indicator applied to line and the yellowest line reflects the strength of the
real data. An example of the indicator applied to closing trend. When the red line is on top, the trend is up. When
prices is shown in Figure 2. the red line is on the bottom, the trend is down.
Moreover, the high-frequency squiggles in all the
indicators tend to be nearly the same. That is because
when the difference is taken between the price and its
average, all of the indicator lines have similar high-
This trend indicator is robust frequency content.
across a range of input So, the idea is to show the trend by taking the difference
parameters and yet has the of two oscillators. The high-frequency components are
elegance of simplicity. canceled when the difference is taken. If the difference
of the length of the two moving averages are one half
CYCLE/TREND ANALYTICS
The following EasyLanguage shows the derivation Color2, Color3),0,4);
If Length = 8 Then Plot8[0](Osc[Length], "S8", RGB(Color1,
code resulting in the MAD indicator. Color2, Color3),0,4);
If Length = 9 Then Plot9[0](Osc[Length], "S9", RGB(Color1,
{
Color2, Color3),0,4);
Cycle/Trend Analytics
If Length = 10 Then Plot10[0](Osc[Length], "S10", RGB(Color1,
(C) 2021 John F. Ehlers
Color2, Color3),0,4);
}
If Length = 11 Then Plot11[0](Osc[Length], "S11", RGB(Color1,
Color2, Color3),0,4);
Inputs:
If Length = 12 Then Plot12[0](Osc[Length], "S12", RGB(Color1,
CTMode("cycle");
Color2, Color3),0,4);
Vars:
If Length = 13 Then Plot13[0](Osc[Length], "S13", RGB(Color1,
Price(0),
Color2, Color3),0,4);
Length(0),
If Length = 14 Then Plot14[0](Osc[Length], "S14", RGB(Color1,
NormalLength(0),
Color2, Color3),0,4);
Color1(0),
If Length = 15 Then Plot15[0](Osc[Length], "S15", RGB(Color1,
Color2(0),
Color2, Color3),0,4);
Color3(0);
If Length = 16 Then Plot16[0](Osc[Length], "S16", RGB(Color1,
Color2, Color3),0,4);
Arrays:
If Length = 17 Then Plot17[0](Osc[Length], "S17", RGB(Color1,
Osc[50](0);
Color2, Color3),0,4);
If Length = 18 Then Plot18[0](Osc[Length], "S18", RGB(Color1,
Plot1(0,"",white, 1, 1);
Color2, Color3),0,4);
Price = Close;
If Length = 19 Then Plot19[0](Osc[Length], "S19", RGB(Color1,
Color2, Color3),0,4);
If CTMode = "cycle" ThenBegin
If Length = 20 Then Plot20[0](Osc[Length], "S20", RGB(Color1,
Price = Sine(360*CurrentBar / 30);
Color2, Color3),0,4);
Plot2(Price,"", cyan, 4, 4);
If Length = 21 Then Plot21[0](Osc[Length], "S21", RGB(Color1,
Plot3(Average(Price, 5) - Average(Price, 30),"", green, 4, 4);
Color2, Color3),0,4);
End;
If Length = 22 Then Plot22[0](Osc[Length], "S22", RGB(Color1,
Color2, Color3),0,4);
Color1 = 255;
If Length = 23 Then Plot23[0](Osc[Length], "S23", RGB(Color1,
Color3 = 0;
Color2, Color3),0,4);
For Length = 5 to 30 Begin
If Length = 24 Then Plot24[0](Osc[Length], "S24", RGB(Color1,
Osc[Length] = Price - Average(Price, Length);
Color2, Color3),0,4);
End;
If Length = 25 Then Plot25[0](Osc[Length], "S25", RGB(Color1,
Color2, Color3),0,4);
For Length = 5 to 30 Begin
If Length = 26 Then Plot26[0](Osc[Length], "S26", RGB(Color1,
Color2 = 306 - 10. 2*Length;
Color2, Color3),0,4);
If Length = 27 Then Plot27[0](Osc[Length], "S27", RGB(Color1,
//If Length = 3 Then Plot3[0](Osc[Length], "S3", RGB(Color1,
Color2, Color3),0,4);
Color2, Color3),0,4);
If Length = 28 Then Plot28[0](Osc[Length], "S28", RGB(Color1,
If Length = 4 Then Plot4[0](Osc[Length], "S4", RGB(Color1,
Color2, Color3),0,4);
Color2, Color3),0,4);
If Length = 29 Then Plot29[0](Osc[Length], "S29", RGB(Color1,
If Length = 5 Then Plot5[0](Osc[Length], "S5", RGB(Color1,
Color2, Color3),0,4);
Color2, Color3),0,4);
If Length = 30 Then Plot30[0](Osc[Length], "S30", RGB(Color1,
If Length = 6 Then Plot6[0](Osc[Length], "S6", RGB(Color1,
Color2, Color3),0,4);
Color2, Color3),0,4);
If Length = 7 Then Plot7[0](Osc[Length], "S7", RGB(Color1,
End;
Linear Regression Of
Price And Time
Part 2: The Regression Adaptive Moving Average (RAMA)
Here’s a novel approach to the problem of incorporating moving average techniques utilize some measure of
changing market volatility into a moving average. volatility to produce a modified exponential moving
average. Perry Kaufman’s adaptive moving average
by Mike B. Siroky, MD (KAMA) uses the sum of absolute price changes to
A
measure volatility. Other filters have been described
moving average has two important character- by John Ehlers (fractal dimension, entropy) and Tushar
istics: 1) it smooths the noise in the data, and Chande (standard deviation). What these techniques
2) it lags behind the most recent price action. have in common is that they alter the effective length of
The longer the time window of the moving an exponential moving average to make it more or less
average, the more lag is built in. Exponential responsive to price change.
moving averages give more weight to recent Approaching this problem in a different way, I will use
prices and thus reduce lag. However, since the statistical concept of linear regression to develop an
the smoothing factor is a constant, exponential averages adaptive moving average.
cannot adapt to changing market volatility. Thus, during
nontrending or range-bound markets, neither simple nor Introducing RAMA
exponential moving averages eliminate the potential for a In the first article in this series on linear regression of
EIGHT_STUDIO/SHUTTERSTOCK
large number of false signals or whipsaws that can erode prices versus time, we saw that, in the case of a positive
the trader’s capital. regression line slope, the most recent price estimated by
Enter the adaptive moving average in an attempt the regression equation is furthest above the mean price,
to adapt to changing market volatility. Most adaptive while the estimate furthest back in time is the furthest
24 • October 2021 • Technical Analysis of Stocks & Commodities
QUANTATATIVE ANALYSIS
MICROSOFT EXCEL
against a number series extending from zero to 24. Now,
if we select an appropriate volatility measure, we can
adjust the X value to oscillate between zero and 24. FIGURE 1: REGRESSION OF PRICE VERSUS TIME. This demonstrates
Because of the association of high volatility and falling a five-day regression of price versus time, with price shown in black. The
prices, we want high volatility to produce an estimate regression line is in green, the mean price is shown in red. When the slope
close to recent prices, and low volatility to move the of the regression line is positive, the most recent price will be above the
mean, while the most distant price will be below the mean.
adaptive average away from current prices. After
testing various candidates, including average true range,
standard deviation, and Kaufman’s efficiency ratio, the
best candidate was the standard error of the regression
line itself. High standard error indicated high volatility
and vice versa for low standard error. The standard error
was then normalized by assigning each value a percentile
rank, so that the highest in a 25-day period was given a
percentile of 1.0 and the lowest a percentile rank of 0.0.
The percentile rank of standard error was then multiplied
by 24, to produce an adjusted time variable for the
Microsoft Excel’s FORECAST function. This adjusted
time variable is a continuous number series that has a FIGURE 2: MOST RECENT VS. MOST DISTANT REGRESSION ESTI-
minimum of zero and a maximum of 24. MATES. This depicts the most recent and most distant estimates from a
The 25-day regression adaptive moving average 25-day regression line, moving through time. The most recent estimate in
green closely tracks the current price, while the most distant estimate in
(RAMA) is shown in Figure 3. Note that prior to the red tracks prices 25 periods prior. The purple line is the 25-day mean price.
market decline in March 2020, two sell signals were The red down arrow indicates when the slope converts from positive to
given. The 25-day RAMA generally gives an earlier negative. The green up arrow indicates the point at which the slope turns
signal than the 25-day mean on both the buy and the sell from negative to positive.
side. A buy signal was given at the end of March 2020
(the green up arrow) very close to the actual bottom and
before prices crossed the 25-day simple moving average.
The buy signal remains in effect until a sell signal in the
middle of June 2020.
RAMA is a volatility-adjusted regression estimate of
the closing price. When period volatility is high, RAMA
Copy this command down to the last row and now you
FIGURE 4: REGRESSION ADAPTIVE MOVING AVERAGE (RAMA). have your third column completed. Set up a fourth column
Shown here are closing prices of $SPX during the last six months of 2020
with a 25-day simple moving average and 25-day RAMA. Compared to
and label it “average n=25”. Move your cursor down to
Figure 3, this represents a more stable period of rising prices. cell D28 and enter “=average(b4:b28)”. Copy it down
to the last entered price and you have a 25-day simple
closely tracks the current price and remains above the moving average of closing prices. Your fifth column
mean. When volatility is low, RAMA moves below the will calculate the volatility measure “standard error of
mean price and moves further away from the current regression line”. Move your cursor to cell E28:
price. This adaptive action reduces your risk during
periods of high volatility, while reducing your chance =STEYX(b4:b28,c$4:c$28)
of being stopped out during periods of rising prices and
low volatility. Figure 3 shows RAMA in action during and copy down to the last row. Note the dollar sign in
a period of high volatility and rapidly declining prices column C, which contains the row numbers in column
followed by low volatility and recovering prices. C, fixing the array to the first 25 cells.
Meanwhile, Figure 4 shows RAMA in action during a The STEYX function measures the average deviation
more stable period of rising prices in the last six months of your data points from the regression line itself. It
of 2020. A definite sell signal developed at the beginning is a measure of volatility and has a high correlation
of September 2020 as prices moved below RAMA while with other measures of volatility such as average true
RAMA was above the simple moving average. This was range and standard deviation. The standard error of the
followed by a buy signal a month later and another buy regression is calculated and interpreted in much the same
signal a month after that (green up arrows). manner as the standard deviation from the mean, only it
The action inside the orange circle is instructive. measures variance from the regression line rather than
Prices dipped below the 25-day moving average and from the mean.
then recovered. RAMA did not give a sell signal because In your sixth row, you will measure the ranking of the
RAMA was not above the moving average when prices standard error from lowest to highest. You need to rank
went below it. RAMA went briefly above the moving the first 25 values of STEYX, so move your cursor down
average and then quickly reversed direction to fall below to row 52 and enter:
the mean. Instead, RAMA gave a second buy signal and
avoided a whipsaw. Immediately after the orange circle, =PERCENTRANK.INC(e28:e52,e52)
RAMA rose above the moving average, but price stayed
above RAMA and the buy signal remained in effect. This function will rank each standard error in relation
Here are the nuts and bolts of calculating RAMA to the other 24 in the series. If it is the lowest, it returns
using Microsoft Excel. In one column, place the dates of 0, and if it is the highest, it returns 1.00. Anything in
between is ranked between 0 and 1.00. Copy PERCEN-
TRANK.INC down to your last row.
You are now ready to calculate RAMA. Open up a 7th
RAMA is a volatility-adjusted column, which will be row G, and enter:
regression estimate of the
closing price. =FORECAST(f52*24,b28:b52,c$4:c$28)
FAST-MOVING BREAKOUTS (strike price of $230 plus the cost The particulars of this trade appear
I would like to buy breakouts on of the option) for buying this long in Figure 2 and the risk curves in
fast-moving stocks. Unfortunately, call was $247.43, or 8.6% above the Figure 3.
many of the stocks I find are very stock’s current price. As a result, the With ZS trading at $227.90 a share,
expensive. Even to buy call options call buyer needs not just a breakout some things to note include:
is proving to be cost prohibitive. Is but a fairly substantial rally in order
there a more cost-effective way to to profit. • The cost to enter this trade—and
make this type of play? Let’s consider an alternative out-of- the maximum risk—is $1,126
There are a variety of spread op- the-money call calendar spread. • The downside breakeven price
portunities that can fill this bill. Let’s Our example trade involves the is $221.31
talk about one that most traders don’t following: • The upside breakeven price is
think of as a directional strategy. $264.07
Many options traders are familiar • Buy the ZS Nov19 240 call @ • These breakeven prices assume no
with a calendar spread. They buy a $18.38 change in implied volatility
call or put at a given strike price in • Sell the ZS Aug 20 240 call @ • The maximum profit potential
a further-out expiration month and $7.12 is $877 (which would only be
simultaneously sell an option at the achieved if ZS closed at exactly
same strike in a closer expiration $240 at the August option expi-
month. Many traders don’t realize
The profit potential for ration)
that this strategy can be used as a this trade increases
directional play simply by trading over time as a function In a nutshell, this trade is a bet on
out-of-the-money calls or puts. of time decay. ticker ZS trading between $221 and
Let’s consider an example using $264 a share through August expi-
Zscaler (ticker ZS, see Figure 1).
After a massive rally from March
2020 into February 2021, the stock
pulled back and then again rallied to
a point where it threatened to break
out to a new high in early July. At the
time, the stock was trading at $227.90
a share. So, to buy 100 shares would
cost $22,790.
At the same time, the September
230 strike price call option was trad-
ing at $17.43 per contract. The good
PROFITSOURCE
OPTIONSANALYSIS.COM
• If you look closely at the risk
curves in Figure 3, you will note
that they “roll over” once the
price exceeds $240 a share. As FIGURE 2: TRADE BREAKDOWN. This shows the details of the example trade, which is an out-of-
the-money call calendar spread on Zscaler (ZS).
a result, when putting together a
plan to manage this trade, there
should be some provision regard-
ing adjusting or exiting the trade
if the price of ZS shares reaches
$240 a share.
• If this happens sooner (see where
the red and blue lines roll over in
Figure 3) rather than later (note the
green and black lines in Figure 3),
the profit will be small. The profit
potential for this trade increases
over time as a function of time
decay, that is, the short August op-
tions will lose their time premium
more quickly than the longer-term FIGURE 3: RISK CURVES FOR EXAMPLE TRADE. Note that the risk curves “roll over” once the
November options. share price for ZS exceeds $240 a share. For this trade, you would likely want to exit or adjust the
trade if ZS approaches $240 a share.
Focusing on risk
As part of a trading plan, let’s also if ZS approaches $240 a share. De-
consider a course of action if ZS fails
The catalyst for this pending on whether $240 is reached
to move to the upside as hoped and trade was the belief immediately or not until August
instead begins to break down. Here that the stock would expiration, the expected profit can
there are no hard and fast rules. At the break out to the upside. range from roughly $55 per 1-lot to
extreme, a trader could hold this trade $877 per 1-lot.
until all the options expire, knowing A closer examination of the risk
that the worst-case loss is the $1,126 curves in Figure 3 suggests that: Option position versus
paid to enter the trade. stock position
But let’s consider another plan of • Stopping out at $211 a share would For the sake of example, look at the
attack. Remember that: incur a loss of between -$261 and green line in Figure 3 (the expected
-$390—depending on whether P/L as of 8/5). If this trade is exited on
• The catalyst for this trade was the the trade is stopped out sooner 8/5, with ZS trading at $240 a share,
belief that the stock would break or later. the expected profit is roughly $300.
out to the upside • Stopping out at $200 a share would In this scenario, the option trade
• The nearest support levels for ZS incur a loss of between -$450 will earn 27% ($300 profit on a $1,126
are near $211 and $200 a share. and -$650—again, depending on investment) in 29 calendar days.
whether the trade is stopped out Had we plunked down the $22,790
A trader could adopt the mindset sooner or later. to buy 100 shares of ZS, the stock
that if one or the other of the recent would have to rally to roughly $289
support levels is hit, they can call it Finally, let’s consider profit po- a share for us to earn 27%.
a “failed breakout” and abandon the tential. As stated earlier, we would
position at that price. likely want to exit or adjust the trade
October 2021 • Technical Analysis of Stocks & Commodities • 29
INTERVIEW
A Conversation
With David Lundgren
David Lundgren, CMT, CFA, is a 30-year investment industry veteran
with a focus on technical analysis strategies, particularly momentum
and trend following. Most recently, he was a managing director, portfolio
manager, and director of technical research at Wellington Management.
He has held similar positions at Fidelity Management and Thomson
Financial as well. In addition, he has launched several research and
investment firms, including Lundgren Financial Services, Breakaway
Research, and hedge fund Lyceum Capital.
Lundgren is a Chartered Financial Analyst (CFA) and a member of
the CFA Institute. He is also a Chartered Market Technician (CMT) and
serves on the CMT Association’s board of directors. He is a frequent
guest speaker at conferences and seminars, including the IFTA and CFA
Institute. He graduated from Babson College in 1988 with a degree in
finance and investments.
He co-hosts the monthly podcast “Fill the Gap” for the CMT Associa-
tion, which he launched at the start of 2021.
Stocks & Commodities contributing writer Karl Montevirgen in-
terviewed David Lundgren in April 2021 to ask him for some of his In investing, there are two
insights from his decades of experience in research and investment, as
well as to explore some of the strong historical links between technical
things that you have to get
and fundamental analysis. right in your mind: What is
your philosophy, and what
is your process?
You have three decades we speak with veteran market ana-
of experience in mar- lysts, money managers, and CMTs
ket analysis, technical (holders of the Chartered Market In my case, my first job was in
analysis, fundamental Technician, or CMT, designation). Canada. I was a broker and I had
analysis, and portfolio We like to ask our guests about their the good fortune of sitting next
management. You are also some- investment philosophy, their process, to someone who really leaned on
what of a rare bird in that you hold and their decision-making tools. technical analysis to manage his ac-
both a CMT and CFA designation. There is often a common theme about counts. So I had a front-row seat to
The latter is extremely difficult for how they got into the technical side watch somebody very successfully
most people to attain. Can you tell of the business, and it’s usually a very employ these tools—tools that I had
us a little bit about yourself and how similar story to mine—we started out just spent four years in college learn-
you got started on this dual path? on the fundamental side and then we ing didn’t work. So his work really
When I think about how I got into saw this shiny thing off in the corner attracted my attention. Since then, I
technical analysis, I don’t think my that was like, “Wow. What is that? It have either been a technical analyst or
path is all that unique. And I’ll tell you seems to be right an awful lot. And the portfolio manager exclusively using
why I say that: I co-host a monthly fundamental side seems to be wrong technical tools to make my invest-
ALEKSOREL/SHUTTERSTOCK
podcast with Tyler Wood for the CMT an awful lot.” So, the technical side ment decisions.
Association that’s called “Fill The just attracted my attention, and that
Gap,” which we launched at the be- seems to be a common theme for our You recently gave a presentation
ginning of this year. On the podcast, podcast guests as well. to the Boston chapter of the CFA
30 • October 2021 • Technical Analysis of Stocks & Commodities
Society. Your talk was titled “How fundamentals will simply
Fundamentally Minded Investors overwhelm any short-term
Can Use Technical Analysis Today.” emotions that investors A core premise about
If you could take the reverse may feel regarding the how I think about
focus—how technically minded fundamentals and news. technical analysis is
traders can use fundamental A perfect example of
analysis today—what do you think that is Tesla. There was
rooted in Dow theory.
you would you say? a lot of emotional charge
A core premise about how I think and passionate discussion
about technical analysis is rooted about whether Tesla was the greatest worked with were on the floor of the
in Dow theory. One of the things thing since sliced bread or whether it Chicago Board of Trade. So it was
Charles Dow observed over 100 years was the greatest fraud on Earth. Yet very much an in-the-weeds, short-
ago is that there are essentially three despite the heat of those debates, the term mindset at that time. Because
timeframes of trend. And each of reality is, the fundamentals have just of that early indoctrination into the
those timeframes of trend is driven completely overwhelmed the discus- technicals vis-à-vis the futures con-
by different things. In other words, sion. You can see on a chart of Tesla tracts and things like that, I wasn’t
the shorter the timeframe of trend stock that it’s become one of the really prone to paying a lot of atten-
you use, the more reactionary and best-performing stocks of the past tion to the fundamentals, because
responsive the trend is to various 10 years. And that’s for one reason it really didn’t matter. As I said, in
news items. So there’s a lot more only, and that’s fundamentals. those short-term trends, it was more
volatility, and it’s a lot more emotion- I think it’s important for investors in about just gauging short-term trends
ally charged. the longer-term timeframes to make regardless of why they were doing
It’s not to say that fundamentals sure they’re aligning themselves with, what they did. You’re just trying to
don’t matter in that short-term time- at minimum, the message of the mar- capture those trends.
frame. It’s just that in that short-term ket. If the trend is up and you don’t As I was saying earlier, the further
timeframe, what drives price action like the fundamentals, at the very you step out in timeframe, the more
is the emotional response to the least, don’t short it because there’s a you should pay attention to the funda-
fundamentals and news. It’s all about good chance that you’re wrong. But mentals. So I’ve sort of morphed from
how much the actual fundamentals if you can find companies that you being a pure technician to somebody
differ from expectations in any given like fundamentally and that have a who really respects the fundamentals.
moment. proper trend structure with relative What I’ve come to learn is that you
And then as you step out to the outperformance, that’s really where should lean on the fundamentals to
intermediate-term and long-term you can make hay while the sun is tell you what to buy. And you should
timeframes, the actual fundamentals shining. lean on the technicals to tell you
matter considerably more. In those when to buy.
timeframes of trend—which is where Both schools of thought have The way you can use it is to say,
I try to focus my energy—you’re not only an extensive history, but okay, I’ve screened 5,000 candidates
really just trying to find companies also have very sophisticated and and here are the 300 companies that
with good fundamental underpin- nuanced levels of depth. It seems meet my fundamental criteria. They
nings. That’s because history shows like an investor has to understand meet my criteria for what I think are
that companies with rapid revenue when to use which approach. That great companies based on all the stud-
growth, expanding margins, and is, we have to know when to use ies and research I’ve done in terms
above-average earnings growth tend either toolbox and specifically of what drives good performance
to outperform the market. which tool to use. for an individual company. So say I
So fundamentals matter in all For most of my career, I have actu- have my 300 candidates. They are not
timeframes. It’s just that the shorter- ally been purely a technical investor. always trending. And when they’re
term timeframe is more driven by It probably has to do with the very not trending, it could be for various
the emotional response that investors early stages of my career when I was reasons. But I’m interested in find-
have. And in the longer timeframe, into daytrading and I was advising on ing those companies with the proper
the investing process is more inten- bond futures contracts and the euro- fundamental setup that are trending
tional. In the long term, the actual dollar contract. Most of the traders I now. What that means is the market
October 2021 • Technical Analysis of Stocks & Commodities • 31
year. Sometimes I listen to yet there’s nothing in those books
them on audio recordings that’s not as applicable to today as it
It’s important for when I’m out going for a was the day they were written—which
investors in the longer- walk or doing something tells you a lot about investing.
term timeframes to make else. These books serve There was also Nicolas Darvas’
sure they’re aligning to remind me of many book published in the 1950s, How
themselves with the important concepts. I Made $2,000,000 In The Stock
The first book is Remi- Market. It’s a fantastic book. There’s
message of the market.
niscences Of A Stock Op- nothing in that book written 70 years
erator by Edwin Lefèvre. ago that’s not as applicable today as
Just about everybody in it was then. There’s also the invest-
has done its fundamental work and this field knows that book. The book ing principles you can learn from
has determined that right now is the is a fictionalized story that is based on the history of the Turtle Traders. It’s
time to buy them. the trading career of Jesse Livermore. channel breakouts and the Donchian
And that’s the way I’ve evolved as It follows his journey from the age of channels. If you want to buy stocks
an investor—to really lean on both 15, when he made his first $1,000, to that will go from $20 to $100, well,
tools and not really time the tools, so becoming a Wall Street legend. The that stock can’t go to $100 unless it
to speak. Use the tools consistently, book contains timeless lessons about goes through $25 first. And no matter
and allow the technicals to help you shorting stocks, commodity futures what happens over the next 100 years,
determine when is the best time to trading, and stock manipulation. that premise will never change.
buy stocks. The second book is called The So by reading these classic books,
Stock Market Barometer, written by it helps to reinforce the basics. And
To me, the closer you get to signal William Peter Hamilton. That was that’s important. Try not to go too
from noise, the more strategic the the first effort to really codify Dow far off into the crazy esoteric ways
approach. Whereas technicals have theory, although he didn’t actually of looking at the market because it’s
always been more of a tactical tool. refer to it as “Dow theory.” not necessary.
Do you agree with that? And then, of course, there’s The With investing, it’s not like you
Yes, I’d say it’s strategy versus Dow Theory by Robert Rhea, pub- have to reinvent the wheel to be a suc-
tactics. The strategic part is: What lished by Barron’s in 1932. To write cessful investor. You just have to be
do I want to own? What strategically his book, Rhea carefully studied 252 practical. Learn from the past. Stand
makes sense? And then you have editorials of Charles H. Dow and on the shoulders of the greats. They
to execute that strategy vis-à-vis William Peter Hamilton in order to have already paved the road for you.
tactics, and that’s where technicals present Dow theory in terms that From them, you will learn what you
come in. would be useful for the individual need to do. From there, it’s more about
You want to use both because great investor. the mental side of it. To succeed, you
tactics can sometimes overwhelm the Those three books are, to me, es- need to develop mental control and
strategy. And a really great strategy sential reading. control over your behavioral biases
can sometimes fail when you have And so, back to your question. when you’re executing your tactics.
poorly executed tactics. My interest in reading and recom- If you want to execute your tactics
mending those books demonstrates properly and purely, you must stick
As you indicated, the evolution my belief of how important it is to to your process.
of technical analysis stands on understand not just the core premise
the shoulders of Dow theory. of Dow theory, but also, as you said, to It’s important to have a process that
How important is it for traders to get to know the more nuanced levels has been known to work, and you
become thoroughly acquainted with of the theory. For that reason alone, need to apply it consistently.
Charles H. Dow’s concepts? Are it’s worth reading these books. And In investing, there are two things
they foundational to most technical consider: All three of these books that you have to get right in your
approaches? were written over 100 years ago or mind: What is your philosophy, and
I will mention three books that I close to it. (I believe The Dow Theory what is your process?
try to reread every year. Sometimes was actually written in 1932—so not
I even reread them more than once a quite a century ago, but almost.) And In your speaking engagements,
32 • October 2021 • Technical Analysis of Stocks & Commodities
you’ve quoted Paul Samuelson— on the weather patterns
the Nobel Prize-winning economist and other forces at work.
who is considered by some histo- The “waves” represent the If you can find companies
rians to be the founder of modern intermediate-term trend. that you like fundamentally
economics—on the notion that the And he referred to the and that have a proper
market is a perpetually forming short-term trend as the trend structure with relative
equilibrium that’s not unlike the “ripples.” The ripples are outperformance, that’s
surface of the ocean. You’ve quoted like droplets of water flit-
Benjamin Graham, who wrote in his tering around on top of the
really where you can make
book The Intelligent Investor that waves. And so, you have hay while the sun is shining.
investing is like a voting machine these three magnitudes
in the short term and a weighing of trend all unfolding at
machine in the long term. And that the same time. Dow used the ocean see it as black & white—it’s either
echoes Charles Dow. Could you analogy to illustrate that point. fundamentals or technicals: One
explain what these references mean And Paul Samuelson, in his book side is right, the other is wrong.
and why you sometimes include 50 years later, said something very In your talks, you give a formula
them in your talks? similar. It’s the idea that the market to describe fundamentals times
My quest is to break down the walls is constantly unsettled but it’s always value. Then you add a behavior
that exist between the fundamental returning to equilibrium, not unlike component to the equation. Can
and technical communities. So when the ocean. It’s the same analogy that you tell us about that formula and
I include those quotes in my talks or Charles Dow leaned on to make the what it illustrates?
presentations, my point is that the phi- very same point. And Benjamin Gra- Yes; to me, this gets back to the idea
losophies that underpin the technical ham said something along the same of knocking down the walls between
and fundamental investment styles lines when he wrote that in the long fundamental and technical thinking.
are virtually identical. term, the market is like a weighing It’s just not helpful to think of it in
The reason I quoted Charles Dow machine, but in the short term, it’s those stark black & white terms.
and then quoted Paul Samuelson’s more like a voting machine. And Instead, it’s helpful to think about
comments—which were made some that analogy corresponds similarly. how to put these things together. Not
50 years later—is to point out that they Graham made that comment 50 only does it make perfect sense to put
were saying virtually the same thing. years after Charles Dow made his these things together, in reality, they
It shows the commonalities that exist comments. But they all allude to the are together.
in sound investing principles, and it same thing: that in the long-term, the So the formula I like to show is:
shows that the basic principles stand market is driven by fundamentals. So
the test of time. in the long term, the market is like a P = (F * V)
In my lead-up to make that point, weighing machine. In the short term,
I like to talk about how in the late it’s driven by emotions, so it’s like a This basically encompasses the
1800s, when Charles Dow was writ- voting machine. three styles of investing all in one
ing his editorials in the Wall Street The philosophical underpinnings formula: technical (or momentum)
Journal about how he felt the markets of both schools of thought are virtu- investing, fundamental (or growth)
worked technically, he discussed ally identical. Both schools of thought investing, and value investing. The P
trend and the three timeframes: the hold that a market is efficient over stands for price, which is momentum,
short term, the medium term, and time. It is inefficient in the short term and that’s technical investing. The F
the long term. He used the ocean but it’s efficient in the long term. The stands for fundamentals. You’re try-
as an analogy to describe the very fundamentals matter; in fact, they ing to estimate what the future of the
complex notion of how these three are paramount. Without good fun- fundamentals is going to look like;
timeframes trend in different direc- damental trends, there are no good that’s growth investing. And then you
tions all at once. He referred to the price trends. have value investing: the V variable
primary trend—that is, the long-term is the price-to-earnings ratio, the
trend—as the “tides.” And then on top You speak well to the importance of price-to-sales ratio, or whatever you
of the tides, you have the “waves,” both components working together. decide you want to assign to those
which are crashing around based Meanwhile, there are those who fundamentals.
October 2021 • Technical Analysis of Stocks & Commodities • 33
really need to pick a part whether as a growth manager or value
of this formula and stick manager, you are not even implicitly
I’m interested in finding with it. saying the market is wrong—you are
companies with the proper For personal investing, explicitly saying the market’s wrong.
fundamental setup that are it’s critical for your suc- You are basically of the mindset that
trending now. cess to do that. From a “I think my estimates are better, I
business perspective, if think the market’s overestimating/
you’re out there trying to underestimating growth. And I see
When you look at this formula, raise capital and assets as a money a gap there that I perceive based on
what you recognize is that these three manager, the last thing you would my personal opinion that the market
styles are joined at the hip. Nobody do is raise capital for a growth ap- has it wrong. So I’m going to invest
makes money unless everybody proach and then all of a sudden take in a way that closes that gap either
makes money. There is no right way a value approach. There are times by going long or short, depending on
to invest. It’s just a matter of determin- when growth isn’t working, like from the direction.”
ing who you are as an investor and 2000 to 2006, and it may cause you It’s a different mindset operating on
figuring out where and how you want to want to take a value approach. the right side of the formula. If you’re
to engage with this formula. But you can’t just change into a on the left side of the formula and
If you look back through history, value manager. Or, maybe nothing operating as a technician, you come
you will see there have been very seems to be working so you jump to work every day with the exact op-
successful investors who have used on the momentum bandwagon. But posite opinion: “I believe the market
just price, there have been a number in business, nobody’s going to give is right.” That’s a totally different way
of very successful growth inves- you capital to do that. You have to to think about the world. And that’s
tors, and there have been a number pick the spot in the formula where why you can’t jump back and forth
of very successful value investors. you’re going to be. in this formula—you would be like
So clearly, it’s not about one style So there are a lot of reasons to be Dr. Jekyll and Mr. Hyde.
being better than the other. They mindful of where you’re going to Moreover, there is a degree of com-
all can work. Rather, it’s often the engage in this formula, and then stick plexity on both sides of the formula.
investor who gets in the way of the with it. That’s the whole point. It’s just On the right side of the formula, the
strategy working. This gets back to to demonstrate that there really isn’t a F opens a whole “Pandora’s box” of
behavioral biases and the emotional right way to do it. It’s just a question questions that you now have to answer
baggage that we bring to the whole of how you engage with the market on each stock under consideration. It’s
investment process. to ensure long-term success. a myriad of very complex questions
that need to be addressed with respect
Yes, investors and traders don’t If the different approaches are to the fundamental growth and how
often acknowledge that we ourselves joined at the hip so to speak, and you’re measuring it, how far out
are sometimes the biggest risk factor come down to the same thing, why you’re looking, what the competition
we face. does it matter which approach you looks like, and all these other things
I think problems come from inves- operate in? that need answers. And then, the V
tors engaging with this formula at the It’s important for you to figure out is just as complex. How do I value
wrong spot. The reason that happens who you are as an investor before this company? Am I looking out on
is because investing is very difficult. you engage. The two different sides estimates one year, 10 years? Am I
And nothing works every single time of the formula are very different. So comparing that current valuation to
or even every year. In theory, all three although they’re linked, each one the history of the company, or am I
investing styles can experience mean- requires a different skill set. comparing it to interest rates or to
ingful drawdowns. It’s those periods If you come to work every day the price of oil? How am I actually
of pain that force investors to jump to operating on the right side of that thinking about valuation?
another part of the formula that they formula, then every day you are mak- Both of those concepts—the funda-
don’t belong in. They don’t belong in ing the base case assumption that the mental and the valuation—are very
it because they’re simply not good market is wrong. Your estimate for involved questions to answer for each
at it. From a long-term performance growth, PE ratio, valuation estimates, company. And you have maybe 20 or
perspective, that’s a nightmare. You whatever it is that you’re looking at, 30 stocks that you follow and have
34 • October 2021 • Technical Analysis of Stocks & Commodities
to answer those same questions for. the target is either never
And then there are other things that achieved, or the trend just
you don’t know but the market knows steamrolls over the target, The market is inefficient in
about. So that’s the right side of the going on to achieve much the short term but efficient
formula, F & V. higher or lower levels than in the long term.
Meanwhile, the left side of the forecast.
formula is price. And it’s always I say all of this in
price. It’s that simple. You use the advance of answering your actual know it wasn’t obvious at all. Yet, the
power of price to help you navigate question only to provide context to market changed direction and hasn’t
the complex world that exists on the my feelings about forecasts gener- looked back since.
right side of the formula. ally. Forecasts are always available,
It’s an incredibly powerful solution but they are rarely meaningful. If we consider daytraders, swing
to bring these two things together. Whether generated using technical traders, and position traders, what
Use the right side of the formula to or fundamental techniques, all fore- level of engagement with the funda-
help you determine what to do. Use casts require one thing and one thing mentals would best benefit each?
the left side of the formula to help only to make them valid: price has Going back to what Charles Dow
you determine when to do it. to move to that forecasted target. In said over 100 years ago, the shorter
other words, all that ever really mat- your timeframe, the less fundamen-
You have commented in your talks ters is trend. If so, then why bother tals matter, particularly long-term
that technicians agree on the im- forecasting? Why not just follow the fundamentals. So to the extent that
portance of fundamentals, it’s just trend until it ends? fundamentals matter to short-term
that they have “hired” the market to So back to your question: As a traders, it would likely be in response
conduct the fundamental analysis trend follower, I am willing to engage to earnings beats and misses, earn-
for them. But can technical analy- with changes in long-term trends ings forecast changes, and perhaps
sis have the same forward-looking on the assumption that the market, analyst upgrades and downgrades.
focus that fundamental analysis in its infinite wisdom, has detected For longer-term trends, however,
does? After all, price itself is not meaningful shifts in the fundamental what really matters are things like
predictive, but fundamentals are. drivers of macro trends. In that mo- top-line growth, EPS growth, margin
Can technical analysis be predic- ment, it is not necessary for me to expansion, new product announce-
tive? How does technical analysis understand what those macro shifts ments, management changes, shifts
take into consideration economic are, let alone provide a forecast for in the competitive landscape, federal
and geopolitical undercurrents that how long they will last. It is my job regulations, and so on.
come into play in the market? to simply acknowledge they have Of course, every major trend
In the technical community, there changed, and to change with them. change starts with a reversal in the
are two schools of thought. One What I find most compelling about short-term intraday timeframe. But
says that technicals can be used to this approach is how long-term funda- by and large, it pays for position
forecast future market trends, while mentally driven trends tend to change traders to ignore that noise until it
the other says that it is enough to direction when current macro data is begins to alter the longer-term trend,
simply acknowledge when trends least supportive of that change. The as that would be confirmation that Mr.
have changed, and that one should bull market that followed the recent Market was growing more concerned
simply trade in the direction of that selloff in March 2020 is a perfect or optimistic about the company’s
new trend until it changes again, with- example of this. The macro data was longer-term prospects.
out forecasting how long it will last. I as bad as it had ever been in history,
am personally in the latter camp, not and forecasts for further collapse You mentioned some technically
because I don’t believe technicals can were everywhere. Yet, despite all oriented books that you recommend
provide a forecast—they surely can, the doom and gloom forecasts, the reading. Can you similarly sug-
by way of using price patterns, targets, market stabilized and turned higher gest some fundamentally oriented
retracements, projections, and tools as it sniffed out what turned out to be books, especially if you have sug-
of that nature. The issue is that those a record response from global central gestions for the technically minded
targets only matter if they are attained banks. We talk about it today as if it investor?
precisely. What is more typical is that was obvious back then, but clearly, we I’m not sure I can say there are
October 2021 • Technical Analysis of Stocks & Commodities • 35
overall market vis-à-vis the main tenets of that damaging
several macro economic school of thought. In Value Invest-
The fundamentals matter; indicators. He goes into ing, Montier takes it to a whole other
in fact, they are paramount. stock-specific factors as level as he absolutely eviscerates
Without good fundamental well, but not as in-depth the notion that markets are efficient,
trends, there are no good as O’Neil does. highlighting the momentum factor
Beyond that, a few among many other things as proof
price trends.
other books that I found that markets are indeed not efficient,
very helpful in develop- particularly in shorter timeframes. As
ing my personal invest- a trend follower, I found this book to
any fundamentally oriented books ing philosophy include 100 Baggers: be almost empowering.
that technical traders absolutely must Stocks That Return 100-To-1 And
read. The only thing technical trad- How To Find Them by Christopher David, thank you for speaking with
ers must absolutely, positively read W. Mayer; Quality Investing by us. You have shared insights that are
is the message of the market itself. Lawrence Cunningham, et al; and unique to your perspective and that
Everything else, technical books Value Investing by James Montier. will definitely make us think.
included, is just an aid to help with Like O’Neil, Mayer’s also goes into
things like general knowledge, risk great detail about the fundamental Karl Montevirgen is a financial
management, psychology, inspira- traits that have underpinned some content writer. His LinkedIn pro-
tion and motivation, and the like. In of history’s best-performing stocks. file can be found at https://www.
that light, to the extent that a funda- I have a lot of issues with the author’s linkedin.com/in/karl-montevirgen-
mentally oriented book might help heavy use of “hindsight bias,” as 4a66b517.
a technical investor hone his or her many of these great stocks have fallen
craft, it would be to help understand upwards of 90% several times on their Further reading
what fundamental drivers ultimately way to 100-bagger status, making it Lefèvre, Edwin [1923]. Reminiscenc-
cause prices to trend. That way, a hard to believe that us mere mortals es Of A Stock Operator, Doubleday
technical trader might try to make it a would not have lost our faith in the and Company.
practice to favor those securities that company. That said, as risk-aware Hamilton, William Peter [1922]. The
have those qualities, but only when trend followers, we can avoid those Stock Market Barometer, Harper
they are trending and outperforming pitfalls while at the same time have and Brothers.
the market, of course. an appreciation for what to be on the Rhea, Robert [1932]. The Dow
In that regard, although it was on lookout for on the hunt for the next Theory, Barron’s.
my list of books for those looking 100 bagger. Darvas, Nicolas [1960]. How I
to learn about technicals, I have to In Quality Investing, once again, Made $2,000,000 In The Stock
double down on my recommendation we get a heavy dose of what really Market.
of How To Make Money In Stocks, matters to long-term stock perfor- Graham, Benjamin [1949]. The Intel-
which is William O’Neil’s excellent mance, as Cunningham provides ligent Investor.
book that discusses in great detail real-time examples of holdings that O’Neil, William [1988]. How To
the fundamental factors that drive meet his definition of quality. Again, Make Money In Stocks, McGraw-
big winners in the stock market, and as trend followers, not all of these Hill.
details the technical strategies to charts cut it, particularly from a Zweig, Martin [1994]. Winning On
capture those trends. As to the idea relative perspective, but if the idea is Wall Street, Warner Books, Inc.
that fundamentals tell us what to buy to align our trend-following efforts Mayer, Christopher W. [2015]. 100
and technicals tell us when, O’Neil’s with companies that possess the Baggers: Stocks That Return
book captures that idea as well as any fundamental traits that historically 100-To-1 And How To Find Them,
book I could recommend. result in big winners, a technical Agora Financial.
A similar book, but with a slightly investor will surely learn a lot read- Cunningham, Lawrence, Torkell
more macro perspective, is Martin ing this book. T. Eide, and Patrick Hargreaves
Zweig’s Winning On Wall Street. In Finally, as a foot soldier in the war
that book, Zweig presents several against the efficient market hypoth-
tools for gauging the health of the esis, I have done my best to dismantle Continued on page 56
36 • October 2021 • Technical Analysis of Stocks & Commodities
Algo Q&A
ALGORITHMIC TRADING
Have a question about system or algo trading? Kevin J. Davey has over
30 years of system trading experience. Kevin is a full time trader, and also
teaches and consults via his Strategy Factory® online workshop (https://
kjtradingsystems.com). He is the author of 5 bestselling trading books, in-
cluding “Building Winning Algorithmic Trading Systems” and his latest
book “Algo Trading Cheat Codes.” Send your questions or topic suggestions
to Kevin Davey at [email protected]. Selected questions will
appear in a future issue of S&C.
Kevin J. Davey
SHOULD SIZE MATTER? trades early or ignore exit signals are trading 10 contracts, you just do
I am generally happy with my trading, completely. not know. If you don’t know the size
but I find that once I increase size, In short, when the money involved involved, you’ll be better grounded
my performance degrades. Do you gets large because of size, it can im- in your trading. You can’t be rattled
have any tips for me? pact every trader. How can a trader by the trade size if you do not know
I’ll make the assumption that you overcome this size issue? Here are a what it is.
are trading a liquid market with a few ideas:
good amount of volume. Most futures “Stop counting the dollars”—Stop
markets fall into this category. But if “Don’t boil the frog”—Toss a frog in counting trades in dollar terms, since
you are trading, say, low-volume milk a pot of boiling water, and he will im- that directly scales with the number
or lumber futures with any size, then mediately jump out. But put the frog of contracts. Instead, use percent-
your performance may be degrading age returns. That way, trading one
due to your size actually moving the contract with $3,000 will be the
market. If you don’t know the same percentage-wise as trading 10
For most traders though, the size involved, you’ll contracts with $30,000. By looking at
market is not the issue. Rather, it is be better grounded in the percentages, you could feel more
the trader’s own psychology that is your trading. comfortable trading the strategy.
degrading their performance. This
can be true for automated algo trades “Gamble till it doesn’t hurt”—
and discretionary traders. It really all in a room temperature pot of water Desensitize yourself to money. Hit
comes down to money. and slowly raise the heat, he will toler- the local casino, and play the slots,
Money impacts people in different ate it until he boils to death (so I’ve video poker, or a table game. Start
ways. I always hear one popular trad- heard, I have never tried it, and I don’t with 25-cent machines. At first it will
ing “guru” say, “Once you trade one recommend you try it either!). For be exciting, but eventually it will get
contract, it is easy to scale up and trade trading, keep the account small, and boring. Then jump up to 50 cents,
50 or 100 contracts.” I don’t think he make withdrawals as profits dictate. and play until that gets boring. Keep
trades, honestly, because that is total And maybe over time, retain some doing this for a few hours. Then go
BS. Scaling from one contract to 100 profits in the account to build your back and do it again. Eventually, you
in the ES, for example, means that size up slowly. Maybe in a year you will be immune to the dollar amount
each tick up or down rockets from double your size, rather than doubling you are gambling.
$12.50 to $1,250. That is not an easy every few weeks. Take profits along
transition for a trader to stomach! the way. Just go slow and increase Ramping up size can be a daunting
You might think this is just an issue only as you feel comfortable. experience. For many, it is psycho-
for discretionary traders, since they logical or emotional torture, since
have to click the “buy 100 contracts” “Mr. Monkey—see no evil”—If you everything gets measured in dollars.
button. But algo traders can be just have a trading partner, have him or With my suggestions, though, you
as freaked out by the large dollar her mirror your trades or execute the should be able to find ways to handle
amounts. This could lead them trades for you, without revealing the increased trade size.
to temporarily turn off strategies, size they are trading. Maybe they
override their algos to exit profitable are not trading at all, maybe they
October 2021 • Technical Analysis of Stocks & Commodities • 37
TRADING ON MOMENTUM
In
profit from technical entry signals. pivots occur every single time this
this month’s column, For example, in Figure 1 (SPY), you pattern was observed in the past.
we’ll look at how can see that the 50 SMA line cor- Similarly, you can use these pivots
consistently the S&P as entry signals for new trades.
has pivoted off of the
50 simple moving The value comes from Step-by step action plan
average (SMA) line during the last seeing whether or not Here’s how you can start using this
six months. These signals can be strategy:
used as part of your trading plan, to
there is a consistent,
help you make effective trade deci- repeatable pattern Step 1: Look for uptrending charts
sions when you see similar patterns that can help you similar to those seen in Figure 1 and
in the charts of instruments that you make winning trades. be sure to plot the 50 SMA line.
are trading.
eSIGNAL
FIGURE 1: 50 SMA PIVOT SIGNALS THE SPY PIVOTED EVERY SINGLE TIME IT TOUCHED THE 50 SMA.
38 • October 2021 • Technical Analysis of Stocks & Commodities
TRADING ON MOMENTUM
https://store.traders.com
October 2021 • Technical Analysis of Stocks & Commodities • 39
A Trend-Following Approach
T
lower line of the envelope (blue) on the chart would cross
he directional cross strategy capitalizes on the lower band of the Bollinger Bands upwards. The cross
trend change. It seeks to give signals about happens just after the simple moving average (red) that is
potential new directional moves in the market. between the envelope lines crosses the Bollinger Bands
The strategy makes use of three tools: a simple below (see Figure 1).
moving average (SMA), price envelopes, and For a sell alert, the upper line of the envelope (blue)
Bollinger Bands. The combination of the three on the chart would cross the upper band of the Bollinger
tools produces the strategy’s signals. Bands downwards. The cross happens just after the simple
This strategy works in trending markets. A trending moving average (red) that is between the envelope lines
market is one that is ascending with higher highs and crosses the Bollinger Bands downwards (see Figure 2).
higher lows or descending with lower highs and lower
lows. To trade profitably in forex, you will want to be • Buy alert (Figure 1): The lower line of the envelope
able to ride the trend to acquire pips as the market moves should cross the lower band of the Bollinger Bands
in the direction of the trade entry. upwards. The cross occurs just after the SMA crosses
Profitable trading involves correctly determining where the Bollinger Bands below.
the market is disposed to go before it moves, and you • Sell alert (Figure 2): The upper line of the envelope
VLADUM/SHUTTERSTOCK
want to stay with the direction the market is heading. should cross the upper band of the Bollinger Bands
Trend-following tools can help. downwards. The cross happens just after the SMA
crosses the Bollinger Bands downwards.
40 • October 2021 • Technical Analysis of Stocks & Commodities
FOREX TRADING
TRADINGVIEW
and rash decisions by the
trader. That could eventually
FIGURE 1: BUY ALERT EXAMPLE. For a buy alert, the lower line of the envelope (blue) on the chart should
affect the trader’s psychology cross the lower band of the Bollinger Bands upwards. The cross happens just after the simple moving average
negatively, which would (red) that is between the envelope lines crosses the Bollinger Bands below.
lead to unhealthy trading.
This is why it’s important to
approach the market with a
consistent methodology to
navigate any asset’s natural
gyrations.
Note that ranging markets
aren’t a good fit for this
strategy. It is therefore
advisable for the trader to
stay out of the market when
consolidation is noticed. For
this strategy, a ranging market
would produce multiple FIGURE 2: SELL ALERT EXAMPLE. For a sell alert, the upper line of the envelope (blue) on the chart should
buys and sell signals within cross the upper band of the Bollinger Bands downwards. The cross happens just after the simple moving
a short period of trading. average (red) that is between the envelope lines crosses the Bollinger Bands downwards.
Each quick change in market
direction would not give a
trade enough of a chance to
run in one direction. Such
quick turnarounds would
eventually lead to loss. (See
Figure 3.)
Continued on page 56
42 • October 2021 • Technical Analysis of Stocks & Commodities
JOHN EHLERS MESA WORKSHOP, nologies are written as functions to wave and large market trends.
OCT. 18–22, 2021 simplify coding. In addition, Ehlers There is no cost for CMT members;
John Ehlers will hold his MESA will disclose MESA. $100 for nonmembers.
workshop on October 18–22, 2021 Code will be distributed prior to the cmtassociation.org
(Monday–Friday). It will be held workshop so that users will be able to
virtually as a live event over Webex. ask questions at the workshop. SLOPEALERTS FOR REAL-TIME
The workshop will run four hours a The workshop cost is $4,000. Trad- NOTIFICATION
day after market close, with open ers can view the full list of topics to The technical analysis website Slope
discussion on Friday. be covered and download a syllabus, Of Hope (slopeofhope.com) has
The workshop will teach algorith- as well as enroll in the workshop, at released its latest version of Slope-
mic trading techniques and how to the MESA Software website. Alerts, which allows a trader to be
apply digital signal processing and www.mesasoftware.com notified of specific events in the equity
a scientific approach to your trading, or cryptocurrency markets via email,
based on Ehlers’ decades of experi- 2021 ASIA PACIFIC SUMMIT, SMS text message, or the Telegram
ence and research. In the workshop, OCT. 2–3 (VIRTUAL) messaging system.
Ehlers, who is the author of Rocket The 2021 Asia Pacific Summit, To set up an alert, the trader sup-
Science For Traders, will provide all presented by CMT Association, plies the symbol to follow, the condi-
the indicators and trading strategies will take place virtually on October tion that constitutes an alert, and the
he has developed, including a very 2–3, 2021 (Saturday–Sunday). The trader’s choice of notification style.
fast WFO (walk-forward optimizer) conference will bring together prac- A variety of price information can
in EasyLanguage, and new strate- titioners to share their perspectives be monitored, including % change,
gies that demonstrate robust out-of- on today’s investment ecosystem. latest price, net change, day’s high,
sample performance. Over the two-day summit, partici- day’s low, 52-week high, and 52-
pants can tune into 12 sessions. Ses- week low. Any of these fields could
sions will be hosted by CMT vol- be compared to a variety of technical
unteers from Eastern counties and indicators, absolute numeric values,
regions including Australia, Japan, or other criteria.
ASEAN, Hong Kong and Greater Moreover, the user can take ad-
China, India, and the Middle East. vantage of chart-based alerts, which
lets the trader point at a given object
on a chart (such as a trendline) and
stipulate that an event related to
that drawn object (such as the price
Topics will include cycle theory, crossing above it or below it) should
effective data smoothing and filtering constitute an alert. This makes it
techniques, spectrum estimators, data convenient for visually oriented
correlation, correct position sizing, traders to lay out the rules for their
and predictions. notifications.
New this year are: MESA Predict; This year’s theme is “Finding Or-
an expanded discussion of FIR win- der In Chaos,” reflecting the second
dowing (see Ehlers’ article in the year of the pandemic as the world
September 2021 issue of S&C titled continues to seek some order amidst
“Windowing”); the critical nature of the chaos. Factors in today’s invest-
filter phase response; the FM nature ment ecosystem include cryptocur-
of market data (see Ehlers’ article rencies, central bank policy, inflation,
in the May 2021 issue of S&C); an and economic recovery. In various
FIR filter bridging cycle mode and sessions, Ayush Nagaraj will speak
trend mode; a universal indicator for about how his process is evolving
algorithmic trading; and a simple for systematic trading; Scott Carney slopeofhope.com
recipe for you to build your own will speak on harmonics; and Mark
robust strategies. The core tech- Galasiewski will speak on Elliott
October 2021 • Technical Analysis of Stocks & Commodities • 43
The Death Cross And The Golden Cross
T
by Stella Osoba, CMT the chart shows, the sideways movement, which contin-
ued until early 2020, resolved in a sharp downtrend. The
he death cross selloff eventually happened but not until well after the
When the 50-day moving average moves below signal happened.
the 200-day moving average, the technical pat- After forming a W bottom (see Figure 1), EBAY started
tern is often termed a death cross. The faster a massive trend reversal.
average moving below the slower average is
often a sign of an impending selloff. The golden cross
Figure 1 is a daily chart of eBay, Inc. (EBAY). You A golden cross is formed when the faster moving average
can see the death cross marked on the chart when the (blue line) moves above the slower moving average (green
shorter-term moving average (faster line/blue line) slips line). The signal is indicated on the chart in Figure 1. The
PESHKOVA/SHUTTERSTOCK
below the slow line (green line). Since moving averages moving averages are lagging indicators, so the signal did
are lagging indicators, we can see that the downtrend not coincide with the reversal. The averages did not cross
had already been in effect well before the death cross until the uptrend was well underway, nearer to about
signal, also after a large gap down in price. If the death halfway up its current move. However, using the golden
44 • October 2021 • Technical Analysis of Stocks & Commodities
TECHNICAL ANALYSIS
STOCKCHARTS.COM
the crosses as signals
for trades, then the
correct method would
have been to take both FIGURE 1: DAILY CHART FOR EBAY
trades depending on
the signals. With the first trade, the short trade, you ‡StockCharts.com
would have likely lost money unless you held on into ‡See Editorial Resource Index
the March decline. The second trade, which is the long
trade, would have been more successful if you could have
held on during the reactions and let the trade run until
a signal told you the uptrend was over. It is important to remember
that signals and chart
Stella Osoba is a trader and financial writer. She is a patterns are the map and
frequent contributor to Technical Analysis of Stocks not the territory.
& Commodities magazine and Traders.com Advantage
as well as other financial publications.
//@version=4 Notes:
// (C) 2021 John F. Ehlers The related article is copyrighted material. If you are
// TradingView Pine Script for PineCoders not a subscriber of Stocks & Commodities, please visit
// translated from EasyLanguage by Ricardo Santos www.traders.com.
study("TASC 2021.10 - MAD Moving Average Difference")
int i_shortLength = input(8, "Short Length") **********************************/
int i_longLength = input(23, "Long Length") var fpArray = new Array();
var bInit = false;
float shortAvg = sma(close, i_shortLength)
float longAvg = sma(close, i_longLength) function preMain() {
float mad = 100 * (shortAvg - longAvg) / longAvg setStudyTitle("Cycle/Trend Analytics");
setCursorLabelName(" ", 0);
plot(mad, "MAD", mad > 0 ? color.lime : color.red, 2) setCursorLabelName(" ", 1);
hline(0, "Zero") setPriceStudy(false);
setDefaultBarFgColor(Color.RGB(0x00,0x94,0xFF), 0);
These indicators are available on TradingView at: setDefaultBarFgColor(Color.green, 1);
setPlotType( PLOTTYPE_LINE , 0 );
tradingview.com/u/PineCodersTASC/#published-scripts setPlotType( PLOTTYPE_LINE , 1 );
—TradingView setDefaultBarThickness(4, 0);
https://www.tradingview.com setDefaultBarThickness(4, 1);
var x=0;
fpArray[x] = new FunctionParameter("CTMode", FunctionPa-
rameter.STRING);
with(fpArray[x++]){
addOption("Cycle");
F ESIGNAL: OCTOBER 2021 TRADERS’ TIPS CODE addOption("Trend");
For this month’s Traders’ Tip, we’ve provided the CycleTrend setDefault("Cycle");
Analytics.efs and Moving Average Difference Indicator. }
}
efs studies based on the article in this issue by John Ehlers,
“Cycle/Trend Analytics And The MAD Indicator.” These var bVersion = null;
studies, in combination, create a trend indicator that is simple var xClose = null;
var xColor2 = [];
and robust. var Osc = [];
The study contains formula parameters that may be con-
figured through the edit chart window (right-click on the function main(CTMode) {
if (bVersion == null) bVersion = verify();
chart and select “edit chart”). A sample chart is shown in
Figure 3.
To discuss this study or download a complete copy
of the formula code, please visit the EFS library dis-
cussion board forum under the forums link from the
support menu at www.esignal.com or visit our EFS
KnowledgeBase at www.esignal.com/support/kb/efs.
The eSignal formula script (EFS) is also available for
copying & pasting from this magazine’s website at
Traders.com in the Traders’ Tips section.
/**********************************
Provided By:
Copyright 2019 Intercontinental Exchange, Inc. All Rights
Reserved.
eSignal is a service mark and/or a registered service mark
of Intercontinental Exchange, Inc.
in the United States and/or other countries. This sample
eSignal Formula Script (EFS)
is for educational purposes only.
Intercontinental Exchange, Inc. reserves the right to modify
and overwrite this EFS file with each new release.
Description: FIGURE 3: ESIGNAL. Here is an example of the studies plotted on a daily chart of SPY.
if (CTMode == "Cycle") {
xPrice = efsInternal('Calc_Price'); Version: 1.00 08/12/2021
}
else xPrice = xClose; Formula Parameters: Default:
ShortLength 8
Color1 = 255; LongLength 23
Color3 = 0;
Notes:
for (i = 2; i <= 27; i++) { The related article is copyrighted material. If you are not a sub-
xColor2[i] = 306 - 10.2 * (i+3); scriber
} of Stocks & Commodities, please visit www.traders.com.
if (CTMode == "Cycle") {
Osc[0] = xPrice.getValue(0); var x=0;
Osc[1] = sma(5, xPrice, 0) - sma(30, xPrice, 0) fpArray[x] = new FunctionParameter("ShortLength", Function-
} Parameter.NUMBER);
with(fpArray[x++]){
return Osc; setLowerLimit(1);
} setDefault(8);
}
function Calc_Price(){ fpArray[x] = new FunctionParameter("LongLength", Function-
return (Math.sin(2 * Math.PI * getCurrentBarIndex() / (30))); Parameter.NUMBER);
} with(fpArray[x++]){
setLowerLimit(1);
function verify(){ setDefault(23);
var b = false; }
if (getBuildNumber() < 779){ }
drawTextAbsolute(5, 35, "This study requires version 10.6 or var bVersion = null;
later.", var xClose = null;
Color.white, Color.blue, Text.RELATIVETOBOTTOM|Text. var xMAD = null;
RELATIVETOLEFT|Text.BOLD|Text.LEFT,
null, 13, "error"); function main(ShortLength, LongLength) {
drawTextAbsolute(5, 20, "Click HERE to upgrade.@ if (bVersion == null) bVersion = verify();
URL=http://www.esignal.com/download/default.asp", if (bVersion == false) return;
Color.white, Color.blue, Text.RELATIVETOBOTTOM|Text.
RELATIVETOLEFT|Text.BOLD|Text.LEFT, if ( bInit == false ) {
null, 13, "upgrade"); xClose = close();
return b; addBand(0, PS_DASH, 1, Color.grey, 1);
} xMAD = efsInternal('Calc_MAD', xClose, ShortLength,
else LongLength);
b = true;
bInit = true;
return b; }
}
if (getCurrentBarCount() < LongLength || getCurrentBarCount()
< ShortLength) return;
/**********************************
Provided By:
Copyright 2019 Intercontinental Exchange, Inc. All Rights Re- return xMAD.getValue(0);
served. }
eSignal is a service mark and/or a registered service mark of
Intercontinental Exchange, Inc. function Calc_MAD(xClose, ShortLength, LongLength){
in the United States and/or other countries. This sample eSignal ret = 100 * (sma(ShortLength, xClose) - sma(LongLength,
Formula Script (EFS) xClose)) / sma(LongLength, xClose);
is for educational purposes only. return ret;
Intercontinental Exchange, Inc. reserves the right to modify and }
return b;
}
—Eric Lippert
eSignal, an Interactive Data company
800 779-6555, www.eSignal.com
System rules
• Enter when the MAD indicator crosses over its
zero line
• Exit when the MAD indicator crosses under its
zero line
Digital Edition — the complete magazine as PDF, Complete Digital Archive — from 1982 through
available to read in your browser or download to to the present. More than 17,000 pages of articles,
your device for offline viewing. You will still receive product reviews, charts, spreadsheets, and code.
the printed magazine unless you opt for a digital-
only subscription. Working Money — insight on how to minimize
your losses and maximize your profits while invest-
ing for maximum growth.
Shortlength is 8.
LongLength is 23.
MAD is 100*(simpleavg([Close], ShortLength) -
simpleavg([Close], LongLength)) /
simpleavg([Close], LongLength).
assetAdd("SPY","STOOQ:*");
asset("SPY");
plot("MAD",MAD(seriesC(),8,23),NEW,RED);
}
FIGURE 13: EXCEL, CYCLE MODE ANALYTIC. This displays the SMA oscillators with lengths from 5 to 30 using a 30-bar sine wave as input.
FIGURE 15: EXCEL, MAD INDICATOR. Here you can see the MAD indicator plotted using lengths 8 and 23.
FIGURE 16: EXCEL, MAD INDICATOR. This chart demonstrates the trend mode oscillator and MAD indicator.
to illustrate the steps are both informative and colorful. MAD indicator as the difference between two simple mov-
First, I’ll show a set of “price minus SMA-of-price” os- ing averages (Figure 15).
cillators where the length of the SMA varies from 5 to 30. A key point of the development of MAD is the choice of
Figure 13 shows the cycle mode and Figure 14 shows the lengths for the shorter and longer moving averages.
trend mode. Ehlers has a couple of comments on this topic:
Ehlers notes that when you substitute the close price as the
input, “the separation between the reddest line and the yel- • MAD becomes smoother as the length of the shorter
lowest line reflects the strength of the trend.” Further, “When moving average becomes longer.
the red line is on top, the trend is up and when the red line • If the dominant cycle of the input is known, then the
is on the bottom, the trend is down.” This leads us to Ehlers’ difference between the averaging lengths should be ap-
Inputs:
ShortLength(8),
INTERVIEW Montier, James [2009] Value Invest- “Fill The Gap,” monthly podcast,
Continued from page 36 ing, Wiley. https://cmtassociation.org/devel-
Lundgren David [1993]. “Stochastic opment/podcasts
Indicators And Trading,” Techni-
[2016]. Quality Investing: Owning cal Analysis of Stocks & Com-
The Best Companies For The Long modities, Volume 11: March.
Term, Harriman House. Lundgren, David, and Tyler Wood,
MUSTAPHA/DIRECTIONAL CROSS
Continued from page 42
Profitable trading involves
correctly determining where
we used for TradingView—the length should be set to the market is disposed to go
12. The source should be “close,” and the offset should before it moves.
be zero. The style should be set to your preference.
AN EFFECTIVE STRATEGY
The directional cross strategy can be an effective strat- FURTHER READING
egy in the right market environment with proper risk Mustapha, Azeez [2021]. “A Simple Forex Trend-Fol-
management in place. lowing Strategy,” Technical Analysis of StockS &
commoditieS, Volume 39: April.
Azeez Mustapha is an analyst at Instaforex Companies ‡MetaTrader ‡TradingView
Group and a blogger at Advfn.com, and as well as a ‡See Editorial Resource Index
freelance author for trading magazines. He is a trading
signals provider at some websites. He can be reached via
email at [email protected].
56 • October 2021 • Technical Analysis of Stocks & Commodities
Free Information From Advertisers
Advertiser Page Advertiser Page How to reach us
Brokerages Software For questions, address changes, or
Interactive Brokers 3 MetaStock 11 ordering information for Technical
ibkr.com/progateway MetaStock.com/traders-summit Analysis of Stocks & Commodities
magazine and its online publications:
Ninjatrader 5 Ninjatrader 5
Toll-free 800 832-4642
ninjatrader.com ninjatrader.com
(800-Technical) or:
TD Ameritrade 19 VectorVest 64 206 938-0570.
thinkorswim.com www.ProfitLockerPro.com/SC
Email us at:
Publications Websites [email protected].
Stocks & Commodities 2, 39, 51, 63 Stocks & Commodities 2, 39, 51, 63 Or write to us at:
Store.Traders.com, Traders.com Store.Traders.com, Traders.com 4757 California Ave. SW,
Seattle, WA 98116-4499.
Software
AbleSys 7
Do your magazines arrive tattered
www.ablesys.com/SCM
and torn? Polybagging of magazines
(domestic delivery) is available for
$6/year.
Single back issues from the current
Editorial Resource Index
year (subject to availability) are $8
The Zorro Project .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 AIQ.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 prepaid. Subscribers have access to
EasyLanguage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 TradersStudio. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 our digital archive of all past articles.
TradeStation.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 StockOdds.net. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 Individual articles can be purchased
Microsoft Excel. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 mystockodds.com.. . . . . . . . . . . . . . . . . . . . . . . . . . . 60
from the Online Store at our website,
Traders.com.
ProfitSource. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
OptionsAnalysis.com.. . . . . . . . . . . . . . . . . . . . . . . 29 Editorial feedback
We always want to know more about
eSignal.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
the needs of our readers: What kinds of
TradingView. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
articles would you like to see more of?
StockCharts.com.. . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 What do you find useful? Address your
Wealth-Lab.com. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 written questions and comments to edi-
NeuroShell Trader (Ward Systems Group) .. . . 49 [email protected] or to: Editor, Stocks
NinjaTrader. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 & Commodities, 4757 California Ave
Optuma. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 SW, Seattle, WA 98116-4499. Sorry, we
cannot perform research on individual
financial questions not related to this
For more information about our advertisers, go to Traders.com/reader where magazine and we cannot respond to
you will find the alphabetized list of this month’s advertisers. For reference, the all mail. Letters or emails containing
list is also printed above along with the corresponding page number for each ad. questions or information that other
Just follow the simple directions below and the advertisers will get your requests readers may enjoy or that relate to
the same day! our articles or technical analysis top-
ics may be published in our Letters to
Step 1: Go to Traders.com/reader and S&C column.
scroll through the list of our current month’s Join us on Facebook
advertisers.Click the box for each adver- at www.facebook.com/
tiser you’d like to hear from. At the bottom STOCKSandCOMMODITIES
of the list, click Continue when finished.
Follow us on Twitter
Step 2: Fill out your contact information @STOCKSandCOMM
and click Send Request. Your request will
then be sent to the advertisers you selected.
To receive information on the products and services listed in the Editorial
and Advertisers’ Indexes, go to: Traders.com/reader. These indexes are
And that’s it! published solely as a convenience. While every effort is made to maintain
accuracy, last-minute changes may result in omissions or errors.
T
rading liquidity is often over- very high volumes. The greatest number three-year period. Thus, all numbers in
looked as a key technical of dots indicates the greatest activity; this column have an equal dollar value.
measurement in the analysis futures with one or no dots show little Columns indicating percent margin
and selection of commodity activity and are therefore less desirable and effective percent margin provide
futures. The following explains how to for speculators. a helpful comparison for traders who
read the futures liquidity chart pub- Courtesy of CBOT wish to place their margin money ef-
lished by Technical Analysis of Stocks ficiently. The effective percent margin
& Commodities every month. is determined by dividing the margin
value ($) by the three-year price range of
Commodity futures contract dollar value, and then multiply-
The futures liquidity chart shown be- ing by one hundred.
low is intended to rank publicly traded
futures contracts in order of liquidity. Stocks
Relative contract liquidity is indicated Trading liquidity has a significant ef-
by the number of dots on the right-hand fect on the change in price of a secu-
side of the chart. rity. Theoretically, trading activity can
This liquidity ranking is produced by serve as a proxy for trading liquidity
multiplying contract point value times All futures listed are weighted equally and equals the total volume for a given
the maximum conceivable price motion under “contracts to trade for equal dol- period expressed as a percentage of the
(based on the past three years’ historical lar profit.” This is done by multiplying total number of shares outstanding. This
data) times the contract’s open interest contract value times the maximum pos- value can be thought of as the turnover
times a factor (usually 1 to 4) for low or sible change in price observed in the last rate of a firm’s shares outstanding.
www.MESASoftware.com
TRADERS'
RESOURCE
STATISTICAL BACKDROPS WITH time protecting their downside, but and US oil fund ETFs (XLE, XOP,
IF-THEN PARAMETERS from a trader’s perspective, we could USO) having substantial negative
The framework I will discuss here be long some historically better performance, as well as gold and
can apply to daily trading activity, performers and short the worst silver (GLD, SLV) and the senior and
swing trading, or investing. performers. junior miners (GDX, GDXJ).
There are many useful inputs to We can see some standouts to focus Having this map of the market prior
utilize for context, no matter which on long, such as the financials (XLF, to entering a season provides the
type of trading styles, methods, and KRE, KBE) and utilities (XLU). market participant with a significant
time durations you undertake. Many For the short side, commodities advantage over those who are not
market participants limit themselves don’t historically behave very well aware. Any form of tape reading,
by electing to use only what they are in October, with energy, exploration chart reading, or indicator reading
familiar with, have been introduced
to, or acquire through third-party October Average Performances in Percentage
means. Few truly do their own Market ETFs Sector SPDR ETFs
homework, remaining vigilant in
DIA SPY QQQ IWM XLB XLC XLE XLF XLI XLK XLP XLRE XLU XLV XLY
seeking out beneficial tools, research,
or data in order to evolve and expand 0.59 0.79 1.06 0.28 0.55 -1.40 -1.30 1.84 0.54 0.83 1.19 -1.60 2.80 0.49 0.13
their trading business or investing. Other ETFs
As I have mentioned in previous
articles, October is a volatile month XRT XOP USO TLT BND VNQ KRE KBE IWD IWF GLD GDX GDXJ SLV EEM
but not a down month on average for -0.61 -3.30 -4.90 -1.14 -0.27 0.86 2.80 2.70 0.87 0.54 -0.40 -2.0 -4.60 -0.56 1.20
the major market indices. Figure 1
FIGURE 1: STOCKODDS SEASONALITY ALMANAC. This shows historical average performance
shows a list of ETFs and their average of various ETFs for the month of October.
performances for October.
As we prepare for a market that may
be up as it has been in the past, we
would focus on the strongest stocks
in the strongest groups, sectors, and
industries. We should however run
the scenario of what it would look
like to have a negative catalyst (or
more than one) push the market down.
The world seems to throw plenty of
surprises at its inhabitants these days,
WWW.MYSTOCKODDS.COM
8999
1 year.........................
$
2 years.................... 149
$ 99
3 years.................... 199
$ 99
157%
$104.26
Profit
in only 4 months!
Purchase
Date
10/22/20
$40.60