You are on page 1of 64

THE TRADERS’ MAGAZINE SINCE 1982 www.traders.

com DECEMBER 2023

GROWTH OR VALUE?
An ETF rotation strategy 8

SEASONAL AND NON-


SEASONAL MARKETS
A trading strategy 18

BUILDING A TREND-
FOLLOWING SYSTEM
A crossover strategy 24

A DIRECTIONAL PATTERN
TO RIDE THE WAVE
The 2HL+ pattern 32

N-CAMA: COMBINING
ARTIFICIAL INTELLIGENCE
WITH A TIME-TESTED
INDICATOR
A dynamic trading model 36

INTERVIEW
Teresa Lo 42

DECEMBER 2023
Take Control of Your Trading with the
Professional Traders’ Starter Kit ™
Stocks & Commodities magazine

5
only

$
Digital Working
Edition Money

Article Code Digital


Optimized per month! * Archive
Trading Traders.com Advantage
The Foremost Collection For Traders 4. Traders.com Advantage, premium website content delivering
This massive collection packages the best tools for trading and real-world technical analysis to you! You’ll get five years of
investing in any market! charts, indicators, and “how-to” advice for specific markets,
1. Technical Analysis of Stocks & Commodities, the Traders’ currencies, stocks, and commodities; near-term opportunities;
Magazine™. The premier magazine for technical analysis. price movement; new techniques. Posted in real-time with an
You’ll get five years — 65 issues — including our annual archive of thousands of articles.
Bonus Issues with our Readers’ Choice Awards. 5. Working Money, the Investors’ Magazine online. You’ll get five
2. S&C Digital Edition. Recent complete issues available in their years of market observations; explanations of charts, markets,
entirety as PDFs for you to either download or read directly and market sectors; money management; and interviews with
in your browser. No more waiting for the mail to deliver your money people that will help you trade and invest wisely.
magazine! You will still receive the printed magazine unless 6. Article Code. Download or copy & paste code presented in
you opt for a digital-only subscription. past issues of Stocks & Commodities — no need to type
3. Complete Digital Archive. The complete archives as PDFs it out manually.
— more than 17,000 pages — from Technical Analysis of 7 . Optimized Trading. The optimized indicator values can be
Stocks & Commodities from 1982 through the present. used as starting points when trying to decide what values to
The articles can be read in your browser or download to input into your charting software. Search for a certain symbol
your computer (or any device with Internet or company or build your own portfolio.
access and the ability to read a PDF)!

ALSO RECEIVE A FREE✝ BOOK


WITH YOUR PTSK ORDER!
Charting The Stock Market: The Wyckoff
Method, edited by Jack K. Hutson, is yours
free✝ with your order for the Professional
Traders’ Starter Kit. www.Traders.com

Shipping and handling charges apply for foreign orders.
*Based on the 5-year subscription rate of $299.99. Shipping extra for foreign addresses.

Email: Circ@Traders.com • Phone: 206-938-0570 facebook.com/STOCKSandCOMMODITIES @STOCKSandCOMM


Can you imagine winning the
Stocks & Commodities Readers’ Choice
Award for 30 consecutive years?

Best Standalone
Analytical Software
in it’s price category
1993-2023

We can.

Get your free trial at MetaStock.com/TASC

This is neither a solicitation to buy or sell any type of financial instruments, nor intended as investment recommendations. All investment trading involves multiple substantial risks of monetary loss. Don’t
trade with money you can’t afford to lose. Trading is not suitable for everyone. Past performance, whether indicated by actual or hypothetical results or testimonials are no guarantee of future performance
or success. NO REPRESENTATION IS BEING MADE THAT ANY ACCOUNT WILL OR IS LIKELY TO ACHIEVE PROFITS OR LOSSES SIMILAR TO THOSE SHOWN. IN FACT, THERE ARE FREQUENTLY SHARP DIFFERENCES
BETWEEN HYPOTHETICAL PERFORMANCE RESULTS OR TESTIMONIALS AND THE ACTUAL RESULTS SUBSEQUENTLY ACHIEVED BY ANY PARTICULAR TRADING PROGRAM. Furthermore, all internal and external
computer and software systems are not fail-safe. Have contingency plans in place for such occasions. MetaStock assumes no responsibility for errors, inaccuracies, or omissions in these materials, nor shall
it be liable for any special, indirect, incidental, or consequential damages, including without limitation losses, lost revenue, or lost profits, that may result from reliance upon the information presented.
CONTENTS DECEMBER 2023, VOLUME 41 NUMBER 13

6 Futures For You


by Carley Garner
The Traders’ MagazineTM Here’s how the futures market
really works.
EDITORIAL
editor@traders.com FEATURE ARTICLE
TIPS
Editor in Chief Jack K. Hutson 8 Growth Or Value?
Production Manager Karen E. Wasserman by Markos Katsanos
Graphic Designer Wayne Shaw Choosing between growth or value artificial intelligence for prediction
Webmaster Han J. Kim stocks presents a challenging of tomorrow’s prices. Find out how
Contributing Editors John Ehlers, dilemma for every investor. Here it works.
Anthony W. Warren, PhD. is a strategy that will help you beat
Contributing Writers Thomas Bulkowski, Martin the market by rotating between INTERVIEW
Pring, Barbara Star, Markos Katsanos, Leslie N. Vanguard’s value and growth ETFs 42 A Conversation With Teresa Lo
Masonson according to market conditions. by Leslie N. Masonson
Teresa Lo has enjoyed a productive
17 Algo Q&A and successful career in the stock
OFFICE OF THE PUBLISHER by Kevin J. Davey market over several decades.
Publisher Jack K. Hutson Got a question about system or algo After working at brokerage firms,
Industrial Engineer Jason K. Hutson
trading? she began trading for herself,
Project Engineer Sean M. Moore
first in daytrading and then
ADVERTISING SALES 18 A Strategy For Trading Seasonal And swing trading before eventually
4757 California Ave. S.W.
Non-Seasonal Markets becoming more of an investor
Seattle, WA 98116-4499
206 660-8577 Fax 206 938-1307 by Perry J. Kaufman with a diversified portfolio. She
advert@traders.com If you can see a seasonal or non- founded several websites including
National Sales Manager Edward W. Schramm seasonal pattern, you may be able to IntelligentSpeculator (1998),
ESchramm@traders.com profit from it. Here is an example of trendVUE (2000), and InViVo
how to find and exploit patterns. Analytics (2007). She joined
CIRCULATION forces with IQ Chart, which was
Subscription & Order Service 1 800 832-4642
1 206 938-0570 Fax 1 206 938-1307 24 Building A Trend-Following System absorbed by Infospace in 2001. As
circ@traders.com by Dillon Figueredo a TradeStation user since 1997, she
developed her own suite of trading
Subscription Manager Sean M. Moore Does filtering trade entries with a
tools and made them available by
volume flow indicator improve the
WEBSITE subscription. We interviewed her
performance of a moving average
http://www.traders.com about her trading career, resources
crossover system when used in a
Staff members may be emailed using first initial at her website, and her pursuits in
trend-following strategy? Here’s a
plus last name plus @traders.com educating traders.
test to find out.

Author­i­za­tion to pho­to­copy items for inter­nal or per­sonal 30 Market Rap 60 Explore Your Options
by Jay Kaeppel
by Emilio Tomasini
use, or the inter­nal or per­sonal use of spe­cific cli­ents, is granted
by Tech­ni­cal Anal­ys­ is, Inc. for users reg­is­tered with the Cop­y­ Got a question about options?
right Clear­ance Cen­ter (CCC) Transactional Reporting Serv­ice, “Unserious” thoughts on serious
pro­vided that the base fee of $1.00 per copy, plus 50¢ per topics in finance.
page is paid directly to CCC, 222 Rosewood Drive, Danvers, DEPARTMENTS
MA 01923. Online: http://www.copyright.com. For those
52 Traders’ Tips
organ­i­za­tions that have been granted a photocopy license
by CCC, a sep­a­rate sys­tem of pay­ment has been arranged.
32 A Directional Pattern To Ride 57 Advertisers’ Index
The fee code for users of the Transactional Reporting Serv­ice The Wave 57 Editorial Resource Index
is: 0738-3355/2023 $1.00 + 0.50. by Andrea Unger 58 Futures Liquidity
Sub­scrip­tions: USA: one year (13 issues) $89.99;
Magazines shipped outside the US require additional post­
Here is a price pattern you can 59 Classified Advertising
use with a trading strategy to filter 59 Traders’ Resource
age as follows: Canada, US$15 per year; Europe, US$25.50
per year; all other countries US$39 per year. Sin­gle copies of trades and ride a price wave. We’ll
most past issues from the cur­rent year are avail­a­ble pre­paid
at $8 per copy. Prior years are avail­a­ble in book format (with­
explain the logic and show step-by-
out ads) or digitally from www.traders.com. USA funds only. step how to do it.
Washington state res­i­dents add sales tax for their locale.
VISA, MasterCard, AmEx, and Discover accepted. Subscrip­
tion orders: 1 800 832-4642 or 1 206 938-0570. 36 N-CAMA: Combining Artificial
Technical Analysis of Stocks & Commodities™, The Intelligence With A Time-Tested
Traders’ Magazine™, is prepared from information believed
to be reliable but not guaranteed by us with­out further Technical Analysis Indicator
verification, and does not purport to be complete. Opinions by Jacinta Chan, PhD
expressed are subject to revision without notification. We
are not offer­ing to buy or sell securities or commodities
Traditional technical analysis
discussed. Technical Anal­ysis Inc., one or more of its officers, tools can benefit from the aid
and authors may have a position in the securities discussed of machine learning. Here, we
herein.
The names of products and services presented in this
introduce a dynamic trading model
magazine are used only in an editorial fashion, and to the called the N-CAMA. It combines n Cover: wan wei/shutterstock
benefit of the trademark owner, with no intention of infring­ a time-tested tool—the adjustable This article is the basis for
TIPS
ing on trademark rights.
moving average—with the power of Traders’ Tips this month.

Copyright © 2023 Technical Analysis, Inc. All rights reserved. Information in this publication must not be stored or reproduced in any form without written permission from the publisher. Technical Analysis of Stocks & Commodities™
(ISSN 0738–3355) is published monthly with a Bonus Issue in March for $89.99 per year by Technical Analysis, Inc., 4757 California Ave. S.W., Seattle, WA 98116–4499. Periodicals postage paid at Seattle, WA and at additional mailing
offices. Postmaster: Send address changes to Technical Analysis of Stocks & Commodities™ 4757 California Ave. S.W., Seattle, WA 98116–4499 U.S.A. Printed in the U.S.A.

4 • December 2023 • Technical Analysis of Stocks & Commodities


Traders take many paths to reach their destination.
Can your platform get you there?

Search apps and services to personalize the


NinjaTrader platform to meet your requirements.
Indicators, automated strategies, free tools & more.

Explore now at ninjatraderecosystem.com

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 info@carleygarnertrading.com or via www.DeCarleyTrading.com.
Selected questions will appear in a future issue of S&C.
Carley Garner

CRUDE OIL OPTIONS NOW EXPIRE search for “protection functionality pm Eastern, to the distance between
THREE TIMES PER WEEK; SHOULD for market and stop orders.” the strike price of the long put option
RETAIL TRADERS CONSIDER THEM On the morning of October 4th, and the futures entry price, plus the
FOR SPECULATION? (PART 3 OF 3) crude oil futures were trading about premium paid for the put. Assuming it
Last month, we discussed the prac- $3.00 below the previous day’s close was possible to execute the trade at the
tice of using long calls and puts with at $86.00 per barrel. This price might clean and simple figures noted (long
proximal expirations (a day or two have seemed like a bargain after the the futures contract from $86.00 even
away rather than a month or two) to previous week’s high closer to the and long an $85.00 put option from
speculate on short-term price moves. mid-$90.00s. However, speculators $0.50), the trader would be on the
This month, we will talk about us- looking for a bounce, or something hook for a maximum potential loss
ing long weekly expiration calls and more, might have been hesitant of $1.50, or $1,500. Not necessarily
puts to limit the price risk of trading to catch a falling knife via a long chump change, but not unlimited risk,
futures. futures contract due to the unlimited either. This protection is absolute
Buying weekly options against until the option expires. Unlike stop-
futures contracts is a risk management Unlike stop-loss loss slippage and malfunctioning
tool that replaces the more common markets that expose a trader to far
stop-loss order, which can be fraught slippage and more downside risk than expected,
with complications such as premature malfunctioning this strategy is fail-safe. If oil goes
stop-outs, slippage, or even failure to markets that expose to zero or lower before expiration, the
fill if liquidity dries up. As a reminder, a trader to far more protection is in place and working as
stop-losses are not guaranteed to expected. Even more important is the
be filled at the stated price; they
downside risk than reality that the trade is still alive. If
become market orders once the price expected, this strategy oil drops to $80.00, the trader will
is reached and are, therefore, subject is fail-safe. be staring at a large loss, but there
to slippage. Further, the exchange has is hope as long as there is time to
a mechanism that essentially turns a risk that comes with trading futures option expiration. Anything can
stop order into a stop-limit order; this outright and the snags that come happen in a day or two; this strategy
means if the ability to fill the order with stop-loss orders. A better way gives traders far more lasting power
within the exchange’s reasonable to play the upside, with the quick and than simply buying a futures contract
price window, the stop order becomes intense profit potential long futures and placing a stop-loss order. Once
a limit order at the stated price. This contracts deliver but with absolutely a trader is stopped out, it is difficult
order might or might not ever be limited risk, would be to go long a to get back into the market without
filled, so it is possible the stop-loss futures contract at or near $86.00 chaos, losses, or both.
order a trader intended to protect their and then purchase a Friday weekly Long options with proximal
position from runaway losses doesn’t expiration (2.5 days) $85.00 put for expiration dates can be used to
limit or even mitigate loss at all. If 50 cents or $500. Doing so limits the hedge day trades or swing trades
you are interested in the logistics and risk to the trader, at least until option (speculations intended to be held
details, visit the CME website and expiration on Friday afternoon at 2:30 for a few days but not beyond the
6 • December 2023 • Technical Analysis of Stocks & Commodities
Futures
ABLETREND 8.0
the Major Upgrade Since 2007
Options are Featuring Award-Winning Signals
depreciating assets;
they are nice to have
when needed but
also work against a
trader in a sideways or
favorable market.
expiration of the protective option).
I’ve pointed out the advantages of
this approach, but it is my job to
ensure that the disadvantages are
equally represented. The primary
drag of using a long option to hedge a
futures position is time value erosion.
Options are depreciating assets; they
are nice to have when needed but also
work against a trader in a sideways or Multi data source support Enhanced AutoScan
favorable market. Using the previous Multiple monitors support 30+ workspaces simultaneous
example, the trader would only be Ichimoku Cloud 40+ charts in one workspace
profitable if the gains from the long Oscillator Blue/Red confirmation Portfolio Performance module
futures contract surpass the losses
on the long put option. If held to
expiration, the futures price would Traders Rave Over AbleTrend
need to be at $86.50 to break even
because the 50 cents in premium
paid for the $85.00 put option must
be overcome. A futures trader using SINCE 1994
ABLETREND 7.0 COLLECTED BY
a stop-loss order would be profitable
at $86.01, not $86.51. Similarly, if the
futures price on Friday afternoon is
$86.00, the trader using a long put
to limit risk absolutely would be
suffering a loss of $500 (50 cents in
premium x $10). Assuming he wasn’t
stopped out prematurely at some
point between entry of the trade and
Friday afternoon, the futures trader
would be breaking even at $86.00.
In truth, there isn’t a perfect
approach to trading. If there were,
it would be easy…and everyone TEST DRIVE THE LATEST SIGNALS
would do it. Each trader must find
what works best for them, based
on their personality, risk tolerance,
and trading capital, and proceed
THESE RESULTS ARE BASED ON SIMULATED OR HYPOTHETICAL PERFORMANCE RESULTS THAT HAVE CERTAIN INHERENT LIMITATIONS. UNLIKE THE RESULTS
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
accordingly. 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.

December 2023 • Technical Analysis of Stocks & Commodities • 7


ETF INVESTING

An ETF Rotation Strategy

Growth Or Value?
Choosing between growth or value stocks presents Generally, growth stocks tend to outperform in bull
a challenging dilemma for every investor. Here is a markets when investors are optimistic about the
strategy that will help you beat the market by rotating economy and earnings growth. On the other hand,
between Vanguard’s value and growth ETFs accord- value stocks tend to outperform, or at least have less
ing to market conditions. risk, during bear markets or periods of rising interest
rates when investors are looking for steady earnings

V
alue and growth investing are two completely and dividends.
different investing styles. Growth investing For example, the largest growth ETF, Vanguard
involves investing in companies that have Growth (VUG), had gains of 75% in the 2020–2021
high potential for future growth, even if bull market when growth stocks were in favor (Figure
they are trading at a high price relative to their cur- 1). In contrast, Vanguard Value (VTV) had much
rent earnings. smaller gains of 22.7% during that period. But when
Some of the best stocks that have outperformed the bear market hit in 2022, VTV declined only 4.7%
the market recently belong to growth industries such versus VUG’s 25% sharp drop.
as artificial intelligence (AI), electric vehicles, cloud It is therefore important to have a versatile portfolio
computing, cybersecurity, etc. and switch between growth and value stocks according
Value investing, on the other hand, involves in- to market conditions in order to minimize risk and
vesting in companies that are currently trading at a maximize returns over the long term.
discount relative to their intrinsic value, even if they It is easy to see when value or growth are outper-
are not necessarily growing as quickly as growth forming in retrospect, but how can you figure out
companies. Both investing styles have advantages the right time for switching in real time? In the next
and disadvantages. Growth stocks have more risk and sections, I will present a strategy that will help you
volatility because it is notoriously difficult to price avoid having to make any subjective decisions and
them correctly, especially when they have little or which, by the way, beat the market by a wide margin
no current earnings. Value stocks, however, can also by trading value and growth ETFs.
be risky and you should try to avoid the
so-called “value traps” where stocks may
look cheap but they can become even
cheaper because of stagnant growth or
deteriorating fundamentals.
The performance of growth or value
stocks can vary widely from year to
year and can depend on a variety of
factors, including the overall state of
WAN WEI/SHUTTERSTOCK

the economy, interest rates, and investor


sentiment. In some years, growth stocks
TC2000

may outperform value stocks, while in FIGURE 1: GROWTH VS. VALUE (VANGUARD). This daily chart shows the Vanguard Growth ETF (VUG)
other years, the opposite may be true. in red with the Vanguard Value ETF (VTV) superimposed in black, from 3/1/2020 until 7/21/2023.

by Markos Katsanos
December 2023 • Technical Analysis of Stocks & Commodities • 9
But f i r st, I Ticker Name
AUM Expense Average P/E
Yield
Total Annualized Return
thought it would (billions) Ratio Volume Ratio 3-Year 5-Year 10-Year 15-Year
be helpful to VUG Vanguard Growth $95.3 0.04% 918,000 35.5 0.59% 10.7% 14.1% 14.5% 11.8%

start with some iShares S&P 500

DATA SOURCES: ETF.COM, ETFDB.COM, FINANCE.YAHOO.COM


IVW $34.0 0.18% 1,734,000 21.9 0.87% 9.9% 12.2% 13.9% 11.6%

Growth
Growth
i n for mation VBK
Vanguard Small-
$14.8 0.07% 166,000 117.0 0.66% 4.7% 5.9% 8.7% 9.5%
about value and Cap Growth

growth ETFs.
iShares Russell
IWO $10.5 0.23% 365,000 37.6 0.77% 5.7% 3.9% 8.4% 9.0%
2000 Growth
VTV Vanguard Value $101.8 0.04% 2,093,000 15.2 2.53% 15.2% 9.3% 10.2% 9.2%
ETF IVE
iShares S&P 500
$26.3 0.18% 559,000 20.5 1.81% 16.5% 10.5% 10.0% 8.4%
statistics Value
Value

Vanguard Small-
In the table in VBR Cap Value
$26.2
0.07% 396,000 12.7 2.14% 19.4% 6.6% 9.0% 9.5%
Figure 2 you IWN iShares Russell
$11.9
0.23% 1,647,000 22.6 2.15% 17.4% 4.0% 6.9% 7.8%
can see some 2000 Value

useful statistics
SPY SPDR S&P 500 $426.6
0.09% 79,124,000 21.2 1.44% 13.4% 12.0% 12.4% 10.3%

for value and FIGURE 2: GROWTH VS. VALUE (VANGUARD & ISHARES). This table shows statistics for eight ETFs (four value ETFs and four growth ETFs
from Vanguard and iShares by Blackrock) plus SPY. Assets under management (AUM) and average three-month volume are as of 7/21/2023.
growth ETFs
In the bottom line you can see, for comparison purposes, the corresponding SPY ETF statistics. In the last four columns you can see the 3-,
from Vanguard 5-, 10-, and 15-year total (including dividends and distributions) annualized performance. Large-cap growth ETFs outperformed both value
and Blackrock. and small-cap growth ETFs during all time segments except the most recent 3-year period.
As you can see,
large-cap growth ETFs (Vanguard’s VUG and Blackrock’s In Figures 3 & 4 you can see the top 10 holdings of each
iShares IVW) outperformed both value and small-cap ETF and their P/E ratios.
growth ETFs during all time segments except for the most I was surprised to see that 7 out of 10 stocks of Black-
recent three-year period, most probably because of the rock’s iShares Value ETF (IVE) top 10 holdings (which
Fed’s 2022–2023 interest rate hikes induced bear market, includes AMZN, CRM, and NFLX) had a P/E higher
which impacted mainly growth stocks. This is because than 37, so perhaps it would make more sense to classify
growth stocks are more vulnerable to rising interest rates, them as growth rather than value stocks. This motivated
as these companies may have high levels of debt and tend me to check on the method that each fund uses to select
to have longer-term cash flow horizons than do value the ETF’s holdings.
stocks, making them more susceptible to rising borrow- The Vanguard ETFs track the Center For Research In
ing costs. Another noteworthy statistic is that large-cap Security Prices LLC (CRSP) Indexes, while the iShares
growth ETFs outperformed the corresponding small-cap ETFs use the S&P value and growth indexes. The CRSP,
ETFs by a wide margin. which is a research center at the University of Chicago
There was no clear winner, however, in the value ETF Booth School of Business, classifies, according to its
group. website, growth securities using six factors (see “Further

VUG IVW VTV IVE


Symbol % Assets P/E Symbol % Assets P/E Symbol % Assets P/E Symbol % Assets P/E
AAPL 13.8% 32.7 AAPL 14.2% 32.7 BRK.B 3.66% 102.8 MSFT 6.23% 37.4
MSFT 12.1% 37.4 MSFT 7.3% 37.4 UNH 2.63% 22.8 META 3.72% 37.8
AMZN 5.4% 306.7 NVDA 5.2% 232.4 XOM 2.55% 7.1 AMZN 3.68% 306.7
NVDA 4.7% 232.4 GOOGL 3.5% 27.6 JNJ 2.53% 34.7 BRK.B 3.6% 102.8
GOOGL 3.4% 27.6 TSLA 3.5% 87.4 JPM 2.50% 10.2 JPM 2.5% 10.2
TSLA 3.4% 87.4 GOOG 3.1% 27.8 AVGO 2.13% 28.3 WMT 1.3% 38.3
META 3.0% 37.8 AMZN 2.7% 306.7 PG 2.10% 26.7 CSCO 1.2% 19.0
GOOG 2.9% 27.8 UNH 2.2% 22.8 MRK 1.72% 21.3 CRM 1.2% 609.9
LLY 1.9% 73.0 XOM 2.2% 7.1 CVX 1.67% 8.7 BAC 1.2% 9.4
V 1.8% 32.2 V 1.9% 32.2 PEP 1.50% 33.4 NFLX 1.2% 50.0
Average 89.5 81.4 Average 29.6 122.1
FIGURE 3: ETF TOP HOLDINGS, GROWTH. The top 10 stock holdings as of FIGURE 4: ETF TOP HOLDINGS, VALUE. The top 10 stock holdings as of 7/21/2023
7/21/2023 are shown for Vanguard and iShares growth ETFs VUG and IVW. are shown for Vanguard and iShares value ETFs VTV and IVE. The high average P/E
ratio of the iShares IVE ETF (last column) is a little unusual for a value ETF.
10 • December 2023 • Technical Analysis of Stocks & Commodities
IBKR Clients
Have Access to the
Lowest Margin Rates

US Margin Loan Rates Comparison - USD 25K

E-Trade 13.70%

Fidelity 13.08%

Interactive Brokers 6.83% 1

Schwab 13.08%

Vanguard 13.25%

See website for full comparison and lower rates

The best informed investors choose Interactive Brokers

ibkr.com/iwantmore

Trading on margin is only for sophisticated investors with


high risk tolerance. You may lose more than your initial investment.
Member - NYSE, FINRA, SIPC – [1] Margin Loan rate as of 9/12/2023. IB calculates the interest charged on margin loans using the applicable rates
for each interest rate tier listed on its website. Rates shown apply to IBKR Pro clients only. Rates subject to change. Restrictions apply. For additional
information on margin loan rates, see ibkr.com/interest.
10-IB23-1655CH1650
reading” at end):

• Future long-term growth in earnings


per share (EPS)
• Future short-term growth in EPS
• 3-year historical growth in EPS
• 3-year historical growth in sales per
share
• Current investment-to-assets ratio
• Return on assets

and value stocks according to:

• Book to price
• Forward earnings to price
• Historic earnings to price
• Dividend-to-price ratio
• Sales-to-price ratio

On the other hand, the S&P value index FIGURE 5: VANGUARD GROWTH VS. VALUE ETFS, WEEKLY. This displays a weekly chart of the
uses only three factors to classify value VTV and VUG ETFs during the last five years from 2018 until August 2023. The 15-week VUG and VTV
RSMK indicators are plotted below the price pane and the 30-week VFI (applied only to VUG) is in the
stocks: book value to price ratio, earnings
bottom window. Positive values are plotted in green and negative in red. Notice that the VFI crossed
to price, and sales to price ratio, and the under zero in January 2022 and remained in negative territory until January 2023. The VFI applied on
following three factors to classify growth: the VTV (not shown) was negative only half the time from June until November 2022. As you can see
three-year net change in earnings per share by the blue vertical lines under the buy signals, the corresponding RS indicator difference triggered
over current price, three-year sales per share the switching from the weaker to the stronger ETF.
growth rate, and momentum (12-month %
price change). Another reason for the disparity is that Growth and value switching system:
the last criterion is technical and not fundamental. The Trading rules
VUG’s better performance provides evidence that the As I mentioned above, investing is dynamic, and different
CRSP six-factor method for selecting growth stocks is market conditions call for different strategies that favor
rather better. either growth or value stocks.
As you can see in Figure 3, both growth selection What’s an investor to do? Here, I will present a momen-
methods resulted in predominance of mega-cap stocks tum trading system that rotates between the two. My main
like Apple, Microsoft, and Amazon. This wasn’t the case objective in designing this system was to beat the broader
with Vanguard’s Value ETF (VTV), where the top three market and minimize drawdowns by switching between
holdings had a market cap only 25% of the correspond- Vanguard’s value and growth ETFs (VUG and VTV).
ing top three VUG holdings. You might have noticed in The strategy is pretty simple. In order to select the best
Figures 3 & 4 that there are some common names in both ETF that was more likely to outperform, I decided to use
growth and value ETF. This is because, even though the relative strength.
investing styles are perceived as being in opposition to The classic relative strength indicator (RS), which is
each other, there are some similarities between the two
types of stocks. Warren Buffett, the most famous pro-
ponent of value investing, wrote in his 1992 Berkshire
Hathaway letter to shareholders: “In our opinion, these It is easy to see when value or
two approaches are joined at the hip: Growth is always growth are outperforming in
a component of the calculation of value, constituting a retrospect, but how can you
variable whose importance can range from negligible to figure out the right time for
enormous.”
switching in real time?

12 • December 2023 • Technical Analysis of Stocks & Commodities


Buy & Hold RS Switching System 5), value stocks outperformed so the system
System
VUG VTV SPY 19 year 10 year 5 year switched from VUG to VTV. This trade,
Net Profit $519,400 $205,300 $313,600 $1,093,200 $330,000 $156,600 however, resulted in heavy losses as VTV
Buy & Hold reversed direction and followed the general
$313,600 $313,600 $313,600 $313,600 $164,400 $57,070
Profit (SPY) market’s downward direction. In using this
Comp. Annual
Return (CAR)
10.1% 6.1% 7.8% 13.9% 15.7% 20.8% method, it is important to keep in mind that
Total Number
1 1 1 30 15 8
relative strength is relative, not absolute.
of Trades One ETF can therefore be outperforming
Percent
Profitable
83.3% 80.0% 75.0% the S&P 500 or another ETF but still be
Profit Factor 19.20 20.85 14.04 losing money.
Avg. Win/Avg.
3.85 5.21 4.68
In order to limit losses, I decided to add
Loss (Payoff) a stop-loss. This reduced drawdowns but
Max System
Drawdown
−50.5% −60.7% −56.5% −15.0% −15.0% −15.5% increased the number of trades, thus in-
CAR/MaxDD 0.20 0.10 0.14 0.93 1.05 1.34 creasing transaction costs and capital gains.
Ulcer Index 13.14 17.30 14.70 3.34 3.06 4.31 Examining the trades on the VTV chart, I
% in the market 100% 100% 100% 68% 75% 79% noticed that the redundant extra trades oc-
From 8/11/04 8/11/04 8/11/04 8/11/04 8/11/13 8/11/18 curred mainly during bear markets, when
To 8/11/23 8/11/23 8/11/23 8/11/23 8/11/23 8/11/23 a signal to buy the stronger ETF followed
Symbols VUG VTV SPY VUG,VTV VUG,VTV VUG,VTV immediately after the stop-loss exit while
FIGURE 6: RS SWITCHING SYSTEM VS. BUY & HOLD. This shows the system’s performance during VTV was outperforming VUG but was still
the last 5-, 10-, and 19-year periods until 8/11/2023. The system outperformed buy & hold by a wide in a downtrend.
margin, producing 2 to 3.5 times more profits with substantially less risk. CAR/MaxDD (the 9th line in There was no other option, therefore,
the table) is the compound annual % return divided by the maximum system % drawdown. The Ulcer but to block trades during bear markets or
index (in the 10th line) measures risk—the lower the better. It is calculated by dividing the square root protracted downtrends. To do this, I tried
of the sum of squared drawdowns by the drawdown duration (number of bars). various indicators or conditions until I
noticed that the VFI indicator was nega-
simply the ratio of two equities (such as VUG/VTV) is tive during the entire 2008 and 2022 bear markets (see
a useful indicator when plotted on a chart but presents a Figure 5), so I decided to use this one. The volume flow
serious problem if you want to use it in a trading system: indicator (VFI) is a custom money flow indicator that I
Indicator values are meaningless and the technician has to first introduced in this magazine (see “Further reading”).
use other indicators (like a moving average on the RS line) It is a long-term indicator and will detect money flowing
in order to generate trading signals. I decided, therefore, to in or out of a stock during the last six months. Generally
use my custom relative strength indicator, first introduced in positive values are bullish and negative are bearish, but
this magazine (see “Further reading” at end). This indicator the indicator direction is also important.
compares the relative performance of an equity versus an This condition reduced the drawdown and eliminated
index (such as the S&P 500 or SPY) over a specific time some whipsaw trades during bear markets but did not
period. In this case, I used the 15-week relative strength necessarily improve the profitability, mainly because a
of both VUG and VTV. The trading signals are described couple of entry signals at the bottom of the bear market
in more detail below. were a little late to materialize.
The system thus selected the best-performing ETF dur- Thus, using the conditions described above, I came up
ing the last three-month period, with the expectation that with the following rules:
it will to do so in the near future.
When it comes to designing any system, even though Buy rules
the premise is sound, backtesting can be a valuable tool • Relative strength. In order to select the best-perform-
in identifying any weaknesses or failures. ing ETF, I used my 15-week relative strength indicator
In this case, backtesting revealed that even though the (RSMK) relative to the index (SPY) for both VUG
strategy managed to outperform the passive buy & hold and VTV and the system bought the ETF with the
strategy, it suffered heavy losses and large drawdowns higher relative strength value. In certain instances,
mainly during the 2008 and 2022 bear markets when both however, when both relative strength levels were
VUG and VTV were down sharply but not at the same similar, this condition produced whipsaw trades. To
time. For example, in the beginning of 2022 (see Figure deal with this, I blocked signals when the stronger
December 2023 • Technical Analysis of Stocks & Commodities • 13
relative strength was be- Ex. Cum.
Symbol Date Price Ex. date % chg Profit # bars MAE MFE
low its 20-week moving Price Profit
average. VTV 08/23/13 70.1 09/06/13 69.29 −1.16% −$1,184 −$1,184 3 −5.65% 0.14%

• Bear market filter. All VUG 09/06/13 82.67 04/04/14 92.7 12.13% $11,962 $10,778 31 −1.73% 16.80%

trades were blocked if the VTV 04/04/14 78.04 07/11/14 81.3 4.18% $4,598 $15,376 15 −2.59% 5.07%

30-week VFI indicator VUG 07/11/14 99.15 06/19/15 109.61 10.55% $12,142 $27,518 50 −7.41% 11.73%

was negative, indicating VTV 12/31/15 81.52 05/27/16 84.66 3.85% $4,880 $32,397 22 −11.09% 4.39%
that money was flowing VUG 08/05/16 112.84 11/11/16 109.53 −2.93% −$3,906 $28,491 15 −5.29% 0.72%
out of the ETF. VUG 02/24/17 120.61 12/15/17 141.54 17.35% $22,269 $50,760 43 −0.99% 17.35%
VUG 01/19/18 149.15 10/05/18 157.26 5.44% $8,171 $58,931 38 −9.76% 8.64%
Sell rules VUG 03/01/19 153.44 11/08/19 172.33 12.31% $19,530 $78,462 37 −3.09% 12.70%
• Relative strength. The VTV 11/08/19 116.7 01/03/20 119.48 2.38% $4,220 $82,682 9 −1.17% 3.70%
trade was closed if the VUG 03/20/20 139.61 12/04/20 247 76.92% $140,440 $223,122 38 −4.33% 77.48%
relative strength of the VTV 12/04/20 119.15 06/25/21 137.86 15.70% $50,669 $273,790 30 −3.18% 19.41%
current open trade ETF VTV 12/31/21 147.11 08/12/22 142.59 −3.07% −$11,532 $262,259 33 −13.56% 3.25%
was below the relative VTV 11/18/22 142.38 02/10/23 143.75 0.96% $3,434 $265,693 13 −3.61% 3.32%
strength of the other one VUG 02/10/23 238.13 08/11/23 280.01 17.59% $64,255 $329,948 28 −5.93% 23.91%
for two consecutive weeks FIGURE 7: 10-YEAR BACKTEST FOR RS SWITCHING SYSTEM. This shows the list of trades signaled in a 10-year
and was also below its 20- simulation test from 2013 to 2023. The maximum drawdown that occurred in 2022 was due to a long trade in VTV at
week moving average. the end of 2021.
• Stop-loss. The trade was
closed if the ETF was down 7% or more below the respectively, with considerably less risk, thus producing
previous week’s closing price. This stop was deployed a smoother equity curve. The maximum drawdown was
only in bear markets when the ETF was below its only 15% versus VUG’s 50% and VTV’s 60%. It is inter-
40-week (200-day) moving average. esting that the VUG buy & hold test outperformed both
VTV and SPY, producing more than double the VTV net
In the sidebar titled “Code For Indicators And ETF profit and 1.6 times the SPY profit. Not surprisingly, the
Rotation Strategy, In Amibroker Formula Language,” I maximum drawdown (50–60%) of all buy & hold tests
provide a code listing for my switching system as well as occurred during the 2008 bear market.
for the indicators I used in the system (that is, my custom The worst drawdown of the system occurred in June
relative strength indicator (RSMK) and the volume flow 2022 because of a VTV long trade on 12/31/2021 (see
indicator). Figures 5 and 7), a few days before the start of the 2022
bear market. This trade was triggered because of VTV’s
Testing method superior relative strength compared to VUG. The trade
The VUG and VTV ETF started trading in February 2004 was marginally profitable for the first four months until
so for the current simulation, I used historical data for the April 2022, when VTV reversed direction and followed
last 19-year period until 8/11/2023. the general market’s summer slide.
In order to compare the system objectively with the buy In the chart in Figure 5 you can see the signals produced
& hold results, I specified the trade size as a percent of by the system during the last five-year period. Notice that
equity. For the sake of simplicity, dividends are not ac- there were no VUG trades during the 2022 bear market,
counted for in the performance. Typical current discount as the VFI was negative during the entire period. The
commission rates (0.01 per share) were used throughout VFI also managed to block all trades during the 2008
the test and the initial investment amount was $100,000.
This is a weekly trading system so I used weekly bars.
History shows that the stock market
System evaluation goes through cycles of varying
In the table in Figure 6 you can see the test simulation length that favor either growth or
results of the 5-, 10-, and 19-year backtests.
The relative strength system managed to beat all buy
value stocks, and this calls for an
& hold strategies easily, producing five, three, and two appropriate rotation strategy.
times more profits than holding VTV, SPY, and VUG,
14 • December 2023 • Technical Analysis of Stocks & Commodities
CODE FOR INDICATORS AND ETF ROTATION STRATEGY, IN AMIBROKER FORMULA LANGUAGE
RELATIVE STRENGTH INDICATOR (RSMK)
/******************************************************************** SetBacktestMode( backtestRegular );
CUSTOM RELATIVE STRENGTH INDICATOR (RSMK) PosQty = 1; SetOption( "MaxOpenPositions", PosQty );
Provided By : MARKOS KATSANOS Copyright 2020 IE= 100000;SetOPTION( "INITIALEQUITY", IE );
********************************************************************} SetPositionSize( 100, spsPercentOfEquity);
For more information see Markos Katsanos's articles in the RoundLotSize = 1; SetOption("MinShares",1);
March 2020 issue of Technical Analysis of Stocks & Commodities SetOption("AllowPositionShrinking", True );
magazine. SetOption("CommissionMode",3);
*/ SetOption("CommissionAmount",.01); //$.01 per share
SetOption("MinPosValue",1000);
RSBARS = Param("RS BARS", 90, 10, 500, 10 ); SetTradeDelays( 0, 0, 0, 0 );
SK = Param("SMOOTHING CONSTANT", 3, 1, 50, 1 ); BuyPrice = CLOSE;SellPrice =CLOSE;
MAB = Param("RS MA BARS", 20, 10, 150, 10 );
VPERIOD=Optimize("VPERIOD",30,26,30,4); //VFI Period
SYMBOL1 = ParamStr( "Symbol", "VUG" ); RSBARS=Optimize("RSBARS",15,13,15,2); // Rel. Strength Bars
BASE = Foreign( SYMBOL1, "C" ); MARSBARS=Optimize("MARSBARS",20,15,25,5); // Rel. Strength MA bars
SYMBOL2 = ParamStr( "Index", "SPY" ); maxlossperc=Optimize("MAXLOSSPERC",7,5,9,2); // Stop Loss
IM = Foreign( SYMBOL2, "C" );
//ETF
//RSMK SYMBOL1 = ParamStr( "ETF1", "VUG" );
R12=BASE/(IM); VUG = Foreign( SYMBOL1, "C" );
RS1=log(R12)-log(Ref(R12,-RSBARS)); SYMBOL2 = ParamStr( "ETF2", "VTV" );
RS=EMA(RS1,SK)*100; VTV = Foreign( SYMBOL2, "C" );
MARS=MA(RS,MAB); //Comparison Index
dynamic_color = IIf( RS > 0 AND RS>MARS, colorGreen, COLORRED); IndexCode = ParamStr( "Index", "SPY" );
Plot(RS,"RSMK",dynamic_color); SPY = Foreign( IndexCode, "C" );
Plot(MARS,"MA",colorGreen,styleDashed); //RSMK Indicator (see also the March 2020 issue of TASC)
Plot(0,"",colorBLUE); RSMK1=EMA(log(VUG/(SPY))-log(Ref(VUG/(SPY),-RSBARS)),2)*100;
RSMK2=EMA(log(VTV/(SPY))-log(Ref(VTV/(SPY),-RSBARS)),2)*100;
VFI INDICATOR //VFI Calculaltion
/********************************************************************
Coef = 0.2;VCoef = 2.5;
VOLUME FLOW INDICATOR (VFI)
inter = log( Avg)-log(Ref( Avg,-1));
Provided By : MARKOS KATSANOS Copyright 2004
Vinter = StDev(inter, 30 );
********************************************************************}
Cutoff = Coef * Vinter * Close;
{For more information see Markos Katsanos's articles in the
Vave = Ref( MA( V, VPeriod ),-1);
June 2004 and July 2004 issues of Technical Analysis of Stocks & Com-
Vmax = Vave * Vcoef;
modities magazine.
Vc = Min( V, VMax );
Period=days for VFI calculation. Default values are 130 for daily and
MF = Avg - Ref( Avg,-1 );
26-30 for weekly charts.
VCP = IIf( MF > Cutoff, VC, IIf(MF<-Cutoff,-VC, 0));
*/
VFI = Sum( VCP,VPeriod )/Vave;
VFI = WMA( VFI,2 );
Period = Param("VFI Period", 130, 2, 300, 10 );
Smooth=Param( "SMOOTH", 2, 1, 10, 1 );
//BUY
crit=Param( "critical", 0, -30, 30, 5 );
Buy1 = Name()==SYMBOL1 AND RSMK1>RSMK2 AND
MAP=Param( "MA Period", 30, 20, 100, 10 );
RSMK1>MA(RSMK1,MARSBARS);
Coef = 0.2;
Buy2 = Name()==SYMBOL2 AND RSMK2>RSMK1 AND
VCoef = Param("Vol Cutoff", 2.5, 1, 5, .5 );
RSMK2>MA(RSMK2,MARSBARS);
inter = log( Avg ) - log( Ref( Avg, -1 ) );
Buy=(BUY1 OR BUY2) AND VFI>0;
//SP=IIf(BarIndex()>30,30,BARINDEX());
//SELL
Vinter = StDev(inter, 30 );
SELL1 = Name()==SYMBOL1 AND RSMK1<RSMK2 AND
Cutoff = Coef * Vinter * Close;
RSMK1<MA(RSMK1,MARSBARS) AND RSMK1<Ref(RSMK2,-1);
//PERIOD=IIf(BarIndex()>PERIOD,PERIOD,BarIndex());
SELL2 = Name()==SYMBOL2 AND (RSMK2<RSMK1 AND
Vave = Ref( MA( V, Period ), -1 );Vave=IIF(Vave>0,Vave,1);
RSMK2<MA(RSMK2,MARSBARS) AND RSMK2<Ref(RSMK1,-1));
Vmax = Vave * Vcoef;Vc = Min( V, VMax );MF = Avg - Ref( Avg, -1 );
SELL3= C<MA(C,50) AND C<(1-MAXLOSSPERC/100)*Ref(C,-1);
VCP = IIf( MF > Cutoff, VC, IIf ( MF < -Cutoff, -VC, 0 ) );
Sell=SELL1 OR SELL2 OR SELL3;
VFI1 = SUM( VCP , Period )/Vave;
Short=False;Cover=False;
VFI =WMA( VFI1, smooth ); MAVFI=MA(VFI,MAP);
//PLOT
dynamic_color = IIf( VFI >= CRIT, colorGreen, colorRed );
SetChartOptions( 0, chartShowArrows | chartShowDates );
Plot( VFI, "VFI(" + PERIOD + ")", dynamic_color, ParamStyle("Histogram
Equity(1); // evaluate stops, all quotes
style", styleHistogram | styleNoLabel, maskHistogram ) );
SetOption("EveryBarNullCheck", True );
PlotGrid( CRIT, colorBLACK );
Plot( C, "Price", colorDefault, stylecandle | styleThick);
Plot( MAVFI, "",colorGREEN, styleDashed );
PlotShapes( IIf( Buy, shapeUPTRIANGLE, 0 ),colorBlue,0,Low);
PlotShapes( IIf( Sell, shapeDownTRIANGLE, 0 ), colorOrange,0,High);
VALUE OR GROWTH RS SWITCHING SYSTEM
//VUG VTV ETF RS SWITCHING WEEKLY LONG SYSTEM // Custom text labels displayed with PlotText
//COPYRIGHT MARKOS KATSANOS 2023 dist = 2*ATR(10);
//To be applied on a weekly chart of VUG OR VTV ETFs for( i =0; i<BarCount;i++ )
//The exploration or Backtest should be run on a watch list containing {if( BUY[i] ) PlotTextSetFont("BUY","ARIAL",10,i,L[ i ]-dist[i], colorBLUE,
//only VUG and VTV. colorDefault,0);

December 2023 • Technical Analysis of Stocks & Commodities • 15


if( Sell[i]==1 AND SELL3[i]==1 ) PlotText( "STOP LOSS" , i, H[ i+1 ]+dist[i], // Exploration
colorRED, colorDefaulT); FILTER= Buy OR Sell ;
if( SELL[i]==1 AND SELL3[i]==0 ) PlotText( "SELL " , i, H[ i ]+.7*dist[i], AddTextColumn( FullName(), "Name");
colorRED, colorDefaulT); AddColumn(Close,"Close",1.2);
if( SELL[i]==4 ) PlotText( "TRAILING STOP" ,i, H[ i+1 ]+dist[i], colorRED, AddColumn(RSMK1,"RS VUG",1.2);
colorDefaulT);} AddColumn(RSMK2,"RS VTV",1.2);
AddColumn(VFI,"VFI",1.2,IIf(VFI>0,colorBlack,colorRed));
GfxSelectFont("Times New Roman",11,600, True ); AddColumn(BUY,"BUY",1);
GfxTextOut( "VALUE OR GROWTH",5,19); AddColumn(Buy1,"BUY VUG",1);
GfxTextOut( "Created By: Markos Katsanos", 5, 41 ); AddColumn(Buy2,"BUY VTV",1);
Title = Name() + " " + Date() + " Price = " + Close + " Open= "+O+ " High AddColumn(SELL,"SELL",1,IIF( Sell, Colorred, colorDefault ));
="+H AddColumn(SELL1,"SELL VUG",1);
+" Low = " + L+ " Volume= "+V+" VUG = " + VUG +" VTV "+VTV +" BarIn- AddColumn(SELL2,"SELL VTV",1);
dex "+BarIndex() AddColumn(SELL3,"STOP LOSS",1);
+" Signal : "+ WriteIf( Buy, "Buy",WriteIf( SELL == 1, "Sell", "none" ));

bear market (not shown in the chart). The most profitable The backtest results indicate that this simple strategy
trade was triggered on 3/20/2020, at the bottom of the produced higher returns with less volatility and draw-
Covid-19 crisis when the fiscal stimulus payments found down than holding either of the value or growth ETF
their way into the stock market and helped propel growth independently.
and speculative names. This trade wasn’t blocked by VFI You should, however, keep in mind that this was achieved
since it was still positive at that time. In observing the VUG with the benefit of hindsight and it is possible that the
chart in isolation, I noticed that this trade was closed rather performance could not be as good in the future.
prematurely in December 2020, leaving a lot of money on Nevertheless, I recommend this strategy to long-term
the table. The system, however, was still in the market and index investors and believe that switching ETFs using a
only replaced VUG by VTV, which, by the way, performed relative strength approach will help bring more profits to
better during the next six-month period. your investments.
A rather surprising statistic was that the volatility and I hope you found this article helpful. If you have any
drawdown of buying and holding VUG was less than either questions or suggestions, don’t hesitate to send me an
VTV or SPY (see the first three columns in Figure 6). email.
This is because VUG’s portfolio is less risky than typical
speculative tech names due to diversification across mul- Markos Katsanos is the author of Intermarket Trading
tiple sectors, as it includes growth stocks from healthcare, Strategies and is a Stocks & Commodities Contributing
financials, industrials, and consumer defensive sectors, Writer. He can be reached at markos.katsanos@gmail.
which help lower portfolio volatility. VUG, therefore, of- com or through his website at http://mkatsanos.com.
fers a better choice for the buy & hold investor than either The code given in this article is available in the S&C
VTV or SPY, since it will benefit from tech-driven growth Article Code section of our website, Traders.com.
bull runs (such as the recent AI parabolic uptrend), while
diversification will lower the risk in the case of downtrends. See our Traders’ Tips section beginning on page 52 for
Moreover, its lower expense ratio and liquidity also make implementation of Markos Katsanos’ technique in vari-
it a better long-term investment option. ous technical analysis programs and trading platforms.
Accompanying program code can be found in the Traders’
Final thoughts Tips area at Traders.com.
History shows that the stock market goes through cycles
of varying length that favor either growth or value stocks, Further reading
and this calls for an appropriate rotating strategy. Katsanos, Markos [2008]. Intermarket Trading Strategies,
In this article, I presented a trading strategy that uses John Wiley & Sons.
short-term momentum to follow the market action and Katsanos, Markos [2020], “Using Relative Strength To
bring more clarity to your investing by removing the Outperform The Market,” Technical Analysis of Stocks
guesswork in deciding when to switch between value and & Commodities, Volume 38: March.
growth. In the stock market, however, nothing works 100% Katsanos, Markos [2004], “Using Money Flow To Stay
of the time and the relative strength condition, when used With The Trend” Technical Analysis of Stocks &
on its own, will fail in protracted bear markets when both Commodities, Volume 22: June.
value and growth are in a downtrend. In these cases, the CRSP Market Indexes Methodology, https://www.crsp.org/
strategy blocks all signals automatically and switches to indexes-pages/crsp-market-indexes-methodology
cash in order to reduce risk and drawdown.
16 • December 2023 • 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 kdavey@kjtradingsystems.com. Selected questions will
appear in a future issue of S&C.
Kevin J. Davey

ALGO OVERRIDE and they might perform worse. But The second is with your psychology
When is it appropriate to override you do not know what will happen. or emotions. Let’s say you get very
an algo’s signals? To use the architect analogy, maybe nervous around every regularly
Imagine you are an architect. You the changes you made will make a scheduled Fed meeting. You always
spend years in university, learning the better house, or maybe the house consider overriding your algo at
principles, rules, etc of architecture. will now be structurally unstable such times. Such announcements
After you graduate with a degree, you and will collapse. cause you a great deal of stress
likely spend years working alongside So ideally, you never override the and worry over your algos. In this
a master architect. Eventually, you go algo signals. situation, ask yourself if the stress
off on your own, and you are awarded That being said, I can think of is really worth the potential gain.
a contract to design your first house. two cases where you might consider Maybe it is better to just turn off
Do you design it using the principles overriding your algo. The first the algo for such announcements.
you have learned and trusted over A better solution to this situation
the years, or do you decide to “wing is to never trade announcements
it”—to go against the established I strongly feel that at all, even during the backtest.
rules and try out untested new ideas if you believe in the Simply turn off trading during the
and concepts? concept of backtesting announcement dates/times when
If you did the latter, you likely you first run your backtest. Then
would not remain an architect for
to “prove” an algo the backtest will reflect what you
long. Your desire to go against the strategy’s effectiveness, really desire—no trading during Fed
rules will eventually lead to problems you should follow those announcements.
in your designs. same rules in your live As you can guess, I am not a fan
It is the same idea as going against trading. of overriding algo signals at all. I
the signals of your algos. strongly feel that if you believe in
With an algo, you likely have the concept of backtesting to “prove”
already spent a great deal of time is a major change in the market an algo strategy’s effectiveness, you
honing your development process conditions. Let’s say some drastic should follow those same rules in
and properly testing and vetting your change happens in the markets. your live trading. Otherwise, why
algo. You likely have an historical An example would be the US bother backtesting at all? At the same
backtest, which of course exactly government enacting a 50% tax on time, though, I realize the mental
follows the rules you programmed. all stock market capital gains. That and psychological considerations
And presumably, you approve of the would have a profound impact on in always following your algo. That
backtest’s performance. the performance of stocks. It would can be stressful at times. The trick,
By overriding the signals of probably invalidate your backtest, then, is to develop algos that you feel
the algo, you now are going “off and overriding the algo (or preferably comfortable with, and only trade
script.” You can’t expect to rely turning it off completely) would be them live if you know you will stick
on the backtest, because you are advisable. Since your backtest was to them.
trading now with different rules. based on a “different” market world,
Of course, your new rules might you should not expect the same algo
perform better than the backtest, performance going forward.
December 2023 • Technical Analysis of Stocks & Commodities • 17
Consistency And Diversification

A Strategy For Trading


Seasonal And
Non-Seasonal Markets
If you can see a seasonal or non-seasonal pattern, you Some background
may be able to profit from it. Here is an example of how Farmers in North America generally plant their summer
to find and exploit patterns. crops in April and harvest in October. You can’t change
the season, although you can change the resilience of the

S
by Perry J. Kaufman crop to extreme weather—heat, drought, and rain—and the
ability to store more at harvest to avoid the sales glut.
easonal patterns are appealing because they Farmers have also gotten more sophisticated, planting
are real, not found by manipulating data, but crops that are likely to yield higher prices, but reporting
by centuries of crop production modified by the opposite to the USDA. On the other hand, the USDA
the evolution of agribusiness and technology. is able to estimate the extent of this misrepresentation,
They offer consistency and diversification for traders. so it becomes a cat-and-mouse game.
Some years back, I was a partner in a large farming Here, we’ll look at seasonal and non-seasonal patterns.
operation in central Illinois. I developed the opinion These patterns are influenced by weather, export agree-
that grain prices rallied in the mid-summer due to “crop ments, and technology. Unfortunately for the farmers,
scares,” that is, lack of rain, too much rain, bugs, and a technology has steadily improved the yields (using hybrids
FGC/SHUTTERSTOCK

variety of nasty things. Since then, I have taken a care- and fertilizer), so the inflation-adjusted return to them
ful look at the price patterns and they are surprisingly has actually declined. We haven’t seen a bad crop year
different. in quite some time.
18 • December 2023 • Technical Analysis of Stocks & Commodities
TRADING STRATEGIES

I will limit the following seasonal strategy to the three


main northern crops: corn, wheat, and soybeans. They
have the same seasonality. Cotton is another U.S. crop,
but it is grown in the south and has a somewhat different
seasonality. You should be able to apply this strategy
to cotton and smaller crops, even to energy, but I will
leave that to you.

MICROSOFT EXCEL
Seasonality of wheat, corn, and soybeans
You’ve seen seasonal charts, so I won’t belabor this, but
we need to see these patterns in order to exploit them.
Figure 1 shows the seasonality of feedgrain futures, FIGURE 1: SEASONALITY OF WHEAT, CORN, AND SOYBEAN FUTURES.
wheat, corn, and soybeans using nearest futures data This chart shows feedgrain seasonality, nearest futures, 20 years through
August 2022.
for the past 20 years, through July 2022. For those of
you who are not in agriculture, the wheat traded on the
Board of Trade is feed, not meant for bread. That would Turning seasonal patterns into rules
be Kansas hard red winter wheat, among others. We can define a “seasonal pattern” as one that starts low
I’ve used the method of yearly averages, which aver- in the winter, increases into the summer, then declines
ages the month-end prices for each year, then finds each into harvest. It uses these rules:
monthly return relative to its yearly average, dividing
the end-of-month price by the yearly average of those • Average the previous five years of monthly re-
month-end prices. While some methods use the average turns.
price for the month, the month-end price is more practi- • If the end-of-April price (the month for planting)
cal and avoids a lag. is below the 5-year average, we have a “seasonal”
The EasyLanguage code given in the sidebar, “Seasonal pattern.
End-Of-Month Prices And Returns, In EasyLanguage,” • If the end-of-April price is above the 5-year average,
creates two tables, the month-end prices and the monthly we have a “non-seasonal” pattern.
returns. You can import them to an Excel file and average
the returns each month, then plot the seasonal pattern Once we have identified the regime, we apply the
from the monthly averages. It will work for any futures rules:
or stock market.
• If “seasonal,” then buy the end-of-April closing
Seasonal patterns in grains price.
The three grains show similarity, starting high at planting • If this year’s price is above the July average, we exit
and ending low at harvest, generally September and Octo- the long position at the end of July and go short.
ber. Soybeans show a mid-summer rally before declining • If we do not exit in July, we always exit at the end
into harvest, but all three grains can spike in the summer of August and go short.
even though the averages smooth out that move. • We exit all positions at the end of September.
Soybeans have slightly different dynamics because • If “non-seasonal,” we sell the end-of-April closing
they can be planted later and harvested sooner. Farmers price.
may switch from corn to soybeans if weather delays corn • We exit at the end of September.
planting. Even in 2022, when prices soared, the seasonal
pattern seemed to hold. Using these rules, we get the results shown in Figures
2, 3, and 4.
A trading system
Now that we see the seasonal pattern, can we profit from
it? It looks straightforward, but it’s not. We will see that
in most years, grain prices simply decline from spring Seasonal patterns are appealing
to harvest. A few years spike in mid-summer, enough because they are real.
to be seen on the chart, but it is far less often than you
would expect.
December 2023 • Technical Analysis of Stocks & Commodities • 19
FIGURE 2: RESULTS FOR WHEAT FUTURES. This shows the returns after FIGURE 4: RESULTS FOR SOYBEAN FUTURES. This shows the returns after
applying the trading strategy to wheat futures. applying the trading strategy to soybean futures.

FIGURE 3 RESULTS FOR CORN FUTURES. This shows the returns after applying FIGURE 5: MAKING THE ENTRY CONDITION MORE RESTRICTIVE. This
the trading strategy to corn futures. shows results for corn using a 5% entry threshold (that is, going long if the
current monthly price is 5% lower than the average and short if it is 5% higher
Making the entry condition more than the average).
restrictive
In the performance above, we went long when the monthly cause, but that would not increase carryover stocks.
return was below the average and short when it was above We then have higher prices and more grain, an unusual
the average. Now we can see if the results are more reli- combination.
able if we only go long if the current monthly price is The only explanation would be higher demand. Even
5% lower than the average, and short if it is 5% higher with higher stocks, grain in storage disappears before the
than the average. Figure 5 shows the results for corn. new crop is harvested. You can confirm this by looking
The other grains were not as good with a 5% threshold, at the December stocks and the stocks the following
but you might want to test other levels. August, as shown in Figure 6.

Non-seasonal is normal Improving the timing


When we look at all the results, we can conclude that Monthly data has the disadvantage of allowing large price
non-seasonal trades, where prices this year start higher swings with no way to respond. An ambitious developer
than the average of the past 5 years, are the norm. That should consider using daily data alongside the monthly
would contradict the idea of technology, because higher signals. If the position is long (seasonal), a mid-summer
yields would cause lower prices. Inflation could be the exit would be better timed using a daily momentum
indicator. I would suggest an RSI with Ehlers’ roofing
filter, which smooths out the values.
This strategy offers a way to Carryover stocks
diversify based on the natural Carryover stocks tell you if the grain supply is low or
phenomenon of seasonality. sufficient to make it through the winter to the harvest of
the new crop. If carryover stocks are low, the market will
be nervous and is likely to spike higher in mid-summer
20 • December 2023 • Technical Analysis of Stocks & Commodities
SEASONAL END-OF-MONTH PRICES AND RETURNS, IN EASYLANGUAGE
The EasyLanguage code shown here compiles data [7]:6:3,",",months[8]:6:3,",",
months[9]:6:3,",",months[10]:6:3,",",mont
so the user can look for seasonal patterns. The coding hs[11]:6:3,",",
creates two tables containing month-end prices and months[12]:6:3,",",avg:6:3);
monthly returns for selected futures or stocks. The // returns
statistics can then be imported to a spreadsheet file. In for ix = 1 to 12 begin
if months[ix] = 0 then returns[ix] = 0
a spreadsheet, the returns can be averaged and plotted else returns[ix] = months[ix]/avg - 1;
for viewing graphically. end;
print(File("c:\TradeStation\Seasonal_End-of-
// TSM Save month-end prices and calculate seasonal Month_Returns.csv"),
returns year(date[1])+1900:4:0,",",
// Copyright 1999,2012, 2022, 2023 P.J. Kaufman. All rights returns[1]:6:3,",",returns[2]:6:3,",",returns[
reserved. 3]:6:3,",",returns[4]:6:3,",",
returns[5]:6:3,",",returns[6]:6:3,",",returns[
// Writes 2 ASCII files: 7]:6:3,",",returns[8]:6:3,",",
// "c:\TradeStation\Seasonal-End-of-Month_Prices.csv" returns[9]:6:3,",",returns[10]:6:3,",",returns[
// "c:\TradeStation\Seasonal-End-of-Month_Returns.csv" 11]:6:3,",",returns[12]:6:3);
// clear array
vars: cmonth(0), pmonth(0), ix(0), avg(0), for ix = 1 to 12 begin
firstyear(true), nmonths(0); months[ix] = 0;
array: months[12](0), returns[12](0); returns[ix] = 0;
end;
if currentbar = 1 then begin firstyear = false;
// Writes an ASCII file with a name created from the data end;
series end;
print(File("c:\TradeStation\Seasonal_End-of-Month_Prices.
csv"), // if end of data output final records
"Year,Jan,Feb,Mar,Apr,May,Jun,Jul,A if lastbaronchart then begin
ug,Sep,Oct,Nov,Dec,Avg"); avg = 0;
print(File("c:\TradeStation\Seasonal_End-of- nmonths = 0;
Month_Returns.csv"), for ix = 1 to pmonth begin
"Year,Jan,Feb,Mar,Apr,May,Jun,Jul,A avg = avg + months[ix];
ug,Sep,Oct,Nov,Dec"); if months[ix] <> 0 then nmonths = nmonths
for ix = 1 to 12 begin + 1;
months[ix] = 0; end;
end; avg = avg/nmonths;
end; print(File("c:\TradeStation\Seasonal_End-of-Month_
Prices.csv"),year(date[1])+1900:4:0,",",
cmonth = month(date); months[1]:6:3,",",months[2]:6:3,",",months
pmonth = month(date[1]); [3]:6:3,",",months[4]:6:3,",",
if cmonth <> pmonth and currentbar > 1 then begin months[5]:6:3,",",months[6]:6:3,",",months
months[pmonth] = close[1]; [7]:6:3,",",months[8]:6:3,",",
// if end of year then print and clear arrays months[9]:6:3,",",months[10]:6:3,",",mont
if pmonth = 12 then begin hs[11]:6:3,",",
avg = 0; months[12]:6:3,",",avg:6:3);
nmonths = 0; for ix = 1 to pmonth begin
for ix = 1 to 12 begin if months[ix] <> 0 then returns[ix] =
avg = avg + months[ix]; months[ix]/avg - 1
if firstyear = false or months[ix] <> 0 else returns[ix] = 0;
then begin end;
nmonths = nmonths + 1; print(File("c:\TradeStation\Seasonal_End-of-Month_
end; Returns.csv"),year(date[1])+1900:4:0,",",
end; returns[1]:6:3,",",returns[2]:6:3,",",returns[
avg = avg/nmonths; 3]:6:3,",",returns[4]:6:3,",",
print(File("c:\TradeStation\Seasonal_End-of-Month_Prices. returns[5]:6:3,",",returns[6]:6:3,",",returns[
csv"), 7]:6:3,",",returns[8]:6:3,",",
year(date[1])+1900:4:0,",", returns[9]:6:3,",",returns[10]:6:3,",",returns[
months[1]:6:3,",",months[2]:6:3,",",months 11]:6:3,",",returns[12]:6:3);
[3]:6:3,",",months[4]:6:3,",", end;
months[5]:6:3,",",months[6]:6:3,",",months

December 2023 • Technical Analysis of Stocks & Commodities • 21


NASS.USDA.GOV/PUBLICATIONS/TODAYS_REPORTS/REPORTS/GRST0622.PDF

FIGURE 7: EFFECT OF CARRYOVER STOCKS, SOYBEANS. Soybean price


patterns are shown here for two years: 2012 (a low number of carryover stocks)
and 2020 (a high number of carryover stocks).

FIGURE 6: CARRYOVER STOCKS, SOYBEANS. Does supply run low or high in down into harvest. High stocks in 2020 resulted in very
this agricultural product? Carryover stocks can tell you. This chart shows carryover quiet, declining prices.
stocks in soybeans as of July each year. We can see that the stocks for 2011–2012 As for the strategy, low stocks would change a non-
are low while the stocks for 2019–2020 are high.
seasonal (selling) year into a seasonal (buying) year,
anticipating a rally in the summer. The continued in-
at the first weather scare. Large stocks will dampen crease in carryover stocks should also be attributed to
those concerns. technology.
Figure 6 shows the stocks for soybeans as of June
of each year. You will need to find a similar chart for How to calculate the 5-year average
December. It used to be easy to find on the internet but I programmed this in a computer language that allowed
seems to have disappeared, so you would need to find a me to manipulate arrays. It can be done on most program-
similar chart as the one shown. mable trading platforms, but it will be tricky. Instead, you
Looking at two of the years, the stocks for 2011–2012 can create the seasonal prices and the monthly return
are low, while the stocks for 2019–2020 are high. Figure tables, then average the monthly returns for the last five
7 shows the price patterns for 2012 and 2020. Low stocks years, not including the current year. You only need to
in 2012 caused a spike in the summer but then traded do that once each year.

Year Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec Avg
2001 622 618.25 603.5 600 621.5 621.75 604 595 598.25 586.75 607.1
2002 583.75 579 574 566 579.5 590.5 604.75 614 597.5 593.5 586 580.25 587.4
2003 582.75 575.75 579 574.5 587.5 571 553.25 581 559.5 586.5 583 580.25 576.17
2004 610.5 630.25 647.25 641.5 625.25 579.5 534.25 546 513.75 510.75 502 503 570.33
2005 495.25 513 503.25 494.75 503.25 493.75 508 474 463 453.75 446.25 460.25 484.04
2006 463.25 472.5 469.75 471.5 473.75 457 450 442.5 457 515.25 568.25 568 484.06
2007 581.75 601 540 522.5 545.25 485.75 471.5 468.5 501.5 504 512.5 566.5 525.06
2008 612.25 653.75 664.5 696 683 807 656.75 635.5 538 452 399.25 440.5 603.21
2009 412.5 383.5 429.25 419.5 452.25 363 348 332.5 346.75 368.75 404.25 401.25 388.46
2010 343.25 364.75 320.75 343.75 327.5 322.25 352.25 383.25 439.75 526 473.25 558.25 396.25
2011 588.75 649.5 611.75 669 660 577 594.5 682 507 561.5 515 553.5 597.46
2012 546 561.75 547.75 548 469 582 760 747 703.5 703 696 641.5 625.46
2013 683.75 654.75 646.5 622 634 599.5 551.25 549.5 509 495.75 485.5 483 576.21
2014 495 518.25 556.75 568 514.75 473 411.25 410 366 422 421 429.25 465.44
2015 402.25 417.5 400.5 386.5 371.75 436 385 377.75 390.25 384.75 368 354.5 389.56
2016 367.75 348 342.5 378 391 347.75 316.75 289 310.25 328.25 313 316.5 337.4
2017 324.25 331.25 321.75 317.25 322.75 323.5 313.25 285.25 282.75 273.25 270.25 265.25 302.56
2018 276 288.25 294 297.75 291 247.5 260.25 238.25 229.5 236.5 239 236.25 261.19
2019 237.75 222.5 208.25 204.5 269 261.25 236.75 196.5 214.75 216.75 197.75 204.25 222.5
2020 197.75 180.75 153.25 124.75 130.5 143 117.5 145.5 166.75 186.25 206.25 264.25 168.04
2021 327.25 329 345.75 477.75 461.25 510 457.75 447 449.5 481 475.25 501 438.54
2022 533.75 601 659 726 666 624.25 611.75 670.5 636.53
FIGURE 8: CORN MONTH-END PRICES. The table shows the end-of-month prices, output from the accompanying code listing. In the last column is the average
yearly price.
22 • December 2023 • Technical Analysis of Stocks & Commodities
Year Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec Avg
2001 0.025 0.018 −0.006 −0.012 0.024 0.024 −0.005 −0.02 −0.015 −0.034 607.1
2002 −0.006 −0.014 −0.023 −0.036 −0.013 0.005 0.03 0.045 0.017 0.01 −0.002 −0.012 587.4
2003 0.011 −0.001 0.005 −0.003 0.02 −0.009 −0.04 0.008 −0.029 0.018 0.012 0.007 576.17
2004 0.07 0.105 0.135 0.125 0.096 0.016 −0.063 −0.043 −0.099 −0.104 −0.12 −0.118 570.33
2005 0.023 0.06 0.04 0.022 0.04 0.02 0.049 −0.021 −0.043 −0.063 −0.078 −0.049 484.04
2006 −0.043 −0.024 −0.03 −0.026 −0.021 −0.056 −0.07 −0.086 −0.056 0.064 0.174 0.173 484.06
2007 0.108 0.145 0.028 −0.005 0.038 −0.075 −0.102 −0.108 −0.045 −0.04 −0.024 0.079 525.06
2008 0.015 0.084 0.102 0.154 0.132 0.338 0.089 0.054 −0.108 −0.251 −0.338 −0.27 603.21
2009 0.062 −0.013 0.105 0.08 0.164 −0.066 −0.104 −0.144 −0.107 −0.051 0.041 0.033 388.46
2010 −0.134 −0.079 −0.191 −0.132 −0.174 −0.187 −0.111 −0.033 0.11 0.327 0.194 0.409 396.25
2011 −0.015 0.087 0.024 0.12 0.105 −0.034 −0.005 0.142 −0.151 −0.06 −0.138 −0.074 597.46
2012 −0.127 −0.102 −0.124 −0.124 −0.25 −0.069 0.215 0.194 0.125 0.124 0.113 0.026 625.46
2013 0.187 0.136 0.122 0.079 0.1 0.04 −0.043 −0.046 −0.117 −0.14 −0.157 −0.162 576.21
2014 0.064 0.113 0.196 0.22 0.106 0.016 −0.116 −0.119 −0.214 −0.093 −0.095 −0.078 465.44
2015 0.033 0.072 0.028 −0.008 −0.046 0.119 −0.012 −0.03 0.002 −0.012 −0.055 −0.09 389.56
2016 0.09 0.031 0.015 0.12 0.159 0.031 −0.061 −0.143 −0.08 −0.027 −0.072 −0.062 337.4
2017 0.072 0.095 0.063 0.049 0.067 0.069 0.035 −0.057 −0.065 −0.097 −0.107 −0.123 302.56
2018 0.057 0.104 0.126 0.14 0.114 −0.052 −0.004 −0.088 −0.121 −0.095 −0.085 −0.095 261.19
2019 0.069 0 −0.064 −0.081 0.209 0.174 0.064 −0.117 −0.035 −0.026 −0.111 −0.082 222.5
2020 0.177 0.076 −0.088 −0.258 −0.223 −0.149 −0.301 −0.134 −0.008 0.108 0.227 0.573 168.04
2021 −0.254 −0.25 −0.212 0.089 0.052 0.163 0.044 0.019 0.025 0.097 0.084 0.142 438.54
2022 −0.161 −0.056 0.035 0.141 0.046 −0.019 −0.039 0.053
Average
0.024 0.005 −0.035 −0.012 0.044 0.041 −0.032 −0.075 −0.041 −0.003 0.002 0.083 636.53
2017–2021
FIGURE 9: CORN MONTH-END RETURNS. The table is the result of dividing the month-end price by the average of the year, minus 1, to give us the month-end
returns.

The table in Figure 8 shows end-of-month prices, Perry J. Kaufman is a trader and financial engineer.
output from the code in the sidebar “Seasonal End-Of- He is the author of many books on trading and market
Month Prices And Returns, In EasyLanguage.” It also analysis, including the sixth edition (2020) of Trading
includes the average yearly price in the last column. The Systems and Methods (with the first edition published in
table in Figure 9 shows monthly returns, output from 1978 as a seminal book in the field of technical analysis),
the same code. as well as Kaufman Constructs Trading Systems (2020),
and Learn To Trade (2022). For questions or comments,
Summary please go to www.kaufmansignals.com.
While the returns of this strategy are not as good as
an optimized trend system, this strategy offers a way The code given in this article is available in the S&C
to diversify based on the natural phenomenon of sea- Article Code section of our website, Traders.com.
sonality. By including carryover stocks and daily data,
the results can be improved. And, the concept can be
applied to any agricultural market. It seems consistent
idea that, at harvest, prices, whether in a seasonal or
nonseasonal pattern, (almost) always decline at the end.
Nature plays its part.

YOUR ONLINE RESOURCE


FOR TECHNICAL ANALYSIS

Join us on Facebook at www.facebook.com/STOCKSandCOMMODITIES


Follow us on Twitter @STOCKSandCOMM

December 2023 • Technical Analysis of Stocks & Commodities • 23


Exploring A Crossover Strategy

Building A Trend-Following
System
Does filtering trade entries with a volume flow indicator Testing procedure
improve the performance of a moving average crossover For the testing, I will use futures markets, specifically:
system when used in a trend-following strategy? Here’s the emini S&P 500, emini NASDAQ, mini Dow Jones,
a test to find out. mini Russell 2000, Australian dollar, Canadian dollar,
euro currency, eurodollar, Japanese yen, Mexican peso,
by Dillon Figueredo Swiss Franc, two-year note, five-year note, 10-year note,

S
30-year T-bond, crude oil, natural gas, heating oil, RBOB
ince I started developing trading strategies, gasoline, wheat, hard winter wheat, corn, soybean oil,
trend-following systems have always cap- rough rice, coffee, cocoa, lean hogs, and lumber.
tivated my interest. However, such systems I will test daily charts all the way down to 15-minute
typically do not boast high win rates. I find charts in no specific increment. My testing range will be
comfort in a system designed with expected from 1/1/2007 to 12/25/2023. The backtest will consist
losses because it’s easier to manage a predict- of optimized inputs from EasyLanguage code. Strategies
ALEXANDER SUPERTRAMP/SHUTTERSTOCK

able setback than to be blindsided by an unexpected that have great performance metrics will be considered
large loss. for evaluation.
In this article, I will dissect a moving average system
to assess its profitability potential when employed in a Using a Monte Carlo simulation for
trend-following strategy and see if we can improve the analyzing system metrics
performance by adding a money flow indicator to filter Monte Carlo simulation is a helpful tool for analyzing
out unprofitable trades. trading systems. Monte Carlo methods are used to obtain
24 • December 2023 • Technical Analysis of Stocks & Commodities
TRADING SYSTEMS

probabilistic interpretations. A Monte


Carlo simulation for a system is a test
for robustness, and can determine the
probability of losing your starting
capital before reaching your profit
goal (that is, the risk of ruin).
The following metrics were derived
for the system using Monte Carlo
simulation. These metrics forecast a
trader’s “road conditions” ahead.

• Ruin: Picture the likelihood your


car breaks down in its first year. FIGURE 1: MOVING AVERAGE CROSSOVER SYSTEM, EQUITY CURVE. The trend-following system
Similarly, this metric shows the is initially tested without applying any filters as a benchmark. Four of the tests appear worthy of further
odds of your trading account dip- consideration: the 100-minute, 180-minute, 210-minute, and the 960-minute chart of the mini Dow Jones,
ping below a safe point in year 1. long only. The 210-minute chart result is shown here.
You’d want this to be low.
• Median drawdown: Like a
car’s average fuel usage, it’s the
midpoint of potential trading
losses. Expect half the losses to
be higher and half to be lower
than this value.
• Median return: Like estimating
how far a car travels annually,
it indicates average earnings.
There’s a 50% chance of earning FIGURE 2: VOLUME FLOW (VFI) INDICATOR. Testing just the volume flow indicator as a trading strategy,
more and 50% of earning less. the 40-minute long-only S&P 500 test showed potential.
• Return to drawdown: Measures
your profit relative to losses. A value of 2 means ratio of 1.5 or higher in the Monte Carlo simulation. This
profit was twice the size of the drawdown. implies that it could be quite challenging to recover your
losses over a year of trading with these systems, making
Moving average crossover system them less appealing for our purposes.
The trend-following system I’ll test is a moving average Therefore, it seems reasonable to move on from these
crossover system. First, the system is tested without ap- particular systems. However, it’s worth noting that since
plying any filters. This initial test will serve as a bench- all four potential candidates were on the mini Dow Jones,
mark to assess whether adding filters can enhance the if we spot any more promising candidates on the Dow
performance of the moving average crossover system. Jones in the future, we can have a bit more confidence
Upon reviewing the output of the trend-following system in the system, given this initial evaluation.
test, I identified four potential candidates that might be
worth adding to my watch space. This selection is based Volume flow indicator
on the assumption that if a strategy performs well in the I was intrigued to determine whether the volume flow,
simulated/watch space, it’s likely to perform well when
applied in a live trading scenario.
Interestingly, all four potential candidates that caught
my attention are based on the mini Dow Jones market, long
One advantage of a trend-following
only. Specifically, these are from the 100-minute chart, system is that it generally holds
180-minute chart, 210-minute chart, and the 960-minute onto winning trades longer and
chart. Refer to Figure 1 for detailed equity curve informa- exits losing trades more swiftly.
tion. However, it’s important to note that none of these
four systems managed to achieve a return-to-drawdown
December 2023 • Technical Analysis of Stocks & Commodities • 25
when isolated, exhibits any trading po- Net Profit $59,687.50 risk of ruin was nullified at 0%, and the
tential. Consequently, I subjected just the Gross Profit $98,203.13 return-to-drawdown ratio was pegged at a
volume flow to testing. The volume flow PFact promising 1.96 (see Figure 4), indicative
Gross Loss ($38,515.63)
2.55
indicator (VFI) is a money flow indica- # Trades 84 of favorable annual return prospects.
tor developed by Markos Katsanos and % Profitable 52.38%
introduced in his June 2004 article in # Wins 44 Moving average crossover
# Losses 40
this magazine. (see “Further reading” at Avg Dist b/w NHs 164.38 with volume flow
end). Many markets presented promising Avg Trade $710.57 The moving average crossover with VFI
out-of-sample metrics. For instance, the Median trade $117.19 filter strategy is demonstrated in Figure 5.
S&P 500, particularly its 40-minute chart Avg Win StdDev $2,333.32
$2,231.89
For a buy signal to be initiated, the faster
going long only, showcased substantial Avg Loss ($962.89) moving average (MA) must cross above
potential (Figure 2). However, its perfor- Ratio Win / Loss $2.32 the slower moving average, with a volume
mance in the Monte Carlo simulation was Largest Win $10,562.50 flow greater than zero. Conversely, for a
Largest Loss
underwhelming. With an initial capital Net Profit sell or sell-short signal, the faster mov-
($2,734.38)
$59,687.50
ranging from $15,000 to $52,000, the FIGURE 3: VFI-ONLY STRATEGY, ing average must cross below the slower
return-to-drawdown ratio consistently PERFORMANCE METRICS. Testing a moving average, with a volume flow less
hovered around 1.5, suggesting limited strategy based only on VFI suggested than zero. When constructing a strategy, I
profitability beyond drawdowns (Figure limited profitability beyond draw- prefer to design the exit strategy as the in-
3). Such a performance could be challeng- downs, with a return-to-drawdown verse of the entry strategy. This approach
ing for most traders to navigate. ratio around 1.5. assists me in organizing and visualizing
One standout in the Monte Carlo the efficiency of both entry and exit.
simulation was the 10-year note.D, particularly the Very good performance metrics have often been ob-
210-minute chart. Initiating with a capital of $11,000, the served with filters applied to certain assets, including the
emini S&P 500, short-only Japanese yen, long-only emini
NASDAQ.D, long-only 10-year T-note, and the long-only
mini Dow Jones.D. The “.D” designation, referring to
an absence of printed bars after hours, could be indica-
tive of unpredictable volume flow during those periods,
possibly due to volatility and low volume.
Examining the 10-year T-note.D 55-minute chart long-
only for out-of-sample trades (Figure 6), we observe an
impressive profit factor of 2.5, indicating gains exceeding
losses by 2.5 times. This strategy’s infrequency (only 44
trades during the backtested period) is neither alarming
FIGURE 4: VFI-ONLY STRATEGY, MONTE CARLO SIMULATION RESULTS. nor encouraging. Though a profit factor of 2.5 might
The Monte Carlo simulation on the VFI-only strategy showed a favorable outlook
seem too good to be true, a closer look at the Monte
for one market tested, the 10-year treasury note. The return-to-drawdown ratio
Carlo simulation (Figure 7) reveals that nothing reaches
was 2.02, suggesting favorable prospects.
a return-to-drawdown greater than
2.0 annually, except for a starting
capital of $5,000. Additionally,
there is a 17% chance of falling
below margin in the first year, a
risk level that may be considered
uncomfortable.
Reviewing the performance after
the backtested dates for the @TY.D
55-minute crossover with volume
flow long-only (as of 8/10/2023),
specifically after 12/25/2023, we no-
FIGURE 5: MOVING AVERAGE CROSSOVER SYSTEM WITH VFI FILTER. The crossover strategy with VFI tice a profit of $1,828.13 from trades
filter is demonstrated on a chart of the 55-minute 10-year T-note. between 11/9/2022 and 12/27/2022,
26 • December 2023 • Technical Analysis of Stocks & Commodities
and a loss of $2,328 from trades be-
tween 2/2/2023 and 2/8/2023. Thus,
if you were trading this since after the
backtest dates, you would be at about
a $500 loss, though we are currently in
an open position with a profit of $671.
See Figure 8 for the performance after
testing. Out-of-sample performance is
to the right of the vertical line.
The out-of-sample data suggests
that this strategy behaves like a trend-
following system. It has a 52% win FIGURE 6: MOVING AVERAGE CROSSOVER SYSTEM WITH VFI FILTER, OUT-OF-SAMPLE PERFOR-
rate, a win/loss ratio of 2.32, and the MANCE. Out-of-sample tests on the 55-minute 10-year T-note.D, long only, showed a promising profit
average bars in a winning trade are factor of 2.5.
almost 2.5 times those in a losing trade.
(See Figure 5 for performance metrics.) My preference
to make the entry the inverse of the exit is reflected in
the code (not provided here), where the fast moving aver-
age’s crossover of the slow moving average and volume
flow greater than zero are inverted for the exit strategy.
From here, you can see if the exit is efficient or if the
entry is efficient.

Moving average crossover system,


unfiltered FIGURE 7: MOVING AVERAGE CROSSOVER SYSTEM WITH VFI FILTER,
In analyzing the crossover with volume flow strategy, I MONTE CARLO SIMULATION RESULTS. A closer look at the strategy from
focused on three promising markets: the TY.D 55-min- Figure 5 using a Monte Carlo simulation revealed a risk level that may not be
ute, ES 150-minute, and the NQ.D 55-minute bar charts. tolerable.
One critical metric I evaluated was
the entry efficiency percentage, with
all three markets averaging around
60%. A score of 100% would imply
that the strategy consistently entered
at the lowest points, or valleys. Given
the high entry efficiency observed, it
seemed logical to adapt the exit strat-
egy to be more responsive to bearish
market conditions.
For the second iteration of this
strategy, I propose simplifying the
exit to a straightforward crossover,
eliminating any filters. This should,
in theory, make the strategy more
sensitive, allowing for quicker exits
during market pullbacks. However,
this approach isn’t without its chal- FIGURE 8: MOVING AVERAGE CROSSOVER SYSTEM WITH VFI FILTER, BACKTEST. After backtesting
lenges. A major concern is the po- on the 55-minute 10-year T-note.D, long only, the crossover system with VFI filter showed a loss after the
tential for frequent exits followed backtest dates. The out-of-sample performance is to the right of the vertical line.
immediately by reentries, increasing
the instances of whipsaws. Consequently, the number frequency trading strategies often fall prey to the erosive
of trades executed might increase significantly. High- effects of commission fees and slippage. However, one
December 2023 • Technical Analysis of Stocks & Commodities • 27
CODING FOR DEMONSTRATION TRADING SYSTEMS, IN EASYLANGUAGE
Moving Average Crossover System With Volume Flow
If SysSum = 1 and Fast < Slow and ExitCross = 1 then Begin
Indicator If FastC crosses over SlowC and MAVFI > 0 and Lo = 1 then buy next
bar at market;
Inputs: If Marketposition = 1 And SlowC Crosses Over FastC then sell next
Period(130), Smooth(3), MAP(30), Coef(0.2), VCoef(2.5), bar at market;
Lo(0), If MAVFI < 0 and FastC crosses under SlowC and So = 1 then sell short
So(0), next bar at market;
Fast(20), If Marketposition = -1 and FastC crosses Over SlowC then buy to
Slow(40), cover next bar at market;
ExitCross(0), {2.0 new feature lets you set an exit for cross only} end;
DaysBack(20);
If SysSum = 0 and Fast < Slow and ExitCross = 1 then Begin
Vars: If FastC crosses over SlowC and MAVFI > 0 then buy next bar at
SlowC(0), market;
FastC(0), If Marketposition = 1 and SlowC crosses Over FastC then sell next bar
SysSum(0), at market;
CloseMinus(0); If MAVFI < 0 and FastC crosses under SlowC then sell short next bar
at market;
Vars: Avg(0), Vinter(0), Cutoff(0), Vave(0), Vmax(0), Vc(0), MF(0), VCP(0), If Marketposition = -1 and FastC crosses Over SlowC then buy to
VFI1(0), VFI(0), MAVFI(0), dynamic_color(0); cover next bar at market;
Vars: inter(0); end;
Vars: epsilon(0.00001);

Avg = (High + Low + Close)/3; Volume Flow Indicator


If (High + Low + Close) > 0 then Begin Inputs:Lo(0),So(0), Period(130), Smooth(3), MAP(30), Coef(0.2),
inter = Log(Avg + epsilon) - Log(Avg[1] + epsilon); VCoef(2.5);

Vinter = StandardDev(inter, 30,2); Vars: Avg(0), Vinter(0), Cutoff(0), Vave(0), Vmax(0), Vc(0), MF(0), VCP(0),
Cutoff = Coef * Vinter * Close; VFI1(0), VFI(0), MAVFI(0), dynamic_color(0),Lso(0);
Vave = Average(V, Period)[1]; Vars: inter(0),DailyVol(0);
Vmax = Vave * VCoef; Vars: epsilon(0.00001);
Vc = MinList(V, VMax);
MF = Avg - Avg[1]; Lso = Lo + So;
VCP = IFF(MF > Cutoff, Vc, IFF(MF < -Cutoff, -Vc, 0));
VFI1 = Summation(VCP, Period)/Vave; If (High + Low + Close) > 0 then Begin
VFI = XAverage(VFI1, Smooth);
MAVFI = Average(VFI, MAP); Avg = (High + Low + Close)/3;
end;
inter = Log(Avg + epsilon) - Log(Avg[1] + epsilon);
{Calculation Module}
Vinter = StandardDev(inter, 30,2);
SysSum = Lo + So; Cutoff = Coef * Vinter * Close;

CloseMinus = C - C[DaysBack]; DailyVol = Volume;

FastC = Average(CloseMinus,Fast); Vave = Average(DailyVol, Period);


SlowC = Average(CloseMinus,Slow);
Vmax = Vave * VCoef;
{Buy module} Vc = MinList(DailyVol, VMax);
If SysSum = 0 and Fast < Slow and ExitCross = 0 then Begin MF = Avg - Avg[1];
If FastC crosses over SlowC and MAVFI > 0 then buy next bar at VCP = IFF(MF > Cutoff, Vc, IFF(MF < -Cutoff, -Vc, 0));
market; VFI1 = Summation(VCP, Period)/Vave;
If Marketposition = 1 and MAVFI < 0 and SlowC > FastC then sell next VFI = XAverage(VFI1, Smooth);
bar at market; MAVFI = Average(VFI, MAP);
If MAVFI < 0 and FastC crosses under SlowC then sell short next bar end;
at market;
If Marketposition = -1 and MAVFI > 0 and FastC > SlowC then buy to {Order Module}
cover next bar at market;
end; If Lso = 0 then Begin
If MAVFI crosses over 0 then buy next bar at market;
If SysSum = 1 and Fast < Slow and ExitCross = 0 then Begin IF MAVFI crosses Below 0 then sell short next bar at market;
If FastC crosses over SlowC and MAVFI > 0 and Lo = 1 then buy next end;
bar at market;
If Marketposition = 1 and MAVFI < 0 and SlowC > FastC then sell next IF Lso = 1 then Begin
bar at market; IF MAVFI crosses over 0 and Lo = 1 then buy next Bar at market;
If MAVFI < 0 and FastC crosses under SlowC and So = 1 then sell short If MAVFI crosses Below 0 and So = 1 then sell short next bar at
next bar at market; market;
If Marketposition = -1 and MAVFI > 0 and FastC > SlowC then buy to
cover next bar at market; IF Marketposition = 1 and MAVFI crosses below 0 then Sell next bar
end; at market;

28 • December 2023 • Technical Analysis of Stocks & Commodities


CODING FOR DEMONSTRATION TRADING SYSTEMS, IN EASYLANGUAGE
If Marketposition = -1 and MAVFI crosses Over 0 then buy to cover SysSum = Lo + So;
next bar at market;
CloseMinus = C - C[DaysBack];
end;
FastC = Average(CloseMinus,Fast);
SlowC = Average(CloseMinus,Slow);
Moving Average Crossover System Without Volume Flow
Indicator {Buy Module}

Inputs: If SysSum = 0 and Fast < Slow then Begin


Lo(0), If FastC crosses over SlowC then buy next bar at market;
So(0), If FastC crosses Below SlowC then sell short next bar at market;
Fast(20), end;
Slow(0),
DaysBack(20); If SysSum = 1 and Fast < Slow then Begin
If FastC crosses over SlowC and Lo = 1 then buy next bar at market;
Vars: IF Marketposition = 1 and FastC crosses below SlowC then sell next
SlowC(0), bar at market;
FastC(0), If FastC crosses Below SlowC and So = 1 then sell short next bar at
SysSum(0), market;
CloseMinus(0); If Marketposition = -1 and FastC crosses over SlowC then buy to cover
next bar at market;
{Calculation Module} end;

advantage of a trend-following system is that it generally to cover (closing out the short).
holds onto winning trades longer and exits losing trades
more swiftly. If both Lo and So = 0, the system will be set to only buy
Despite identifying eight potential candidates, none and sell short.
proved robust enough to be considered viable trading Let’s move on to optimization. Think of optimization
systems. (A spreadsheet of out-of-sample results is not as fine-tuning your car for better performance. But here’s
shown here due to its size.) the thing: if the car (or our trading system in this case) is
Several reasons underpin my decision to discard these fundamentally good, you don’t need to spend ages fine-
systems: tuning. A bit of tweaking here and there is enough.

1. The sheer volume of trades in certain strategies ExitCross = 1: This will make the system exit positions
meant that, once slippage and commissions were from crossovers only.
taken into account, the potential annual returns
were underwhelming. Here are the settings I optimized for the 55-minute chart
2. Some strategies displayed extended periods of of the 10-year treasury yield (@TY.D) when using the
sideways trading without much profit or loss. crossover with volume flow system:
3. Certain strategies failed to capitalize on significant
bull or bear market movements. Period: Fixed at 130
Smooth: Fixed at 3
In conclusion, the moving average crossover system MAP: Fixed at 30
using only the crossover as the exit signal did not show Coef: Fixed at 0.2
much potential.
Continued on page 31
Steps for replicating the studies
When setting up a trading system, the trader has some
options on how the system will operate. Here is a list of
some of the parameters I used and what they mean:
I was intrigued to determine
whether the volume flow,
Lo = 1: T
 his setting allows the system to buy and then when isolated, exhibits any
sell. trading potential.
So = 1: W
 ith this, the system will short (basically,
betting the price will go down) and then buy
December 2023 • Technical Analysis of Stocks & Commodities • 29
MARKET RAP
THE WORLD OF RETAIL TRADING
Emilio Tomasini is an adjunct professor of corporate finance at the
University of Bologna in Italy and is a professional trader. He has au-
dited over 5,000 accounts of traders during 13 years of a real-money
trading competition, giving him unique insights into what helps a retail
trader to succeed. He has expertise in technical analysis and trading
Emilio Tomasini
system design. In this column, he shares his sometimes “unserious”
thoughts on serious topics in finance. In his writings, he hopes to help the retail trader better understand the leap
from unprofitable to profitable trader, firmly believing that the right answers can come only if the right questions
are asked. At his website at www.emiliotomasini.com, he offers some of his expertise in a free video course.

WHAT IS GOOD FINANCIAL responded that he only dealt with if you wanted something, you had
INFORMATION ? (PART 2 OF 2) “serious” topics. You see, even in the to take a piece of paper, write what
Last month, I discussed what true academic world, there are trends, just information you desired, politely
financial information is as opposed as in fashion and cosmetics. Back request a complimentary copy, put
to financial hearsay and gossip. For then, for decades, technical analy- it in an envelope, affix a stamp, and
writing that piece, I looked back over sis was compared to sorcery, and a drop it in a mailbox.
my career in the world of journalism trendline held the same weight as a I still vividly recall the day the first
and how I got started in it at age 14, fortune-teller reading coffee grounds. printed copy of Technical Analysis of
and I became nostalgic. I believe some It was only with the advent of behav- Stocks & Commodities magazine
readers will identify with my story of ioral finance and the various Nobel arrived at my home in the distant Ital-
how I came to find out about technical Prizes awarded to economists who ian province. It was a magazine with
analysis and how that changed my debunked the belief in rational finan- glossy paper and articles that delved
direction in life. My story may be a cial markets that technical analysis into that world I had only been able
lot like yours. began to be viewed benevolently. to peek at through a keyhole until
I first delved into technical analysis Let’s just say I was unintentionally that moment. It was like a child step-
in 1987. It was a late night in a disco ahead of the curve. ping into a candy store. I remember
when a friend of mine began to talk my father observing me, intrigued
about stocks and how a person could With just a chart, you by my passion, and commenting,
earn substantial profits by investing “The Americans are always one
in the stock market. His words fas- could stand toe-to- step ahead. I want you to subscribe
cinated me and within a few days, I toe with the financial to this magazine. If you read it and
went to a bookstore and purchased the market professionals. keep it, it will be a treasure trove of
only Italian book on technical analy- knowledge.” My father, Ercole, born
sis. That book hit me like a lightning Because of my stubborn nature, in 1921, had fought in World War II,
bolt, and at that moment, I decided I didn’t give up. After complet- but as an entrepreneur, he had a knack
it would be my calling because of ing my doctoral dissertation at the for innovation. I can only thank him
the sense of freedom emanating University of Reading in the United today for buying me a subscription
from those pages. With just a chart, Kingdom (where they were more to this magazine.
you could stand toe-to-toe with the tolerant of new ideas), I decided to I had collected every printed copy
financial market professionals. It was attend a technical analysis course of the magazine until I had to succumb
like a showdown at the OK Corral, for institutional investors in Milan. to space constraints and I switched
and may the best person win. It was there, sitting among my class- to using the digital archive of past
From that point on, during my mates, that I caught a glimpse of a issues, where the entire collection of
years as a university student, I strived trader from a major bank with an magazine content is just a click away
to build an academic path that in- English-language technical analysis (at Traders.com). I still remember my
cluded courses in finance. When I magazine. I distinctly remember writ- astonishment when, driven by my
approached my finance professor to ing down, with trembling hands, the insatiable entrepreneurial curiosity,
propose writing my final dissertation magazine’s title and mailing address. I contacted the magazine via email
on technical analysis, he dismissively Back then, there was no internet, so to ask how many other subscribers
30 • December 2023 • Technical Analysis of Stocks & Commodities
MARKET RAP
they had in Italy, and they informed sion through the front door into the
me they had over 900 subscribers temple of finance. Some readers will
throughout Italy. That was a mas- I owe a great deal to Technical identify with my story
sive number for that point in time Analysis of Stocks & Commodities of how I came to find
and it demonstrates the demand that magazine because, even in those ear-
existed for quality information in lier skeptical times, it gave me a sense
out about technical
the field of technical analysis. I also of discipline that was anything but analysis and how that
distinctly remember the moment charlatanism. This magazine made changed my direction
when the beautifully colored covers its mark on financial publishing, and in life.
of this magazine suddenly appeared today, I proudly sign this editorial.
in university libraries all over Europe. There is an ancient pact that goes: I hope to give back some of what
The academic world, riding the wave When fate gives you something, it is I’ve taken from these pages over the
of behavioral finance’s success, had your duty, if possible, to give back. years. I wish everyone reading this
begun to embrace technical analysis, And with all my writings, in which I good investing and trading.
and the subject’s most well-known try to share some of what I’ve learned
magazine had been granted admis- as well as what I’ve learned to avoid,

FIGUEREDO/TREND-FOLLOWING
Continued from page 29
Smaller timeframes generally
showed less promise, a
VCoef: Fixed at 2.5
Lo: Fixed at 0
pattern I’ve observed with
So: Fixed at 0 many strategies I test.
Some of the values could be played around with to see
which works best. Following are some optimizations I “Coding For Demonstration Trading Systems, In Easy-
tried: Language,” to see these performances firsthand. While
there was potential in the equity markets, none seemed
My optimizations significant enough to warrant close attention. However, I
Fast: Anywhere between 10 and 30, moving in suggest checking them out and assessing if they fit your
steps of 5 (such as 10, 15, 20...) risk tolerance. On another note, smaller timeframes gen-
Slow: Anywhere between 30 and 80, moving in erally showed less promise, a pattern I’ve observed with
steps of 5 many strategies I test. Remember, always do your own
ExitCross: Fixed at 1 research before implementing any trading strategy.
DaysBack: Choose any value between 14 and 60,
adjusting in steps of 10. Dillon Figueredo is university student set to graduate
in 2025. He is pursuing opportunities for entering the
Think of these settings as the various dials and but- field. He can be reached at dillon.figueredo@gmail.com
tons in your car. or 816 896-8959.

SUMMARY The code given in this article is available in the Article


After examining various markets across multiple time- Code section of our website, Traders.com.
frames, two standout strategies emerged for the 10-year
treasury yield (@TY.D). On the 55-minute chart, trading FURTHER READING
the crossover system with volume flow shows potential, Katsanos, Markos [2004]. “Volume Flow Indicator
even if it’s currently at a loss. Over time, this method Performance,” Technical Analysis of StockS & com-
may prove profitable. On the 210-minute chart, using the moditieS, Volume 22: July.
VFI-only strategy also displayed encouraging results. I’d
recommend trying out the code I provide in the sidebar,
December 2023 • Technical Analysis of Stocks & Commodities • 31
The 2HL+ Pattern

A Directional Pattern
To Ride The Wave
Here is a price pattern you can use with a trading strategy and bearish. Figure 1 depicts the bullish 2HL+ pattern
to filter trades and ride a price wave. We’ll explain the and the bearish 2HL+ pattern.
logic and show step-by-step how to do it. The bullish 2HL+ pattern occurs when:

by Andrea Unger • Two sessions ago, prices closed higher than the

Is
previous close
it possible to use a pattern to ride a price • In the last session, prices closed higher than the
wave? Let’s see how! previous close
At Unger Academy, we teach how to use • The current session opened at a price higher than
price patterns to filter market entries and the previous close
make our trading strategies more profitable
and robust. In this article, we will discuss the The bearish 2HL+ pattern occurs when:
pattern we call “2HL+.” It is a directional filter that looks
for two consecutive up/down market closes and requires • Two sessions ago, prices closed down from the
additional confirmation of the price direction. previous close
We will test it with a real strategy on one of the most • In the last session, prices closed down from the
HUZA STUDIO/SHUTTERSTOCK

buoyant markets: gasoline futures. previous close


• The current session opened at a price lower than
What is 2HL+? the previous close
The easiest way to understand it is with a graphical
representation of the pattern in its two variants, bullish If we look at the pattern’s graphical configuration and
32 • December 2023 • Technical Analysis of Stocks & Commodities
PRICE PATTERNS

conditions, we realize why this pattern is called “direc-


tional.” Specifically, it expresses a clear intention that the
market is either up (when it is bullish) or down (when
it is bearish).
If we want to encode the pattern in formulas and use
PowerLanguage, we would write:

Bullish 2HL+ pattern:

(closed1>closed2 and closed2>closed3 and


opend0>closed1) FIGURE 1: THE 2HL+ PATTERN. The 2HL+pattern is based on two consecu-
tive up (down) market closes. The two variants—bullish and bearish—are
Bearish 2HL+ pattern: depicted here.
Countsession Count2H % Count2H Count2L % Count2L
(closed1<closed2 and closed2<closed3 and @RB 3.410 370 11% 256 8%
opend0<closed1) @EC 3.411 289 8% 417 12%
@GC 3.413 455 13% 282 8%
where: @NQ 3.408 418 12% 309 9%
@US 3.408 229 7% 267 8%
closedN indicates the closing price of N sessions ago
FIGURE 2: HOW OFTEN DOES THE 2HL+ PATTERN OCCUR? Shown here are
opend0 indicates the opening price of the current
the percentage of occurrences of the 2HL+ pattern in different markets from
session 2010 using a 15-minute timeframe. The 2HL+ pattern occurs in only about 10%
of the sessions for the instruments tested, suggesting the pattern would filter
How much can it filter? out up to 90% of long and short trades if used as a market entry filter.
Since this pattern seeks strong market directionality,
we can easily see that it is quite selective and, if used to count2H indicates the number of bullish events, while the
filter our entries, will significantly reduce the number of variable count2L indicates the bearish events.
trades of a system. Let us see how much 2HL+ can filter For a given instrument, we can then relate these two
by using some simple code that calculates the percentage numbers to the total number of sessions (countsession)
of occurrence in different markets from 2010 and using and estimate how well the 2HL+ pattern filters.
a 15-minute timeframe: The table in Figure 2 shows the results for a range of
instruments (equities, bonds, energy, metals, and currency
var: count2H(0), count2L(0), countsession(0); crosses); we find that the 2HL+ pattern occurs in only
about 10% of the sessions for all the instruments used,
if time = 1900 then begin and therefore, when used as a filter for market entries, it
can filter out up to 90% of long and short trades.
if closeS(1)>closeS(2) and closeS(2)>closeS(3) and Since it is a very selective filter, we need to use it in
openS(0)>closeS(1) then systems with few other conditions to avoid reducing the
count2H = count2H + 1; number of trades too much and losing statistical signifi-
if closeS(1)<closeS(2) and closeS(2)<closeS(3) and cance in the results.
openS(0)<closeS(1) then
count2L = count2L + 1; A trading strategy
countsession=countsession+1; Let’s develop a straightforward strategy for trading RBOB
gasoline futures. We will start with a simple strategy that
end;

if LastBarOnChart then The pattern we call “2HL+” is a


print(count2H,” “,count2L,” “,countsession); directional filter that looks for two
This code counts how often the pattern has occurred
consecutive up/down market closes.
in the historical period under consideration: the variable
December 2023 • Technical Analysis of Stocks & Commodities • 33
works according to the following rules:

• Open a long/short position on the break of the high/


low of the previous session
• Set a stop-loss of $1,500 and a take-profit of
$3,750
• Close the remaining open positions after 5 sessions
in the market.

input: MyStartTrade(0000), MyEndTrade(2400);


inputs: MyStop(1500), MyProfit(3750);
input: maxdaysintrade(5);

MULTICHARTS
var: highd1(0), lowd1(0);
var: opend0(0), closed1(0), closed2(0), closed3(0);
var: mp(0), daysintrade(0);
Avg. Trade # of Trades NetProfit Max DD
highd1 = highS(1); lowd1 = lowS(1); opend0 = openS(0); $126 2,374 $298,611 −$38,728
closed1 = closeS(1); closed2 = closeS(2); closed3 = closeS(3); FIGURE 3: SIMPLE TRADING STRATEGY. A simple breakout system is used to
trade RBOB gasoline futures, and the starting equity curve and system metrics
if tw(MyStartTrade,MyEndTrade) then begin are shown here. The equity curve is positive but the average trade profit is too
low to cover trading costs and the number of trades is very high.
buy next bar at highd1 stop;
sellshort next bar at lowd1 stop; if Myprofit > 0 then setprofittarget(MyProfit);

end; We will apply the strategy to a chart of RBOB gaso-


line futures with a 15-minute timeframe and data from
mp = marketposition; 2010 to today.
We get the equity curve and metrics shown in Figure
if time = 1800 and mp <> 0 then daysintrade = daysintrade 3.
+ 1; This seems to be a good start: equity grows with good
if mp <> mp[1] and mp <> 0 then daysintrade = 1; regularity.
However, for the chosen instrument, the average trade
if daysintrade >= maxdaysintrade and maxdaysintrade > 0 is still too low to cover the trading costs. This requires
then begin us to continue our development, trying to maximize this
if time >= 1645 and time < 1700 then begin parameter while keeping the profit curve as constant as
if mp = 1 then sell next bar market; possible.
if mp = -1 then buytocover next bar market; The number of trades made by the strategy is still very
end; high (almost 200 per year). We therefore decide to apply
end; a condition very similar to our 2HL+ pattern to filter
market entries. The two rows representing the “order
Setstopcontract; engine” of the strategy become these:
if MyStop > 0 then setstoploss(MyStop);
if closed1>closed2 and closed2>closed3 then buy next bar
at highd1 stop;
if closed1<closed2 and closed2<closed3 then sellshort next
We will test it with a real strategy bar at lowd1 stop;
on one of the most buoyant
We note that these conditions are very similar to those
markets: gasoline futures. of the 2HL+ pattern (in addition, the latter would require
comparing opend0 and closed1).
34 • December 2023 • Technical Analysis of Stocks & Commodities
We have also optimized the start and end times of
the time window by restricting our entries to the time
from 1:00 pm to 5:00 pm exchange time; this means
that we should replace the first line of the original code
as follows:

input: MyStartTrade(1300), MyEndTrade(1700);

With the updated order engine and the new time win-
dow, we get the equity and metrics shown in Figure 4.
We note that the number of total trades has been greatly
reduced. We require that the last two session closes were
both up/down, as a necessary condition before entering
the market long/short. In addition, we only allow entry
if the highd1 and lowd1 levels are broken between 1:00
pm to 5:00 pm.
The profit curve slopes upward, and we have increased Avg. Trade # of Trades NetProfit Max DD
the average trade from $126 to $220, which seems decid- $220 515 $113,329 −$29,576
edly attractive for gasoline futures. FIGURE 4: FILTERING TRADE ENTRIES WITH CONDITIONS. To reduce the
Based on the results achieved, we continue in this number of trade signals in the breakout system, a condition similar to the 2HL+
direction and add our 2HL+ pattern to the starter script. pattern is applied and the entry time window is restricted. This initial attempt
The two lines of code will look like this: to filter market entries shows improved average profit per trade and greatly
reduced the number of trades.
if closed1>closed2 and closed2>closed3 and
opend0>closed1 then buy next bar at highd1 stop;
if closed1<closed2 and closed2<closed3 and
opend0<closed1 then sellshort next bar at lowd1 stop;

And we get the equity curve and metrics shown in


Figure 5.
The number of total trades has been further reduced
due to the latest condition introduced by the 2HL+ pat-
tern. In addition to the previous conditions, to enter the
market long/short, it is required that the current session
was opened at a price higher/lower than the last session
close.
Having used the 2HL+ pattern, let us analyze the other
differences from the previous case:

• The profit curve has remained upward Avg. Trade # of Trades NetProfit Max DD
• NetProfit has remained more or less the same $378 297 $112,232 −$20,559
• Max DD dropped from $30K to $21K FIGURE 5: FILTERING TRADE ENTRIES WITH THE 2HL+ PATTERN. When
• The average trade of the system increased con- the 2HL+ pattern and an additional entry condition is added to the starter script,
siderably, from $220 to $378. The latter value is the number of trades is further reduced, drawdowns dropped, and average
undoubtedly excellent for trading this instrument. profit per trade increased considerably.
It allows us to comfortably cover all the trading
costs while making a good profit margin. pattern significantly reduces the number of trades, and
adding other conditions would further reduce the number
Can we improve the system further? of remaining trades and risk to deprive our test results
We can say that we have reached a “limit” number
for this strategy. As we know now, adopting the 2HL+ Continued on page 51
December 2023 • Technical Analysis of Stocks & Commodities • 35
Using Neural Network Technology To Create A Dynamic Trading Model

N-CAMA: Combining Artificial


Intelligence With A Time-Tested
Technical Analysis Indicator
Traditional technical analysis tools can benefit from the time-tested tool to the next level by harnessing some of
aid of machine learning. Here, we introduce a dynamic today’s artificial intelligence techniques.
trading model called the N-CAMA. It combines a time-
tested tool, the adjustable moving average, with the power The adjustable moving average (AMA)
of artificial intelligence for prediction of tomorrow’s In the AMA, the length of the moving average is adjust-
prices. Find out how it works. able to suit the prevailing market condition. In my last
article, I demonstrated how it can be more profitable
by Jacinta Chan, PhD than using the most optimized moving average (which

In
happened to be the 20-day moving average for the cases
my previous article, “The Time-Tested Ad- of the Hang Seng Index futures, KOSPI futures, and
justable Moving Average,” I discussed the SiMSCI futures). The AMA significantly outperformed
adjustable moving average (AMA) as a very the 20-day moving average and the threshold benchmark
good tool to use in today’s fast-changing passive buy-and-hold strategy in these markets in the
WHO IS DANNY/SHUTTTERSTOCK

markets. I explained how it is calculated past decade for HSIF and KOSPIF. (However, for the
and I presented some research that showed SiMSCIF, AMA’s performance was only marginally
it boosted returns in several stock index futures markets better than the 20-day moving average.)
that I backtested. This calls for a more dynamic algorithm that generates
In this article, I’ll demonstrate how you can take this superior trading results.
36 • December 2023 • Technical Analysis of Stocks & Commodities
TRADING TECHNIQUES

Methodology
As markets mature, many technical
tools such as moving averages that
used to be popular have failed to
perform well because mature mar-
kets are saturated with sophisticated

MATLAB R2023A
program trading, as much published
literature shows. Some studies found
in the literature show that abnormal FIGURE 1: THE BACKPROPAGATION NEURAL NETWORK
returns using basic technical indica-
tors of yesteryear are fast declining. A 2004 article in y(t) = f(y(t−1), y(t−2),..., y(t−d), x(t−1), x(t−2),...,x(t−d)
the Journal Of Banking & Finance by D. Olson (“Have Eq. 1
Trading Rule Profits In The Currency Markets Declined
Over Time?”) found empirical evidence that financial where the obtained value of the dependent output signal
markets are evolving and increasing their efficiency y(t) is regressed on d former values of the target signal
over time. With increasing efficiency, abnormal profits y(t) and d previous values of exogenous (independent)
are harder to come by. input signals x(t). The weights and biases will be adjusted
As traditional statistical methods reach their limita- continuously to minimize the error term between output
tions, artificial intelligence and machine learning are (y*(t + 1)) and target value (y(t + 1)) to achieve the lowest
popularly being used in forecasting financial time series mean of the error terms.
today. Artificial neural networks are a capable prediction The backpropagation neural network (Figure 1) em-
tool, and they outperform most single and fixed moving- ploys a training process of error backpropagation that
average rules and other traditional statistical methods uses recursive gradient descent method that minimizes
(as reported in many academic studies and articles; see the sum of squared errors of the system by moving down
“Further reading” at end for several that I reference). the gradient error curve. The values of the weights are
Some studies have shown significant profits on stocks determined by an iterative learning process. Siegelmann
using ANNs. My research using a dynamic trading model et al. show that NARX networks perform better on prob-
I call the N-CAMA confirms these findings. lems involving long-term dependencies and is used to
establish a one-step-ahead prediction model.
Artificial neural networks However, literature review shows technical trading
Artificial neural networks (ANNs) are sets of simple techniques are still lacking in accounting for varying
interconnected factors processing information. Here’s volatility clustering found in most financial time-series
how it works: Each connection of the neural network data. In view of this deficiency, this research introduces
gets a weight attached to it. The elements in the net- neural networks that use an innovated technical indicator
work are linked in a feedforward style. The error term as an input to predict the next output. The neural network
between the actual value and the predicted output value can train itself by making the comparison between the
is backpropagated across the network for the weights to predicted output and the actual data of the time series,
be revised in order to minimize the error between the which is destined the target.
predicted and the actual value. The descriptive statistics for these series were presented
In a 1997 IEEE article by H. Siegelmann et al. (“Com- and analyzed in my previous article. It has been found that
putational Capabilities Of Recurrent NARX Neural Net- all of the stock indexes futures possess excess kurtosis,
works”), the authors show their work on a different type
of ANN that takes feedback from the output neuron, the
target. They call it nonlinear autoregressive models with
exogenous inputs (NARX). NARX is a kind of recurrent
In view of the growing efficiency
dynamic backpropagation neural network with feedback of financial markets, traditional
links connecting some layers of the network. The NARX technical analysis tools will need
model is built on the linear auto regressive exogenous the aid of machine learning to
(ARX) method, which is generally applied in time series trade in the future.
modeling. NARX can be modeled as follows:

December 2023 • Technical Analysis of Stocks & Commodities • 37


that is, they display fat tails. Besides indicating inefficient
markets, it indicates that there are probabilities of high
risks and returns.

The N-CAMA trading model


I will present a dynamic trading model using a neural
network. I call this model the N-CAMA. I have found it

EIKON DATASTREAM
to work well in recent Asian futures markets.
The goal of my research has been to develop an in-
novative technical indicator that performs well in the
post-pandemic East Asian markets. It is well known that FIGURE 2: AMA AND N-CAMA, HANG SENG INDEX FUTURES. This demon-
strates the adjustable moving average (AMA) and neural-network-trained AMA
it is extremely difficult to consistently forecast future
(N-CAMA) applied to HSIF closing prices.
prices accurately based on past time series. Trading in
the post-pandemic Asian markets has born this out, where
making investment timing decisions has become more
difficult than before. This is why I set out to develop my
trading model.

Training the N-CAMA model


The model is trained using eight years of training data;
the model is tested on two years of out-of-sample data.
In this model, the next period’s close is predicted using
the close and an adjustable moving average as inputs into
a nonlinear autoregressive ANN with exogenous inputs
FIGURE 3: AMA AND N-CAMA, KOREAN STOCK INDEX FUTURES. This
(NARX) process.
demonstrates the AMA and N-CAMA applied to applied to KOSPIF closing
The results show significant abnormal returns above
prices.
the passive threshold buy-and-hold market returns for
all three stock index futures contracts.
Here, I’ll explain the approach.
First, the adjustable moving average (AMA) using the
efficacy ratio is computed. AMA is unique, as the efficacy
ratio can adjust the length used for the moving average
according to the prevailing market condition.

Eq. 2

where: FIGURE 4: AMA AND N-CAMA, SINGAPORE MSCI FUTURES. This demon-
strates the AMA and N-CAMA applied to SiMSCIF closing prices.
Efficacy ratio = L
 ong-term std. dev./
Short-term std. dev.
The inputs are the daily close and the AMA for the
and stock index futures for eight years from January 2, 2013
to December 31, 2020 for training.
Ct is the daily close. Matlab’s “narxnet” is used to establish a one-step-ahead
prediction mode. (The code generated from Matlab is
Nonlinear autoregressive with exogeneous input shown in the sidebar, “Script Generated By Matlab For
(NARX) neural networks, which are available in Matlab, NARX Network.”) The architecture of a NARX network
are used in this research because it has the benefits of includes the number of hidden layers, the number of
multilayered perceptrons and back-propagation neural delays (the number of past data of that network that ac-
networks. count for training), and portions of training, validation,
38 • December 2023 • Technical Analysis of Stocks & Commodities
HSIF KOSPIF SiMSCIF
Year Buy & Hold MA20 AMA' NCAMA' Buy & Hold MA20 AMA' NCAMA' Buy & Hold MA20 AMA' NCAMA'
2013 −1.22% −0.70% 1.21% 42.19% −2.05% 7.82% −3.96% 27.58% −0.05% 10.12% 13.98% 6.68%
2014 7.19% −4.77% −0.07% 15.37% −8.37% −8.45% −11.12% −0.11% 4.58% 3.92% −0.41% 6.21%
2015 −12.70% 21.12% 46.51% 26.76% −1.45% −0.49% 14.80% 7.19% −15.83% 6.48% 25.95% 10.89%
2016 28.69% −3.11% 7.85% −27.96% 8.15% −17.26% −15.85% 16.07% −0.83% −9.75% −11.66% 2.08%
2017 24.72% 14.09% 14.69% 2.81% 25.40% 18.71% 24.00% 5.43% 20.48% −1.85% −10.26% 6.88%
2018 −18.12% −32.35% −1.11% 26.39% −19.75% −20.82% −22.05% 1.65% −10.94% −2.25% 5.14% 5.86%
2019 −4.79% 21.11% 1.79% 2.68% 12.67% 12.23% 22.25% 6.09% 11.34% 16.12% 8.31% 14.95%
2020 5.76% −8.09% −14.54% −20.22% 31.83% 32.28% 21.75% −14.00% −12.52% 14.50% 5.71% 2.66%
Average 3.69% 0.91% 7.04% 8.50% 5.80% 3.00% 3.73% 6.24% −0.47% 4.66% 4.59% 7.03%
FIGURE 5: IN-SAMPLE TRAINING RESULTS, 2013–2020. This table compares the percentage returns for the in-sample period 2013–2020 for the four strate-
gies: AMA, MA20, N-CAMA, and buy-and-hold, for the HSIF, KOSPIF, and SiMSCIF markets.
HSIF KOSPIF SiMSCIF
Year Buy & Hold MA20 AMA' NCAMA' Buy & Hold MA20 AMA' NCAMA' Buy & Hold MA20 AMA' NCAMA'
2021 −15.82% −8.14% 1.48% −2.26% 1.31% −12.95% 5.41% 24.49% 4.38% −3.31% −0.64% 11.64%
2022 −6.54% 6.48% 2.89% 51.81% −25.58% 7.14% 17.59% 26.50% −14.54% 17.39% 16.71% 2.81%
Average −11.18% −0.83% 2.19% 24.78% −12.13% −2.91% 11.50% 25.50% −5.08% 7.04% 8.04% 7.22%
FIGURE 6: OUT-OF-SAMPLE TRAINING RESULTS AND VALIDATION, 2021–2022. This table compares the out-of-sample percentage returns (pilot run) for
the period 2021–2022 for the four strategies AMA, MA20, N-CAMA, and buy-and-hold, for HSIF, KOSPIF, and SiMSCIF.

and testing. NARX networks divide the data into three Even after taking transaction costs of 0.005 index
subsets: training set, validation set, and testing set, with point for each transaction, the trading result confirms
a configured percentage for each of them; in this study, that N-CAMA outperforms the threshold buy-and-hold
the proportions are training 75%, validation 15%, and strategy as well as the two tested trading systems for all
testing 15%. the futures contracts for the in-sample period (Figure
N-CAMA uses the current close price and AMA to 5). N-CAMA outperforms buy-and-hold, the fixed and
predict the next period’s close. This output will be used adjustable moving averages for HSIF and KOSPIF in
in the modeling stage to generate automated buy or sell the out-of-sample period (Figure 6). N-CAMA on the
signals. Comparing this predicted future close against average did not perform better than AMA in the out-of-
the current close, this approach is similar to that of the sample period for SiMSCIF.
one written about in 1999 by Yao et al., which is to buy Therefore, it can be concluded that N-CAMA works
at the next day’s open when the predicted close is higher well to generate abnormal profits for HSIF and KO-
than the current close. SPIF. However, given the suboptimal out-of-sample
The N-CAMA trading rules are as follows: performance for SiMSCIF, it is advisable to analyze
the performances of N-CAMA and AMA on SiMSCIF,
• Buy at the next market open (Ot+1) if C*t+1 > Ct especially on recent performance. We should look at the
• Sell at the next market open (Ot+1) if C*t+1 < Ct significance of the overall returns including the pilot
trading returns and the maximum consecutive losses to
where Ct is the current market close, Ot+1 is the following determine how to place the stop-losses.
market day’s open, and C*t+1 is the predicted value for The positive results are in support of academic literature
the following market day.

Results
N-CAMA predicts the value of the next day. If the
I will present a dynamic
predicted value is higher than the closing price, then trading model using a
the trading signal is to buy at the next day’s open. N- neural network. I call this
CAMA seems to predict the values quite well and the model the N-CAMA.
actual prices follow the predicted values, as can be seen
in Figures 2 through 4.
December 2023 • Technical Analysis of Stocks & Commodities • 39
previously published (see “Further reading” at end), which the passive buy-and-hold strategy.
provides evidence that automated artificial intelligent N-CAMA shows the highest return among the three
trading performs somewhat better than a fixed-length trading models, which lends support to current literature
moving average, the adjustable moving average, and also that suggests that artificial neural networks allow the

SCRIPT GENERATED BY MATLAB FOR NARX NETWORK


net.divideParam.testRatio = 15/100;
Matlab’s “narxnet” is used to establish a one-step-ahead
prediction mode. The architecture of a NARX network % Train the Network
[net,tr] = train(net,x,t,xi,ai);
includes the number of hidden layers, the number of
delays (the number of past data of that network that ac- % Test the Network
count for training), and portions of training, validation, y = net(x,xi,ai);
and testing. NARX networks divide the data into three e = gsubtract(t,y);
performance = perform(net,t,y)
subsets: training set, validation set, and testing set, with
a configured percentage for each. % View the Network
view(net)
% Solve an Autoregression Problem with External Input
% with a NARX Neural Network % Plots
% Script generated by Neural Time Series app % Uncomment these lines to enable various plots.
% Created 27-Jul-2023 23:31:04 %figure, plotperform(tr)
% %figure, plottrainstate(tr)
% This script assumes these variables are defined: %figure, ploterrhist(e)
% %figure, plotregression(t,y)
% simplenarxInputs - input time series. %figure, plotresponse(t,y)
% simplenarxTargets - feedback time series. %figure, ploterrcorr(e)
%figure, plotinerrcorr(x,e)
X = simplenarxInputs;
T = simplenarxTargets; % Closed Loop Network
% Use this network to do multi-step prediction.
% Choose a Training Function % The function CLOSELOOP replaces the feedback input
% For a list of all training functions type: help nntrain % with a direct connection from the output layer.
% 'trainlm' is usually fastest. netc = closeloop(net);
% 'trainbr' takes longer but may be better for challenging netc.name = [net.name ' - Closed Loop'];
% problems. view(netc)
% 'trainscg' uses less memory. Suitable in low memory [xc,xic,aic,tc] = preparets(netc,X,{},T);
% situations. yc = netc(xc,xic,aic);
trainFcn = 'trainlm'; closedLoopPerformance = perform(net,tc,yc)
% Levenberg-Marquardt backpropagation.
% Step-Ahead Prediction Network
% Create a Nonlinear Autoregressive Network with % For some applications it helps to get the prediction a
% External Input % timestep early. The original network returns predicted
inputDelays = 1:2; % y(t+1) at the same time it is given y(t+1). For some
feedbackDelays = 1:2; % applications such as decision making, it would
hiddenLayerSize = 10; % help to have predicted y(t+1) once y(t) is available, but
net = narxnet(inputDelays,feedbackDelays,hiddenLayerSiz % before the actual y(t+1) occurs. The network can be
e,'open',trainFcn); % made to return its output a timestep early by removing
% one delay so that its minimal tap delay is now 0 instead
% Prepare the Data for Training and Simulation % of 1. The new network returns the same outputs as the
% The function PREPARETS prepares timeseries data for a % original network, but outputs are shifted left one
% particular network, shifting time by the minimum % timestep.
% amount to fill input states and layer states. nets = removedelay(net);
% Using PREPARETS allows you to keep your original time nets.name = [net.name ' - Predict One Step Ahead'];
% series data unchanged, while easily customizing it for view(nets)
% networks with differing numbers of delays, with open [xs,xis,ais,ts] = preparets(nets,X,{},T);
% loop or closed loop feedback modes. ys = nets(xs,xis,ais);
[x,xi,ai,t] = preparets(net,X,{},T); stepAheadPerformance = perform(nets,ts,ys)

% Setup Division of Data for Training, Validation, Testing


net.divideParam.trainRatio = 70/100; Credit: Matlab R2023a
net.divideParam.valRatio = 15/100;

40 • December 2023 • Technical Analysis of Stocks & Commodities


model to learn better in the training period and per-
form better in the out-of-sample period. These results
are consistent with other similar studies that have been This research introduces neural
published, which show that machine learning using tech- networks that use an innovated
nical analysis indicators can lead to abnormal returns in
inefficient markets. technical indicator as an input to
Thus, this research should expand to include other predict the next output.
markets in the region. In real-life trading, the trading
period should be shortened. I used daily closes for in-
put and the next open for trading. In real-life trading, Singapore.
especially in today’s fast-trading futures markets, this [2023]. “The Time-Tested Adjustable Moving Aver-
is too slow. A much shorter timeframe such as a half age,” Technical Analysis of Stocks & Commodities,
day, two hours, one hour, or even every fifteen or ten Volume 41: November.
minutes can be used. [2011]. “The Adjustable-Bands Z-Test,” Techni-
In conclusion, the findings of this trading simulation cal Analysis of Stocks & Commodities, Volume
indicate that in view of the growing efficiency of financial 29: December.
markets, traditional technical analysis tools will need the [2006]. “Trading Trends With The Bollinger Bands
aid of machine learning to trade in the future. Artificial Z-Test,” Technical Analysis of Stocks & Commodi-
intelligent methods are a way to trade futures contracts ties, Volume 24: March.
in this post-pandemic era. The result of this study should Chan Phooi M’ng, J., and M. Mehralizadeh [2016].
interest traders who, in today’s increasingly difficult and “Forecasting East Asian Indices Futures Via A Novel
volatile markets, find that basing their trading decisions Hybrid Of Wavelet-PCA Denoising And Artificial
solely on traditional technical analysis signals is not Neural Network Models,” PLOS One, doi:10.1371/
enough, since it is not as profitable as it used to be. journal.pone.0156338
Chan Phooi M’ng, J. [2018]. “Dynamically Adjustable
Jacinta Chan has a PhD in financial statistics, lectures Moving Average (AMA’) Technical Analysis Indicator
on investing topics at the university level, and spent most To Forecast Asian Tigers’ Futures Markets,” Physica
of her career as a futures and equities dealer. She is A: Statistical Mechanics And Its Applications, Vol.
author of Algorithm Trading 101: Trading Made Simple 509, pp. 336–345.
For Everyone. She is currently researching neural net- Gencay, R., T. Stengos [1998]. “Moving Average Rules,
work trading systems. She can be reached at jacinta@ Volume, And The Predictability Of Security Returns
um.edu.my or jacintachanpm@gmail.com. With Feedforward Networks,” Journal Of Forecasting,
Vol. 17, pp. 401–414.
Further reading Guerard, J., and H. Markowitz [2018]. “The Existence
Andrada-Felix, J, and F. Fernandez-Rodriquez [2008]. And Persistence Of Financial Anomalies: What Have
“Improving Moving Average Trading Rules With You Done For Me Lately?” Financial Planning Re-
Boosting And Statistical Learning Methods,” Journal view, Vol. 1, pp. 3–4.
Of Forecasting, Vol. 27, pp. 433–449. Kuan, C., K. Hornik, and H. White [1994]. “A Convergence
Atsalakis, G., and K. Valavanis [2009]. “Surveying Stock Result For Learning In Recurrent Neural Networks,”
Market Forecasting Techniques—Part II: Soft Com- Neural Computation, Vol. 6, pp. 420–440.
puting Methods,” Expert Systems With Applications, Lo, A., H. Mamaysky, and J. Wang [2000]. “Foundations
Vol. 36, No. 3, pp. 5932–5941. Of Technical Analysis: Computational Algorithms,
Chan, Jacinta [2019]. Automation Of Trading Machine: Statistical Inference, And Empirical Implementa-
How To Develop Trading Model, Palgrave Macmillan, tion,” The Journal Of Finance, Vol, LV, No. 4, pp.
Singapore. 1705–1765.
[2022]. Algorithm Trading 101: Trading Made Locke, P., and P. Venkatesh [1997]. “Futures Market
Simple For Everyone, 2nd. Ed., https://www.amazon. Transaction Costs,” Journal Of Futures Markets, Vol.
com/Algorithm-Trading-101-everyone-professional/ 17, No. 2, pp. 229–245.
dp/B08W3VZTDX Levenberg, K. [1944]. “A Method For The Solution Of
[2019]. Automation Of Trading Machine: How
To Develop Trading Model, Palgrave Macmillan, Continued on page 62
December 2023 • Technical Analysis of Stocks & Commodities • 41
INTERVIEW

Trader, Educator, Trading Tools Developer

A Conversation With Teresa Lo


Teresa Lo has enjoyed a productive and successful career in the stock
market over several decades. After working at brokerage firms after
college, she began trading for herself, first in daytrading and then swing
trading before eventually becoming more of an investor with a diversified
portfolio over a longer time horizon. With the completion of her latest
research program, she has come back to stockpicking.
Over the course of her career, she has launched several educational
resources for traders, created novel trading indicators, and devised an
algorithm for asset allocation. She has published a trading newsletter,
hosted chat rooms for traders to learn the craft, and has been inter-
viewed many times in the media. She has written articles for a number
of publications.
Lo considers it her mission in life to educate traders and investors about
the workings of the market and the traps to avoid, as well as how to trade
based on rules and simple technical analysis. Thousands of students have
benefited from learning the trading principles she shares.
After receiving a BA degree from the University of British Columbia with
a dual major in economics and psychology with a focus on life sciences, The objective of investing
she started working in the late 1980s at a local brokerage firm’s trading is to compound capital
desk, learning about the markets, trading securities, and watching how
brokerage firms operate, which she observed was not always in the best
efficiently, which means
interests of clients. drawdown must be as
After a dozen years in the investment industry, she called it quits in small as possible.
1998. She didn’t like what she saw and wanted to alert the public to some
of the internal practices taking place in the brokerage industry. She went
out on her own to found various websites such as IntelligentSpeculator (1998), trendVUE (2000), and InViVo
Analytics (2007). She joined forces with IQ Chart, which was absorbed by Infospace in 2001. As a TradeStation
user since 1997, she developed her own suite of trading tools and made them available by subscription.
Interestingly, she never really felt that technical indicators contributed to her trading success. Instead, she
chose to rely on simple bar and candlestick charts with volume, weaving in her ability to expertly read market
sentiment.
She wrote an article for this magazine titled “Looked At Market Sentiment Lately?” in the September 2009 issue
and ended the article by saying: “Each of us must continually cultivate independent, critical thinking in order to
get through times of euphoria and despair. We must not be our own worst enemy. It is not an easy task to avoid
being caught up in the madness of the crowds, but surviving turbulent markets depends on it.”
Stocks & Commodities contributing writer and ETF columnist Leslie N. Masonson interviewed Teresa Lo
via email in mid-September 2023 to discuss her trading career, the resources at her website, and her pursuits in
educating traders.
PHOTOBUAY/SHUTTERSTOCK

You’ve had an extensive and Briefly, why do you think there were trading arena?
varied career in the markets so many steps in your journey prior Like many investment advisors I
since the 1980s with several firms, to making educational and software know, I graduated from college during
startups, and your own websites. contributions to the investment and a huge bull market when firms were
42 • December 2023 • Technical Analysis of Stocks & Commodities
on hiring sprees. My background as because the knowledge
a science student turned out to be a and skill I acquired was
great asset because I was already used something I could keep To my mind, there are three
to learning about subjects I wasn’t and would be of value. types of risk: diversifiable
necessarily interested in, and doing risk, systematic market risk,
hard things. Problems were there to As a teenager, you invest­
be solved, and if I didn’t have the ed in mutual funds based
and unpriceable risk.
tools or the understanding, I would on using fundamentals.
acquire knowledge, gain insight, and What got you interested
come up with solutions. in investing? based on technical analysis?
I happened to live in Vancouver, One of my friends was a model at At the brokerage firms, some bro-
Canada, where the local stock ex- the top local agency, so I stumbled kers subscribed to thick chartbooks.
change had a notorious reputation into modeling as well, and when those They were like a shopping catalog
thanks to its role in financing penny paychecks started to add up, I thought featuring one stock per page with
stocks, the so-called “junior resource about investing the money. My dad some key fundamental metrics and
stocks.” In 1989, Forbes magazine had taken large losses speculating in a chart. I noticed people paid much
even called the Vancouver Stock gold bullion during the 1980 bubble, more attention to the charts than to
Exchange the “scam capital of the and so the business section of the the fundamentals, so I learned about
world.” newspaper was always on the dinner chart reading mostly by looking over
My first job offer was from an table. That’s how I learned about mu- people’s shoulders as they studied
infamous stock promoter who shall tual funds. At the time, I had no idea chartbooks.
remain nameless. The second one technical analysis was a thing.
was from the executive vice president How did you eventually learn about
of the second-largest firm, and so Why did you decide to use and use technical analysis?
I spent my first summer gathering fundamentals as the basis for The charts in the William O’Neil
documents from an offsite storage your decision-making, and what Daily Graphs books were simple
facility fulfilling requests from the fundamentals were you using? bar charts with a moving average
Royal Canadian Mounted Police in The newspaper featured articles and a line that showed the price
their investigation into the collapse about how to select mutual funds, and performance against the S&P 500
of International Tillex. It was just me I simply picked a fund from the list labeled “relative strength,” which
in the vault, so I read every piece of based on the statistics in the paper. might have been better described as
paper I handled. As it turned out, 1982 marked the relative performance to avoid confu-
My early experiences in the indus- beginning of the biggest asset bubble sion with the relative strength index
try really opened my eyes. I saw for in history, so anything I picked would (RSI) developed by J. Welles Wilder.
myself that financial gain was often have worked out fine. As traders What fascinated me was how various
at the expense of investors. I can’t like to say, better to be lucky than people would look at the same chart
recall meeting a single person who smart. Back then, mutual funds were and come to different conclusions.
traded for a living. The big money distributed by financial planners, I didn’t think much of technical
came from manufacturing endless not stock brokers. I had to make an analysis at that time because these
amounts of paper, flogging it to the appointment with a firm, and when judgments seemed so subjective,
public and churning their accounts, a I showed up, the woman was very which didn’t sit well with someone
process filled with markups, commis- stern and grilled the client in front with my academic background.
sion and fees. Everyone in the value of her before saying there was a 5 At the same time, though, I got to
chain extracted something from the percent commission up front. That know people’s thought processes,
investor, capitalizing on their hopes made for a poor first impression that what they were looking for, and how
and dreams. never left me. they tried to time entries by reading
As an outsider and a female, I had chart patterns, which is not the same
no chance to get on that gravy train Years later you focused on simple as using an indicator. Patterns made
even if I had wanted to, so right away, technical trading using price and more sense to me, because a chart is
I knew trading was the way out, not volume. Can you explain why you literally a graphical representation of
only because it’s an honorable job, but changed your trading approach prices paid and volume traded. People
December 2023 • Technical Analysis of Stocks & Commodities • 43
are only human, and very early in life, from the movie Trading Places. ity. In the world of promoted stocks,
I saw that they were irrational, even His young assistant was a college there was literally a new mania every
crazy, yet the episodes were somehow student with a background in en- month and there was a pattern to
predictable. Right away, I realized gineering and computer science. A the investor sentiment every time. I
all the hot stocks had something in month later, Winthorpe was gone and made money scalping these stocks,
common: investor sentiment. the young assistant took over, whom but trading profits were never a topic
My last and longest job was work- we dubbed “The Quant.” We immedi- of discussion since the big money
ing in a group headed by a legendary ately switched to TradeStation, which was in extracting fees and charging
trader and partner at Canada’s largest was my official entry into real-time commissions.
independent investment dealer. I wore technical analysis, and we also played Our firm had a U.S. trading desk,
a bunch of hats, one of which was around with NeuroShell. and a couple of times a year, the rumor
being the CFO for a charting service I’m not sure if we ever came up mill would go into overdrive that they
he owned with Ian Notley, who wrote with ideas that my boss thought were had “blown up”—again—shorting
a book on trend and cycle analysis. good. The war room itself was prob- something for their own account.
We distributed Notley’s Notes every ably more of a vanity project than There would be much finger-wagging
week and I sort of became a resource anything. The most valuable insight at the greed of the group because why
for those wanting to print charts from he imparted on us was that our job even bother to trade when they were
the “Notley terminal.” was “to keep ’em alive until they already pocketing the spread? Risk
Ian had his own indicator, the Not- get lucky, because there’s one born was considered something to be borne
ley curve. The firm’s technical analyst every minute.” If you think about it, by retail traders and investors.
told me it was a modified Coppock that is the essence of trend trading. That said, there is actually one trade
curve. Thinking about it now, there I convinced The Quant to finish worth mentioning, not just because
seems to be a group of indicators that school, and one honors math degree, I made a lot of money, but it goes to
are similar in nature such as RSI and one MBA, and a CFA designation show how things work in the busi-
MACD. They’re nice to look at, but later, he went on to do great things ness. The year was 1997. The stock
I’m not sure if they offer much value in risk management where he is still was Bre-X Minerals Ltd. I never paid
in terms of generating signals. working today. much attention to it, but at some point,
When the Vancouver Stock Ex- Along the way he worked at one this exploration play in Indonesia
change trading floor closed down, of the largest firms in the world and became the biggest underwriting
the firm’s head trader and his group discovered there was no reason to do bonanza around. Only the top mining
joined us, which meant we had our proprietary trading because market analysts from blue chip firms were
own trading desk. Our floor was making came with a guaranteed 20 invited to visit, and the share price,
reorganized and the remodeled percent return for the firm, confirm- based on speculation as to the size
conference room became a classic, ing once again my early observations of the deposit in the ground, was
high-tech “war room,” complete with that nobody in the investment dealer astronomical.
the big projection screen, dimmed value chain even needs to trade. Of course, investors expected that
lights, dark wood paneling, and so it would later be bought out for even
on. The occupants would be tasked In 1998, after working a dozen more insane prices by a major mining
with coming up with trading ideas, years at various brokerage firms, company rumored to be Freeport-
and of course, I immediately staked you retired at a young age. What McMoRan. Then on one fine day,
out a spot. instruments did you trade on the the chief geologist simply fell out
A couple of guys from outside the job and how successful were you of a helicopter while flying over the
firm showed up one day with a com- compared to your associates? property. There happened to be a
puter, set it up and demonstrated a At every firm I worked in, employ- group of broker-trainees in the war
charting program. Real-time stream- ees paid no commission, only a ticket room discussing the stock, which
ing data going into a PC was a new fee, so I traded for my own account was in a holding pattern just off the
thing then, and of course, we had to be like everyone else. I learned from highs trading on low volume as if
on the bleeding edge, right? The guy the floor traders to trade only what the buyout offer would be coming. I
who provided the charting program was hot and avoid what was “dead.” finally could take no more, printed
turned out to be a real-life version of Thinking about it now, “hot” meant off a chart and said listen up, this is
Louis Winthorpe III, the character anything with volume and volatil- not the best-looking chart in history,
44 • December 2023 • Technical Analysis of Stocks & Commodities
and if all this turns out to be a fraud, that episode I learned
the clients will be wiped out. about position sizing, and
They objected and protested, but I never looked back. I don’t think it’s possible
said there was one crucial problem to manage an investment
with Bre-X, which was the fact that Was one of the reasons
the shares were listed on every single you decided to quit the
portfolio by gut feel.
exchange except Forbes’ “scam brokerage industry the
capital of the world”—having been desire to trade for your
burned before, the Vancouver Stock own account and keep all the profits, real-time coaching focused on
Exchange required all analysis to or was it other factors? daytrading stocks and S&P futures.
be done by fire-assay, no exceptions Our boss left to start his own firm. Did most of your subscribers achieve
allowed, and Bre-X had only ever This was the year after my Bre-X their goals? If not, why not?
provided some newfangled cyanide- trades. With money in the bank, I 1999 was when stocks began to
leach analysis. An hour later, the decided to go home to raise my five- display extraordinary volatility while
sales manager, an acquaintance from year-old daughter. It was then that I going up in price—upward crashes,
college, stormed into the war room to set off on the road to where I am now if you will—to the point where a
demand the reason for my speaking with trading and investing. typical day’s price range could be
to the trainees. compressed into an hour. In order
They were in my space, after all, Yo u s t a r t e d a n d h o s t e d to maintain proper position sizing,
and I suggested that by learning when IntelligentSpeculator.com in 1998 we literally had to trade ever-smaller
to sell, the trainees could spend less to help traders learn the real truths amounts or trade much smaller time-
time prospecting for new clients if about the brokerage industry and frames. Making that many decisions
they would simply stop laying out trading that were not available per time unit on an intraday basis was
or blowing up the last batch. It then elsewhere. You felt morally obligated very difficult for subscribers. The
occurred to me if I was so sure the to tell the truth about the industry. feedback I received was that I was
Bre-X situation looked bad, I should It seems you were always thinking not able to help them deal with fear,
just buy some puts. The stock was about educating investors and which isn’t surprising because their
trading at maybe $250 per share, traders as an undercurrent in brain was right to tell them they were
down from the high of around $280. all your endeavors over the past in danger. Hopefully, I prevented a
The puts were incredibly cheap and two decades. Was that website bunch of bankruptcies.
based on my normal position sizing, successful in meeting your goals
I got a ton for almost nothing. I kept and that of your subscribers? How long did that website stay
rolling them down until the stock was I had been part of a big group active, and when and why did you
around $5. Later on, when it was trad- chat at another website that went decide to close shop?
ing in the pennies, I bought a bunch, sideways, and started my own trader We did it for a couple of years dur-
took delivery of the certificates, and chat group to find others to discuss ing the peak of the dot-com bubble,
distributed them as gifts. trading with. As it turned out, most after which people lost interest in
people who came were looking for daytrading.
What did you learn about yourself advice and I answered all of their
and about trading through that questions, for free. At the time, I still Around that time, you were also on
experience? had things like MACD and RSI on SiliconInvestor.com and worked
I learned that proprietary trading my charts, even though I knew not to with IQ Chart. Were your responsi­
was a risk not worth taking. For ex- rely on them for signals. At around bilities focused on developing chart­
ample, a firm’s desk traders needed the same time, Steve Nison’s book ing packages and their chatroom?
no charts; they had order flow in their on Japanese candlestick charting Due to a quick succession of merg-
hands and worked the spreads. What I was gaining traction. That was the ers, SI and IQ Chart came to be owned
learned about trading, I did in my own first time I actually looked at price by the same company, and so they
account. Early on, I made a disastrous action bar by bar. thought there would be an audience
gold trade that became a chapter in for the charting program with me
Art Collins’ book, When Supertrad- Your first website morphed into promoting it. The plan was to have
ers Meet Kryptonite. Luckily, from TrendVue in 1999 and offered me put together a set of indicators
December 2023 • Technical Analysis of Stocks & Commodities • 45
and promote it at the site. an academic in Vienna who needed forms after a downtrend (or a top
some help to write the English version that forms after an uptrend) has
How did that work out? of his master’s thesis. already been in place for a long
That was the top for the dot-com It was the perfect introduction into time—especially in periods of
bubble. When the market went bust, the world of central banking, hedge high volatility and uncertainty—is
my guess is a lot of the Silicon Inves- fund conferences, and econometrics, relatively straightforward.” Any
tor population took substantial losses. which the IMF defines as using additional thoughts about that
FINRA also established the pattern “economic theory, mathematics, and turbulent market?
daytrader rule in February 2001, statistical inference to quantify eco- I think it was Justin Mamis who
making it so that accounts with less nomic phenomena.” Most important- said that tops take time, but bottoms
than $25,000 in equity were limited ly, I learned about exploratory data can be made in a day. There is a big
in how often trades could be made. analysis, a topic seldom mentioned in difference between seeing and trad-
This plus the bear market effectively the world of technical analysis. ing, and even more between how to
ended the adventures of a lot of indi- trade tops and bottoms.
vidual daytraders. On March 11, 2009 you wrote
IQ Chart was spun off and pur- a market commentary that was You launched InVivoAnalytics in
chased by one of the senior employ- published by Jason Kelly on late 2007 to support trading tools
ees. We actually delivered the product SeekingAlpha titled “How To Know you developed for eSignal and
and the partnership went on for a A Bottom When You Don’t See One” TradeStation. Are they still available
number of years. In the end, they in which you identified the market on those two platforms and can you
were not in a position to improve the bottom. How did the timing of that describe their purpose?
platform, and they made the decision article work out? The academic research I was privy
to let the user base shrink until it I had identified this sort of thing to in Vienna was basically a crash
was unprofitable and then they shut before at tops, such as in QCOM in course in quantitative methods ap-
it down. January 2000. Spike tops and bot- plied to nonstationary data, and
toms are not that difficult to see but when I evaluated the classic techni-
During the years 2003 to 2006 they must be confirmed by sentiment. cal analysis indicators, I realized
you were a young-ish mother of After a prolonged downtrend and a why none of them had ever worked
a 3- and 9-year-old, trading S&P scary close on a Friday, an interviewer particularly well. The fact is they
futures from home. You became will ask every guest on TV the same only worked by coincidence, and the
proficient at reading and trading question: “How much lower will it human mind being what it is, saw
bar and candlestick patterns as go?” and when the expert technical patterns that weren’t actually there.
well as market sentiment. In 2007 analyst projects an ever-lower price For quants, there is such a thing as
you traveled overseas to expand that works out to another big percent first principles and stylized facts of
your knowledge of monetary policy, downward move, that’s when the bell asset price returns. The bottom line
macroeconomics, and history. What goes off. The process works in reverse for traders is to know that volatil-
was your objective and how did it for uptrends. ity is always bad, and I continue to
enlighten you regarding the world refine my work in this area using
and the markets? You also wrote an article that TradeStation.
Traders usually think about techni- appeared in the September 2009
cal versus fundamental analysis of issue of this magazine in which For investing your own money,
individual stocks or commodities. you provided an assessment of the you developed model investment
Investment managers, on the other March 2009 ultimate bear market portfolios that you also shared with
hand, think about allocating assets low. In that article, you wrote: “How your subscribers. How have those
based on a financial model (such was it possible to accurately analyze models performed over the years?
CAPM or later on, risk parity) versus and capitalize on these chaotic The objective of investing is to
“global macro” strategy where PhD market conditions? Actually, it is compound capital efficiently, which
economists peer into their crystal easier than it looks because of a means drawdown must be as small
balls to make bets on the future. I simple paradox. Compared to the as possible. In directional trading,
happened to become friends with difficulty of timing the market the win–loss ratio is typically poor,
a high-profile economics blogger, on a daily basis, a bottom that so the trader must be prepared for a
46 • December 2023 • Technical Analysis of Stocks & Commodities
string of small losses and the result- You have spent consider­
ing drawdown before hitting a home able time understanding
run with a big trend trade. In order the nature of volatility Defending against drawdown
to reduce drawdown in an investment and measuring it prop­
portfolio, I use volatility measure- erly. Applying the knowl­
does not require us to make
ments to calculate position size and edge you have gained all-or-nothing decisions.
then limit drawdown by raising cash from this research, how
when the portfolio’s overall volatil- has it contributed to your
ity goes beyond a certain point. The trading success? 0.4149 as of September 14, 2023. Us-
models have done well over the years Volatility is one of the most-studied ing the rule of 16, we divide 41.19%
because as volatility rises, we tacti- empirical properties of what aca- by 16 which gets us 2.57%. Multiply
cally cut exposure. Of course, there demics call asset price returns. By that by the September 15 closing price
is also the question of deciding what quantifying volatility, we can calcu- of $439.00, we can expect NVDA to
goes into the investment portfolio— late position size or asset allocation, fluctuate around $11.30 per day. This
the strategic asset allocation. reduce systemic risk to an investment number can be used to help calculate
portfolio, and determine risk-adjusted position size based on the trader’s
In 2018 to 2020, your interest in performance. Volatility happens bankroll.
macroeconomics resulted in a in clusters and is highly correlated The Nasdaq trading day is 390
three-part article you published with volume. We can also use these minutes long: dividing $11.30 by 6
for your subscribers titled “How stylized facts to rank and sort entire bars (of 65-minutes each) means the
The Bond Market Ends.” What watchlists of stocks to find the ones average bar should be about $1.88 tall.
were your main points and did that are of interest. To me, volatility If for some reason the bars are much
you foresee the 2022 bond market is simply a succinct measurement of shorter than that and barely overlap,
debacle? the herd stampeding in and out of volatility has decreased and it’s time
Even though the U.S. twin deficits stocks and markets. to move to a larger timeframe. Some
and national debt problems were indicators such as ADX serve a simi-
well-known, it wasn’t until a few How should volatility be interpreted lar purpose, but quantifying volatility
months into 2018 that I observed and used to make market timing down to percentages seems to be more
treasuries failing to do their job. To decisions? practical and can be directly used to
my mind, there are three types of risk: The March 2009 low was a good compare against another stock.
diversifiable risk, systematic market example of how a spike in volatility
risk, and unpriceable risk. The start can be used to help identify bottoms, You are a firm believer in using
of the trade war had the potential but in my opinion, volatility is more a mechanical/systematic trading
to upend the role of treasuries as a helpful as a metric, rather than as an approach with appropriate bet sizes,
recycling mechanism, first for Saudi indicator. Because I started off read- and defending against excessive
petrodollars, and later on, for the trade ing chart patterns and, later on, visu- drawdowns. Did that approach work
deficit with China, used to finance ally trading in real time, it’s second out well for you?
U.S. deficit spending. The end of this nature to think of the action of price Yes. I don’t think it’s possible to
paradigm was simply not something I bars as expansions and contractions in manage an investment portfolio by
could put a price on, and if treasuries volatility. In my experience, I found gut feel. Defending against draw-
could no longer serve the function many undercapitalized traders go down does not require us to make
as a “flight to quality” asset that for intraday timeframes that are too all-or-nothing decisions. It’s a matter
insulated stocks during downturns, small and too illiquid, not to men- of calculating how to divide the pie
what was the point of owning them? tion dangerous. The counterintuitive and how much cash to hold. For the
In 2019 I updated the models with solution is to use larger timeframes, trader, trading smaller size is always
shorter-duration bonds, and before like daily charts, and trade smaller better than trading too large.
the 2022 debacle, I had models with positions.
no bonds since the macroeconomic Any number of websites provide My understanding is that when
and geopolitical situation just kept historical, realized volatility for free. you were trading, you used two
deteriorating. For example, the 60-day annualized basic charts—a candlestick chart
historical volatility for NVDA is and a bar chart with volume. You
December 2023 • Technical Analysis of Stocks & Commodities • 47
draw trendlines and look You are not a fan of using
for breaches, as well as the most popular technical
pattern breaches. You indicators. Why is that?
observe, but don’t trade, At the office, everyone
patterns such as triangles, used the standard indicators
wedges, and massive head- and little has changed since
and-shoulders because then. When I look into the
you don’t want to get in actual calculations, it’s not
there and be trapped. Can clear to me what the rationale
you expand a bit on your is for these indicators. This
approach? is coming from a person
If you plot the one-month who bought and read all
or three-month volatility these books by the original
on a daily bar chart and authors.

TRADESTATION
squeeze the bars together,
these patterns will stand What charting software
out as areas of contracting FIGURE 1: NVDA SEMI-LOG DAILY CHART. On the right side of the chart, and brokerage firms do you
volatility. In fact, we can NVDA moves above the trendline for two days after falling below it for six days. use in your work?
use declining volatility to Many traders got shaken out, and then the price reversed upward. I use TradeStation for
help us draw lines around charting, I download eSignal
these trading ranges and the patterns the uptrend has ended and a reversal data for spreadsheets, and I execute
will identify themselves. It might be is in place, then the bounce should trades with Interactive Brokers.
more profitable to ride a portion of a fail and head down from here. One
trend rather than repeatedly position potential entry point to initiate a short You capitalized on observing
for a breakout. position would be on the break of a pattern or setup failures to make
two-day low, and then use the cyan- your move. You felt that if a market
Could you provide a chart example colored dots above the price bars as doesn’t go where it should, then you
using volatility and walk us through a trailing stop-loss. concluded that some traders will
how it helps you make decisions? When it comes to reading indi- be on the wrong side of the trade
Let’s look at the semi-log daily vidual price bars, my best recom- and need to exit the trade. That is
chart of NVDA (Figure 1) with data mendation for a book about this good information to capitalize on,
to September 29, 2023. Outperfor- is William Dunnigan’s One-Way right?
mance against the S&P 500 index Formula For Trading In Stocks And Linda Bradford Raschke used to
on a risk-adjusted basis is shown by Commodities. do a free day in her S&P futures chat
the cyan-colored price bars, while room every month. She used the CQG
underperformance against the bench- On your typical chart layout, you charting platform and liked to apply
mark is colored magenta. The 50-day use moving averages, candlesticks, ADX (average directional movement
moving average is there because ev- patterns, and trendlines for support index) to intraday charts. The thesis
eryone uses it. Most traders probably and resistance levels. Is that more behind the ADX, a J. Welles Wilder
have that line drawn below all the or less a complete picture of your creation, was that it somehow mea-
price action above the May 2023 gap charting approach? sured volatility and so it could be used
up. The close below the “neckline” I’ve looked at candlestick charts to delineate areas of consolidation.
on September 21 did not lead to an for so long that I can “see” them I noticed traders always seem to be
immediate breakdown; instead, it on bar charts. Candlesticks take up fixated on positioning for breakouts
predictably bounced upward after room, which can make it difficult to and spend a lot of time betting on
the breach, trapping some breakout identify patterns easily. For example, the direction. If the breakout goes
players. my preferred configuration for a daily against them, not only do the existing
At this point, the bounce is six days bar chart includes volume, the 21- and positions need to be closed, but new
old, trading below the 50-day mov- 63-day realized volatility, and the 50- positions are likely to be initiated,
ing average, which acts as “overhead day moving average, since everyone which means there are twice the or-
resistance.” The trader lies in wait: If else is watching it. ders going in the opposite direction,
48 • December 2023 • Technical Analysis of Stocks & Commodities
giving the move impetus and thrust. probably not that much
The process repeats, which can often of a difference between a
be seen as a triangle that just keeps “retail” versus a “profes- It might be more profitable
getting bigger, and when all these sional” daytrader. Firms to ride a portion of a trend
traders are finally exhausted, the real don’t have titles to that
trend starts going. effect. Personally, I think
rather than repeatedly
it’s a myth that the aver- position for a breakout.
You prefer looking for fake breakouts age person can trade for a
and then taking advantage of them. living. The good news is
Briefly, how did you do that? that almost anyone can accumulate investing than daytrading. What
I know of no method of determining a decent amount by investing over happened to change your mind?
if a breakout will be successful or not, time if they put their mind to it by After the dot-com bust, volatility
so the way I prefer to do it is simple. capturing and compounding the to- completely dried up, making day-
For a triangle, a wedge, a head-and- tal return which includes dividends, trading uneconomical in terms of
shoulders pattern—basically any rather than just the price return from the time commitment. Also, as one’s
large consolidation—just wait until short-term trading. capital increases, it becomes more
the breakout happens on volume, then efficient to deploy it as an investment
get on the first pullback, especially If an individual was interested in portfolio. The best thing I ever did
the small and scary two- to four-bar becoming a daytrader in 2023, what was to devise my own asset allocation
bull or bear flag; sometimes, there’s would you tell them to be aware of, as algorithm, one that could put lots of
only a tiny pause, a single “inside” compared to the 1990s to early 2000 dollars to work.
bar after a thrust in the direction of timeframe when you daytraded?
the breakout, to capitalize on failed I would probably tell them what Can you walk us through the
breakouts of a recent high or low. I’ve already spoken about here, which components of that algorithm?
Victor Sperandeo called it the “2B” is that nobody in the investment While there are a number of ways to
in chapter 7 his book, Trader Vic— industry trades for a living. Brokers measure and quantify price volatility,
Methods Of A Wall Street Master. earn a commission. Market makers the principle is always the same. If
get a spread. Fund managers charge Asset A is twice as volatile as Asset
Is there any difference in today’s management fees. B, then you will want to own one unit
trading methods as compared to of Asset A and two units of Asset B.
two decades ago? Do you still believe that a trading You could take this one step further
For trading patterns, no, because journal is helpful, at least for by targeting volatility on a portfolio
human nature never seems to change. beginning traders, to track their basis to mitigate risk. For example,
We know from Kahneman and Tver- results, as well as to review and if the price volatility of the portfolio
sky’s Prospect Theory that human learn from their mistakes to become that contains Asset A and Asset B
nature operates to maximize the successful? exceeds 10 percent, then raise cash.
chance of a gain, not the actual gain. I think it’s a good idea to prac- This practice would have safeguarded
For example, traders keep taking tice paper trading until you have capital during 2022 when both stocks
“stabs” inside consolidation patterns your analysis and execution locked and bonds went down together.
rather than getting on board on the down.
first opportunity of a new trend. When As we speak, you have just
it comes to technical indicators, all I You once said that “trading should launched your latest endeavor,
can say is the same old ones seem to never be used as a sole source of ActiveInvestorMag.com, on the 25th
pop up on most charts. Let’s hope the income.” Do you still hold that anniversary of your first market-
quants have something better. view today? related website. Why did you launch
Yes, because none of the industry it, and what are the benefits to
What is your view of the difference professionals do it. They don’t worry subscribers?
between a retail daytrader versus a about how to make rent or pay the I would like to curate useful in-
professional daytrader? next mortgage payment. formation from credible sources for
If the trader uses his own capital, those interested in trading and invest-
or isn’t paid by a fund to do it, there’s Over time, you pivoted more to ing. There is so much information out
December 2023 • Technical Analysis of Stocks & Commodities • 49
there it’s difficult to figure out where SUNW, VRTS, and VSTR.
to start, what’s important and why. As As of September 15, 2023, It’s second nature to think
a public service, I plan to publish a the top ten are AAPL, of the action of price
model investment portfolio that any- MSFT, NVDA, AVGO,
one can put to use, regardless of the ADBE, CSCO, AMD, bars as expansions and
amount of money being invested. INTC, INTU, and TXN. contractions in volatility.
Because the Nasdaq-100
Do you have any plans or interest in index is a modified mar-
writing a book about your trading ket capitalization-weighted index, Cont, Rama [2001]. “Empirical
and investing approach? adjusted quarterly, the no-brainer Properties Of Asset Returns:
I started on one, but I’m not sure way to own the future winners is by Stylized Facts And Statistical Is-
people even bother to read anymore. owning the Nasdaq-100 ETF. sues,” Quantitative Finance, Vol.
From the popular stock market apps 1., Institute Of Physics Publishing,
I’ve checked out, it sure seems people Are there any concluding remarks quant.iop.org.
just buy the names they know and you’d like to make? Dunnigan, William [2005]. One-Way
hope for the best. Some of these Quantifying volatility allows us to Formula For Trading In Stocks
apps don’t even bother to display gauge risk on an objective basis, to And Commodities, Harriman
price bars. determine position size and calcu- House.
late stop-losses; we can buy and sell Gopalakrishnan, Jayanthi [2002].
Since it’s mid-September 2023 as incrementally rather than making “Teresa Lo Of TrendVue.com,”
we speak, what is your take on the all-or-nothing decisions. We can interview, Technical Analysis of
market’s outlook for the remainder even incorporate volatility into stock Stocks & Commodities, Volume
of the year? picking by constructing an indica- 20: November.
Bloomberg reported in July that tor of risk-adjusted returns against Lo, Teresa [2004]. “Swing Trading
the cost of servicing government debt a benchmark such as the S&P 500, With Swing Charts,” Technical
reached $652 billion, which was up 25 coming full circle from the days of Analysis of Stocks & Commodi-
percent in the first nine months of the the William O’Neil chartbooks. As ties, Volume 22: February.
fiscal year. Higher interest rates drive someone who spent the first half of [2004]. “Set Up Your Trades
up the cost of debt service, something their time in the markets focused on With The Swing Indicator,”
we haven’t seen in decades. At some trading based on price action and Technical Analysis of Stocks
point, the powers that be might quietly investor sentiment, I have to say that & Commodities, Volume 22:
concede that 5 percent inflation is the second half focused on studying September.
the means to devalue the debt. The volatility has made making decisions [2009]. “Where We Are In
country is at a crossroads; political completely stress-free. The Cycle,” guest column, www.
instability and partisan gridlock will jasonkelly.com.
only exacerbate the U.S. debt spiral. Leslie N. Masonson is president of [2009]. “Looked At Market
This doesn’t exactly look bullish for Cash Management Resources, a fi- Sentiment Lately?” Technical
bonds, and with cash now yielding nancial consulting firm focusing on Analysis of Stocks & Com-
more than stocks, I can see why ETF strategies. He is an active ETF modities, Volume 27: September,
market participants might book some and Nasdaq futures trader, and the https://traders.com/Documenta-
profits. author of Buy—Don’t Hold: Investing tion/FEEDbk_docs/2009/09/
With ETFs Using Relative Strength close.html
What is your insight on whether To Increase Returns With Less Risk; Kahneman, Daniel, and Amos Tver-
or not the “magnificent 7” can and All About Market Timing, as sky [1979]. “Prospect Theory: An
continue to outpace the market in well as Day Trading On The Edge. Analysis Of Decision Under Risk,”
the next decade and beyond or will He can be reached at lesmasonson@ research paper.
there be other stock replacements yahoo.com or 845 323-7276. Sperandeo, Victor [1993]. Trader
along the way? Vic—Methods Of A Wall Street
At the peak in March 2000, the Further reading Master, John Wiley & Sons.
top ten were MSFT, INTC, CSCO, Collins, Art [2009]. When Supertraders
QCOM, ORCL, JDSU, AMGN, Meet Kryptonite, Traders Press.
50 • December 2023 • Technical Analysis of Stocks & Commodities
UNGER/DIRECTIONAL PATTERN Asia. He may be reached at Andrea@ UngerAcademy.
Continued from page 35 com. The Unger Academy provides services to traders,
including individuals, to help them improve their ap-
proach to trading (more information can be found at
of statistical value. We therefore decide to consider our https://autc.pro/tasc8).
strategy terminated.
The code given in this article is available in the S&C
Conclusions Article Code section of our website, Traders.com.
In this article, we have shown the results of a simple
strategy applying this filter: Further reading
Unger, Andrea [2021]. The Successful Trader’s Guide To
if closed1>closed2 and closed2>closed3 then buy ... Money Management: Proven Strategies, Applications,
if closed1<closed2 and closed2<closed3 then sellshort ... And Management Techniques, Wiley Trading.
[2021]. The Unger Method: The Winning Strategy
as well as the complete 2HL+ pattern: Of The 4-Time World Trading Champion, The Boss
Books.
if closed1>closed2 and closed2>closed3 and
opend0>closed1 then buy ... ‡MultiCharts
if closed1<closed2 and closed2<closed3 and ‡See Editorial Resource Index
opend0<closed1 then sellshort ...

The results of the two case comparisons showed the


effectiveness of 2HL+ in its directional strength com-
ponent. The additional condition,
which compares opend0 with closed1
and further filters the entries based
on accentuated market directional- 2024 Readers’ Choice Awards
ity, actually excluded only the losing
trades, while net profit remained Winners will be announced in the Bonus Issue,
virtually unchanged.
So, we have seen that the 2HL+ available February 2024.
pattern is very powerful, both be-
cause it can filter out most trades If you are a current subscriber,
in a system and because, when go to Traders.com and log in to
combined with a simple breakout vote for your favorites.
entry, it can already become a win-
ning strategy! Not a subscriber? Become one
We leave it to the reader to test
it on other instruments to verify its
today! Call 1-206-938-0570 or
full strength. go to Traders.com to subscribe.

Andrea Unger is a full-time pro-


fessional trader, president of The
Unger Academy, and author of The
Unger Method. He is a four-time
Vote Now!
World Trading Champion (2008,
2009, 2010, and 2012), an honorary Voting begins October 1 and ends December 31, 2023.
member of SIAT (Italian Society Must use your subscriber ID number to vote.
of Technical Analysis, a branch Follow us on Twitter @STOCKSandCOMM
of IFTA), and speaks throughout
Join us on Facebook at www.facebook.com/STOCKSandCOMMODITIES
Europe, America, Australia, and
December 2023 • Technical Analysis of Stocks & Commodities • 51
The focus of Traders’ Tips • Traders.com → S&C Magazine → Traders’ Tips
this month is Markos Kat-
sanos’ article in this issue, At Traders.com you can also right-click on any chart
“Growth Or Value?” Here, to open it in a new tab or window and view the chart
we present the Decem- at a much larger size.
ber 2023 Traders’ Tips The Traders’ Tips section is provided to help readers im-
code with possible im- plement a selected technique from an article in this issue
plementations in various or another recent issue. The entries here are contributed
software. by software developers or programmers for software
The code for the following Traders’ Tips selections is that is capable of customization.
posted here:

inputs:
Coef( 0.2 ),
VCoef( 2.5 ),
F TRADESTATION: DECEMBER 2023 TRADERS’ TIPS CODE VPeriod( 30 ),
Since market conditions continually change and may favor RSBARS( 15 ),
either growth or value stocks, investors often find themselves MARSBARS( 20 ),
at a crossroads. In response to this dilemma, author Markos MAXLOSSPERC( 7 );

Katsanos introduces a momentum trading system designed constants:


to rotate between these two strategies. He begins by outlin- VUG( "VUG" ),
ing the distinctions between growth and value investing and VTV( "VTV" );
subsequently presents a system for switching between the two variables:
using Vanguard’s value and growth ETFs. Since the strategy MyVol( 0 ),
defaults to use a lookback period of 90 bars, the maximum Inter( 0 ),
number of bars study will reference (MaxBarsBack) setting VInter( 0 ),
CutOff( 0 ),
must be increased within the general tab of the strategy VAve( 0 ),
properties for all window. VMax( 0 ),
MF( 0 ),
Strategy: ETF Rotation VC( 0 ),
DirectionalVolume( 0 ),
// TASC DEC 2023 VFI( 0 ),
// Markos Katsanos Ratio1( 0 ),
// "Growth or Value?" Ratio2( 0 ),
// ETF Rotation Strategy Diff1( 0 ),
// Set up weekly chart with 3 data series: Diff2( 0 ),
// Data1 = VUG or VTV RSMK1( 0 ),
// Data2 = VTV or VUG RSMK2( 0 ),
// Data3 = SPY BUY1( false ),
BUY2( false ),
SELL1( false ),
SELL2( false ),
SELL3( false );

if Symbol = VUG then


begin
Ratio1 = Close / Close of Data3;
Ratio2 = Close of Data2 / Close of Data3;
end
else if Symbol = VTV then
begin
Ratio1 = Close of Data2 / Close of Data3;
Ratio2 = Close / Close of Data3;
end;

if Ratio1[RSBARS] > 0
and Ratio2[RSBARS] > 0 then
begin
MyVol = IFF( BarType >= 2 and BarType < 5,
FIGURE 1: TRADESTATION. This TradeStation weekly chart demonstrates the strategy ap- Volume, Ticks );
Inter = Log(TypicalPrice) - Log(TypicalPrice[1]);
plied to the Vanguard ETF VUG. Data2 is VTV and Data3 is SPY.
52 • December 2023 • Technical Analysis of Stocks & Commodities
VInter = StdDev(Inter, 30);
CutOff = Coef * VInter * Close;
VAve = Average(MyVol, VPeriod)[1];
VMax = VAve * VCoef;
VC = MinList(MyVol, VMax);
MF = AvgPrice - AvgPrice[1];

if MF > CutOff then


DirectionalVolume = VC
else if MF < -CutOff then
DirectionalVolume = -VC
else
DirectionalVolume = 0;

if VAve <> 0 then


VFI = Summation(DirectionalVolume, VPeriod) / FIGURE 2: WEALTH-LAB. This chart shows sample trades signaled by the trading system on a
VAve; weekly chart of VUG. Data provided by Yahoo! Finance.
VFI = XAverage(VFI, 2);

Diff1 = Log(Ratio1) - Log(Ratio1[RSBARS]); Fortunately, Wealth-Lab has long included the indicators
Diff2 = Log(Ratio2) - Log(Ratio2[RSBars]); developed by Markos Katsanos: both the custom relative
RSMK1 = XAverage(Diff1, 2) * 100; strength indicator (RSMK) and the volume flow indicator
RSMK2 = XAverage(Diff2, 2) * 100;
(VFI). As usual, this means that they can be used universally
BUY1 = Symbol = VUG and RSMK1 > RSMK2 throughout our program features. These include the Build-
and RSMK1 > Average(RSMK1, MARSBARS); ing Blocks feature (which offer an easy way to create trading
strategies without having to code them), the indicator pro-
BUY2 = Symbol = VTV and RSMK2 > RSMK1
and RSMK2 > Average(RSMK2, MARSBARS); filer (which tells how much of an edge an indicator provides),
a strategy optimization tool, and many more.
if (BUY1 OR BUY2) and VFI > 0 then The chart in Figure 2 demonstrates implementing the
Buy this bar at close;
trading system on a weekly chart of VUG.
SELL1 = Symbol = VUG and RSMK1 < RSMK2 and Coding in C# for use in Wealth-Lab 8 is shown here:
RSMK1 < Average(RSMK1,MARSBARS) and RSMK1 < RSMK2[1];
using WealthLab.Backtest;
SELL2 = Symbol = VTV and RSMK2 < RSMK1 and using System;
RSMK2 < Average(RSMK2, MARSBARS) and RSMK2 < RSMK1[1]; using WealthLab.Core;
using WealthLab.Data;
SELL3 = Close < Average(Close, 50) and using WealthLab.Indicators;
Close < (1 - MAXLOSSPERC / 100) * Close[1]; using System.Collections.Generic;
using WealthLab.TASC;
if SELL1 or SELL2 or SELL3 then
Sell this bar at close; namespace WealthScript1
end; {
public class GrowthOrValue : UserStrategyBase
A sample chart is shown in Figure 1.
{
string symbol1 = "VUG", symbol2 = "VTV", indexSymbol = "SPY";
This article is for informational purposes. No type of BarHistory etf1, etf2, index;
trading or investment recommendation, advice, or strategy RSMK rsmk1, rsmk2;
is being made, given, or in any manner provided by TradeS- SMA ma1, ma2, etfMA1, etfMA2;
VFI vfi1, vfi2;
tation Securities or its affiliates. double pctMaxLoss;
—John Robinson
TradeStation Securities, Inc. public GrowthOrValue()
www.TradeStation.com {
AddParameter("VFI Period", ParameterType.Int32, 30, 26, 30,
4);
AddParameter("Rel. Strength Bars", ParameterType.Int32, 15,
13, 15, 2);
AddParameter("Rel. Strength MA Bars", ParameterType.Int32,
20, 15, 25, 5);
F WEALTH-LAB: DECEMBER 2023 TRADERS’ TIPS CODE AddParameter("MA Period", ParameterType.Int32, 30, 20, 100,
In his article in this issue, “Growth Or Value?”, author Markos 10);
Katsanos once again explores his intermarket edge with a AddParameter("Stop Loss", ParameterType.Int32, 7, 5, 9, 2);
rotation-like system that switches between two growth and }

value ETFs according to market conditions. To assist his trad- public override void Initialize(BarHistory bars)
ing decisions, he uses two indicators of his own construction {
to measure relative strength and detect bear markets. int vfiPeriod = Parameters[0].AsInt;
int rsBars = Parameters[1].AsInt;

December 2023 • Technical Analysis of Stocks & Commodities • 53


int maRSBars = Parameters[2].AsInt; /* first ETF's exits */
int maPeriod = Parameters[3].AsInt; if ((rsmk1[idx] < rsmk2[idx]) && (rsmk1[idx] < ma1[idx]) &&
double Coef = 0.2; (rsmk1[idx] < rsmk2[idx - 1]))
pctMaxLoss = (1.0 - Parameters[4].AsInt / 100d); PlaceTrade(etf1, TransactionType.Sell, OrderType.Mar-
ket);
etf1 = GetHistory(bars, symbol1);
etf2 = GetHistory(bars, symbol2); if(etf1.Close[idx] < etfMA1[idx])
index = GetHistory(bars, indexSymbol); PlaceTrade(etf1, TransactionType.Sell, OrderType.Stop,
etfMA1 = SMA.Series(etf1.Close, 50); etf1.Close[idx - 1] * pctMaxLoss);
etfMA2 = SMA.Series(etf2.Close, 50);
/* second ETF's exits */
rsmk1 = RSMK.Series(etf1, indexSymbol, rsBars); if ((rsmk2[idx] < rsmk1[idx]) && (rsmk2[idx] < ma2[idx]) &&
rsmk2 = RSMK.Series(etf2, indexSymbol, rsBars); (rsmk2[idx] < rsmk1[idx - 1]))
ma1 = SMA.Series(rsmk1, maRSBars); PlaceTrade(etf2, TransactionType.Sell, OrderType.Mar-
ma2 = SMA.Series(rsmk2, maRSBars); ket);

vfi1 = VFI.Series(etf1, vfiPeriod, maPeriod, cutoff: default, if(etf2.Close[idx] < etfMA2[idx])


curtailCoeff: Coef ); PlaceTrade(etf2, TransactionType.Sell, OrderType.Stop,
vfi2 = VFI.Series(etf2, vfiPeriod, maPeriod, cutoff: default, etf2.Close[idx - 1] * pctMaxLoss);
curtailCoeff: Coef ); }
}
PlotBarHistory(etf1, "etf1"); }
PlotBarHistory(etf2, "etf2"); }
PlotIndicatorLine(rsmk1);
PlotIndicatorLine(rsmk2); —Gene Geren (Eugene)
PlotIndicatorLine(ma1); Wealth-Lab team
PlotIndicatorLine(ma2); www.wealth-lab.com
PlotIndicatorLine(vfi1);
PlotIndicatorLine(vfi2);
}

public override void Execute(BarHistory bars, int idx)


{
if (!HasOpenPosition(bars, PositionType.Long)) F NINJATRADER: DECEMBER 2023 TRADERS’ TIPS CODE
{ The RSMK indicator and ETF switching system presented
var buy1 = (rsmk1[idx] > rsmk2[idx]) && (rsmk1[idx] > in the article “Growth Or Value?” in this issue by Markos
ma1[idx]) && (vfi1[idx] > 0);
Katsanos is available for download at the following link for
var buy2 = (rsmk2[idx] > rsmk1[idx]) && (rsmk2[idx] >
ma2[idx]) && (vfi2[idx] > 0); NinjaTrader 8:
var Buy = (buy1 || buy2);
if(Buy) NinjaTrader 8: www.ninjatrader.com/SC/December2023SCNT8.zip
PlaceTrade(buy1 ? etf1 : buy2 ? etf2 : null, Transaction-
Type.Buy, OrderType.Market); Once the file is downloaded, you can import the indicator
} into NinjaTrader 8 from within the control center by select-
else
{
ing Tools → Import → NinjaScript Add-On and then select-
ing the downloaded file for NinjaTrader 8.
You can review the indicator source code in
NinjaTrader 8 by selecting the menu New →
NinjaScript Editor → Indicators folder from
within the control center window and selecting
the file.
A sample chart displaying the indicators and
switching system is shown in Figure 3. Note
that the exit logic used affects when entry or-
ders are placed, and therefore affects the trade
signals. In this example chart implementation,
more trades are signaled compared with the
trades shown in the article.
—NinjaTrader, LLC
www.ninjatrader.com

FIGURE 3: NINJATRADER. This sample chart displays the


RSMK indicators and switching system. The exit logic used affects
when entry orders are placed, and in this example chart imple-
mentation, more trades are signaled than in the article.
54 • December 2023 • Technical Analysis of Stocks & Commodities
button to view the backtest and trade-by-trade statistics for
F NEUROSHELL TRADER: DECEMBER 2023 the system.
TRADERS’ TIPS CODE Users of NeuroShell Trader can go to the Stocks & Com-
The ETF rotation strategy described by Markos modities section of the NeuroShell Trader free technical
Katsanos in his article in this issue, titled “Growth Or support website to download a copy of this or any previous
Value?”can be easily implemented in NeuroShell Trader. Select Traders’ Tips.
“new indicator” from the insert menu and use the indicator —Ward Systems Group, Inc.
wizard to create the following indicators: sales@wardsystems.com
www.neuroshell.com
Relative Strength Indicator:
RSMK: Mul2( ExpAvg( Momentum( Ln( Divide( Close, S&P500
Close) ), 90), 3), 100)

Volume Flow Indicator:


TYPICAL: Avg3 ( High, Low, Close) F TRADINGVIEW: DECEMBER 2023 TRADERS’ TIPS CODE
Here is TradingView Pine Script code implementing the rota-
CUTOFF: Multiply3 ( 0.2, StndDev ( Momentum (Ln (TYPICAL),1), 30 ),
Close )
VAVE: LagAvg ( Volume, 1, 130 ) tion strategy for trading value and growth ETFs, as presented
VC: Min2 ( Volume, Multiply2 ( 2.5, VAVE ) ) in Markos Katsanos’ article in this issue titled “Growth or
MF : Momentum (TYPICAL, 1 ) Value?”
VFI: Divide ( Sum( IfThenIfThenElse ( A>B(MF,CUTOFF), VC,
A<B(MF, Negative(CUTOFF)), Negative(VC), 0 ), 130 ), VAVE ) // TASC Issue: December 2023 - Vol. 41, Issue 13
// Article: Growth or Value?
To create a rotation trading system on a chart with a chart // Article By: Markos Katsanos
page for each of the two ETFs, select “new trading strategy” // Language: TradingView's Pine Script® v5
from the insert menu and enter the following in the appropri- // Provided By: PineCoders, for tradingview.com

ate locations of the trading strategy wizard: //@version=5


string it = 'TASC 2023.12 Growth and Value Switching System'
BUY LONG CONDITIONS (All of which must be true): string st = 'GoV'
RSMK = ChartPageMax ( RSMK ) indicator(it, st, true)
A>B ( RSMK, MovAvg( RSMK, 20 )
A>B ( VFI, 0 ) // --- Constants ---
string it0 = 'Growth Equity'
SELL LONG CONDITIONS (1 of which must be true): string it1 = 'Value Equity'
AND4 ( A=B ( RSMK, ChartPageMin ( RSMK ) ) string it2 = 'RS Reference Index'
A<B ( RSMK, MovAvg( RSMK, 20 ) string it3 = 'RS Period'
A<B ( RSMK, Lag( ChartPageMin ( RSMK ) ), 1 ) string it4 = 'RS MA Period'
A>B ( VFI, 0 ) ) string it5 = 'VFI Period'
AND2 ( A<B( Close, MovAvg(Close,50 ), string it6 = 'Stop-loss, %'
A<B ( Close, Multiply( 0.97, Lag(Close,1) ) color ic1 = #C5D7F8
color ic2 = #324B76
After entering the system conditions, you can also choose color ic3 = #8BB0F2
whether or not the parameters should be optimized. After color ic4 = #D8E5FA
backtesting the trading strategy, use the detailed analysis
color ic5 = #F1F5FD

// --- Inputs ---


string iSym1 = input.symbol('VUG', it0)
string iSym2 = input.symbol('VTV', it1)
string iSymI = input.symbol('SPY', it2)
int iRSBars = input.int(15, it3)
int iMABars = input.int(20, it4)
int iPeriod = input.int(30, it5)
float iMaxLossP = input.float(7.0, it6)

// --- Functions ---


// @function Custom Relative Strength Indicator (RSMK)
// @param base Input time series
// @param im Reference time series
// @param bars N bars for RS calculation
// @param sk Smoothing constant
// @returns Relative Strength
RS (float base, float im, int bars, int sk=2) =>
float r12 = base / im
float rs1 = math.log(r12) - math.log(nz(r12[bars], 0.0))
ta.ema(rs1, sk) * 100.0
FIGURE 4: NEUROSHELL TRADER. This NeuroShell Trader chart shows the RSMK indicator
// @function Custom Volume Flow Indicator (VFI)
and trading system.
December 2023 • Technical Analysis of Stocks & Commodities • 55
bool exit1 = opPos == iSym1 and rsmk1 < rsmk2 and
rsmk1 < mars1 and rsmk1 < rsmk2[1]
bool exit2 = opPos == iSym2 and rsmk2 < rsmk1 and
rsmk2 < mars2 and rsmk2 < rsmk1[1]
bool SL1 = opPos == iSym1 and
c1 < ta.sma(c1, 50) and
c1 < ((1.0 - iMaxLossP/100) * c1[1])
bool SL2 = opPos == iSym2 and
c2 < ta.sma(c2, 50) and
c2 < ((1.0 - iMaxLossP/100) * c2[1])
bool exit = exit1 or exit2 or SL1 or SL2

// Update open position


opPos := switch
long1 => iSym1
long2 => iSym2
exit => ''
=> opPos[1]

// Plot
plotshape(long1, 'L1', shape.triangleup, location.
FIGURE 5: TRADINGVIEW. This demonstrates the growth and value switching system belowbar,
color.purple, text = 'long Growth',size=size.small)
on a chart of the Vanguard Growth ETF. plotshape(long2, 'L2', shape.triangleup, location.
belowbar,
// @param avg Input time series (hlc3) color.green, text = 'long Value', size=size.small)
// @param vol Input time series (volume) plotshape(exit1 or SL1, 'E1',shape.xcross,location.abovebar,
// @param period N bars for VFI calculation color.purple, text = 'exit Growth',size=size.tiny)
// @param Coef VFI coefficient plotshape(exit2 or SL2, 'E2',shape.xcross,location.abovebar,
// @param VCoef Volume cutoff color.green, text = 'exit Value', size=size.tiny)
// @returns Volume Flow Indicator
VFI (float avg, float vol, int period, // --- Exploration ----
float Coef=0.2, float VCoef=2.5, int smooth=2) => var table T = table.new(position.bottom_right,2,8,ic1)
// T.cell(0, 0, 'G&V Switching System',
float inter = math.log(avg) - math.log(nz(avg[1])) text_color = #FFFFFF, bgcolor = ic2)
float Cuttoff = Coef * ta.stdev(inter, 30) * close T.merge_cells(0, 0, 1, 0)
float Vave = nz(ta.sma(volume, period)[1], 1.0) T.cell(0, 1, 'Created by Markos Katsanos',
float Vc = math.min(volume, Vave * VCoef ) bgcolor = ic3)
float MF = ta.change(avg) T.merge_cells(0, 1, 1, 1)
float VCP = switch T.cell(0, 2, 'Growth Equity:', bgcolor = ic5)
MF > Cuttoff => Vc T.cell(1, 2, iSym1, bgcolor = ic5)
MF < -Cuttoff => -Vc T.cell(0, 3, 'Value Equity:', bgcolor = ic5)
=> 0.0 T.cell(1, 3, iSym2, bgcolor = ic5)
float vfi1 = math.sum(VCP, period) / Vave T.cell(0, 4, 'RS Growth:')
ta.wma(vfi1, smooth) T.cell(1, 4, str.format('{0}', rsmk1),bgcolor = ic4)
T.cell(0, 5, 'RS Value:')
// --- Calculations --- T.cell(1, 5, str.format('{0}', rsmk2),bgcolor = ic4)
float ci = request.security(iSymI, timeframe.period, close) T.cell(0, 6, 'VFI Growth:')
float c1 = request.security(iSym1, timeframe.period, close) T.cell(1, 6, str.format('{0}', vfi), bgcolor = ic4)
float h1 = request.security(iSym1, timeframe.period, hlc3) T.cell(0, 7, 'Current Position:')
float v1 = request.security(iSym1, timeframe.period, volume) T.cell(1, 7, opPos, bgcolor = ic4)
float c2 = request.security(iSym2, timeframe.period, close)
float h2 = request.security(iSym2, timeframe.period, hlc3)
float v2 = request.security(iSym2, timeframe.period, volume) The indicator is available on TradingView from the Pine-
CodersTASC account:
float rsmk1 = RS(c1, ci, iRSBars, 2)
float rsmk2 = RS(c2, ci, iRSBars, 2) https://www.tradingview.com/u/PineCodersTASC/#published-scripts
float vfi = VFI(h1, v1, iPeriod, 0.2, 2.5)
float mars1 = ta.sma(rsmk1, iMABars) —PineCoders, for TradingView
float mars2 = ta.sma(rsmk2, iMABars) www.TradingView.com
float dist = 2.0 * ta.atr(10)

// --- Trade Signals ---


var string opPos = ''
// Long:
bool long1 = opPos == '' and rsmk1 > rsmk2 and
rsmk1 > mars1 and vfi > 0.0
bool long2 = opPos == '' and rsmk2 > rsmk1 and
rsmk2 > mars2 and vfi > 0.0
bool long = long1 or long2
// Exit:

56 • December 2023 • Technical Analysis of Stocks & Commodities


Free Information From Advertisers
Advertiser Page Advertiser Page How to reach us
For questions, address changes, or
Brokerages Software ordering information for Technical
Charles Schwab/thinkorswim 64 AbleSys 7 Analysis of Stocks & Commodities
Schwab.com/Trading www.wintick.com/SCM magazine and its online publications:
Interactive Brokers 11 Charles Schwab/thinkorswim 64 Toll-free 800 832-4642
ibkr.com/iwantmore Schwab.com/Trading (800-Technical) or:
Ninjatrader 5 MetaStock 3 206 938-0570.
ninjatrader.com MetaStock.com/TASC Email us at:
Publications Ninjatrader 5 circ@traders.com.
ninjatrader.com
Stocks & Commodities 2, 51, 63 Or write to us at:
Store.Traders.com, Traders.com Websites 4757 California Ave. SW,
Stocks & Commodities 2, 51, 63 Seattle, WA 98116-4499.
Store.Traders.com, Traders.com Do your magazines arrive tattered
and torn? Polybagging of magazines
(domestic delivery) is available for
$6/year.
Editorial Resource Index Single back issues from the current
TC2000 .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 TradingView .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 year (subject to availability) are $8
Etf.com .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 ProfitSource .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 prepaid. Subscribers have access to
Etfdb.com .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 OptionsAnalysis.com .. . . . . . . . . . . . . . . . . . . . . . . . . . 61 our digital archive of all past articles.
Individual articles can be purchased
Finance.Yahoo.com .. . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
from the Online Store at our website,
Amibroker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Traders.com.
Microsoft Excel .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Editorial feedback
TradeStation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
We always want to know more about
nass.usda.gov .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 the needs of our readers: What kinds of
MultiCharts .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 articles would you like to see more of?
Matlab R2023a (MathWorks) . . . . . . . . . . . . . . . . . 37 What do you find useful? Address your
Eikon Datastream . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 written questions and comments to edi-
Wealth-Lab.com .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 tor@traders.com or to: Editor, Stocks
& Commodities, 4757 California Ave
NinjaTrader .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
SW, Seattle, WA 98116-4499. Sorry, we
NeuroShell Trader (Ward Systems Group) .. . . . . . . . . . 55 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 at
advertisers.Click the box for each adver- 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
To receive information on the products and services listed in the Editorial
then be sent to the advertisers you selected. 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.

December 2023 • Technical Analysis of Stocks & Commodities • 57


FUTURES LIQUIDITY

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.

Trading Liquidity: Futures


Contracts to
Effective
Commodity Futures Exchange % Margin Trade for Equal Relative Contract Liquidity
% Margin Dollar Profit
10-Year T-Note (Dec ’23) CBOT 2.1 6.7 7 • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • >>
Ultra T-Bond (Dec ’23) CBOT 5.9 6 2 • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •>>
5-Year T-Note (Dec ’23) CBOT 1.4 6.7 11 • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •>
S&P 500 E-Mini (Dec ’23) CME 5.8 24 5 • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •>
Ultra 10-Year T-Note (Dec ’23) CBOT 2.8 6.1 5 • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •>
30-Year T-Bond (Dec ’23) CBOT 3.9 6.5 4 • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •>
2-Year T-Note (Dec ’23) CBOT 0.6 6.9 13 • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •• •• •>
Russell 2000 E-Mini (Dec ’23) CME 4.1 8.8 3 ••••••••••••••••••••••••••••••••••••••
Nasdaq 100 E-Mini (Dec ’23) CME 6.3 21.7 3 •••••••••••••••••••••••••••
3-Month SOFR (Dec ’23) CME 0.2 3.7 17 •••••••••••••••••••••
Crude Oil WTI (Dec ’23) NYMEX 8.4 13.8 5 •••••••••••••••••
Euro FX (Dec ’23) CME 2 12.7 11 ••••••••••••••
Gold (Dec ’23) COMEX 4.3 23.1 6 •••••••••••••
Corn (Dec ’23) CBOT 7.7 11.3 14 •••••••••
Japanese Yen (Dec ’23) CME 3.9 8.8 6 •••••••••
Natural Gas (Dec ’23) NYMEX 18.5 9 3 •••••••••
Soybean Meal (Dec ’23) CBOT 1.2 4.4 4 •••••••••
30-Day Fed Funds (Nov ’23) CBOT 0.1 1.2 11 •••••••
Soybean (Nov ’23) CBOT 2.8 7.3 5 •••••••
Gasoline RBOB (Dec ’23) NYMEX 8.9 10.3 3 ••••••
Wheat (Dec ’23) CBOT 12.4 8.7 6 ••••••
Sugar #11 (Mar ’24) ICE/US 4.8 9.7 16 •••••
ULSD NY Harbor (Dec ’23) NYMEX 7.4 10.3 3 •••••
High Grade Copper (Dec ’23) COMEX 6.1 15.4 7 ••••
Australian Dollar (Dec ’23) CME 2.7 10.3 14 •••
Dow Futures Mini (Dec ’23) CBOT 5.3 24.5 7 •••
Live Cattle (Dec ’23) CME 2.9 6.8 8 •••
British Pound (Dec ’23) CME 3 18.4 19 ••
Coffee (Dec ’23) ICE/US 7.3 12.8 7 ••
Cotton #2 (Dec ’23) ICE/US 8.9 10 6 ••
Hard Red Wheat (Dec ’23) KCBT 11.2 10.6 7 ••
Palladium (Dec ’23) NYMEX 117 58.6 1 •• CBOT Chicago Board of Trade, Division of CME
S&P 500 VIX (Nov ’23) CFE 36.2 43.2 14 •• CFE CBOE Futures Exchange
Silver (Dec ’23) COMEX 7.6 24.4 7 •• CME Chicago Mercantile Exchange
Canadian Dollar (Dec ’23) CME 1.7 11.9 23 • COMEX Commodity Exchange, Inc. CME Group
Canola (Jan ’24) ICE/CA 7 9.1 22 • ICE-EU Intercontinental Exchange-Futures—Europe
Cocoa (Dec ’23) ICE/US 4.2 10 15 • ICE-US Intercontinental Exchange-Futures—US
Crude Oil Brent (F) (Dec ’23) NYMEX 8 13.3 4 • KCBT Kansas City Board of Trade
Lean Hogs (Dec ’23) CME 6.2 7.3 10 • MGEX Minneapolis Grain Exchange
Mexican Peso (Dec ’23) CME 5.6 32.1 49 • NYMEX New York Mercantile Exchange
New Zealand Dollar (Dec ’23) CME 2.9 10.6 15 •
Platinum (Jan ’24) NYMEX 6.1 12.4 11 • 2312
Trading Liquidity: Futures is a reference chart for speculators. It compares markets “Relative Contract Liquidity” places commodities in descending order according to
according to their per-contract potential for profit and how easily contracts can be bought how easily all of their contracts can be traded. Commodities at the top of the list are easi-
or sold (i.e., trading liquidity). Each is a proportional measure and is meaningful only est to buy and sell; commodities at the bottom of the list are the most difficult. “Relative
when compared to others in the same column. Contract Liquidity” is the number of contracts to trade times total open interest times a
The number in the “Contracts to Trade for Equal Dollar Profit” column shows how volume factor, which is the greater of:
many contracts of one commodity must be traded to obtain the same potential return In volume
as another commodity. Contracts to Trade = (Tick $ value) x (3-year Maximum Price 1 or exp –2
In 5000
Excursion).

58 • December 2023 • Technical Analysis of Stocks & Commodities


ADVISORY SERVICES SOFTWARE CLASSIFIED

Yes, You Can Cash In On Chaos! Certified


Chaos Traders Courses teach you how.
Learn to earn at http://moneytide.com?r=s TO ADVERTISE CONTACT:
EMini MoonTide Hotline up 260 months in a row
http://daytradingforecasts.com?r=s Ed Schramm
ESchramm@traders.com • (206) 660 8577

TRADERS'
RESOURCE

TOP 10 VIEWED MUTUAL FUNDS/ETFs FOR TRADERS


LINKS
When investing with mutual
funds & ETFs, the issue is cost of Product Company
all kinds. Sales charges, turnover
costs (trading costs), tax costs, 1. Fidelity Fund Fidelity Investments
management fees, marketing
costs, and cash-holding costs all 2. Schwab 1000 Index Charles Schwab
eat into your returns; then the
compounding effect magnifies 3. SPDR S&P 500 ETF State Street Global Advisors
your losses. It’s critical to con- Wells Fargo Advantage
sider all of these costs when approaching mutual fund 4. Strong Opportunity Fund
Funds
investing and do the appropriate research to make sure Thrivent Investment
you are making the most of your investment. A family 5. AAL Capital Growth Fund
Management
of low-cost, no-load funds that allows costless switching
between funds can be beneficial in the long run. 6. Fidelity Aggressive Growth Fidelity Investments
After you’ve minimized costs, you can look at returns.
The benchmarks for returns are usually index funds that 7. Fidelity Advisor Asset Allocation B Fidelity Investments
mirror one of the market indexes, such as the Standard
& Poor’s 500. It’s a challenge for actively managed funds
8. Scudder-Dreman High Return
DWS Investments
to beat the returns of the benchmarks, especially when Equity Fund
you take into account the costs of active management, 9. Scudder-Dreman Small Cap Value Fund DWS Investments
so consider these index funds in your research.
Finally, consider balancing your portfolio between 10. Fidelity Advisor Balanced C Fidelity Investments
bonds or money market funds and equity funds. A mix
of bond funds and equity funds is best for all but the These are the 10 Mutual Fund/ETF listings clicked on most often on the Traders’ Resource
website, in order of clicks received. This is not an editorial rating or ranking. For more
youngest investor. This portfolio diversification will information on specific products and services, try checking store.Traders.com for archived
help limit your risk while still allowing for respectable S&C product reviews.
returns.

TRADERS’ RESOURCE AT TRADERS.COM ages, seminars, hardware, software, and trading systems. Just
Traders’ Resource is available at our website, Traders.com, click on the Traders’ Resource link. Then follow the Mutual
where you’ll find information on other products and services Funds category link, or use the search feature to find products or
in numerous other categories, such as data services, broker- services with specific attributes in this or other categories.

The information in Traders’ Resource is the most accurate at the time of posting and is subject to change. Because the vendors posting to Traders’ Resource are responsible for their own listing, Technical Analysis, Inc. declines any and all
liability for any representations made by the businesses and individuals listed. Nor can Technical Analysis, Inc. endorse any business or individual listed on Traders’ Resource. Technical Analysis, Inc. makes no warranties, express or implied,
as to the accuracy and reliability of claims herein. You agree to release Technical Analysis, Inc., together with its respective employees, agents, officers, directors and shareholders, from any and all liability and obligations whatsoever in
connection with or arising from your use of Traders’ Resource. If at any time you are not happy with the information posted to Traders’ Resource or object to any material within Traders’ Resource, your sole remedy is to cease using it. This
list is updated frequently. If you are aware of a business that should be listed, please email us at Editor@Traders.com.

December 2023 • Technical Analysis of Stocks & Commodities • 59


Explore Your Options
GOT A QUESTION ABOUT OPTIONS?
Jay Kaeppel has over three decades of experience in the options markets. He
was a head trader for a CTA firm, an options trading software developer,
and was a portfolio manager for an investment management firm. He is
presently Senior Research Analyst for Sentimentrader.com. He is the author
of several books, including The Four Biggest Mistakes In Option Trading;
The Option Trader’s Guide To Probability, Volatility, And Timing; and
Seasonal Stock Market Trends. Send your questions or topic suggestions
to Jay Kaeppel at jay@sentimentrader.com. Selected questions will appear
in a future issue of S&C.
Jay Kaeppel

CASH-SECURED PUTS of support This allows an option seller to receive


I keep hearing that selling cash- • Higher than average implied maximum premium income.
secured puts to generate income is volatility This combination of a price and
a good idea. Is that true? • A strike price at least 20% below volatility action creates an opportu-
If the question is “Can you generate stock price nity to sell an out-of-the-money naked
income?” the answer is yes. Whether put. Our example trade involves:
or not it is a good idea depends on As always, the best way to illustrate
how well you understand the tradeoffs is with an example. • Selling the SAVE Jan19 2024
between reward and risk. To sell a 12.5 put @ $1.88
“cash-secured put” you must have Spirit Airlines example
enough cash in your account to In Figure 1 (courtesy of ProfitSource), To enter, a trader must have enough
buy the underlying stock shares at we see that on October 3rd, Spirit Air- cash to buy 100 shares at the strike
the options strike price if an option lines traded at $16.28 a share, down price of $12.50, or $1,250 per option
buyer exercises their put and you are from a high above $38 in March 2021. sold. This amount can include the
assigned. The stock bottomed in May 2023 at premium received when selling the
The first question is, “Are you around $14, trading in a narrow range option. In this example, the trader
willing to own the stock?” If you for several months. would need to put up $1,250 minus
are, then selling puts becomes a In Figure 2 (courtesy of Options­ the $188 in premium received for
way to: a) generate income and/or Analysis.com), we see that SAVE selling the put, or $1,062, to sell one
b) accumulate shares of stock. If you implied option volatility (the black naked put option. Put another way;
are not willing to buy the underlying line) has spiked to a high level. This the trader stands to earn 17.7% ($188 /
stock, then you need to manage the high IV means a lot of time premium $1,062) in 108 days—as long as SAVE
position from a trader’s point of view built into the price of SAVE options. remains above $12.50 a share and/or
(i.e., at what point should I exit the
trade to avoid getting assigned shares
of stock?).
There is no way around having to
hold cash to write a cash-secured put.
However, you can minimize the cash
you must keep on hand by focusing
on low-priced stocks.
There are no set “rules,” but we can
establish some helpful guidelines,
including:
PROFITSOURCE

• Stock price <20


• The stock price is down sig- FIGURE 1: STOCK CHARACTERISTICS. A stock chart to look for when considering selling a put could
nificantly from a peak but either look something like this one of Spirit Airlines (SAVE), which traded down from a peak and then stayed in
stabilizing or with an obvious line a narrow range for several months.
60 • December 2023 • Technical Analysis of Stocks & Commodities
Explore Your Options
the put is not exercised.
The trade particulars appear in
Figure 3, and the risk curves in
Figure 4.
Things to note:

• The cost to enter the trade is


$1,062
• The maximum profit potential on
a 1-lot is $188
• The put will expire worthless if
SAVE shares are above $12.50 at

OPTIONSANALYSIS.COM
option expiration
• If the put option is exercised, the
option seller would be obligated
to buy 100 shares of SAVE at FIGURE 2: IMPLIED OPTION VOLATILITY. As seen here, the option IV (black line) on SAVE stock spiked.
$12.50 a share High IV means time premium is built into the price of SAVE options, to the benefit of the put seller.

Managing the trade


Ideally, SAVE remains above $12.50
a share through the January 2024 op-
tion expiration, and the trader waits
for the option to expire worthless
and keeps the full $188 premium as a
profit. But there are other contingen- FIGURE 3: TRADE PARTICULARS, PUT SALE. This demonstrates selling a naked put on SAVE stock. For
cies to plan for. a cash-secured put, the trader must hold enough cash to buy 100 stock shares at the strike price.
One possibility is that implied
volatility for the put option plummets.
This would cause a large part of the
time premium to evaporate and could
offer an opportunity to buy back the
option with an early profit.
A second possibility is to close the
trade early if an open profit of, say,
80% is available. This eliminates risk
exposure and frees up the $1,062 of
committed cash to apply to another
trade.
If SAVE drops below $12.50 and
the put option is exercised, we would FIGURE 4: RISK CURVES, PUT SALE. As long as the underlying stock price remains above $12.50 a
be obligated to buy 100 shares of share through option expiration and/or the put is not exercised, the put seller can wait for the option to
SAVE at $12.50. From there, we expire and then keep the premium.
need a plan to manage that long stock
position. only occurs at option expiration. Figure 5 zooms in on the risk curves.
One final consideration would be Exercise is not automatic when the What we can see is that if SAVE were
cutting a loss if the stock goes in the stock price reaches or drops below
wrong direction. If the stock drops the strike price. Before expiration,
below the strike price to, say, $12.25, exercise on an in-the-money short There is no way around
we might be able to buy back the put put is a definite risk but typically having to hold cash to
option before it is exercised against only occurs when a minimal time write a cash-secured put.
us. Remember, automatic exercise premium is left in the option.
December 2023 • Technical Analysis of Stocks & Commodities • 61
Explore Your Options

Remember, automatic
exercise only occurs at
option expiration.
to take out its recent low of $14.08
and fall to $12.25—depending on
how soon that happened—we might
be able to exit with anywhere from
a breakeven result (if much time has
gone by and time decay has eaten
away enough of the premium) to a FIGURE 5: RISK CURVES DETAIL, PUT SALE. If the underlying stock were to drop below $12.50, in this sce-
loss of roughly −$125 (if the decline nario the trader might be able to exit with anywhere from a breakeven result to a loss of roughly −$125.
takes place immediately).
Statement of Ownership, Management, and Circulation
(All Periodicals Publications Except Requester Publications)
1. Publication Title 2. Publication Number 3. Filing Date

Technical Analysis of Stocks & Commodities 7 2 6 _ 8 3 0 11


11 October 2023
October 2023
4. Issue Frequency 5. Number of Issues Published Annually 6. Annual Subscription Price

Monthlywith
Monthly with a Bonus
a Bonus IssueIssue in March 13
in March 13 $89.99
$89.99

CHAN/N-CAMA ref/trainlm.html.
7. Complete Mailing Address of Known Office of Publication (Not printer) (Street, city, county, state, and ZIP+4 ®) Contact Person
Jack K. Hutson
4757 California Ave. SW, Seattle, WA 98116-4499
4757 California Ave. SW, Seattle, WA 98116-4499 Telephone (Include area code)
(206) 938-0570

Continued from page 41 Olson, D. [2004]. “Have Trading Rule


8. Complete Mailing Address of Headquarters or General Business Office of Publisher (Not printer)

4757
4757 California
California Ave. SW,Ave. SW,
Seattle, Seattle, WA
WA 98116-4499 98116-4499

Profits In The Currency Markets


9. Full Names and Complete Mailing Addresses of Publisher, Editor, and Managing Editor (Do not leave blank)
Publisher (Name and complete mailing address)

Jack
JackK. Hutson, 4757 California
K. Hutson, Ave. SW, Seattle,
4757 California Ave.WA 98116-4499
SW, Seattle, WA 98116-4499

Declined Over Time?” Journal


Editor (Name and complete mailing address)

Karen
KarenWasserman, 4757 California
Wasserman, Ave. SW, Seattle,
4757 California Ave. SW,WA 98116-4499
Seattle, WA 98116-4499

Certain Non-Linear Problems In Of Banking & Finance, Vol. 28,


Managing Editor (Name and complete mailing address)

Least Squares,” Quarterly Of Ap- pp. 85–105.


10. Owner (Do not leave blank. If the publication is owned by a corporation, give the name and address of the corporation immediately followed by the
names and addresses of all stockholders owning or holding 1 percent or more of the total amount of stock. If not owned by a corporation, give the
names and addresses of the individual owners. If owned by a partnership or other unincorporated firm, give its name and address as well as those of

plied Mathematics, Vol. 2, No. 2, Siegelmann, H., B. Horne, and C.


each individual owner. If the publication is published by a nonprofit organization, give its name and address.)
Full Name Complete Mailing Address

Technical Analysis, Inc. 4757 California Ave. SW

pp.164–168. Giles [1997]. “Computational


Jack K. Hutson Seattle, WA 98116-4499

Lukac, L., B. Brorsen, and S. Irwin Capabilities Of Recurrent NARX


[1988]. “Similarity Of Computer Neural Networks,” IEEE Trans
11. Known Bondholders, Mortgagees, and Other Security Holders Owning or Holding 1 Percent or More of Total Amount of Bonds, Mortgages, or
Other Securities. If none, check box ✔ None
Full Name Complete Mailing Address

Guided Technical Trading Sys- Syst Man Cybern B Cybern, Vol.


tems,” Journal Of Futures Mar- 27, No. 2, pp. 208–215.
kets, Vol. 8, pp. 1–13. Szakmary, A., and S. Sharma [2010].
12. Tax Status (For completion by nonprofit organizations authorized to mail at nonprofit rates) (Check one)
The purpose, function, and nonprofit status of this organization and the exempt status for federal income tax purposes:
Has Not Changed During Preceding 12 Months
Has Changed During Preceding 12 Months (Publisher must submit explanation of change with this statement)

Marquardt, D. [1963]. “An Algorithm “Trend-Following Trading Strate-


PS Form 3526, July 2014 [Page 1 of 4 (see instructions page 4)] PSN: 7530-01-000-9931 PRIVACY NOTICE: See our privacy policy on www.usps.com.

13. Publication Title 14. Issue Date for Circulation Data Below

For Least-Squares Estimation Of gies In Commodity Futures: A


Technical Analysis of Stocks & Commodities October 2023
October 2023
15. Extent and Nature of Circulation Average No. Copies No. Copies of Single
Monthly with a Bonus Issue in March Each Issue During Issue Published

Nonlinear Parameters,” SIAM Re-examination,” Journal Of


Preceding 12 Months Nearest to Filing Date

a. Total Number of Copies (Net press run)


13,318
13,318 9,415
9,415

Journal On Applied Mathematics, Banking And Finance, Vol. 34,


(1) Mailed Outside-County Paid Subscriptions Stated on PS Form 3541 (Include paid
distribution above nominal rate, advertiser’s proof copies, and exchange copies) 10,851
10,851 6,978
6,978

b. Paid

00 00
Circulation Mailed In-County Paid Subscriptions Stated on PS Form 3541 (Include paid
(2)

Vol. 11, No. 2. pp. 431–441. No. 2, pp. 409.


(By Mail distribution above nominal rate, advertiser’s proof copies, and exchange copies)
and

2,437 2,437
Outside Paid Distribution Outside the Mails Including Sales Through Dealers and Carriers,
the Mail) (3)
Street Vendors, Counter Sales, and Other Paid Distribution Outside USPS® 2,437 2,437

Matlab function for nonlinear autore- White, H. [1989]. “Learning In 00 00


Paid Distribution by Other Classes of Mail Through the USPS
(4)
(e.g., First-Class Mail®)

c. Total Paid Distribution [Sum of 15b (1), (2), (3), and (4)]
13,318 9,415

gressive with exogeneous input Artificial Neural Networks: A


13,318 9,415

d. Free or
Nominal
(1) Free or Nominal Rate Outside-County Copies included on PS Form 3541
0
0 00
Rate
0 00

(NARX) neural networks, http:// Statistical Perspective,” Neural


Distribution (2) Free or Nominal Rate In-County Copies Included on PS Form 3541 0
(By Mail
and
Outside
the Mail)
(3)
Free or Nominal Rate Copies Mailed at Other Classes Through the USPS
(e.g., First-Class Mail) 30
30 00

www.mathworks.com/help/nnet/ Computation, Vol. 1, No. 4, pp.


(4) Free or Nominal Rate Distribution Outside the Mail (Carriers or other means)
0
0 00
e. Total Free or Nominal Rate Distribution (Sum of 15d (1), (2), (3) and (4))
30
30 00

425–464. f. Total Distribution (Sum of 15c and 15e)


13,318
13,318

894
9,415
9,415

00
Yao, J., L. Chew, and H. Poh [1999].
g. Copies not Distributed (See Instructions to Publishers #4 (page #3)) 894

h. Total (Sum of 15f and g)


14,212
14,212 9,415
9,415

“Neural Networks For Technical 93.7% 100%


i. Percent Paid
(15c divided by 15f times 100) 93.7% 100%

* If you are claiming electronic copies, go to line 16 on page 3. If you are not claiming electronic copies, skip to line 17 on page 3.

Analysis: A Study On KLCI,” Statement of Ownership, Management, and Circulation


(All Periodicals Publications Except Requester Publications)

International Journal Of Theo-


16. Electronic Copy Circulation Average No. Copies No. Copies of Single
Each Issue During Issue Published
Technical Analysis of Stocks & Commodities Preceding 12 Months Nearest to Filing Date

retical And Applied Finance, Vol.


a. Paid Electronic Copies
7,919
7,919 14,803
14,803

N-CAMA uses the 2, No. 2, pp. 221–241.


b. Total Paid Print Copies (Line 15c) + Paid Electronic Copies (Line 16a)

c. Total Print Distribution (Line 15f) + Paid Electronic Copies (Line 16a)
21,237
21,237

22,131
22,131
35,444
35,444

35,444
35,444

current close price and ‡Matlab (MathWorks),


d. Percent Paid (Both Print & Electronic Copies) (16b divided by 16c Í 100)

PS Form 3526, July 2014 (Page 2 of 4)


✔ I certify that 50% of all my distributed copies (electronic and print) are paid above a nominal price.
95.96%
95.96% 100%
100%

AMA to predict the ‡See Editorial Resource Index


17. Publication of Statement of Ownership

✔ If the publication is a general publication, publication of this statement is required. Will be printed ✔ Publication not required.

next period’s close.


Dec 2023
in the ________________________ issue of this publication.

18. Signature and Title of Editor, Publisher, Business Manager, or Owner Date

11 October 2023

I certify that all information furnished on this form is true and complete. I understand that anyone who furnishes false or misleading information on this form
or who omits material or information requested on the form may be subject to criminal sanctions (including fines and imprisonment) and/or civil sanctions
(including civil penalties).

62 • December 2023 • Technical Analysis of Stocks & Commodities


Subscribe Or Renew Today!
Every article at
your fingertips.

Did you know that every subscriber to Technical Analysis of Stocks & Commodities magazine
has full access to the magazine in digital format? No waiting for the mail to be delivered, no need to carry
around back issues — just log on to Traders.com on any internet-capable device and read any issue or
article we’ve ever published, either in your browser, or downloaded to your device as a PDF for reading
anytime, anywhere.

Each subscription comes with:


• Full access to our Digital Edition
The complete magazine as a PDF you can download.
8999
1 year..................
$

2 years............ 149
• Full access to our Digital Archives
Every article since 1982! $ 99
• Complete access to WorkingMoney.com
The information you need to invest smartly and successfully.

3 years............ 199
• Access to Traders.com Advantage
$ 99
Insights, tips and techniques that can help you trade smarter.

$
29999
PROFESSIONAL TRADERS’ STARTER KIT
A 5-year subscription to S&C magazine that includes everything
above PLUS a free* book, Charting The Stock Market: The Wyckoff
5 years............
Method, all for a price that saves you $150 off the year-by-year price!
*Shipping & handling charges apply for foreign orders. That’s around $5 a month!

Visit www.Traders.com to find out more!


Email: Circ@Traders.com • Phone: 206-938-0570 facebook.com/STOCKSandCOMMODITIES @STOCKSandCOMM
thinkorswim is now at Schwab.
®

Our award-winning thinkorswim trading platforms are loaded


with powerful features that let you dive deeper into the market.
• Visualize your trades in a new light on thinkorswim
desktop with robust charting and analysis tools,
including 400+ technical studies.
• Uncover new opportunities with up-to-the-minute market
news and insights.
• Choose a platform to fit your trading style—
from streamlined to advanced.
• Available on desktop, web, and mobile to meet you where
you are so you never miss a thing.
Built by the trading-obsessed, so you can trade brilliantly.

Investing involves risks, including loss of principal.


Schwab does not recommend the use of technical analysis as a sole means of investment research.
© 2023 Charles Schwab & Co., Inc. All rights reserved. Member SIPC. (1023-373U) ADP121824-00 Schwab.com/Trading

You might also like