0% found this document useful (0 votes)
232 views64 pages

2022 Aug

The August 2022 issue of Traders' Magazine features articles on various trading strategies, including a long-short strategy for capitalizing on volatility, logistic asset allocation, and trading with double tops and bottoms. It also explores whether members of Congress can outperform the market and introduces a new tool for filtering price movements using linear regression-adjusted EMA. Additionally, the magazine promotes the Professional Traders' Starter Kit, which offers a comprehensive collection of trading resources and tools.

Uploaded by

alark.singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
232 views64 pages

2022 Aug

The August 2022 issue of Traders' Magazine features articles on various trading strategies, including a long-short strategy for capitalizing on volatility, logistic asset allocation, and trading with double tops and bottoms. It also explores whether members of Congress can outperform the market and introduces a new tool for filtering price movements using linear regression-adjusted EMA. Additionally, the magazine promotes the Professional Traders' Starter Kit, which offers a comprehensive collection of trading resources and tools.

Uploaded by

alark.singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 64

THE TRADERS’ MAGAZINE SINCE 1982 www.traders.

com AUGUST 2022

TRADING THE
FEAR INDEX
A long-short strategy to
capitalize on volatility 8

LINEAR REGRESSION
OF PRICE AND TIME
Part 4: Logistic asset
allocation 20

CAN MEMBERS OF
CONGRESS BEAT
THE MARKET?
See what this study says 30

TRADING WITH
DOUBLE TOPS AND
DOUBLE BOTTOMS
A trading strategy 34

LINEAR REGRESSION-
ADJUSTED EMA
A new tool to filter price
movement 38
AUGUST 2022
Take Control of Your Trading with the
Professional Traders’ Starter Kit ™

only

$
5
per month!*

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 it
3. Complete Digital Archive. The complete archives as PDFs 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


IBKR GlobalTrader
Simple. Worldwide.
Stock trading.

The IBKR GlobalTrader app makes it easy to trade


stocks worldwide. Open your account in minutes
and enjoy commission-free trading on US stocks and ETFs and access
over 90 stock markets in the US, Canada, Europe, and Asia.

The app is packed with powerful functionality, including:

Scan the globe for Trade in Deposit in your Free educational


undervalued stocks fractions local currency resources

Start your FREE TRIAL today.


Download your app by scanning the
QR code and put the world in the palm
of your hand.

Download on the App Store Get it on


for iPhone and iPad Google Play

ibkr.com/sc-trader

Interactive Brokers LLC - member NYSE, FINRA, SIPC.


Any trading symbols displayed are for illustrative purposes only and are not intended to portray recommendations. 04-IB22-1530CH1522
CONTENTS AUGUST 2022, VOLUME 40 NUMBER 9

6 The Savvy Technician


by Stella Osoba, CMT, Esq.
The Traders’ MagazineTM Recognizing and applying technical
chart patterns to trading.
EDITORIAL
editor@traders.com
8 Trading The Fear Index TIPS
by Markos Katsanos
Editor in Chief Jack K. Hutson
Here is a long-short strategy to
Production Manager Karen E. Wasserman
capitalize on stock market volatility
Art Director Christine Morrison
using volatility-based exchange-
Graphic Designer Wayne Shaw
traded funds (ETFs or ETNs).
Webmaster Han J. Kim 38 The Linear Regression-Adjusted
Contributing Editors John Ehlers, 20 Linear Regression Of Price And Exponential Moving Average
Anthony W. Warren, PhD.
Time, Part 4: Logistic Asset by Vitali Apirine
Contributing Writers Thomas Bulkowski, Martin Pring,
Barbara Star, Markos Katsanos, Leslie N. Masonson, Allocation Here is a new tool you can use
Karl Montevirgen by Mike B. Siroky, MD that combines a linear regression
Effective asset allocation design indicator with exponential moving
OFFICE OF THE PUBLISHER will recognize not only how much averages to filter price movement
Publisher Jack K. Hutson is allocated to various assets, but and help define turning points.
Industrial Engineer Jason K. Hutson
Project Engineer Sean M. Moore
also, which assets are performing 42 Daytrading Small Caps:
the best. Toward this goal, the
“logistic portfolio” is introduced
End-Of-Day
ADVERTISING SALES by Ken Calhoun
4757 California Ave. S.W. here, which is a dynamic allocation
Seattle, WA 98116-4499
model based on near-term estimates Here is a simple momentum
206 938-0570 Fax 206 938-1307
advert@traders.com of risk-adjusted returns, rather than daytrading breakout strategy that
on long-term expected returns or is designed to capitalize on volatile
National Sales Manager Edward W. Schramm
ESchramm@traders.com expected volatilities. Find out how moves in small-cap stocks.
to implement it. 43 Algo Q&A
CIRCULATION
Subscription & Order Service 1 800 832-4642 29 Market Rap by Kevin J. Davey
1 206 938-0570 Fax 1 206 938-1307
by Emilio Tomasini Got a question about system or algo
circ@traders.com
“Unserious” thoughts on serious trading?
Subscription Manager Sean M. Moore
topics in finance. 44 Futures For You
WEBSITE
30 Can Members Of Congress by Carley Garner
http://www.traders.com
Beat The Market? Here’s how the futures market
Staff members may be emailed using first initial
by Massoud Metghalchi, PhD, really works.
plus last name plus @traders.com
Peggy A. Cloninger, PhD, and 46 Explore Your Options
Jaime G. Herran La Torre by Jay Kaeppel
Author­i­za­tion to pho­to­copy items for inter­nal or per­sonal
use, or the inter­nal or per­sonal use of spe­cific cli­ents, is grant- The US Congress passed the Got a question about options?
ed by Tech­ni­cal Anal­y­sis, Inc. for users reg­is­tered with the Stop Trading on Congressional
Cop­y­right Clear­ance Cen­ter (CCC) Transactional Reporting Knowledge Act of 2012, commonly 60 Trading Perspectives
Serv­ice, pro­vided that the base fee of $1.00 per copy, plus
50¢ per page is paid directly to CCC, 222 Rosewood Drive, known as the STOCK Act, to help by Rob Friesen
Danvers, MA 01923. Online: http://www.copyright.com. For curb potential or apparent trading Some perspectives on the equities
those organ­iz­ a­tions that have been granted a photocopy by members of Congress based on world.
license by CCC, a sep­a­rate sys­tem of pay­ment has been
arranged. The fee code for users of the Transactional inside or confidential information
Reporting Serv­ice is: 0738-3355/2022 $1.00 + 0.50. they may possess. But have
Sub­scrip­tions: USA: one year (13 issues) $89.99; members of Congress actually fared DEPARTMENTS
Magazines shipped outside the US require additional
postage as follows: Canada, US$15 per year; Europe, better in their trading results than 49 Traders’ Tips
57 Advertisers’ Index
US$25.50 per year; all other countries US$39 per year. anyone else? See what this study 57 Editorial Resource Index
Sin­gle copies of most past issues from the cur­rent year are says. 59 Classified Advertising
avail­a­ble pre­paid at $8 per copy. Prior years are avail­a­ble
in book format (without ads) or digitally from www.traders. 59 Traders’ Resource
com. USA funds only. Washington state res­i­dents add 34 Trading With Double Tops And
sales tax for their locale. VISA, MasterCard, AmEx, and Double Bottoms
Discover accepted. Subscription orders: 1 800 832-4642
or 1 206 938-0570.
by Azeez Mustapha
Technical Analysis of Stocks & Commodities™, You can make profitable trades by
The Traders’ Magazine™, is prepared from information getting to recognize patterns that
tend to repeat. Here’s an example
believed to be reliable but not guaranteed by us with­out
further verification, and does not purport to be complete.
Opinions expressed are subject to revision without noti- of taking trades in the forex market
fication. We are not offer­ing to buy or sell securities or based on double tops and double
bottoms, with confirmation from
commodities discussed. Technical Anal­ysis Inc., one or
more of its officers, and authors may have a position in
the securities discussed herein. Bollinger Bands.
The names of products and services presented in this
magazine are used only in an editorial fashion, and to the
benefit of the trademark owner, with no intention of infringing This article is the basis for
on trademark rights.
n Cover: Roy Wiemann
TIPS Traders’ Tips this month.
n Cover concept: Christine Morrison
Copyright © 2022 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 • August 2022 • Technical Analysis of Stocks & Commodities


We are honored to be recognized as a
top trading software provider in the
2022 Readers’ Choice Awards.

WINNER: Stand Alone Analytical Software $$$


WINNER: Stand Alone Analytical Software $

Thank you to all who voted for NinjaTrader’s industry


leading platform & brokerage services.
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.

ninjatrader.com
The Savvy Technician
CHARTING THE MARKETS
Stella Osoba, CMT, Esq., is an attorney, trader, and financial writer in New York, NY. Her work in financial
litigation involving regulatory bodies and large multinational corporations led to an interest in the financial
markets, then technical analysis and the psychological aspects of market behavior. She earned a CMT charter
in 2013 and was a director-at-large on the board of the CMT Association for four years. This column will
focus on recognizing and applying technical chart patterns to trading with flexibility and astuteness for better
decision-making in trading. She can be reached at stellaosoba@gmail.com.

HISTORY DOESN’T REPEAT For example, if you had been slow anticipation of higher prices to come.
There’s a well-known quote attributed to recognize and participate in the They deny that the market has topped
to Samuel Langhorne Clemens (also preceding bull market, it’s likely you and that distribution is happening.
known by his pen name Mark Twain) would have hung on during reac- What will eventually become clear
that says, “History doesn’t repeat, but tions hoping that the market would is that hindsight is clouded by the fog
it often rhymes.” eventually recover and reward you. of euphoria and enthusiasm.
With the Dow Jones Industrial You climbed the “wall of worry” Figure 1 is a daily price chart of
Average (DJIA) flirting near bear with the bull market, thinking every the DJIA from March 2007 until May
market territory as I write this, now reaction was the beginning of a bear 2009. The clarity that comes from
seems a good time to revisit some of market, and were proved wrong so the safe and unencumbered distance
the rhymes and rhythms of a previ- many times, that
ous consequential bear market in you now started
the DJIA and to see if there are any to believe that ev-
lessons we can take from it. ery reaction was
On October 11, 2007, the DJIA simply another
touched an all-time high of 14,198.10. opportunity to
Even though the following price re- add more to your
action had brought the DJIA down positions.
to a low of 12,724 on November 26, The emotional
2007, there was no reason to think reaction of mar-
that the market would not quickly ket participants
recover and proceed to make even to bear markets
higher highs. The following high has been adapted
took the DJIA up to only 13,780 on from the famous
December 11, 2007, but very few mar- theory of the five
ket participants would have noticed stages of grief
or had confidence in the signals of a elucidated by
changing trend and correctly posi- Swiss-American
tioned themselves to take advantage psychiatrist Elisa-
of the market conditions. beth Kubler-Ross.
Hindsight is always 20/20, but in They are: denial,
real time, many more emotions cloud anger, bargain-
STOCKCHARTS.COM

our judgment and slow our reactions. ing, depression,


and finally, ac-
ceptance. Denial, FIGURE 1: BEAR MARKET, 2007–2009. In this daily price chart of the
Now seems a good time or stage one, is Dow Jones Industrial Average (DJIA) from March 2007 until May 2009, you
to revisit some of the when market par- can see that the DJIA fell from a high of 14,198 to a low of 6,546—a 54%
decrease in price during this bear market in the DJIA. But with intervening
rhymes and rhythms of a ticipants see any rallies along the way, the overall trend change from up to down may not
previous consequential stock market re- have been easy to recognize in real time. Astute technicians would have
noticed the valuable clues being provided by chart patterns such as the
bear market in the DJIA. action as a buying head & shoulders topping pattern, the death cross, and candle patterns
opportunity in seen in this chart.
6 • August 2022 • Technical Analysis of Stocks & Commodities
The Savvy Technician

FIGURE 2: TOPPPING PATTERN, 2021. In this daily price chart of the


DJIA from June 2020 until May 2022, you can see a similar topping pat-
tern to the one seen in Figure 1. The death cross appears shortly after the
right shoulder is formed. You can see a failed test of the right shoulder
with the next high and then the consequent plunge in prices. On May 20,
2022, price fell to new lows, but recovered as buying pressure came in FIGURE 3: SHORT-TERM VIEW, 2022. In this daily price chart of the DJIA
to the market. from February until May 2022, the candlestick that formed on the last trading
day depicted in the chart is a hammer, which is bullish. This could mark the
of time shows a head & shoulders believe that price end of the current leg of the reaction, but since candlestick patterns are
topping pattern. The test of the price declines are re- short-term indicators, it does not tell us the larger trend.
highs of the right shoulder fails as ally no more than
price rises to 13,551 on December 27, normal reactions, because during the death cross appears shortly after the
2007, and then retreats. Also, notice preceding bull market, that was true right shoulder is formed. We see the
the death cross that forms soon after for so long. There is no appetite to failed test of the right shoulder with
the right shoulder has formed. (A believe that the reversal really has the next high and then the consequent
death cross is when the 50-day mov- happened. More market participants plunge in prices. On May 20, 2022,
ing average moves below the 200-day are hopeful for a continued rise in price fell to new lows, but recovered
moving average). Once that happens, prices than are fearful of a fall. as buying pressure came in to the
the 200-day moving average acts as Figure 2 is a daily price chart of market.
resistance for the next reaction high. the DJIA showing price action from See Figure 3. The candlestick
The 200-day moving average remains June 2020 until May 2022. We see that formed on the last trading day
above the 50-day moving average for a similar topping pattern to the one depicted in the chart is a hammer,
the remainder of the bear market. The observed in Figure 1. We see that the which is bullish. (Remember that
DJIA will eventually fall from a high candlestick patterns are short term.)
of 14,198 to a low of 6,546—a 54% The hammer possibly marks the end
decrease in price. When these patterns are of the current leg of the reaction. But
When these patterns are happening happening in real time, without a crystal ball, it is impossible
in real time, it is easy and tempting it is easy and tempting to tell where price will eventually
to dismiss them, especially when we to dismiss them, find its lows.
are positioned for different market History does not repeat, but it
conditions. Well-known technician
especially when we are rhymes. Trade cautiously!
and Elliott wave practitioner Bob positioned for different
Prechter named this the “slope of market conditions.
hope.” Market participants want to
August 2022 • Technical Analysis of Stocks & Commodities • 7
TRADING SYSTEMS

There Is Nothing To Fear But Fear Itself

Trading The Fear Index


Here is a long-short strategy to capitalize on stock can see, the curve is in contango (that is, later months
market volatility using volatility-based exchange- are higher than closer months) and each time the fund
traded funds (ETFs or ETNs). rolls futures contracts near expiration, it sells a cheaper

M
contract to buy a more expensive one. This process
ost investors regard the VIX Index (also decays the NAV of the fund, resulting in underperfor-
known as the “fear index”) simply as a mance versus the VIX Index over time. As you can
metric that might help them prepare for see in Figure 3, the chart of UVXY resembles a ski
market movements but ignore any potentially lucra- slope with occasional steep or low bumps. Shorting
tive trading opportunities that it offers. it, therefore, looks like a free lunch. My first thought
Of course, it is not possible to trade the Cboe Vola- was that it looked too good to be true. Of course,
tility Index (VIX Index, or VIX) directly, but you where the stock market is concerned, nothing is free
can trade futures and options on the VIX as well as and this is the case with UVXY.
various exchange-traded funds that offer exposure to The VIX is not always below the curve. During
the VIX complex (see Figure 1). There is, however, a periods of high implied volatility (about 25% of the
problem with that: You might have noticed that neither time), the VIX rises above the curve and this leads to
the long-term nor short-term returns of the volatility compounding returns for long VIX ETFs as prices rise
ETFs track the cor-
responding long-term Ticker
Inception Long/Short Long/Short
Leverage
AUM Expense Average Historical
or short-term returns Date VIX term VIX ($ mil) Ratio Volume Volatility
UVXY 03/06/13 Long Short term 1.5x $894 0.95% 78,371,000 141.0
of the VIX. VXX 01/19/18 Long Short term 1x $571 0.89% 20,057,000 90.3
For example, the VIXY 01/04/11 Long Short term 1x $403 0.85% 10,774,000 94.6
VIX Index was down VIXM 01/05/11 Long Mid term 1x $104 0.85% 164,300 34.1
25% in 2021 whereas VXZ 01/23/18 Long Mid term 1x $60 0.89% 72,200 35.0
VXX (iPath Series B SVXY 10/04/11 Short Short term −0.5x $427 1.38% 6,010,000 47.8
S&P 500 VIX Short SVOL 05/13/21 Short Short term −0.25x $105 0.50% 60,400 23.6
Term Futures ex- FIGURE 1: LIST OF VOLATILITY FUNDS (ETNS AND ETFS). Assets under management (AUM) and average 50-day
volume are as of 5/6/2022. In the last column, you can see the six-month historical volatility.
change-traded note)
was down 75%—three times the corresponding VIX
return.
Why the discrepancy?
The answer is that since the VIX itself is not invest-
able, volatility ETFs use the VIX futures curve to
construct a synthetic one-month volatility exposure
by buying and selling a combination of VIX futures
and rolling them each month. Thus, day-to-day returns
are driven not by the VIX but by movement along the
ROY WIEMANN

FIGURE 2: VIX FUTURES CURVE. Volatility ETFs are constructed from rolling
curve. You can see in Figure 2 what the curve looked VIX Index futures contracts. As you can see, the VIX futures curve as of 1/19/2022
like on January 19, 2022 with the VIX at 23.85. As you is in contango (that is, later months are higher than recent months).

by Markos Katsanos
August 2022 • Technical Analysis of Stocks & Commodities • 9
VIX Statistics
Mean (Average) 19.40
5% Trimmed Mean 18.52
Median 17.34
Maximum 82.69
Minimum 9.14
Percentiles
50% 17.33
60% 19.39
80% 24.28
90% 28.75
95% 34.01
99% 49.74
FIGURE 4: VIX VALUES OVER THE
YEARS. Shown here are statistics
for the Cboe Volatility Index (on a
closing price basis) based on the
FIGURE 3: A LEVERAGED, LONG, VOLATILITY ETF (UVXY). The green plot is a weekly logarithmic chart of the last 30 years from 1992 until the
ProShares Ultra VIX Short-Term Futures ETF (UVXY) since its inception in March 2013 through May 2022. The end of 2021. The percentiles section
VIX is super­imposed in blue. UVXY is a 1.5x leveraged VIX long ETF. As you can see, the VIX reverts to the mean, shows the percentage of VIX prices
while the UVXY decays over time. Little yellow boxes on the chart indicate reverse splits. There were two 1:10, (first column) that didn’t exceed the
four 1:5, and two 1:4 reverse splits since 2013! The initial trading price (after adjusting for splits) was $9,170,000 corresponding maximum value of
while today’s price is $16.11! the VIX in the second column. For
example, the VIX was below 34 about
95% of the time.
periods of low volatility?
The answer is simple.
Volatility ETFs and VIX options function like insur-
ance, and insurance costs money. The buyer doesn’t care
about the cost or the contango effect of the volatility de-
rivatives because he is buying them to mitigate the losses
of a long equity portfolio in case of a rare event that will
drive share prices sharply lower. The seller, on the other
hand, is comparable to an insurance company and has a
huge risk in case this rare event actually occurs, with the
difference that the derivatives seller can close his position
at any time during the trade while the insurance company
cannot cancel the policy before expiration.
In this article, I will present a long-short strategy that
tries to capture a large part of the volatility spikes while
capitalizing on the long-term time decay of the volatility
FIGURE 5: WHERE DOES THE VIX SPEND MOST OF ITS TIME? This ETFs.
VIX frequency histogram uses 7,652 VIX prices (on a closing price basis)
during the last 30 years from 1992 until the end of 2021 with the normal VIX statistics
curve superimposed in black. The y-axis is the number of VIX prices that
are included between the corresponding values on the x-axis. For example,
While most investors have heard of the VIX Index, far fewer
the most frequent VIX prices were between 12 and 14 and occurred about understand what it actually measures. The VIX is often
1,050 times during the 30 years since 1992. referred to as the “fear index” or “fear gauge.” It represents
the implied volatility in the stock market for the next 30
to converge with the VIX, resulting in occasional violent days. The VIX is calculated in real time by the Cboe Op-
short-term spikes that can wipe you out if you are short tions Exchange (formerly called the Chicago Board Options
volatility. In fact, during the last four years, the UVXY Exchange or CBOE) and is a weighted blend of option
spiked more than 50% no less than ten times. prices for the S&P 500. The formula that calculates the
But who buys these ETFs in a bull market or in extended index takes current market prices for all out-of-the-money
10 • August 2022 • Technical Analysis of Stocks & Commodities
options for the first and sec-
ond nearest months. The VIX
has been around since 1990
and futures and options on
the index have been traded
since the mid-2000s.
The original formula for
calculating the VIX used
the S&P 100 index (OEX)
options but in 2003 the
CBOE changed the under-
lying index to the S&P 500
(SPX), and the old VIX was
renamed the VXO.
In addition to VIX, Cboe FIGURE 6: VIX & VVIX (VOLATILITY OF VIX). Shown here is a weekly logarithmic chart of the Cboe VIX Index
uses the same methodology from 2013 to May 2022 with the Cboe VVIX Index superimposed in red. The Cboe VVIX Index represents the
expected 30-day volatility of the VIX based on VIX options.
to compute the following
related products using different calculation periods on You should also keep in mind that since the beginning of
the S&P 500 or other equity indexes: 2020, the VIX and the associated VIX volatility remained
at elevated levels (see Figure 6) and it is currently a few
• S&P 500 9-day Volatility Index (VIX9D) points below its 2021 peak. Whether this is the new normal
• S&P 500 3-Month Volatility Index (VIX3M) remains to be seen.
• S&P 500 6-Month Volatility Index (VIX6M)
• S&P 500 1-Year Volatility Index (VIX1YS) Trading system description
• Nasdaq-100 Volatility Index (VOLQ) VIX funds generally tend to drift lower but with occasional
• Cboe Nasdaq Volatility Index (VXN) short, and often violent, spikes higher. Since the funds were
• DJIA Volatility Index (VXD) in a downtrend, my main objective in designing the sell
• Russell 2000 Volatility Index (RVX) short rules system was to avoid these transitory spikes,
thus limiting drawdown to a minimum. On the other hand,
There is even a VIX on the VIX (VVIX) (Figure 6), which I spent a lot more time in coming up with profitable buy
is the volatility of the VIX and it is calculated the same rules, as the VIX spikes were short-lived and against the
way as the VIX, except the inputs are market prices for main trend.
VIX options instead of for S&P 500 options. A pre- and post-spike VIX spike analysis revealed a
Before we can go into the strategy, we need to understand few common warning signals. The most obvious was
the statistics of the VIX (see Figures 4 & 5) on which some that the implied volatility was up sharply, more than 50%
of the conditions are based. from previous levels, before the spike and declined more
You can see in Figure 5 that although the VIX can spike than 20% after the event. So I decided to use the VIX as
up as high as 80, these occurrences are not only extremely my main forecasting tool. I also noticed that the angle of
rare but are also short-lived. In fact, it stayed above 60 ascent was also important, so I used a custom indicator,
for only 38 days in 30 years: 11 days during the Covid which I call the correlation trend (RC), to calculate the
crisis in March 2020 and 27 days during the financial correlation of the VIX with a straight line. Thus, if the
crisis in 2008.
At the bottom of Figure 4, you can see the percentage
of the time that the VIX was below a certain value during
the last 30 years. Notice (in the last row) that it exceeded In this article, I will present a long-
49.7 only 1% of the time or 75 days. All other times, the short strategy that tries to capture
VIX fluctuated around the median (17.3). a large part of the volatility spikes
It might seem odd that 60% of occurrences were while capitalizing on the long-term
below the mean (19.4). In this case, the median is more time decay of the volatility ETFs.
useful as a measure of central tendency, as the mean is
sensitive to the presence of very high outliers.
August 2022 • Technical Analysis of Stocks & Commodities • 11
trend is up, the correlation with the straight line is positive, the last 3 days. The percentage is calculated using
ranging from +0.5 to a maximum of +1, and if the trend closing VIX prices.
is down, the correlation is negative, ranging from −0.5 to 2. Maximum volatility surge. The VIX should not
a minimum of −1. If the price trend is weak or sideways, be up more than 50% during the last 6 days. This
then the correlation is between +0.5 and −0.5. metric is calculated using intraday VIX high and
A major problem was that during the last ten years, US low prices.
equities were in a secular bull market with only a few brief 3. VIX threshold. The VIX spends less than 35% of
corrections and the VIX spikes tended to fizzle out very the time below 15, which indicates that the probabil-
quickly. The VIX Index is tightly correlated to drawdowns ity of going even lower is not very favorable. Short
in the S&P 500 since the demand for protection rises when trades when the VIX was 15 or less were therefore
the market declines. Therefore, I decided to use the SPY filtered out.
ETF, which is a proxy for the S&P 500, in order to filter 4. VIX–SPY relative position. The 10-day stochastic
out shallow corrections. In order to normalize both SPY of the SPY ETF should be higher than the 10-day
and VIX price levels, I used the stochastic indicator. Thus, stochastic of the VIX, and the 10-day stochastic of the
long trades were only permitted if the VIX stochastic was SPY ETF should be higher thans yesterday’s value.
above the SPY stochastic and the reverse for short trades.
This condition improved the performance, especially of the Buy to cover rules
long trades. I finally came up with the following rules: 1. Rising volatility. The VIX rises more than 50% over
the past 6 days.
Buy rules 2. VIX trend. The correlation trend indicator should be
1. Rising volatility. The VIX should be up more than more than 0.8 and the 10-day stochastic of the VIX
50% during the last 6 days. The percentage is calcu- should be higher than yesterday’s value.
lated using intraday VIX high–low prices.
2. Trend. The correlation trend (RC) of the VIX As you can see from these rules, all conditions are
should be 0.8 or higher and it should be higher than based on the VIX and the SPY ETF, and not on actual
yesterday’s value. volatility ETF prices. Therefore, to trade the short VIX
3. VIX–SPY relative position. The 25-day stochastic of ETF (SVXY), I just renamed the exact same rules from
the VIX should be higher than the 25-day stochastic short to buy and from cover to sell.
of the SPY ETF; similarly, the 10-day stochastic of You can find AmiBroker code and formulas for cal-
the VIX should be higher than the 10-day stochastic culating all the indicators and metrics I’ve used for this
of the SPY ETF. In addition, the 10-day stochastic of system in the sidebar, “Volatility ETF Trading System,
the VIX should be higher than yesterday’s value. In AmiBroker Code.”
If you want to translate the code in the sidebar to other
Sell rules programming languages, I strongly suggest using the for-
Long positions are closed if the 10-day stochastic of the mulas in the code in the sidebar and not just the description
SPY rises above the 10-day stochastic of the VIX or falls above in the rules.
below yesterday’s value.
Testing method
Sell short rules Most volatility ETFs only came into existence after 2011
1. Declining volatility. The VIX should fall more than (see Figure 1) while some others (TVIX, ZIV, XVZ) were
20% during the last 6 days and should be down during delisted, which presented a problem in backtesting them
on equal time periods. Nevertheless, I decided to backtest
the most popular and liquid ETFs: SVXY, VXX, VIXY,
UVXY, and VIXM.
Since the VIX itself is not For the simulation, I used 10-year daily historical data of
investable, volatility ETFs the funds or, in the case of VXX and UVXY, all available
use the VIX futures curve to data since they started trading.
construct a synthetic one-
month volatility exposure. • All signals were executed next day at the open.
Typical current discount commission rates (0.01 per
share) were used throughout the test and the initial
12 • August 2022 • Technical Analysis of Stocks & Commodities
How is futures margin different
from equities margin?
When you trade futures, you often wind up with a lot of questions. That’s why, at TD Ameritrade, we have
on-demand education, futures specialists ready to talk day and night, and an intuitive trading platform.
So whatever the question, you’ll have all the answers you need.
Learn more at tdameritrade.com/tradefutures

Futures trading involves substantial risk, and is not suitable for all investors. Futures trading services provided by Charles Schwab Futures and Forex LLC,
a CFTC-registered Futures Commission Merchant and NFA Forex Dealer Member. Charles Schwab Futures and Forex LLC is a subsidiary of The Charles
Schwab Corporation. TD Ameritrade, Inc., member SIPC, a subsidiary of The Charles Schwab Corporation. TD Ameritrade is a trademark jointly owned by
TD Ameritrade IP Company, Inc. and The Toronto-Dominion Bank. © 2021 Charles Schwab & Co., Inc. All rights reserved.
ETF SVXY VXX UVXY VIXM VIXY
SYSTEM BUY & HOLD LONG-SHORT LONG-SHORT LONG-SHORT LONG-SHORT LONG-SHORT ONLY LONG ONLY SHORT
Net Profit $370 $92,260 $55,240 $158,800 $39,950 $102,100 $30,500 $74,900
Initial Equity $20,000 $20,000 $20,000 $20,000 $20,000 $20,000 $20,000 $20,000
Comp. Annual Return 0.2% 18.8% 36.5% 27.0% 11.6% 19.8% 9.7% 16.4%
Total Number of Trades 1 47 26 47 47 47 24 23
Winners % 100% 66.0% 73.1% 70.2% 59.6% 70.2% 66.7% 73.9%
Profit Factor 6.02 5.65 5.81 4.45 6.14 5.76 6.32
Ratio Avg win/Avg loss 3.11 2.08 2.46 3.02 2.60 2.88 2.23
Max System Drawdown % −95.3% −28.6% −37.3% −24.2% −10.6% −17.6% −13.6% −19.9%
Max System $ Drawdown −$231,900 −$13,870 −$7,770 −$18,400 −$5,046 −$11,970 −$4,660 −$10,180
Max Drawdown Date 3/18/20 6/24/13 3/27/18 2/11/16 2/11/16 2/11/16 3/26/18 2/11/16
Largest Losing Trade −$231,900 −$2,630 −$4,190 −$6,295 −$1,722 −$4,180 −$1,850 −$4,180
Ulcer Index 62.10 6.38 8.10 4.68 3.09 3.95 5.84 4.31
Ulcer Performance Index −0.01 2.79 4.36 5.57 3.43 4.76 1.49 3.58
Reward/Risk (Recovery) 0.00 6.65 7.1 5.6 7.9 8.5 6.5 7.0
Avg Trade Duration (bars) 2518 39 34 32 39 39 3 77
Start Date 5/10/12 5/10/12 1/31/18 3/6/13 5/10/12 5/10/12 5/10/12 5/10/12
First Trade 5/10/12 6/11/12 2/15/18 10/14/13 6/11/12 6/11/12 1/28/14 6/11/12
End Date 5/10/22 5/10/22 5/10/22 5/6/22 5/10/22 5/10/22 5/10/22 5/10/22
FIGURE 7: SYSTEM PERFORMANCE. Here you can see the performance of the long-short volatility trading system on five volatility ETFs during the last
10-year period (except for VXX and the UVXY, which started trading in January 2018 and March 2013, respectively). The reward/risk or recovery factor is
the net profit divided by the maximum system drawdown, where values >3 are good. The ulcer index is the square root of the sum of squared drawdowns
divided by the number of bars; the lower, the better. The ulcer performance index is a measure of risk-adjusted return of an investment; above 1.0 is fair,
and more than 2.0 is good. It is calculated by subtracting the risk-free rate of return from the annual return and dividing it by the square root of the sum
of squared drawdowns. Buy & hold statistics are given for SVXY for illustration. Statistics for long-only and short-only are shown for VIXY to illustrate the
long and short performance separately.

investment amount was $20,000. and 60% in February 2020. Nobody wants to be on the
• There was a problem, however, during testing be- wrong side of that trade! A timing model, therefore, feels
cause the initial equity wasn’t enough to buy a whole right.
share of UVXY during the first year of the test. This In the table in Figure 7, you can see the backtest results
was because the split-adjusted price of one share for the simulation. At first glance, the 10-year performance
of UVXY in the first half of 2013, due to multiple statistics of the short-term volatility ETFs (SVXY, VIXY,
reverse splits, was more than $8,000,000! So in the and UVXY) look similar. The most profitable ETF was
case of UVXY, I allowed for fractional shares up to the UVXY, but this was to be expected because it was
3 decimal places. For the other ETFs, the minimum the only leveraged (1.5×) ETF. In this case, the higher
amount of shares was set to 1. leverage produced higher profits over time but at the cost
• I used only VIXY to develop and optimize the system, of higher short-term risk.
since it had a complete 10-year history and no leverage. The best performer overall was VIXY (Figure 8), which
I used profitability and drawdown criteria to come up had the highest profit factor with reasonable drawdown.
with the best parameters for the maximum volatility, The maximum drawdown occurred in February 2016
the lookback period, and the stochastic bars. during the January–February 2016 market selloff. The
maximum drawdown developed because of a confluence
System evaluation of two events: a losing short trade in December 2015 and
In view of the UVXY chart in Figure 3, the obvious ques- adverse excursion from the next trade in the beginning
tion is: Why not just buy and hold SVXY, or short UVXY,
rather than trade them? The answer is that, sooner or later,
in extreme situations, it is possible for the ETF to move The VIX Index has consistently
more than 90% against you. This happened twice during
reverted to the mean over time.
the last 10 years (see the buy & hold drawdown statistics
in Figure 7), when SVXY plunged 95% in February 2018
14 • August 2022 • Technical Analysis of Stocks & Commodities
it is not a good idea to hold it
over very long periods. At the
time of writing in May 2022,
the ETF has lost 69% of its
value over the past year and
99% in the last five years.
The system performed
well during the last 10 years
but there is no guarantee that
it will perform equally well
in the future.
Volatility funds only came
into existence after the global
financial crisis (see Figure
1) and consequently, mar-
ket corrections were brief,
FIGURE 8: VIXY & VIX. The best overall performer in the test of the trading system was VIXY (ProShares VIX lasting no more than four
Short-Term Futures ETF.) Shown here is a daily chart of the VIXY ETF from January 2015 to June 2016 with the
months, since the backtest
VIX superimposed in black. The 25-day and 10-day stochastic of the VIX (in red) and of the SPY ETF (in blue) are
plotted in the middle windows. The equity line is plotted at the bottom in red. The blue vertical line was drawn at period did not include a pro-
the point of the maximum system drawdown on 2/11/2016. There were four short and four buy signals during that tracted bear market. It may
period. Notice the spike in the VIX during the buy signal in August 2015. be a good idea, therefore, to
revise the code or reoptimize
of February 2016 (see the chart in Figure 8). This trade, the parameters in case the current downtrend develops
in fact, turned out to become one of the most profitable into a protracted bear market.
trades, producing more than $5,900 of profits. The VIX volatility is currently at unusually elevated
The VXX, which started trading in 2018, produced less levels (Figure 6) so it would be a good idea to raise the
net dollar profits but had the highest annual return. It also maximum volatility parameter threshold (VIX UP%
had the highest percentage drawdown, but this statistic is MAX). In fact, optimization of this parameter during the
not very indicative of risk because it depends on the value last two years produced a higher threshold by 10 basis
of the equity and price levels at the time. In this case, it points. You should therefore change the default value
developed during the first trade when the equity was low from 50 to 60.
and the price was relatively high, so even minor price Another thing that comes to mind is to increase the
swings caused unevenly high equity fluctuations. holding period of long trades. You can do this by revising
The ETF with the least drawdown was the mid-term the sell (close long) rules.
volatility ETF VIXM, but this had less than half the profits So which ETF to choose? Their performance was simi-
of the short-term volatility ETFs. lar, so trading attributes should also be considered. If you
All the ETFs were out of the market during the Febru- want to use options, then UVXY is the best choice, since
ary 2020 volatility spike and thus managed to avoid the it has the most liquid options with only 1–2 cent bid-ask
associated drawdown. spread. The performance of the single leveraged VXX and
In the last two columns of the table in Figure 7 you can VIXY was similar but the VXX had three times the daily
see the long and short performance of the system sepa- volume of the VIXY and more liquid options.
rately for VIXY. The first thing you will notice is the huge If you choose VXX, then you should keep in mind
difference in trade durations: The short trades lasted an that on March 14, 2022, Barclays, the administrator of
average of 77 business days (3.5 months) while the long
trades only 3 business days. This is because volatility
ETFs are speculative assets that tend to rise swiftly but
fall gradually. You only need patience for the inevitable to Volatility ETFs and VIX options
play out. On the other hand, you need to be quick to close function like insurance, and
long trades, otherwise. you will be deep underwater on insurance costs money.
your long volatility fund until the next spike occurs.
A look at the UVXY chart (see Figure 3) suggests that
August 2022 • Technical Analysis of Stocks & Commodities • 15
the VXX ETN product, suspended sales from inventory the risk of shorting volatility:
and further issuance of the VXX. Barclays said in a later
statement that this suspension was being imposed because • Reduce the position size of your short trades to a
“Barclays does not currently have sufficient issuance small percentage of your portfolio until the market
capacity to support further sales from inventory and any trend changes.
further issuances of the ETNs. These actions are not the • Buy far out-of-the-money UVXY protective call
result of the crisis in Ukraine or any issue with the market options to hedge a sharp VIX spike. Of course, this
dynamics in the underlying index components.” The past will reduce the potential gain.
performance statistics, therefore, may not accurately reflect • Buy UVXY put options instead of shorting the ETF.
the future performance because the reduced share count The option premium will again reduce profits.
may increase the probability of a short squeeze. • Use more complicated option strategies like vertical
The VIXM is more appropriate for more conservative spreads. The exact method is beyond the scope of
investors since it had the lowest drawdown. Finally, inves- this article.
tors who can’t or don’t want to sell short stocks can use
the SVXY and VXX to short or buy volatility. On the other hand, if you are thinking of buying a vola-
tility fund for the sake of protecting the portfolio against
Is there nothing to fear? more losses, it is not a good time to do it at elevated prices
This year has seen a significant amount of market volatility. either, such as in the current market environment.
At the time of writing (mid-May 2022), the stock market The VIX Index has consistently reverted to the mean
continues to trend lower with the S&P 500 hovering above over time, and the current high level (around 30) suggests
and the Nasdaq well into bear market territory due to that it is a matter of time before it will go lower. This could
multiple issues including: happen because of a technical factor such as extremely
oversold market levels or a geopolitical event such as the
• Rising interest rates end of the war in Ukraine.
• Record high inflation
• High risk of a recession Concluding thoughts
• Disrupted supply chains President Franklin D. Roosevelt famously said during his
• China’s growth contraction because of Covid 1933 inaugural address, “There is nothing to fear but fear
lockdowns itself.” You might have to embrace the President’s advice
• The ongoing war in Ukraine. and overcome any emotions that replace logic with fear
because this is not an easy system to use in real-time
All these factors are far from reaching a point of resolu- trading, especially when following through short volatility
tion. Inflation has yet to moderate, although it could peak signals under bearish market conditions.
soon. Also, the Federal Reserve has only started to raise
interest rates, and it is anyone’s guess how long the central Markos Katsanos is the author of Intermarket Trading
bank may push with monetary tightening. Strategies published by John Wiley & Sons and is a Stocks
Given all the uncertainties in 2022, my gut feeling is & Commodities Contributing Writer. He can be reached
that volatility is currently underpriced and it might go at markos.katsanos@gmail.com or through his website
higher this year. at http://mkatsanos.com.
So in light of the above and taking into consideration
that fear or other emotional reactions are a real deterrent The code given in this article is available in the Article
in following through with system signals, you can revert Code section of our website, Traders.com.
to the following alternative techniques in order to mitigate
See our Traders’ Tips section beginning on page 49 for
implementation of Markos Katsanos’ technique in vari-
ous technical analysis programs and trading platforms.
Volatility ETFs are speculative Accompanying program code can be found in the Traders’
assets that tend to rise swiftly Tips area at Traders.com.
but fall gradually.
Further reading
Katsanos, Markos [2021]. “Buy & Hold or Buy & Sell?”
16 • August 2022 • Technical Analysis of Stocks & Commodities
Technical Analysis of Stocks & Commodities, Vol- Siroky, Mike [2022]. “Why Volatility Matters, ” Techni-
ume 39: July. cal Analysis of Stocks & Commodities, Volume 40:
Kaufman, Perry [2020]. “Price Shocks: Anticipation Is January.
Everything,” Technical Analysis of Stocks & Com- Gardner, Trent [2012]. “Using VIX To Forecast The S&P
modities, Volume 38: June. 500,” Technical Analysis of Stocks & Commodities,
Barlis, Glenn [2007]. “Trading Vs. Buy & Hold,” Techni- Volume 30: December.
cal Analysis of Stocks & Commodities, Volume 25:
Bonus Issue.

VOLATILITY ETF TRADING SYSTEM, IN AMIBROKER CODE


The underlying code for the long-short volatility ETF VOLATILITY ETF TRADING SYSTEM,
trading system is a little complex, but the rules are pretty FOR LONG VOLATILITY ETFS
basic. In translating the code to other programming This system should be applied only to long VIX ETFs
languages, please keep in mind the following: (such as VXX, VIXY, UVXY, VIXM, VXZ, SVOL.)
The default value of an indicator is the first number For applying the system to an inverse (short) VIX
enclosed in the optimization parameters. For example, ETF such as SVXY, see the next code segment titled
in the line: “Volatility ETF Trading System, For An Inverse (Short)
Volatility ETF—SVXY.”
VIXUPMAX=Optimize("VIXUPMAX",50,40,60,5);
//DAILY LONG-SHORT TRADING SYSTEM FOR LONG
the default value is 50, the optimization range is 40–60, VOLATILITY ETFs
and the increment is 5. //COPYRIGHT MARKOS KATSANOS 2022
//To be applied on a daily chart of long VIX ETFs:
In calculating my correlation trend custom indicator //VXX,VIXY,UVXY,VIXM,VXZ,SVOL
(RC), I use Pearson’s correlation function. In Easy­
SetBacktestMode( backtestRegular );
Language, the formula is: PosQty = 1; SetOption( "MaxOpenPositions", PosQty );
IE= 20000;SetOPTION( "INITIALEQUITY", IE );
RC=CoefficientR(VIX,CUM(1),RCBARS) Posize =20000;SetPositionSize( posize, spsValue );
RoundLotSize = 1; SetOption("MinShares",1); //for UVXY use
and not 0.001
SetOption("AllowPositionShrinking", True );
RC=correlation(VIX,CUM(1),RCBARS); SetOption("CommissionMode",3);
SetOption("CommissionAmount",.01); //$.01 per share
There is a discrepancy in calculating the stochastic SetOption("MinPosValue",1000); //$1000 per trade
oscillator in various technical analysis software mainly SetTradeDelays( 1, 1, 1, 1 );
BuyPrice = OPEN; SellPrice =OPEN;
because of different methods used in smoothing the raw SHORTPrice = OPEN; COVERPrice = OPEN;
indicator value. Some software calculates the fast %K
VIXUPMAX=Optimize("VIXUPMAX",50,40,60,5); // VIX UP%
stochastic using the formula: MAX
VBARS=Optimize("VBARS",6,5,10,1); // Number of bars to cal-
(C-LOWEST(L,DAYS))⁄(HIGHEST(H, DAYS) culate VIXUP,VIXDN & RC
–LOWEST(L, DAYS))*100 STBARSL=Optimize("STBARSL",25,25,30,5); // Number of Bars
to calculate slow Stochastic
and then smooths it by taking the simple n-day average, STBARSS=Optimize("STBARS",10,10,15,5); // Number of Bars to
while other technical analysis software smooths the calculate fast Stochastic
//Comparison Index
numerator and denominator of the fraction separately. IndexCode1 = ParamStr( "VIX", "VIX--X" );
Others smooth it by using the exponential moving aver- VIX = Foreign( IndexCode1, "C" );
VIXH = Foreign( IndexCode1, "H" );
age. In addition, each platform uses a different name, VIXL = Foreign( IndexCode1, "L" );
such as stochastic %K, stochastic %D, fast stochastic, IndexCode2 = ParamStr( "SPY", "SPY" );
slow stochastic, SlowKCustom, SlowKCustomOrig, etc. SPY = Foreign( IndexCode2, "C" );
SPYH = Foreign( IndexCode2, "H" );
To avoid errors in translation and because the stochastic SPYL = Foreign( IndexCode2, "L" );
indicator is used extensively by my system, I calculated //STOCHASTIC
the stochastic from first principles using the first method STOCHVS=(VIX-LLV(VIXL,STBARSS))/(HHV(VIXH, STBARSS)-
LLV(VIXL, STBARSS)+.0001)*100;
(smoothing of the %K and not the numerator and de- STVIXS=MA(STOCHVS,3);
nominator separately). STOCHSS=(SPY-LLV(SPYL,STBARSS))/
(HHV(SPYH,STBARSS)-LLV(SPYL,STBARSS)+.0001)*100;
STSPYS=MA(STOCHSS,3);

August 2022 • Technical Analysis of Stocks & Commodities • 17


STOCHVL=(VIX-LLV(VIXL,STBARSL))/(HHV(VIXH,STBARSL)- AddColumn(VIX,"VIX",1.2); AddColumn(VIXH,"VIXH",1.2);
LLV(VIXL,STBARSL)+.0001)*100; AddColumn(STVIXS,"STVIXS",1.2);AddColumn(STSPYS,"STS
STVIXL=MA(STOCHVL,3); PYS",1.2);
STOCHSL=(SPY-LLV(SPYL,STBARSL))/ AddColumn(STVIXL,"STVIXL",1.2);AddColumn(STSPYL,"STSP
(HHV(SPYH,STBARSL)-LLV(SPYL,STBARSL)+.0001)*100; YL",1.2);
STSPYL=MA(STOCHSL,3); AddColumn(RC,"RC",1.2);
// VIX AddColumn(VIXUP, "VIXUP% ",1.2);
VIXDN=(VIX/Ref(HHV(VIX,VBARS),-1)-1)*100; AddColumn(VIXDN,"VIXDN% ",1.2);
VIXUP=(VIXH/Ref(LLV(VIXL,VBARS),-1)-1)*100; AddColumn(BUY,"BUY",1);
// CORRELATION TREND AddColumn(SELL,"SELL",1,IIF( Sell, Colorred, colorDefault ));
RCBARS=VBARS-1; AddColumn(SHORT,"SHORT",1,IIF( SHORT, ColorRED, col-
RC=Correlation(VIX,Cum(1),RCBARS); orDefault ));
//RC1=Correlation(C,Cum(1),CL); AddColumn(COVER,"COVER",1,IIF( COVER, ColorBLUE,
//LONG colorDefault ));
BUY=BarIndex()>STBARSL+3 AND STVIXL>STSPYL AND
STVIXS>STSPYS AND STVIXS>Ref(STVIXS,-1) VOLATILITY ETF TRADING SYSTEM,
AND VIXUP>VIXUPMAX AND RC>.8 AND RC>Ref(RC,-1) ;
Sell= STSPYS>STVIXS OR STVIXS<REF(STVIXS,-1) ;//OR
FOR AN INVERSE (SHORT) VOLATILITY ETF—SVXY
//DAILY LONG-SHORT TRADING SYSTEM FOR THE
VIX<Ref(LLV(VIX,3),-1) ;//OR VIX<=HHV(VIXH,3)-15;
INVERSE ETF SVXY
//SHORT
//COPYRIGHT MARKOS KATSANOS 2022
SHORT=BarIndex()>STBARSS+3 AND VIX<=LLV(VIX,3) AND
//To be applied on a daily chart of SVXY:
VIXUP<VIXUPMAX AND VIXDN<-20 AND VIX>15
AND STSPYS>STVIXS AND STSPYS>Ref(STSPYS,-1) ;
SetBacktestMode( backtestRegular );
COVER= VIXUP>VIXUPMAX AND STVIXS>Ref(STVIXS,-1)
PosQty = 1; SetOption( "MaxOpenPositions", PosQty );
AND RC>.8 ;
IE= 20000;SetOPTION( "INITIALEQUITY", IE );
Posize =20000;SetPositionSize( posize, spsValue );
//PLOT
RoundLotSize = 1; SetOption("MinShares",1); // for UVXY use
SetChartOptions( 0, chartShowArrows | chartShowDates );
0.001
Equity(1); // evaluate stops, all quotes
SetOption("AllowPositionShrinking", True );
SetOption("EveryBarNullCheck", True );
SetOption("CommissionMode",3);
Plot( C, "Price", colorDefault, stylecandle | styleThick );
SetOption("CommissionAmount",.01); //$.01 per share
PlotShapes( IIf( Buy, shapeUPTRIANGLE, 0 ), colorBlue, 0, Low
SetOption("MinPosValue",1000); //$1000 per trade
);
SetTradeDelays( 1, 1, 1, 1 );
PlotShapes( IIf( Sell, shapeDownTRIANGLE, 0 ), colorOrange,
BuyPrice = OPEN;SellPrice =OPEN;
0, High );
SHORTPrice = OPEN; COVERPrice = OPEN;
PlotShapes( IIf( COVER, shapeUpTRIANGLE, 0 ), colorGrey50,
0, Low );
VIXUPMAX=Optimize("VIXUPMAX",50,50,60,5); // VIX UP%
PlotShapes( IIf( SHORT, shapeDownTRIANGLE, 0 ), colorRed,
MAX
0, High );
VBARS=Optimize("VBARS",6,5,10,1); // NUMBER OF BARS TO
// Custom text labels displayed with PlotText
CALCULATE VIXUP & VIXDN
dist = 2*ATR(10);
STBARSL=Optimize("STBARSL",25,25,30,5);
for( i = 0; i < BarCount; i++ )
STBARSS=Optimize("STBARS",10,10,10,5);
{if( BUY[i] ) PlotTextSetFont("BUY", "ARIAL", 10, i, L[ i ]-dist[i],
//Comparison Index
colorBLUE, colorDefault, 0 );
IndexCode1 = ParamStr( "VIX", "VIX--X" );
if( SELL[i]==1 ) PlotText( "SELL " , i, H[ i ]+.7*dist[i], colorRED,
VIX = Foreign( IndexCode1, "C" );
colorDefaulT );
VIXH = Foreign( IndexCode1, "H" );
if( SHORT[i] ) PlotTextSetFont("SHORT", "ARIAL", 12, i-2, H[ i
VIXL = Foreign( IndexCode1, "L" );
]+.5*dist[i], colorRED, colorDefault, 0 ); //PlotText( "OB SHORT",
IndexCode2 = ParamStr( "SPY", "SPY" );
i, H[ i ]+dist[i], colorRED );
SPY = Foreign( IndexCode2, "C" );
if( COVER[i]==1 ) PlotText( "Cover" , i-2, L[ i ]-dist[i], color-
SPYH = Foreign( IndexCode2, "H" );
GREEN, colorDefaulT );
SPYL = Foreign( IndexCode2, "L" );
if( COVER[i]==4 ) PlotText( "Trailing Stop" , i-2, L[ i ]-dist[i],
STOCHVS=(VIX - LLV(VIXL,STBARSS)) / (HHV(VIXH,
colorblue, colorDefaulT );}
STBARSS)-LLV(VIXL, STBARSS)+.0001)*100;
STVIXS=MA(STOCHVS,3);
GfxSelectFont("Times New Roman", 11, 600, True );
STOCHSS=(SPY - LLV(SPYL,STBARSS)) / (HHV(SPYH,
GfxTextOut( "VIX ETF", 5, 19);
STBARSS)-LLV(SPYL, STBARSS)+.0001)*100;
GfxTextOut( "Created By: Markos Katsanos", 5, 41 );
STSPYS=MA(STOCHSS,3);
Title = Name() + " " + Date() + " Price = " + Close + " Open=
STOCHVL=(VIX - LLV(VIXL,STBARSL)) / (HHV(VIXH,
"+O+ " High = " + H +" Low = " + L + " Volume= "+V+
STBARSL)-LLV(VIXL, STBARSL)+.0001)*100;
" VIX = " + VIX +" VIXH "+VIXH +" VIXL "+VIXL+" BarIndex
STVIXL=MA(STOCHVL,3);
"+BarIndex()+" Signal : "
STOCHSL=(SPY - LLV(SPYL,STBARSL)) / (HHV(SPYH,
+ WriteIf( Buy, "Buy", WriteIf( cover == 1, "Cover", WriteIf(
STBARSL)-LLV(SPYL, STBARSL)+.0001)*100;
SELL == 1, "Sell",
STSPYL=MA(STOCHSL,3);
WriteIf( short == 1, "Short", "none" )) ) ) ;
VIXDN=(VIX/Ref(HHV(VIX,VBARS),-1)-1)*100;
FILTER= Buy OR Sell OR Short OR Cover ;
VIXUP=(VIXH/Ref(LLV(VIXL,VBARS),-1)-1)*100;
AddTextColumn( FullName(), "Name");
AddColumn(Close,"Close",1.2); AddColumn(Ref(O,1),"Buy
// CORRELATION TREND
Price",1.2);
RC=Correlation(VIX,Cum(1),VBARS-1);

18 • August 2022 • Technical Analysis of Stocks & Commodities


SHORT=BarIndex()>STBARSL+3 AND STVIXL>STSPYL if( SHORT[i] ) PlotTextSetFont("SHORT", "ARIAL", 12, i-2, H[ i
AND STVIXS>Ref(STVIXS,-1) AND STVIXS>STSPYS AND ]+dist[i], colorRED, colorDefault, 0 ); // PlotText( "OB SHORT", i,
VIXUP>VIXUPMAX H[ i ]+dist[i], colorRED );
AND RC>.8 AND RC>Ref(RC,-1) ; // =HHV(RC,VLL) ; if( COVER[i]==1 ) PlotText( "Cover" , i-2, L[ i ]-2*dist[i], color-
GREEN, colorDefaulT );
COVER= STSPYS>STVIXS OR STVIXS<REF(STVIXS,-1) ; if( COVER[i]==4 ) PlotText( "Trailing Stop" , i-2, L[ i ]-dist[i],
// OR VIX<Ref(LLV(VIX,3),-1) ; // OR VIX<=HHV(VIXH,3)-15; colorblue, colorDefaulT );}

BUY=BarIndex()>STBARSS+3 AND VIXDN<-20 AND GfxSelectFont("Times New Roman", 11, 600, True );
VIX>15 AND VIX<=LLV(VIX,3) AND STSPYS>STVIXS AND GfxTextOut( "SVXY", 5, 19);
STSPYS>Ref(STSPYS,-1) GfxTextOut( "Created By: Markos Katsanos", 5, 41 );
AND VIXUP<VIXUPMAX ; Title = Name() + " " + Date() + " Price = " + Close + " Open=
"+O+ " High = " + H +" Low = " + L + " VIX = " + VIX +
SELL= (VIXUP>VIXUPMAX AND STVIXS>Ref(STVIXS,-1) AND " VIXH "+VIXH +" VIXL "+VIXL+" BarIndex "+BarIndex()+" Signal
RC>.8) ; : " + WriteIf( Buy, "Buy",
WriteIf( cover == 1, "Cover", WriteIf( SELL == 1, "Sell",
//PLOT WriteIf( short == 1, "Short", "none" )) ) ) ;
SetChartOptions( 0, chartShowArrows | chartShowDates );
Equity(1); // evaluate stops, all quotes FILTER= Buy OR Sell OR Short OR Cover ;
SetOption("EveryBarNullCheck", True ); AddTextColumn( FullName(), "Name");
Plot( C, "Price", colorDefault, stylecandle | styleThick ); AddColumn(Close,"Close",1.2); AddColumn(Ref(O,1),"Buy
PlotShapes( IIf( Buy, shapeUPTRIANGLE, 0 ), colorBlue, 0, Low Price",1.2);
); AddColumn(VIX,"VIX",1.2); AddColumn(VIXH,"VIXH",1.2);
PlotShapes( IIf( Sell, shapeDownTRIANGLE, 0 ), colorOrange, AddColumn(STVIXS,"STVIXS",1.2);AddColumn(STSPYS,"STS
0, High ); PYS",1.2);
PlotShapes( IIf( COVER, shapeUpTRIANGLE, 0 ), color- AddColumn(STVIXL,"STVIXL",1.2);AddColumn(STSPYL,"STSP
GREY50, 0, Low ); YL",1.2);
PlotShapes( IIf( SHORT, shapeDownTRIANGLE, 0 ), colorRed, AddColumn(RC,"RC",1.2);
0, High ); AddColumn(VIXUP, "VIXUP% ",1.2);
// Custom text labels displayed with PlotText AddColumn(VIXDN,"VIXDN% ",1.2);
dist = ATR(10); AddColumn(BUY,"BUY",1);
for( i = 0; i < BarCount; i++ ) AddColumn(SELL,"SELL",1,IIF( Sell, Colorred, colorDefault ));
{if( BUY[i] ) PlotTextSetFont("BUY", "ARIAL", 10, i, L[ i ]-dist[i], AddColumn(SHORT,"SHORT",1,IIF( SHORT, ColorRED, col-
colorBLUE, colorDefault, 0 ); orDefault ));
if( SELL[i]==1 ) PlotText( "SELL " , i, H[ i ]+2*dist[i], colorRED, AddColumn(COVER,"COVER",1,IIF( COVER, ColorBLUE,
colorDefaulT ); colorDefault ));
// if( SELL[i]==5 ) PlotText( "TIME EXIT" , i-3, H[ i ]+dist[i], color-
BlueGrey, colorDefaulT );

SIROKY/LINEAR REGRESSION www.tandfonline.com/doi/abs/10.2469/faj.v66.n2.4.


Continued from page 28 Siroky, Mike B., MD [2022]. “Linear Regression Of
Price And Time, Part 3: Regression Sharpe Ratio,”
Technical Analysis of StockS & commoditieS,
maximum of 10 positions. The probability estimates of Volume 40: March.
trend are then used to allocate the portfolio among the [2020]. “Trend Direction And Probability: The
various assets. Cash plays an active role in protecting the Bull Bear Index,” Technical Analysis of StockS &
total portfolio from excessive drawdowns. commoditieS, Volume 38: November.
“Breaking The Market,” website, https://breakingthemar-
Mike B. Siroky, MD is a retired surgeon living in Arizona. ket.com/welcome
He is particularly interested in quantitative analysis and Sotiroff, Daniel [2016]. “Rebalancing With Shannon’s
probability-based investing. He is the author of The Art Demon,” The Personal Finance Engineer, April 25,
of High Probability Investing, second edition. He may https://thepfengineer.com/2016/04/25/rebalancing-
be reached at mike.siroky@yahoo.com. with-shannons-demon
‡Microsoft Excel, ‡StockCharts.com
further reading ‡See Editorial Resource Index
Ibbotson, Roger G. [2010]. “The Importance Of Asset
Allocation,” Financial Analysts Journal, 66:2, https://
August 2022 • Technical Analysis of Stocks & Commodities • 19
Smart Allocation For Best Portfolio Performance

Linear Regression
Of Price And Time
Part 4: Logistic Asset Allocation
Effective asset allocation design will recognize not to help determine how much is invested in any particular
only how much is allocated to various assets, but also, asset. But volatility alone is not enough, because it fails
which assets are performing the best. Toward this goal, to take performance into account. Considering volatility
the “logistic portfolio” is introduced here, which is a alone, you might overweight an asset with low volatility
dynamic allocation model based on near-term estimates but poor performance, and underweight a stock with
of risk-adjusted returns, rather than on long-term ex- higher volatility but even higher performance. Thus,
pected returns or expected volatilities. Find out how to what is needed is a single indicator that measures risk-
implement it. adjusted performance. The regression Sharpe ratio is such
an indicator, which is described in part 3 of this article
by Mike B. Siroky, MD series (see the “Further reading” section at end).

B
efore putting any capital at risk, an investor What is asset allocation?
is faced with two difficult questions: Asset allocation is the division of one’s capital among
different assets in such a way as to provide the most
1. What fraction of my capital should I put protection of capital while producing the highest possible
at risk? return—that is, to maximize risk-adjusted return. Capital
BLEAKSTAR/SHUTTERSTOCK

2. How should I allocate my capital at risk to produce can be allocated among four major asset classes:
the best risk-adjusted performance?
1. Equities (stocks)
Since volatility is a proxy for risk, volatility can be used 2. Debt (bonds)
20 • August 2022 • Technical Analysis of Stocks & Commodities
QUANTITATIVE ANALYSIS

3. Hard assets (commodities, land, gold)


4. Cash (money market, Treasury bills, bank depos-
its).

This scheme ignores some assets such as currencies


(including digital varieties), futures, and options, which
some investors might include. By subdividing these four
asset classes, one can derive a much larger investing uni-
verse and thus potentially achieve better diversification.

MICROSOFT EXCEL
For example, equities can be subdivided into US stocks
and non-US stocks, growth stocks and value stocks, large-
capitalization stocks and small-capitalization stocks and FIGURE 1: ANNUALIZED VOLATILITY CALCULATED FROM STANDARD
various combinations of these. Exchange-traded funds DEVIATION OF RETURNS FOR VARIOUS ASSET CLASSES. Historically,
(ETFs) provide a convenient way to both diversify and equities are considered the riskiest asset because of the possibility of stock
market crashes. However, in terms of volatility, equities are often less volatile
simplify your portfolio in comparison to holding indi- than commodities or other assets. These rankings of volatilities depend
vidual stocks, bonds, commodities, and so on. Although on the time window examined.
there are a total of about 1,800 ETFs available, in practice,
a relatively small number of well-capitalized, actively eliminates the need to make up losses, which can take
traded ETFs can be used to emulate almost all the im- years. Gold may also provide protection during equity
portant asset classes. Historically, equities are considered drawdowns. This is why it is important to consider these
the riskiest asset because of well-known crashes in equity categories of assets.
prices. However, in terms of volatility, equities are often Effective asset allocation protects investor capital by
less volatile than commodities or other assets. three mechanisms:
For example, Figure 1 shows annualized volatility of
several asset classes over the past year ending April 29, 1. Diversification significantly reduces portfolio
2022. It shows annualized volatility for commodities volatility
(DBC), gold (GLD), real estate (VNQ), stocks (VTI), 2. Asset allocation requires periodic rebalancing,
long-term government bonds (TLT), medium-term and
government bonds (IEF), aggregate bonds (AGG), and 3. Asset allocation concentrates assets in those dem-
cash-equivalent Treasury bills (BIL). The chart shows onstrating the best performance.
that commodities, gold, and real estate are actually more
volatile (riskier) than a broad index of stocks. In fact, it By using properly selected ETFs, it is possible to be diver-
is not at all unusual for commodities to carry more risk sified and be concentrated in strong sectors at the same
than equities, since their prices are subject to severe time. Nobel Prize winner Harry Markowitz showed that
weather, floods, war, and other unpredictable factors. It a portfolio of noncorrelated assets has a lower volatility
is also noteworthy that government bonds can be more than the assets held alone. The downside is that such a
volatile than corporate bonds. Of course, these rankings portfolio will generally (but not always) produce lower
of volatilities depend on the time window examined. absolute returns than equities alone. Nevertheless, due
Thus, in order to protect against large drawdowns, to significantly lower volatility (and risk), the effectively
asset allocation should utilize assets that are as much as diversified portfolio will have a higher risk-adjusted return
possible noncorrelated or even negatively correlated with than a buy & hold equity-only portfolio.
each other. This is because when equities suffer a large The second protective mechanism is the requirement
drawdown, alternative assets such as bonds and com- for periodic rebalancing. Rebalancing is generally un-
modities may also decline. However, the noncorrelated derrated by most investors and even money managers.
alternative assets will almost always decline less than However, Claude Shannon showed in the 1940s that
equities and provide some protection when compared periodic rebalancing between two noncorrelated assets
to a “buy and hold” portfolio consisting of stocks only. can produce a profitable portfolio, even when both as-
Of course, the most secure protection (without going sets produce zero or negative returns on their own. The
short) is provided by cash and cash equivalents. Going only requirement is that the non-cash assets demonstrate
50% into cash will cut your portfolio losses in half. Go- volatility. This phenomenon has been termed “Shannon’s
ing 100% into cash preserves your portfolio value and demon” (see “Further reading” at end).
August 2022 • Technical Analysis of Stocks & Commodities • 21
By definition, rebalancing Assets Constant Constant Variable Variable
requires moving capital from Allocation Constant Variable Constant Variable
assets that are relatively stron- Harry Browne Permanent Breakingthemarket.com Muscular Portfolios Dual Momentum
ger into assets that are rela- Examples 60/40 Portfolio Logistic Portfolio
tively weaker or else into cash. All Weather Portfolio
Either way, it is a mechanism FIGURE 2: ASSET ALLOCATION METHODS. This shows methods of simple classification of asset allocation
for harvesting profit from based on whether the assets and their allocation are constant or variable. In the first column on the left, both
volatility. At the same time, it the selected assets and their allocation are constant and rebalanced as needed. These are sometimes called
mandates investing in assets “strategic allocation” or “lazy portfolios.” In the last column on the right, the assets vary with market conditions
and their allocation also varies based on performance. These are sometimes called “dynamic allocation.”
that are lagging and simu-
lates dollar-cost averaging.
Because it is a mechanical system, rebalancing removes are sometimes termed “lazy portfolios.” Tactical asset
much of the emotion associated with market movements allocation is very similar, but allows changes in alloca-
that may lead to bad investment decisions. tion percent due to perceived short-term opportunities in
While many asset allocation schemes use a fixed or the market. After these market conditions disappear, the
constant group of assets, others allow asset rotation, original strategic allocation is restored. Dynamic asset
which provides a third protective mechanism. In these allocation is the least restrictive as there is no predeter-
dynamic allocation schemes, only the best current per- mined selection of assets or their percentage allocation.
formers are selected for inclusion in the portfolio and Rotation among assets and changes in their allocation
thus operates on the principle that the best defense is a are permitted, usually without restriction. There are also
good offense. hybrid schemes that have a restricted universe of assets
Roger Ibbotson of the Yale School of Management from which the best recent performers are selected, but the
has found that as much as three quarters of a portfolio’s percentages are equally weighted (muscular portfolios)
performance is due to the overall market environment, and may include assets with negative returns. Finally, we
bullish or bearish. The remaining 25% is split evenly will examine asset allocation methods that select the best
between asset allocation and active management. What performers and allocate according to performance.
Ibbotson means is that in drawdown years like 2007–2009, A simple alternative classification scheme is offered
most portfolios, mutual funds, ETFs, etc. declined. In here that depends only on whether the assets and the
the recovery years of 2009–2010, most of these same allocation fraction are constant or variable. In this way,
portfolios, mutual funds, ETFs, etc. advanced, showing we see that there are four possible combinations, seen in
the correlation between the overall market environment the table in Figure 2. In this table, we see a progression
and individual portfolios. An effective asset allocation from most fixed on the left to most variable on the right.
scheme will recognize a change in market environment This corresponds roughly to portfolios that require the
according to which assets are performing the best and least attention to those that require the most.
according to how much is allocated to various assets.
From this, it is usually clear whether the market is in Mechanics of the logistic function
“risk off” or “risk on” mode. The logistic portfolio, introduced here, is a form of
dynamic asset allocation in which the logistic func-
Classification of asset allocation tion plays a central role. The logistic function was first
models described in 1838 by Belgian mathematician Pierre F.
There are literally hundreds if not thousands of suggested Verhulst (1804–1849) to model the growth of popula-
asset allocation schemes in the financial arena. Some are
based on characteristics of the investor: age, risk appetite
or aversion, time horizon, or a combination of these fac-
tors. Some are based on simplicity versus mathematical The logistic portfolio,
complexity and the amount of time required to manage introduced here, is a form of
the portfolio. Some require lots of research, some none dynamic asset allocation in
at all. Strategic asset allocation allocates assets based which the logistic function
on some or all of the criteria above. The assets are pre- plays a central role.
selected and remain constant. The percentage allocation
is also kept constant through periodic rebalancing. These
22 • August 2022 • Technical Analysis of Stocks & Commodities
FIGURE 3: STANDARD FORM LOGISTIC FUNCTION. The logistic func- FIGURE 4: LOGISTIC FUNCTION CURVES WITH VARIOUS SHAPE
tion is simpler and easier to calculate than the normal distribution, and it VALUES OF K. By changing the value of k in equation 1, we can markedly
is also more versatile. affect the shape of the curve. With higher values of k, the logistic function
has a steeper rise and resembles a step function that saturates quickly at
its limits of 0.0 and 1.0. With k equal to about 1.658, the logistic function
tions under resource constraints. The population to be closely follows the normal distribution, shown here as a dashed green line
modeled might be humans, bacteria, crops, or anything (the cumulative normal distribution curve).
that exhibits logarithmic growth and decline. During
the 1800s, “logistic” was synonymous with the modern asset prices. By changing the value of k in equation 1,
term “logarithmic.” we can markedly affect the shape of the curve. In Figure
In our case, we are using the logistic function to model 4, we can see that with higher values of k, the logistic
the logarithmic growth and decline in the price of assets function has a steeper rise and resembles a step function
such as stocks, bonds, commodities, and so forth. The that saturates quickly at its limits of 0.0 and 1.0. With k
early phase of growth is rapid and exponential with a equal to about 1.658, the logistic function closely follows
rising slope. However, after hitting resource constraints, the normal distribution, which is shown in Figure 4 as
it becomes a convex curve with a declining slope. Today, a dashed green line.
the logistic function is used in neural networks, machine Note in Figures 3 and 4 that the x axis consists of both
learning, biology, economics, political science, mathemat- positive and negative numbers oscillating around zero
ics, statistics, and many other applications. while the logistic function outputs a probability estimate
The logistic function in standard form is shown in between 0 and 1 on the y axis. If we use the regression
Figure 3. The equation for the logistic function is: Sharpe ratio as the independent variable, the logistic
function converts risk-adjusted returns into probability
f(x) = 1 ⁄ (1+e−kx) Eq. 1 estimates of trend strength.

In equation 1, x is an independent variable and e is Testing logistic function probability


Euler’s number, which equals 2.718 and is the base for How well does the logistic function estimate probabili-
natural logarithms. The k factor is a constant greater than ties? That will depend on the data set and on the selected
or equal to zero that shapes the steepness of the curve. time window. It also will depend on the value selected
In standard form, k=1 and has no effect. Suppose x=0. for the k value in equation 1, which changes the shape
Then, in equation 1, 1+e−kx = 1+e0 = 2 and the entire of the curve.
fraction is then equal to 0.5. Negative values for x will One way to directly estimate probability of an uptrend
produce values less than 0.5 while positive values for x is based on the bull-bear index (BBI). (See my November
will produce values greater than 0.5. 2020 article in this magazine, “Trend Direction And
As seen in equation 1, the logistic function is much Probability: The Bull Bear Index.”) Using daily price data
simpler and easier to calculate than the normal distribu- that includes the high and low, we simply count every
tion. Another major advantage of the logistic function instance of today’s high exceeding yesterday’s high (new
is that it is much more versatile than the normal distri- highs) and each instance of today’s low declining below
bution curve. In fact, the logistic function can model yesterday’s low (new lows). Some days will have neither
non-Gaussian distributions, which is often the case with a new high nor a new low (inside days) and some days
August 2022 • Technical Analysis of Stocks & Commodities • 23
FIGURE 6: EFFECT OF K FACTOR ON R-SQUARED CORRELATION BBI
VERSUS LOGISTIC ESTIMATE. The strength of r-squared correlation
between BBI and logistic estimates of probability will depend on the value
FIGURE 5: LINEAR CORRELATION BETWEEN BBI ESTIMATED PROB- we choose for the shape factor k. At various values for shape constant k,
ABILITY AND LOGISTIC ESTIMATE. Both the bull-bear index (BBI) you get this graph.
estimate of probability and the logistic estimate using the standard form
logistic function are calculated and compared over a 25-day time window. For this particular data set, the peak r-squared cor-
The correlation between the BBI estimate and the logistic estimate is shown
relation occurs at K factor=1.5. As mentioned earlier, a
here. The data set consists of intraday and closing prices from 12/29/2004
to 3/4/2022, a period of about 18 years with n=4,326. K factor of 1.658 emulates the normal distribution, so
with K=1.5 we have a curve with slightly fatter tails and
lower peak than the normal distribution as the best fit
will have both a new high and a new low (outside day). for this data set.
Divide the total of new highs by the sum of new highs
and new lows over a 25-day time window. This gives a Testing logistic asset allocation
fraction between 0 and 1 representing the probability of In order to test the concept of logistic asset allocation,
a trend. A perfect uptrend would have a new high every let us set up a simple portfolio consisting of three risky
day and no new lows, resulting in a probability of 1.0. A assets plus cash or cash equivalents. The three risky
perfect downtrend would have a new low every day and assets are the same as in Harry Browne’s “Permanent
zero new highs, resulting in a trend probability of 0.0. Portfolio”:
The data set consists of intraday and closing prices
from 12/29/2004 to 3/4/2022, a period of about 18 years 1. Stocks (VTI)
with n=4,326. Both the BBI estimate of probability and 2. Treasury bonds (TLT)
the logistic estimate using the standard form logistic 3. Gold (GLD)
function were calculated and compared over a 25-day
time window. The correlation between the BBI estimate The fourth asset is a reserve of cash.
and the logistic estimate is shown in Figure 5. To calculate the 25-day regression Sharpe ratio, you
The strength of r-squared correlation between BBI need the 25-day slope of price versus time, the 25-day
and logistic estimates of probability will depend on average price, and the 25-day standard deviation of
the value we choose for the shape factor k. At various daily percent returns (see my March 2022 article in this
values for shape constant k, we obtain the graph you magazine, “Linear Regression Of Price And Time, Part
see in Figure 6. 3: Regression Sharpe Ratio”).
You may want to include the risk-free interest rate if
rates rise significantly. Including the risk-free rate will
not affect the ranks of the assets but it may affect which
The logistic asset model is assets have a regression Sharpe ratio at or above zero.
based on current, near-term Thus, including the risk-free rate makes the logistic
measures of risk-adjusted portfolio more conservative. In equation 2, the risk-free
returns. interest rate is RF and refers to the one-month Treasury
bill money market rate.

24 • August 2022 • Technical Analysis of Stocks & Commodities


FIGURE 7: RANKING BY REGRESSION SHARPE RATIO. The logistic
probabilities for the three symbols VTI, TLT, GLD are shown here for
November 1, 2021. For this example, StockCharts.com was used to de-
termine the regression Sharpe ratio (RSR). Once you have the RSR for
the three symbols, you can substitute into equation 1 using Excel. The K
FIGURE 8: NORMALIZED PERFORMANCE OF THREE DIFFERENT
factor used was K=1.5.
PORTFOLIO ALLOCATION MODELS. The three portfolio allocation models
tested were the logistic, buy & hold, and the Browne permanent portfolio,
Regression Sharpe ratio = [[100×(n−1) × SLOPE] ⁄ [Ave using a simple four-asset portfolio (including cash). The data set consists
price − .5×(n−1)×SLOPE]−RF] ⁄ [√n × SD] of closing prices from 12/29/2004 to 3/4/2022, a period of about 18 years
with n=4,326. You can see that the logistic portfolio provided protection
during drawdowns as well as outperformed a portfolio of only stocks.
As this is written, Treasury money market funds yield
0.18% annualized. On a monthly basis, this is 0.015%.
The StockCharts.com scan engine can calculate the RSR four assets are added for a total of 2.806. In the fifth
for you as follows: column, the logistic weights are calculated by dividing
each probability by the sum of probabilities or 2.806.
[favorites list is xxx] // Select chartlist The cell containing the sum of probabilities needs to be
fixed with dollar signs in Excel so its reference remains
rank by [480×slope(25) ⁄ [sma(25)−[12×slope(25)]]−.015] fixed. The sum of the probabilities must add up to 1 or
⁄ std deviation(25,roc(1)) 100%, as shown.
Considering cash as an asset, the logistic allocation
StockCharts.com allows you to create several hundred for cash in this example is 18%. Since VTI has the high-
different chartlists, and each is assigned a number. In the est risk-adjusted performance over the past 25 days, it
above code, “xxx” would represent whatever chartlist receives the highest allocation at 33% and TLT receives
you create that contains the three symbols VTI, TLT, the lowest at 22%. GLD is intermediate at 27%. We can
GLD. The scan code then calculates the regression summarize by saying stocks and gold are overweighted,
Sharpe ratio (including the risk-free rate) and ranks bonds and cash are underweighted. Depending on the
by that criterion. Let’s do this for November 1, 2021. frequency of rebalancing, these values will change as
Download the resulting table from StockCharts.com risk-adjusted performance changes.
into an Excel spreadsheet. After deleting the columns
you don’t want and formatting the remaining data, you Important rule
will have something like the Excel spreadsheet shown There is one more important rule: An asset is included
in Figure 7. Once you have the RSR for VTI, TLT, and in the portfolio only if its regression Sharpe ratio is zero
GLD as of November 1, we substitute into equation 1 or higher, indicating the asset’s risk-adjusted return is
using Excel to obtain the logistic probabilities. The K positive. If the asset does not meet this test, its allocation
factor used was K=1.5. percent falls to zero. It is possible that all three risky
Note that in this model, cash is considered an asset, assets will have allocations of 0%, leaving only cash
not an afterthought. Over the short term of 25 days, in the portfolio at 100%. Since cash has an RSR that is
cash will neither rise nor fall in intrinsic value (ignoring never less than zero, cash is always included and may on
inflation and deflation). Since cash has no volatility, we occasion constitute 100% of the portfolio.
cannot calculate an RSR for cash because dividing by You can adjust the riskiness of your portfolio by ad-
zero is not allowed. Therefore, since cash has a stable justing the cutoff value for inclusion. Raise the cutoff
value, we assign cash an RSR of zero and a probability value to RSR>=0.5 or RSR>=1.0 and you will quickly
of 0.5. In other words, its probability of rising equals its reduce your universe of investable ETFs and increase
probability of falling. your cash holdings.
In the fourth column, the logistic probabilities of the You can update and adjust your holdings as often as
August 2022 • Technical Analysis of Stocks & Commodities • 25
you wish, whether daily, weekly, VTI TLT GLD CASH well as outperforming a portfolio of
monthly, quarterly, etc. I usually Logistic 0.27 0.20 0.19 0.34
only stocks.
adjust my holdings weekly, but that Over the entire data set, the al-
B&H 1.00 0.00 0.00 0.00
is up to each investor’s investing location averages were as shown in
style. This method can be applied Browne 0.25 0.25 0.25 0.25
Figure 9.
to a portfolio containing ETFs of FIGURE 9: ALLOCATION AVERAGES FOR THREE Comparing the logistic portfo-
PORTFOLIO ALLOCATION MODELS, ENTIRE
different asset classes, a portfolio lio to the equal-weighted Browne
DATA SET. The allocation averages are shown
of sector funds, or a portfolio of in- here for the entire data set. permanent portfolio, we see that
dividually selected stocks the Browne portfolio was
as desired. overweighted in bonds and
gold and underweighted in
Backtesting cash. We can see the pro-
logistic asset tection during drawdowns
allocation more clearly if we focus on
Using our simple four-asset performance during the
portfolio (including cash), last six months of 2008
results were compared us- and the first six months
ing three different methods of 2009, one of the worst
of asset allocation: FIGURE 10: PERFORMANCE OF THREE PORTFOLIO ALLOCATION drawdowns in the last 50
MODELS DURING THE 2008–2009 BEAR MARKET. This graphs the
years. (See Figure 10.)
normalized performance of the logistic allocation portfolio, the buy & hold
1. Buy-and-hold stocks portfolio, and the Browne permanent portfolio during the drawdown of During this drawdown
only (VTI) 2008–2009. During this drawdown period, the logistic portfolio gained 17.1%, period, the logistic port-
2. The Harry Browne the Browne portfolio lost 1.4%, and the buy & hold portfolio lost 31.6%. folio gained 17.1%, the
Permanent Portfolio Browne portfolio lost
of equal allocation to VTI, VTI TLT GLD CASH 1.4%, and the buy & hold portfolio
TLT, GLD, and cash at 25% Logistic 0.17 0.18 0.22 0.43 lost 31.6%. During the 2008–2009
each, rebalanced daily B&H 1.00 0.00 0.00 0.00 period (n=268), the allocation aver-
3. The logistic portfolio with Browne 0.25 0.25 0.25 0.25 ages were as shown in the table in
daily rebalancing of the four FIGURE 11: ALLOCATION AVERAGES FOR Figure 11.
assets using regression Sharpe THREE PORTFOLIO ALLOCATION MODELS, The logistic portfolio gave equi-
ratio and logistic function as 2008–2009. The allocation averages are ties the lowest allocation during the
described earlier. shown here for the 2008–2009 drawdown period drawdown and cash the highest al-
(n=268).
location. During 2008–2009, the lo-
The data set consists of closing gistic portfolio displayed a 10-point
prices from 12/29/2004 to 3/4/2022, a period of about reduction in stock allocation, a two-point reduction in
18 years with n= 4,326. Treasury bonds, a three-point increase in gold allocation,
We see in Figure 8 that as expected, the diversified and a nine-point increase in cash, in comparison to the
Browne Permanent Portfolio provided protection from logistic portfolio allocation over total data set. While
drawdowns during 2008–2009 and during early 2020. most money managers run to the safety of Treasury
Also as expected, the Browne portfolio underperformed a bonds when stocks decline, Treasury bonds also fell
buy & hold portfolio of stocks only. However, the logistic during 2008–2009. It turns out that the most effective
portfolio provided both protection during drawdowns as response was to increase holdings in gold and especially
in cash. In fact, the logistic portfolio was 100% in cash
for 41 days or 15% of the time during 2008–2009. Dur-
ing those 41 days, stocks, bonds as well as gold were all
The logistic function declining, leading to a 100% cash position.
converts risk-adjusted The Browne portfolio, being a “strategic portfolio,”
returns into probability could not increase cash beyond 25% and thus could
estimates of trend strength. never hold 100% in cash. In fact, the Browne strategic
allocation of equal weights was overweighted in all the
risky assets and underweighted in cash.
26 • August 2022 • Technical Analysis of Stocks & Commodities
placed at risk.
There is no one
correct answer,
but here is one
simple way to
estimate how
much capital
to place at risk.
Your invest-
ment universe
is now a list
FIGURE 13: CORRELATION GRAPH OF MONTHLY VALUES FOR WIN% of 36 carefully
VS. LOGISTIC PROBABILITY, N =27. If you compare Win% and the selected ETFs.
estimate derived from the logistic calculation, you obtain this graph. You Since we know
can see that the two methods correlate very closely.
that the overall
investment environment is a major
FIGURE 12: EXPANDING THE INVESTMENT
UNIVERSE FOR DIVERSIFICATION. You can factor in determining performance,
diversify beyond the four basic asset classes if we need to estimate the strength
you want to increase exposure outside the US of the 36 ETFs in our designated
and to add other noncorrelated assets such as investment universe. In your
real estate, corporate bonds, emerging market
bonds, and commodities. The 36 ETF symbols
spreadsheet, average all 36 RSR
shown here include some diverse and noncor- values and convert this value to a
related ETF asset classes. probability using the logistic func-
tion with a k value of 1.5 in Excel.
Expanding your investment This will generate a value that
universe ranges from near zero to near 1.0
Your investment universe can be eas- FIGURE 14: CALCULATING YOUR INVESMENT and represents the overall strength
EXPOSURE, BULLISH PERIOD. Using the method
ily expanded beyond just four asset described in this article, you can calculate the frac- of the risk assets in your investing
classes if increased diversification tion of capital that you may wish to place at risk. universe. This probability is a good
is desired. The main reason for ex- For the bullish period used here, the calculation estimate of how much capital to
panding the investable universe is to comes to 0.817. So if the available capital is, say, place at risk.
increase exposure outside the US and $100,000, you would invest a total of $81,710,
leaving $18,290 as a cash reserve. The $81,710
Another way to estimate your
to add other noncorrelated assets such would be invested in the top 10 assets as ranked probability of winning is to count
as real estate, corporate bonds, emerg- by RSR and divided up according to strength. the number of ETFs that have a
ing market bonds, and commodities RSR of zero or above and divide
including oil, sector funds, and so forth. by 36. We can call this strength estimate Win%. If we
The table in Figure 12 contains 36 ETF symbols cover- compare Win% and the estimate derived from the logistic
ing domestic and foreign stocks, sovereign and corporate calculation, we obtain the graph in Figure 13.
bonds, hard and soft commodities, oil, and precious met- As shown in Figure 13, the two methods correlate very
als. Among the domestic stocks are included total market, closely. Using the logistic method, let’s look at November
large cap, small cap, growth, and value subsectors. Among 1, 2021, which was a bullish period in the stock market.
the foreign stocks included are total non-US, Pacific, Calculate the 25-day RSR for all 36 ETFs in your chartlist
Eurozone, and emerging stock markets. Place these 36 on StockCharts.com. Result:
symbols into a StockChart.com chartlist and rank them
by RSR as described previously. Download the ranked Win% = 29/36 or 81%; the average RSR is 0.998
list into an Excel spreadsheet and observe which classes and logistic probability is 0.817.
are showing strength, and which are not.
Let’s say your available capital is $100,000, so your
Calculating your investment exposure spreadsheet will look like what you see in Figure 14.
While many wonder how much cash to hold in their port- Our fractional capital at risk is 0.817, so we will invest
folio, the real question is what fraction of capital should be a total of $81,710, leaving $18,290 as a cash reserve. The
August 2022 • Technical Analysis of Stocks & Commodities • 27
$81,710 will be invested in the top the average RSR of all 36 assets
10 assets by RSR and divided ac- and convert to a logistic probability
cording to strength as shown in the using Excel. This is your fractional
last column on the right. Consumer investment at risk. Now select up to
discretionary stocks are at the top 10 assets from the top of the list of
and oil stocks are at the bottom. ranked 36 asset class ETFs. Only
Now let’s look at April 29, 2022, a assets with RSR at or above your
much less bullish time for the stock FIGURE 15: CALCULATING YOUR INVESMENT preset cutoff value are eligible for
market. Again, calculate the 25-day EXPOSURE, BEARISH PERIOD. Using the
inclusion. If the ETFs selected for
method described in this article, you can calculate
RSR for all 36 ETFs in your chartlist the fraction of capital that you may wish to place at inclusion match what is already in
on StockCharts.com. Result: risk. For the bearish period used here, the calcula- your brokerage account, you will
tion comes to only 0.198. If the available capital only need to reallocate your current
5/36 have an RSR >= 0 or 14%; is $100,000, you would invest a total of $19,800, holdings.
leaving $80,200 as a cash reserve. The $19,800
the average RSR is −0.932, and would be invested in the top 10 assets (or less) by The logistic portfolio will allocate
logistic probability is 0.198. RSR and divided up according to strength. your selected assets based on prob-
ability of trend. Calculate the logistic
Let’s say your available capital is the same $100,000, probabilities using equation 1 given earlier in an Excel
so your spreadsheet will look like what you see in Fig- column next to the column that contains the RSR values.
ure 15. The K factor to use should be determined empirically
Our fractional capital at risk is now only 0.198, so we or else just use k=1.5.
will invest a total of $19,800, leaving $80,200 as a cash Add up all the asset probabilities. In the next Excel
reserve. The $19,800 will be invested in the top 10 by column, divide each individual asset probability by the
RSR. However, our rules prevent investing in any holding sum of probabilities. Once you have calculated the alloca-
with RSR of less than zero, so there are only five hold- tion fraction for any portfolio asset, in the next column
ings identified for purchase. Again, the total of $19,800 multiply the fraction allocated by the portfolio dollars at
is divided among five holdings according to strength as risk previously determined. Subtract the dollars allocated
shown in the last column on the right. Natural gas is at from your current holding to determine whether shares
the top and oil stocks are at the bottom. should be bought or sold.
The stronger the investment universe, the less cash is If a new asset is put into the portfolio, it is prudent to
held and vice versa. If there are no assets with RSR>=0, buy only half the allocation indicated on the first day (or
your cash will be at 100%. In a very strong market, week). During the next rebalancing, again buy only half
your cash will probably hover around 10%. Cash never of the indicated number of shares until you have bought
goes to 0% in order to hold a reserve for rebalancing the indicated total number of shares. On the other hand, if
purposes. the logistic portfolio indicates an asset no longer qualifies
for investment, sell the entire position that day.
Managing the logistic portfolio
Download your portfolio holdings from your brokerage Summary
account into an Excel spreadsheet. You will need only Logistic asset allocation is a dynamic allocation model
four columns of data: 1) the symbol, 2) number of shares, based on near-term estimates of risk-adjusted returns
3) last closing price, and 4) current holdings value. Use using the regression Sharpe ratio to rank assets. The
the StockCharts.com scanning engine to calculate RSR logistic function is used to convert risk-adjusted returns
on your chartlist containing the 36 ETF symbols. Find to a probability-based estimate of trend strength. Unlike
strategic asset models, the logistic asset model is not based
on long-term expected returns or expected volatilities, but
on current near-term measures of risk-adjusted returns.
We are using the logistic The average risk-adjusted return of 36 diverse ETFs is
function to model the used to gauge how much capital to invest versus cash
logarithmic growth and decline positions. Only assets with a positive RSR above a preset
in the price of assets. criterion are included in the logistic portfolio, up to a

Continued on page 19
28 • August 2022 • Technical Analysis of Stocks & Commodities
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.

MARKET DECLINES: A DISASTER, sum of cash to put to work in an in- they are already 100% invested, then
OR AN OPPORTUNITY? vestment and don’t have a consistent how can they buy the dip?
Over the years, I have observed a stream of extra income beyond their A successful entrepreneur once told
growing number of financial advisors, monthly expenses to put to work in me his golden rule is to suppress the
financial analysts, and money manag- the market, so no more money is on temptation to immediately buy things
ers who have just a single investing the horizon for future investment. and instead wait for a good price.
strategy: buy when the market is down The investor with a lump sum to In life, we mainly purchase things
20% or 30%, then sit back and wait invest would want to put this money when we need them or when we feel
for double-digit returns, and then to work all at once and would want it’s necessary, but when it comes to
sell when the market goes back up. to invest the amount right away. That investing, it pays to be smart about
Many proponents of this “buy when doesn’t leave any cash for additional your purchases and consider the price
the market is down” or “buy when investing. It’s a different case for those carefully.
the market is in disaster territory” with high income or those with a So here’s my version of the golden
approach generally will start to buy large amount of discretionary money. rule that I recommend to traders and
when the market is down 20% and investors: make use of the limit buy
they start to sell when the market order.
is up 20%—this produces more or If the investor does If you place your buys with a limit
less a +40% return. Sounds good, not sell some during order, then you will be buying at a
doesn’t it? bull markets when price that is palatable to you, a price
But there can be a few obstacles to the market is at all- that you feel will give you the best
this approach. First of all, financial time highs, and if they chance of having a successful invest-
advisors tend to repeat the mantra that ment. And if the price you want is a
are already 100%
we should all be invested 100% of particular percentage below the fair
the time. Many investors believe this
invested, then how can market value of the investment, then
is the right approach, perhaps after they buy the dip? you can use a limit order to hold out
growing accustomed to a decade-long for that price.
bull market and having the fear of They can more easily pour more new Here’s an example of this thinking.
missing out on any gains. After all, if money into the markets during any Since I was 6 years old I have been
you are not fully invested, you are at dip or drop in the markets. a collector of military helmets and
risk of losing the opportunity to earn A second problem with the “buy other militaria. This kind of hobby
interest, dividends, or coupons. when the market is down” investing can turn into an expensive habit, as
So there’s the first problem: How approach is a lack of understanding of expensive as collecting, say, Ferrari
can you go big and buy more when what constitutes a good return as well automobiles. And what’s more, it’s
you are already 100% invested? You as when the best time to sell really is. admittedly a pretty useless activity
need to have a good amount of cash It’s difficult to persuade people to sell and maybe even a little infantile; it
sitting on the sidelines in your ac- in good times when their account is would probably be a better use of
count in order to buy any significant gaining. But if the investor does not my time to volunteer in a charitable
amount. sell some during bull markets when
Often, investors will have a lump the market is at all-time highs, and if Continued on page 33
August 2022 • Technical Analysis of Stocks & Commodities • 29
“Personal And Confidential”

Can Members Of Congress


Beat The Market?
The US Congress passed the Stop Trading on Congres- overvalued at any point in time, and this random deviation
sional Knowledge Act of 2012, commonly known as the from the current price implies no one can consistently
STOCK Act, to help curb potential or apparent trading beat the market. The implication is to buy a broadly
by members of Congress based on inside or confidential diversified market index and hold it for the long-term, a
information they may possess. But have members of buy and hold strategy. Many financial economists still
Congress actually fared better in their trading results believe in the EMH hypothesis and almost all investment
than anyone else? See what this study says. textbooks are based on the EMH.
Managers of public companies in the United States
by Massoud Metghalchi, PhD, Peggy A. Cloninger, are forbidden from engaging in “insider trading.” In-
PhD, and Jaime G. Herran La Torre sider trading is an illegal act of trading on the stock

T
exchange to one’s own advantage through having access
he efficient market hypothesis (EMH), devel- to confidential information of a company. In contrast,
oped in the 1960s, argues that no traders can members of Congress who have access to “confidential
make consistent abnormal returns in the stock information” are not prevented from trading. To help
market because all data and information, past prevent conflicts of interest, however, Congress passed
HADAYEVA SVIATLANA /SHUTTERSTOCK

and present, is fully reflected in the current the Stop Trading on Congressional Knowledge Act of
COLLAGE: CHRISITNE MORRISON

stock price. The EMH does not postulate that 2012, commonly known as the STOCK Act. Although
prices are always right but only says that no one knows the STOCK Act doesn’t prevent trading, it increases
whether a security is undervalued or overvalued, and transparency by requiring that members of Congress
deviations from the current stock price are random. Thus, disclose any stock trade made by themselves, a spouse,
there is an equal chance that stocks are undervalued or or a dependent child within 45 days.
30 • August 2022 • Technical Analysis of Stocks & Commodities
REAL WORLD

Many people, however, do not believe the STOCK We then compare the HPR of the lawmaker with the
Act, by merely requiring reporting of trades, actually HPR of its sector. We use Standard & Poor’s Deposi-
prevents members of Congress from using confidential tory Receipts ETF (SPDR) estimates for the returns of
information about companies and industries garnered each sector. For example, if the lawmaker bought Exxon
through the course of their work in Congress. Further, Mobile (XOM) stock on January 15, 2019 at $71 and on
lawmakers who violate the STOCK Act typically face 12/31/2021 XOM closed at $68, then the HPR for this
only small fines, often only $200 (Levinthal, 2021). At lawmaker is estimated to be (68−71)/71 = −4.23%. We
least fifty-two members of Congress violated the Stock then compare this HPR with the return of XLE (an ETF
Act in 2021. As a result, some traders are following the representing the energy sector) during the same holding
trades of members of Congress. For example, some inves- period, or January 15, 2019 to December 31, 2021.
tors on TikTok are using House Speaker Nancy Pelosi’s Note that the omission of dividends in estimating HPR
trading disclosures to guide their investment decisions of a lawmaker would not be a major factor since we also
(Mak, 2021). The co-founder of the company Iris, Chris omit the sector’s dividend in estimation of sector HPR.
Joseph, has gone a step further. Joseph personally invests The second method of comparison is to estimate the
and sends push notifications from his platform every time average annual return of the lawmaker and compare that
Nancy Pelosi reports a trade. Joseph told NPR, “I’m at to the average annual return of the sector.
the point where if you can’t beat them, join them” (Mak, Finally, the third method is to compare the reward-to-
2021). US Senators Mark Kelly and Jon Ossoff proposed risk return of the lawmaker with the reward-to-risk of
the “Ban Congressional Stock Trading Act” that, if passed, the sector. More specifically, we estimate the HPR of a
would require members of Congress, their spouses, and lawmaker divided by the beta of that stock and compare
dependent children to place their stock portfolios into a it with the HPR of the sector divided by the beta of the
blind trust (Kelly.senate.gov, 2022). sector.
However, the question remains: Do members of We used Capitol Trades data (www.capitoltrades.
Congress have actionable information that will result com) to identify lawmakers’ reported trades. Since it
in their trades beating the market? The purpose of this would be too cumbersome to attempt to match “buys”
study is to examine the performance of a sample of stock and “sells” when lawmakers may have several buys and
purchases by members of Congress between 2019–2021 sells reported, these data were deleted. We also deleted
that were not reported as sold in order to determine if all reported transactions that were not for individual
their trades would “beat” the market at the end of 2021. stocks (for example, purchases of ETFs, bonds, mutual
In other words, in this article, we examine the “unreal- funds, etc.).
ized” gains of lawmakers and compare the gains to the Capitol Trades lists over 40,000 reported trades be-
returns of the sector in which they traded. Our findings tween 2019 and 2021. To focus our search, we began by
support the EMH in that we find lawmakers do not beat downloading the trades of lawmakers in any leadership
the market. position between 2019 and 2021. Trades by any lawmak-
ers who left office during this time (e.g., retired or lost
Methodology and data an election) were excluded. The focus on leadership
This study focuses on examining the unrealized gains for supported the assumption of the traders that lawmakers
stocks reported purchased by lawmakers between 2019 may possess information not publicly available. Many
and 2021. The gain is considered “unrealized” when the lawmakers reported trades, but many did not report any
stock has been purchased and has not been sold by the trades, and some reported non-stock trades (for example,
last day of 2021. For the buy date, we use the reported ETFs).
transaction data.
We use three methods of comparing a lawmaker’s return
with the sector return. The first method is the holding
period return (HPR), calculated as follows:
Do members of Congress
HPR = (PDB − P12/31/21)/PDB have actionable information
that will result in their
 here PDB is the stock price when the lawmaker
w trades beating the market?
bought the stock, and P12/31/21 is the stock price on
12/31/2021.
August 2022 • Technical Analysis of Stocks & Commodities • 31
We continued building our data file by down- Sector Description Symbol
Trades Beat Beat Beat
loading all trades by senators and then by down- Made HPR R/R annual

loading trades reported by members in the House Communication Services Select XLC 91 37 27 37

until we had over 1,000 trades by Republicans SPDR Financial Select XLF 58 24 28 24

and Democrats in the Senate and the House. We Real Estate XLRE 14 7 7 7

used Yahoo Finance and Wall Street Journal to SPDR Industrial Select XLI 47 16 18 16

identify the closing prices on 12/31/2021 of every Consumer Staples Select XLP 30 16 11 16

stock used in this study. If closing prices were no SPDR Health Care Select XLV 48 26 22 26

longer available (such as because the company Consumer Discretionary Select XLY 74 31 26 31

had been acquired) the trade was excluded from SPDR Materials Select XLB 20 5 5 5

WWW.CAPITOLTRADES.COM
the sample. SPDR Energy Select XLE 28 8 13 8
Our final sample consisted of trades reported Utilities Select XLU 8 0 0 0
by 11 Republicans and 10 Democrats, including Technology Select XLK 163 60 56 60
one Independent who caucuses with the Demo- Total 581 230 213 230
crats and who is considered a Democrat for the R/R = reward to risk. HPR = holding period return. “Beat” means the number
balance of this study. of lawmakers beating the sector. “Annual” means average annual return.

Our final data file included 581 trades. Two FIGURE 1: SUMMARY OF STUDY RESULTS. The study focused on examining the
unrealized gains for stocks reported purchased by lawmakers between 2019 and
lawmakers, one Democrat and one Republican, 2021. Three methods were used to compare a lawmaker’s return with the sector
had reported only one buy. Most lawmakers, return. In the study, no lawmaker beat the market in the Utilities Select Sector, XLU.
eight Republicans and eight Democrats, had re- In the Health Care Select Sector, XLV, a slight majority of lawmakers (26 out of 48)
ported between two and 35 buys in the final data beat the market based on two of the three measures, though not the third measure.
Overall, fewer than half of the lawmakers beat the market based on any measure
file. Three lawmakers, two Democrats and one of comparison.
Republican, had more than 35 buys in the final
data file with one of the Democrats having over
100 buys. The time in office ranged from 4 years to 40 beats the market in the Utilities Select Sector, XLU, us-
years. Fifteen of the lawmakers were male and five were ing any of the three measures. Only for the Health Care
female. This distribution is similar to the distribution of Select Sector, XLV, do a slight majority of lawmakers
male and female members in Congress; according to the (26 out of 48) beat the market based on two of the three
Pew Research Center, women hold 27% of seats in the measures; they do not beat the market based on the
House and 24% of the seats in the Senate. The value of reward-to-risk ratio measure. Overall, fewer than half
each buy varied from $1,001 to $4,800,000. of the lawmakers beat the market based on any measure
of comparison.
Empirical analysis
In Figure 1 we show the summary results of our find- Summary
ings. As can be seen from the table, there were 91 buys In this study, we tested the belief held by some that mem-
by Congress people in the communication sector, XLC. bers of Congress should beat the market because they
Thirty-seven lawmakers beat the performance of the have better information than the public. We downloaded
sector using HPR and annual average measures, and 581 trades from Capitol Trades from 2019 to 2021 that
twenty-seven beat the performance of the sector using the were not closed by December 31, 2021. We assigned each
reward-to-risk ratio measure. As you can see, there are buy to a different sector and then used three methods
similar results for most sectors. Not a single lawmaker of comparing a lawmaker’s return with the return of the
assigned sector. Our findings show that the majority of
lawmakers did not beat the market by any of the three
measures. Overall, our findings support the efficient
In this study, we tested the belief market hypothesis.
held by some that members
of Congress should beat the Massoud Metghalchi, PhD, is a professor of finance at
market because they have better the University of Houston-Victoria. He may be reached
information than the public. at Metghalchim@uhv.edu.
Peggy Cloninger, PhD, is a professor of management
at the University of Houston-Victoria.
32 • August 2022 • Technical Analysis of Stocks & Commodities
Jaime G. Herran La Torre is a student in the Strategic
MBA program at the University of Houston-Victoria.
Members of Congress who
Further reading have access to “confidential
Kelly.senate.gov [2022]. “Sens. Kelly, Ossoff Introduce
Bill Banning Stock Trading by Members of Congress,”
information” are not
January 12, 2022, https://www.kelly.senate.gov/press- prevented from trading.
releases/sens-kelly-ossoff-introduce-bill-banning-
stock-trading-by-members-of-congress
Levinthal, Dave [2021]. “52 members of Congress
have violated a law designed to stop insider trading NPR, All Things Considered, https://www.npr.
and prevent conflicts-of-interest,” BusinessInsider, org/2021/09/21/1039313011/tiktokers-are-trading-
https://www.businessinsider.com/congress-stock-act- stocks-by-watching-what-members-of-congress-do
violations-senate-house-trading-2021-9#rep-roger- Capitol Trades, www.capitoltrades.com, 2iQ Research
williams-a-republican-from-texas-52
Mak, T. [2021] “TikTokers Are Trading Stocks
By Copying What Members Of Congress Do,”

MARKET RAP
TOMASINI/MARKET RAP place a buy limit order, at 50% less
Continued from page 29 than the listed price of something, No sophisticated
whether that’s real estate or a col- analysis or quantitative
organization. Anyway, some years lectible or something else. You might approaches needed.
ago I changed my approach to make be surprised to find your buy offer
It’s just the idea
it more deliberate and considered. is actually accepted. It occasionally
Instead of just purchasing whatever happens for different reasons that that sometimes,
items I liked no matter the price, I aren’t obvious to the buyer, but the the markets offer a
instead only collect what I can get reasons are not our concern here. bargain.
for free or at my preconceived notion Similarly, when the stock market
of a discount. That way, I have no loses 30%, it can be a good time to sidelines ready to put to work when
anxiety, no stress, no buyer’s remorse buy—for those who have some cash these opportunities arise.
connected to the purchase. That feels ready to invest. It takes having the So whenever you feel bad or feel
better to me than being the “winner” discipline to plan ahead and to spread “FOMO” that you are not fully
at an auction but afterward feeling out your buying, and then use this participating in a bull market or
like you were the loser to have offered market discount to your advantage. If in an investment, remind yourself
the highest bid. prices lose another 20%, then we buy of the importance of positioning
I like the idea of getting something even more. No sophisticated analysis yourself for the next opportunity. A
for free or at half price. So if I see or quantitative approaches needed. 30% decline in the market happens
an item that costs $1,000, I make It’s just the idea that sometimes, the from time to time. If you are fully
my spending limit for it $500. It’s a markets offer a bargain. It’s seldom, invested, it could feel like a disaster.
limit order. but it happens. It can be a quasi-free But if you keep to your investing al-
Using this approach, my collection lunch. In order to take advantage, you location guidelines and keep to your
has grown slowly in quality and in must have the money to take part. preferred entry prices, it will be less
value. It’s worth much more than But if you are 100% fully invested of a disaster and more of a golden
what I paid for it. all the time and you never sell, then opportunity.
Don’t be afraid to make an offer, or you won’t have any money on the
August 2022 • Technical Analysis of Stocks & Commodities • 33
A Trading Strategy Based On Chart Reading

Trading With Double Tops


And Double Bottoms
You can make profitable trades by getting to recognize the point of mastering it, the trader can become good
patterns that tend to repeat. Here’s an example of tak- at trading that type of movement or pattern. Bruce Lee,
ing trades in the forex market based on double tops a legendary martial arts practitioner and movie star,
and double bottoms, with confirmation from Bollinger once said, “I fear not the man who has practiced 10,000
Bands. kicks once, but I fear the man who has practiced one
kick 10,000 times.”
by Azeez Mustapha The trader must understand a pattern to the point that

T
he or she develops trust in it. Think of it like a hunter who
he feelings of uncertainty and fear of execution develops expertise in spotting and recognizing a particular
disappear the moment a trader can finally read kind of animal tracks and footprints. He will become
the meaning of the charts. If you can have a so familiar with that pattern that he can quickly spot it
precise understanding of something that hap- and identify it, even when surrounded by other patterns.
pens repeatedly in the markets, it can give you Similarly, a trading strategy that can provide clarity and
an edge in the markets. provide a narrative about a particular “track” (or pattern)
Each candle, individually and as a group, has some in the market is valuable, especially when you get some
meaning. However, a trader does not necessarily have further technical confirmation for that pattern.
to know what is going on every single time. In fact,
over-ascribing meaning to every bar, candle, and gyra- Bull and bear tracks
tion of the market and every motion on the chart could It’s good to keep things simple in trading. It’s fundamental
GEARS: ALPHASPIRIT.IT/SHUTTERSTOCK

encourage overtrading as well as the dread of missing for traders to know that the market makes higher highs
COLLAGE: CHRISTINE MORRISON

out. This is not healthy for the psychology of the analyst. and higher lows in an uptrend. In a downtrend, the market
So instead of trying to attach too much meaning to every makes lower highs and lower lows.
movement on the chart, consider becoming very familiar The higher high means that the bulls are pushing higher;
with specific moves that tend to repeat. If a trader can hence, there is much buying pressure, and the previous
understand and get to know a particular movement to high is surpassed. Similarly, in a downtrend, the bears are
34 • August 2022 • Technical Analysis of Stocks & Commodities
TRADING STRATEGIES

TRADINGVIEW
FIGURE 1: DOUBLE TOP, USDCHF. In Figures 1–3, the black line is the nine-period moving average (9MA), the yellow line is the 21-period moving
average (21MA), and the blue wavy lines are the Bollinger Bands’ upper and lower borders. The pink-shaded box indicates the area of the stop-loss
placement. The blue shaded area is the area of the profit run. You can see the double top here marked in black. This example short trade, exited on
January 13, 2022, was successful.

pushing lower; hence, there is more selling pressure. The firmation when a double top forms around areas of the
previous lows may be surpassed. In cases of an uptrend upper string of the Bollinger Bands. Similarly, a double
in which the previous highs were not surpassed by the bottom shape features equal lows. Sometimes, one of
new high, that is, the new high is equal to the previous the lows of the double bottom is slightly elevated than
high or even slightly lower, it shows that the bulls are the other. The double bottoms signify a bullish reversal.
exhausted and can’t push up any further. At this point, A stronger confirmation exists when the double bottom
the bears begin to take over. Similarly, in a downtrend, forms around areas of the lower string of the Bollinger
when the new lows do not take out the previous lows—that Bands.
is, the new lows are equal to or higher than the previous An extra moving average of nine periods can be added
low—it signifies that bears are exhausted and that the to aid the other moving average already within the Bol-
bulls are gaining control. linger Bands. The Bollinger Band’s MA is adjusted to
By mastering this track, the trader can anticipate a 21 periods. The cross of the 9MA from the upper side to
trend reversal, allowing the trader to gain from the bulk the lower side of the 21MA in the Bollinger Bands can
of the move. provide confirmation for a short entry. The cross of the
MAs for entries is valid when the double tops form in the
Technical confirmations upper string of the Bollinger Bands. Similarly, the cross
Getting technical confirmations for a pattern gives the of the 9MA from the lower side to the upper side of the
trader more confidence in the pattern. One way to gain 21MA in the Bollinger Bands can provide confirmation
a technical confirmation is by using Bollinger Bands. for a long entry. The cross of the MAs for entries is a
Bollinger Bands are trading bands that are made up of valid indication when the double bottom forms at the
three major strings that trap the candles. While the up- lower string of the Bollinger Bands.
per and lower strings act as resistance and support, the
middle string, a moving average (MA), shows the trend.
When the candles exceed the upper band, they will likely
fall rapidly. When candles exceed the lower string, they It is necessary to apply
are expected to rise suddenly. This happens as a result proper risk management
of the nature of the resistance and support. even when all entry
The double top shape features equal highs. At times, criteria seem perfect.
the second high is slightly lower than the first. The double
top signifies a bearish reversal. There is a stronger con-
August 2022 • Technical Analysis of Stocks & Commodities • 35
FIGURE 2: DOUBLE TOP, USDJPY. A double top is marked in black. This example trade was nearly picture-perfect with almost no drawdown after the
moving average crossed. This short trade was exited on January 13, 2022. This is an example of a successful trade in USDJPY.

A strategy for trading with double tops stop-loss placement. The blue shaded area is the area
and double bottoms of the profit run.
The double top pattern can be spotted in an uptrend,
and the double bottom pattern can be spotted in a down- Instrument: USDCHF
trend. For the strategy I’m describing here, one of the Order: Sell
bottoms or tops must rest on the Bollinger Band. That Entry date: November 26, 2021
is, for an uptrend, a top must be on the higher band. For Exit date: January 13, 2022
a downtrend, a bottom must be on the Bollinger Band. Entry price: 0.9334
The 9MA must cross the 21MA in that direction for an Stop-loss: 0.9377
entry. The stop-loss would be placed above the most Take-profit: 0.9099
recent high when going short, or below the most recent Profit/loss: 235 pips
low when going long.
The trade was executed with a high risk-to-reward ratio.
Some example trades This gives the trader a long-term edge. The trade appeared
In Figures 1–3 you can see some examples of using the to retrace towards the loss area but eventually smashed
approach I just described. the take-profit. Patience is recommended for trading!
Looking at the chart of the US dollar/Swiss franc Looking at the chart of the US dollar/Japanese yen
(USDCHF) in Figure 1, the black line in the chart is the (USDJPY) in Figure 2, I’ve again marked the double top
nine-period moving average (9MA). The blue wavy lines in black to point in out. Following are the trade details
are the Bollinger Bands’ upper and lower borders. The for an example trade in USDJPY based on trading off a
yellow line is the 21-period moving average (21MA). I’ve double top with technical confirmation:
marked the double top that occurred in black to point
it out. The pink-shaded box indicates the area of the Instrument: USDJPY
Order: Sell
Entry date: November 26, 2021
The double top pattern can be Exit date: January 13, 2022
spotted in an uptrend, and the Entry price: 105.204
Stop-loss: 105.659
double bottom pattern can be Take-profit: 103.200
spotted in a downtrend. Profit/loss: 200 pips

36 • August 2022 • Technical Analysis of Stocks & Commodities


FIGURE 3: DOUBLE BOTTOM, USDJPY. A double bottom is marked in black. Even when all the entry criteria are properly met for a strategy, trades
don’t always work out, such as in this case. For that reason, it’s crucial to always apply proper risk management even when all entry criteria seem
perfect. In this example long trade, the position was exited on February 21, 2022 with a loss.

After the criteria were met, there was a “sniper” entry with
almost no drawdown after the moving average crossed.
Trades do not always go as well as this, but once in a Getting technical
while, you will get a perfect trade such as this one, as
long as you stick to your trading discipline.
confirmations for a pattern
Looking at another chart of the US dollar/Japanese gives the trader more
yen in Figure 3, I’ve marked a double bottom in black confidence in the pattern.
to point it out. This time, the trade didn’t go as well.
Following are the trade details for this example trade in
USDJPY based on trading off the double bottom with
technical confirmation: death traps due to some criteria not being met. It is bet-
ter to let go of such trades. Otherwise, if you are taking
Instrument: USDJPY trades for which only some of the criteria are met and the
Order: Buy trade goes into profitable territory, that may encourage
Entry date: February 18, 2022 undisciplined behavior when trading. And that would end
Exit date: February 21, 2022 up leading to long-term inconsistency. Hence, using risk
Entry price: 115.184 management and having patience are essential tools for
Stop-loss: 114.783 achieving long-term profitability in trading.
Take-profit: 115.871
Profit/loss: −36 pips Azeez Mustapha is an analyst at Instaforex Companies
Group and a blogger at Advfn.com, and as well as a
Even the best strategies will have times when they fail, freelance author for various trading publications. He
because there is just no holy grail in trading. Therefore, is a trading signals provider at some websites. He can
it is necessary to apply proper risk management even be reached via email at azeez.mustapha@analytics.
when all entry criteria seem perfect. instaforex.com.
‡TradingView
Concluding remarks ‡See Editorial Resource Index
Before executing a trade, it’s important to wait for all the
criteria to be met. This means that some setups may look
good based on some of the criteria, but could be potential
August 2022 • Technical Analysis of Stocks & Commodities • 37
The LRAdj EMA

The Linear Regression-Adjusted


Exponential Moving Average
Here is a new tool you can use that combines a linear Current LRAdj EMA = Prior LRAdj EMA + MLTP
regression indicator with exponential moving averages to × (1+LRAdj×MLTP_LRAdj) × (Price − Prior LRAdj
filter price movement and help define turning points. EMA)

by Vitali Apirine Multiplier (the weighting multiplier):

T
he linear regression-adjusted exponential MLTP = 2 ⁄ (Time periods + 1)
moving average (LRAdj EMA) is designed to
account for linear regression deviation (that is, Linear regression adjustment (LRAdj) multiplier:
the distance between the price and the linear
regression indicator). LRAdj = (Abs(Current LR Dist)−Abs(Minimum LR
An exponential moving average (EMA) smooths price Dist)) ⁄ (Abs(Maximum LR Dist)−Abs(Minimum LR
data and defines the current direction. EMAs are lag- Dist))
ging indicators.
The linear regression indicator predicts price direction where:
on a statistical basis.
This LRAdj EMA can be used in conjunction with Absolute values are used to ensure positive numbers.
exponential moving averages of the same length to Current LR Dist: Distance between the linear regres-
identify the overall trend. LRAdj EMAs with different sion indicator and the current close
lengths can be used to define turning points and filter Minimum LR Dist: Minimum distance between
price movements. the linear regression indicator and the close for the
STEFAN BALAZ/SHUTTERSTOCK

lookback period
Calculation Maximum LR Dist: Maximum distance between
The example shown here is based on a 10-day LRAdj the linear regression indicator and the close for the
EMA. lookback period
38 • August 2022 • Technical Analysis of Stocks & Commodities
INDICATORS

A formula in Meta­Stock
coding language is given
for the LRAdj EMA in the
sidebar, “LRAdj EMA, In
MetaStock Code.”
LRAdj fluctuates be-
tween 0 and 1. If the cur-
rent LRAdj Dist is close
to the minimum LRAdj
Dist, then the LRAdj is
close to zero. LRAdj can
reach 1 if the current
LRAdj Dist is equal to the

METASTOCK
maximum LRAdj Dist.
Multiply by MLTP_LR-
FIGURE 1: RUSSELL 2000 INDEX. Shown here is the Russell 2000 index with the linear regression indicator
Adj. Mltp_LRAdj can LR(C,10), LRAdj(10,10,5), and EMA(10) from August to December 2010.
vary from 1 to 5.
The values of 10,10,5
are the typical settings
for LRAdj EMA(10,10,5),
where the first parameter
is the moving average
length, the second pa-
rameter is the lookback
period, and the third
parameter is the MLTP_
LRAdj multiplier. Other
values can be substituted
depending on your trading
style and goals.
The chart in Figure 1
shows the Russell 2000 in-
dex with the linear regres- FIGURE 2: S&P 500 INDEX. Shown here is the S&P 500 index with a 20-day EMA and LRAdj EMA(20,20,5)
sion indicator LR(C,10), from June to November 2019.
LR Adj(10,10, 5), and
EMA(10) from August
to December 2010.

LRAdj EMA and


EMA crossovers
Bearish crossovers were
ignored during strong
uptrends. Bullish LRAdj
EMA and EMA cross-
overs (green arrows) can
be used as entry points for
long trades.
The chart in Figure 2
shows the S&P 500 index
with a 20-day EMA and FIGURE 3: NYSE COMPOSITE INDEX. Shown here is the NYSE Composite Index with a 50-day EMA and LRAdj
LRAdj EMA(20,20,5) EMA(50,50,5) from October 2016 to October 2017.
August 2022 • Technical Analysis of Stocks & Commodities • 39
from June to November
2019.
The chart in Figure 3
shows the NYSE Com-
posite Index with a 50-
day EMA and LRAdj
EMA(50,50,5) from Oc-
tober 2016 to October
2017.
The chart in Figure
4 shows the Dow Jones
Industrial Index (DJIA)
with 100-day EMA and
LRAdj EMA(100,100,5)
from January 2012 to
FIGURE 4: DOW JONES INDUSTRIAL AVERAGE. Shown here is the DJIA with a 100-day EMA and LRAdj
April 2022. Note the EMA(100,100,5) from January 2012 to April 2022. Note the failed breakout in October 2014.
failed breakout in October
2014.

Trend
identification
The chart in Figure 5
shows the Dow Jones
Industrial Average (DJIA)
with a 200-day EMA and
LRAdj EMA(200,200,1).
The 200-day EMA and
LRAdj EMA(200,200,1)
captured the 2003–2008
bull market.
The weekly chart in
Figure 6 shows the S&P
FIGURE 5: TREND IDENTIFICATION, BULL MARKET. Shown here is the DJIA with a 200-day EMA and LRAdj
500 index with a 40- EMA(200,200,1). The 200-day EMA and LRAdj EMA(200,200,1) captured the 2003–2008 bull market.
week EMA and LRAdj
EMA(40,40,5). The 40-
week EMA and LRAdj
EMA(40,40,5) defined the
2001–2003 bear market.

LRAdj EMA
crossovers
The chart in Figure 7
shows the NYSE Com-
posite Index with LRAdj
EMA(10,10,3) and LRAdj
EMA(50,50,3) from July
to November 2009. Bull-
ish LRAdj EMA cross-
overs (green arrows) can FIGURE 6: TREND IDENTIFICATION, BEAR MARKET. This weekly chart shows the S&P 500 index with a 40-
be used as entry points for week EMA and LRAdj EMA(40,40,5). The 40-week EMA and LRAdj EMA(40,40,5) defined the 2001–2003 bear
long trades. market.
40 • August 2022 • Technical Analysis of Stocks & Commodities
T he cha r t in Fig-
ure 8 shows the FTSE
100 index with LRAdj
EMA(50,50,5) and LR-
Adj EMA(200,200,5)
from December 2017 to
May 2019. Bullish LRAdj
EMA (green arrows) and
bearish crossovers (red ar-
rows) can be used as entry
points for long and short
trades during sideways
movement.

Conclusion
FIGURE 7: LRADJ EMA CROSSOVERS. Shown here is the NYSE Composite Index with LRAdj EMA(10,10,3) and
The LRAdj EMA offers LRAdj EMA(50,50,3) from July to November 2009. Bullish LRAdj EMA crossovers (green arrows) can be used as
both trend-following and entry points for long trades.
price prediction. The
LRAdj EMA is inter-
preted in a similar way to
traditional EMAs, but it
responds more quickly.
Unfortunately, a moving
average crossover system
can produce whipsaws.
TheLRAdj EMA should
be used in conjunction
with price analysis.

Vitali Apirine is a pro-


grammer engineer with
an interest in technical
analysis, especially the FIGURE 8: LRADJ EMA CROSSOVERS. Shown here is the FTSE 100 index with LRAdj EMA(50,50,5) and LRAdj
application of indicators EMA(200,200,5) from December 2017 to May 2019. Bullish LRAdj EMA (green arrows) and bearish crossovers
such as MACD, RSI, OBV, (red arrows) can be used as entry points for long and short trades during sideways movement.
etc. to trading. He may be
reached at vitapirine@mediacombb.net. ‡MetaStock
‡See Editorial Resource Index
The code given in this article is available in the Article
Code section of our website, Traders.com.

THE LINEAR REGRESSION-ADJUSTED EXPONENTIAL MOVING AVERAGE


(LRADJ EMA), IN METASTOCK FORMULA LANGUAGE
Here is a formula in MetaStock language for the linear Mltp1:=2/(Periods+1);
LR:=LinearReg(C,Pds);
regression-adjusted exponential moving average, LRAdj Dist:=Abs(LR-C);
EMA(50,50,3). ST:=(Dist-LLV(Dist,PDS))/(HHV(Dist,PDS)-LLV(Dist,PDS));
Mltp2:=ST*Mltp;
Periods:=50; Rate:=Mltp1*(1+Mltp2);
Pds:=50; If(Cum(1)=Periods*2,C,PREV+Rate*(C-PREV));
Mltp:=3;

August 2022 • Technical Analysis of Stocks & Commodities • 41


TRADING ON MOMENTUM

Trading Volatile Closes

Daytrading Small Caps:


End-Of-Day
Here is a simple momentum daytrad- breakouts in small-cap stocks in the volume. I like to see volume bars of at
ing breakout strategy that is designed last hour. least 30% higher than average when
to capitalize on volatile moves in entering these trades.
small-cap stocks. End-of-day breakouts
As with many technical breakout Step-by-step action plan
by Ken Calhoun patterns, it is important to avoid false Here’s how you can start using this

B
breakouts. When trading small caps, strategy:
ecause of their volatility the easiest filter to use is increasing
and speculative price action, Step 1: Look for charts priced
small-cap stocks under $10 between $5 and $10 with at least
often provide good trading End-of-day breakouts 15,000 shares-per-minute volume.
opportunities during the last hour of often occur because The pattern should be similar to
the trading session. of short squeezes or that seen in Figure 1.
Here, I’ll discuss a momentum speculative interest.
daytrading strategy that looks for Continued on page 45

eSIGNAL

FIGURE 1: END-OF-DAY BREAKOUT. The day’s biggest move occurred after 3 pm.
42 • August 2022 • 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,
including 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

STRATEGY DEVELOPMENT AND mentality, for example. will just magically appear. Not a good
PSYCHOLOGY Some think the answer is jumping way to successfully trade!
You seem to focus more on strat- to category 2. These are the people Of course, some people think
egy building than on psychology who work on their psychology, their creating a good strategy alone is
or emotions in this column. Why emotional control, and they journal the way to go. Assuming they even
is that? Do emotions not matter in regularly. They spend most of their create a good strategy (most people
algo trading? time working on these things but feel backtesting is the key, and while
Emotions, discipline, and psychol- it is important, it is only part of the
very little on finding a strategy. It is
ogy absolutely do matter in algo almost as if they believe the law of strategy development puzzle), when
trading. But the way I see it, strat- attraction holds for trading—if they the time comes to trade it, they fall
egy development and psychology/ spend enough time imagining them- apart. For whatever reason, they
emotions are both partners in your selves as a successful trader, it willcannot handle the emotional ups and
trading success (Figure 1). I view it miraculously happen. As part of this downs of algo trading.
like this: attitude, they feel that the strategy part
A good example of this is found
is easy, and a good trading strategy with drawdowns. In live trading,
1. Bad strategy, poor psychology/ most people can mentally withstand
discipline = you will lose only a small percentage of the back-
2. Bad strategy, good psychology/ Maybe the need for test drawdown. Live drawdown and
discipline = you will lose left brain and right backtest drawdown are completely
3. Good strategy, poor psychol- brain components for different animals emotionally.
ogy/discipline = you will successful trading is The only traders with a long-term
lose what keeps most people chance are those who commit to
4. Good strategy, good psychol- from being profitable. category 4. But that is hard—both
ogy/discipline = you will the strategy development part, and the
win (unless you get execution part. These are
unlucky) two totally different sets
Category 1 Category 2 of skills to master. I know
In working with traders Bad Strategy Bad Strategy plenty of traders who
for the past few decades, Poor Psychology Good Psychology had good strategies but
I can safely tell you that Outcome: Outcome: who could not translate
most people fall into YOU LOSE YOU LOSE that into trading profits.
category 1. They will They never jumped from
never be successful at category 3 to 4.
trading. They have no Category 3 Category 4 My advice is to aim for
viable strategy to trade Good Strategy Good Strategy category 4 with a two-
(that is to say, they have Poor Psychology Good Psychology pronged approach. First,
no trading edge) and their Outcome: Outcome: learn how to properly
psychology is poorly YOU LOSE YOU WIN develop algo strategies
suited to trading. Maybe (unless you get unlucky)
they have a gambler’s risk FIGURE 1: FOUR CATEGORIES OF TRADING OUTCOMES Continued on page 48
August 2022 • Technical Analysis of Stocks & Commodities • 43
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

ARE PRICE LIMITS GOOD OR BAD trader who sells an at-the-money risk, not because they want to. As
FOR FUTURES MARKETS? (PART 2) call option and simultaneously buys you can imagine, this environment is
Last month I discussed the unintended an at-the-money put has created a ripe for volatility, overpriced options,
consequences and disadvantages of strategy that shares the same profit and liquidity issues. A trader forced
exchange price limits on futures trad- and risk profile as being short a fu- to go to the options market for risk
ers. Price limits are daily maximum tures contract. This can be a great relief from locked-limit futures can
fluctuations allowed by commodity way for traders needing to exit long expect to see a bid/ask spread much
exchanges for respective products. futures contracts, or even enter short wider than the norm. In corn, options
Once the price limit for a particular futures contracts, but are unable to generally have a spread of about a
commodity is reached, trades cannot due to locked-limit pricing. In short, half a cent or $25 but during locked
take place beyond the limit. However, the options market provides traders limit conditions the options bid/ask
trades can occur within the limits if with a place to offset or take risk in spread might be 5 to 10 cents ($250
traders are willing to execute at such a commodity even if the futures con- to $500). If conditions are abnormally
prices. In my opinion, although price tracts are not available to trade. extreme, such as war-time markets
limits are intended to reduce vola- or some other catastrophic shock
tility, they seem to do the opposite As you can imagine, to fundamentals, the spread could
because it ruffles the emotions of be closer to 20 cents ($1,000). Even
vulnerable traders who, in turn, react
this environment is worse, there might not be any bids
in panic rather than logic. Let’s now ripe for volatility, or asks at all; this occurs if market
focus on how locked limit futures overpriced options, makers have deemed it too risky to
contracts impact the associated op- and liquidity issues. make a market with dried-up liquid-
tion market. ity, excessive volatility, and no way
Some are surprised to learn that Of course, going to the options to hedge their exposure.
when a futures market is locked market during times of duress is not Market makers often execute or-
limit-up or limit-down, the options as seamless as I’ve laid out. As we ders in the options market and use
market continues to trade without any know, locked-limit futures markets long or short futures, whether mini
price limits. This is a great “out” for breed panic; that anxiety often bleeds or full-sized to hedge the price risk
traders caught on the wrong side of into the options market tenfold. This of the options they have executed
a limit move. For instance, a trader is because options on futures are not as a liquidity provider. We saw
who is long corn in a limit-down as liquid as futures contracts; as a re- such anomalies in wheat options in
market might not be able to sell his sult, traders tend to suffer more from March 2022 as the futures market
corn futures contract but he can go price slippage in the form of the bid/ was mostly limit-up for six trading
to the options market and buy a put ask spread, and in the process, men- sessions. Those trading options and
to hedge his downside risk exposure. tal stability is frayed. Additionally, wishing to exit positions were forced
He can also create a synthetic short once a futures contract is limit-up or to enter orders near the theoretical
futures contract (a position created limit-down, those venturing into the value of the options with several cents
with options that mimic being short options markets are doing so because in leeway to entice another party to
a futures contract). For instance, a they feel they must do so to manage take the other side. During times like
44 • August 2022 • Technical Analysis of Stocks & Commodities
Futures For You
these traders are reminded there is of 50 cents or more in anticipation
no guarantee of having the ability of the continuation of the rally in the In short, the options
to execute orders at a price they can next session (in when the limit price market provides
live with. The only way one trader is increased by another 40 cents). In traders with a place to
can buy or sell an option is if another March of 2022, the wheat futures
offset or take risk in a
trader (retail market participant or market was mostly limit-up for five
market maker) is willing to execute consecutive sessions. This wreaked commodity even if the
the opposite position. In other words, havoc on the options markets. There futures contracts are
the transaction must be at a price and were some days in which the wheat not available to trade.
time acceptable to both parties; it isn’t limit was 75 cents but the options
possible to force another party to buy pricing changed in a way to infer a future. In a normally functioning
or sell at a price they do not wish to rally of $1.50 in the same session. market, the trader should have no
buy or sell at. Those trading covered calls or similar upside risk because the profits on the
I should also point out that the strategies involving long futures and long future should offset losses on
options market often prices in price short call options discovered that the short call tick for tick, but price
changes in the underlying futures price limits can create risk for strate- limits occasionally interfere with this
market in advance. For example, if the gies that have no risk on paper. For strategy. Thus, I continue to believe
current corn limit is 40 cents and the example, a trader who is long futures that price limits promote dysfunction
market is limit-up, the futures cannot against a short call option on such a rather than stability.
trade higher but the options market day could lose twice as much on the
might price in a daily price increase short call than is made on the long

CALHOUN/MOMENTUM Step 4: Trail a stop at $0.20 behind to trade a larger share size of at least
Continued from page 42 the current price and close the posi- 1,000 shares. Because of the speed at
tion by 4 pm. which these stocks move, it is often
difficult to scale in to winning trades
Step 2: Enter the trade after 3 pm INSIGHTS: WHY THIS in a timely manner. These are there-
if it is breaking out to new highs TECHNIQUE WORKS fore usually best traded in a single
on increasing volume. This is a simple momentum daytrad- position rather than by scaling in as
ing breakout strategy, designed to we usually do.
Step 3: Set a stop-loss at $0.20 capitalize on volatile moves in small-
beneath your entry. cap stocks. End-of-day breakouts Ken Calhoun moderates a live trad-
often occur because of short squeezes ing room for active traders. He is the
or speculative interest before 4 pm. founder of TradeMastery.com, an
When trading small interactive webinar site for active
caps, the easiest filter TRADE MANAGEMENT TIPS traders, and is a UCLA alumnus.
to use is increasing Because the end-of-day trading range
volume. in these plays is usually less than $1
in price variance, it’s often necessary

YOUR ONLINE RESOURCE


FOR TECHNICAL ANALYSIS

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


Follow us on Twitter @STOCKSandCOMM

August 2022 • Technical Analysis of Stocks & Commodities • 45


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

MINIMIZING CASH NEEDED TO SELL • Higher than average implied Example trade: FUBO
NAKED PUTS volatility See Figure 1. On May 18, 2022:
I like the idea of selling naked puts • A strike price at least 30% be-
to collect premium. But I’m not too low stock price (ideally 50% or • Shares of FuboTV (FUBO) traded
fond of having to hold large sums more) at $3.10 a share, down from a high
of cash in my account to secure the above $62 in December 2020.
puts. Any way around this? Our goal is not to buy stock shares • The stock had put in a temporary
There is no way around having to and for the put option to expire low at $2.76 a share.
hold cash to write a cash-secured worthless or for implied volatility to • The implied volatility for FuboTV
put. However, you can minimize fall significantly, allowing us to take (FUBO) options ticked lower after
the amount of cash you have to keep an early profit. By focusing on low- soaring to an exorbitantly high
on hand by focusing on low-priced priced stocks, we limit the amount level. This high IV means that
stocks. of capital at risk. there is a lot of time premium built
There are no set “rules,” but we can into the price of FUBO options.
establish some helpful guidelines, • At this time, the January 2022 1
including: You can minimize the strike price put (which was 68%
amount of cash you below the price of the stock) could
• Stock price < $20 have to keep on hand by be sold for $0.22 apiece.
• Stock price down significantly focusing on low-priced • There are 253 days left until op-
from a peak, but either stabilizing or stocks. tion expiration.
with an obvious line of support
To enter, a trader would need to
have enough cash to buy 100 shares
at the strike price of $1, less the
option premium received. In other
words, the trader would need $100
cash in their account to secure the
put. But the trader already took in
$22 in premium for selling the put,
so would only need to put up an ad-
ditional $78 of their own cash. The
trader stands to earn 28.2% ($22 ⁄
$78) in 253 days—as long as FUBO
remains above $1 a share.
OPTIONSANALYSIS.COM

For example, we will assume that


a trader sells 30 puts at $22 apiece.
The maximum profit is $660, and the
FIGURE 1: FUBOTV (FUBO). We can look for some favorable characteristics in stock price, option
strike price, and implied volatility to find potential trades when writing naked puts. Here, you see the maximum risk (if FUBO shares are
implied volatility for options on FUBO ticked lower after soaring to an exorbitantly high level. traded at $0) is $2,340.
46 • August 2022 • Technical Analysis of Stocks & Commodities
Explore Your Options

FIGURE 2: FUBO TRADE DETAILS. In this example, the trader sells 30 puts at $22 apiece. The maximum profit would be $660 and the maximum risk
(if FUBO shares traded at $0) is $2,340. So the trader could earn 28.2% ($22 ⁄ $78) in 253 days as long as FUBO remains above $1/share.

The particulars of the trade appear


in Figure 2 and the risk curves in
Figure 3.
To call the recent low of $2.76 a
“support level” is admittedly a bit of a
stretch. However, it might be deemed
acceptable in this case because the
option strike price of $1 is 68% below
the current price of the stock, and the
breakeven price for this trade ($0.78
a share) is 75% below the price of
the stock.

Managing the trade FIGURE 3: FUBO TRADE RISK CURVES. The option strike price of $1 is 68% below the current price of
the stock, and the breakeven price for this trade ($0.78 a share) is 75% below the price of the stock.
With one possible exception, there
isn’t much to do but wait and see if
FUBO stabilizes somewhere before it
hits $1 a share. The possible exception
is if the implied volatility for the put
option plummets. This would cause
a large part of the time premium to
evaporate and could offer an oppor-
tunity to buy back the option with
an early profit.

Example trade: AMC


See Figure 4. On May 31:

• Shares of AMC Entertainment


Holding (AMC) traded at $14.34
a share, down from a high above FIGURE 4: AMC ENTERTAINMENT HOLDING (AMC). In this example, AMC exhibits some charac-
$72 in June 2021. teristics in stock price, option strike price, and implied volatility that makes it a candidate for writing
• The stock had put in a temporary naked puts on. Among other things, the implied volatility for options on AMC was once again trading
at a very high level, inflating the premium available from selling AMC puts.
low at $9.70 a share.
• The implied volatility for options ing AMC puts. sold for $0.30 apiece.
on AMC was once again trading • At this time, the September 2021 • There are 108 days left until op-
at a very high level, thus inflating 4 strike price put (which was 72% tion expiration.
the premium available from sell- below the stock price) could be
August 2022 • Technical Analysis of Stocks & Commodities • 47
Explore Your Options

FIGURE 5: AMC TRADE PARTICULARS. In this example, the trader sells six puts at $30 apiece. The maximum profit would be $180 and the maximum
risk (if AMC shares traded to $0) is $2,219. So the trader could earn 8.11% ($30 ⁄ $370) in 108 days as long as AMC remains above $4 a share.

There is no way
around having to hold
cash to write a cash-
secured put.
and the maximum risk (if AMC
shares traded to $0) is $2,219.
The particulars of the trade appear
in Figure 5 and the risk curves in
Figure 6.

Managing the trade


As long as AMC holds above $4 a
FIGURE 6: AMC TRADE RISK CURVES. The trader would need to have enough cash to buy 100 share through the September options
shares at the strike price of $4, less the option premium received. So the trader would need $400 expiration, the trader does not have
minus the $30 in premium received for selling the put.
to do anything. As with the FUBO
To enter, a trader would need $400 stands to earn 8.11% ($30 ⁄ $370) in example, if implied volatility does
cash in their account to secure the put. 108 days—as long as AMC remains decline sharply between now and
But the trader already took in $30 in above $4 a share. then, an early profit-taking oppor-
premium for selling the put, so would For our example, we will assume tunity might be available.
only need to put up an additional that a trader sells six puts at $30
$370 of their own cash. The trader apiece. The maximum profit is $180,

Algo
Algo Q&A
Q&A
DAVEY activity—so-called soft skills. If you
Continued from page 43 have a tendency to gamble or sabotage In live trading, most
yourself, you need to dedicate time people can mentally
and create good backtests. Consider to working out your issues. withstand only a small
this “a “left-brain” activity, and key Maybe the need for left-brain and percentage of the
components of this are technical right-brain components for success-
acumen, working with numbers, and ful trading is what keeps most people
backtest drawdown.
performing analysis. from being profitable. Many people,
Second, spend time working on after all, tend to be primarily one both sets of skills is critical for algo
your psychology, discipline, and or the other—”analytical” left brain trading success.
emotions. This is “right-brain” or “feeling” right brain. Embracing
48 • August 2022 • Technical Analysis of Stocks & Commodities
The focus of Trad- • Traders.com → S&C Magazine →
ers’ Tips this month Traders’ Tips
is Markos Katsanos’
article in this issue, At Traders.com you can also right-click on any
“Trading The Fear In- chart to open it in a new tab or window and view
dex.” Here, we pres- the chart at a much larger size.
ent the August 2022 The Traders’ Tips section is provided to help read-
Traders’ Tips code ers implement a selected technique from an article in
with possible imple- this issue or another recent issue. The entries here
mentations in various software. are contributed by software developers or program-
The code for the following Traders’ Tips selections mers for software that is capable of customization.
is posted here:

SELLCONDITION( false ),
SHORTCONDITION( false ),
COVERCONDITION( false );
F TRADESTATION: AUGUST 2022 TRADERS’ TIPS CODE
// Data2 = $VIX.X
In his article in this issue, “Trading The Fear Index,” author VIX = Close of Data2;
Markos Katsanos explains how the VIX (Cboe Volatility Index), VIXH = High of Data2;
VIXL = Low of Data2;
often called the “fear index,” is used by traders as a measure of
the 30-day expected volatility of the US stock market. While // Data3 = SPY
SPY = Close of Data3;
many traders use the index as a gauge of potential market SPYH = High of Data3;
movements, many ignore potential trading opportunities that SPYL = Low of Data3;

the index offers. The VIX itself cannot be traded directly; if CurrentBar > STBARSS + 3 then
however, there are instruments that offer exposure to the in- begin

dex, such as exchange-traded funds (ETFs). Markos Katsanos //STOCHASTIC


presents a set of rules for a long-short volatility trading system
STOCHVS = (VIX - Lowest(VIXL, STBARSS)) /
that attempts to capture a sizable part of the volatility spikes (Highest(VIXH, STBARSS) - Lowest(VIXL, STBARSS) +
while also benefiting from the long-term time decay of the .0001) * 100;
STVIXS = Average(STOCHVS, 3);
volatility ETFs. Two strategies are exhibited: one for long
VIX ETFs and one for inverse (short) VIX ETFs. STOCHSS = (SPY - Lowest(SPYL, STBARSS)) /
(Highest(SPYH, STBARSS) - Lowest(SPYL, STBARSS) +
Strategy: TASC AUG 2022 Long VIX ETF .0001) * 100;
STSPYS = Average(STOCHSS, 3);
// TASC AUG 2022
// DAILY LONG–SHORT TRADING SYSTEM FOR STOCHVL = (VIX - Lowest(VIXL, STBARSL)) /
// LONG VOLATILITY ETFs
// To be applied on a daily chart
// of long VIX ETFs:
// VXX, VIXY, UVXY, VIXM, VXZ, SVOL
// COPYRIGHT MARKOS KATSANOS 2022

inputs:
VIXUPMAX( 50 ), // 40 to 60 by 5
VBARS( 6 ), // 5 to 10 by 1
STBARSL( 25 ), // 25 to 30 by 5
STBARSS( 10 ); // 10 to 15 by 5

variables:
VIX( 0 ),
VIXH( 0 ),
VIXL( 0 ),
SPY( 0 ),
SPYH( 0 ),
SPYL( 0 ),
STOCHVS( 0 ),
STVIXS( 0 ),
STOCHSS( 0 ),
STSPYS( 0 ),
STOCHVL( 0 ),
STVIXL( 0 ),
STOCHSL( 0 ),
STSPYL( 0 ),
VIXDN( 0 ),
VIXUP( 0 ),
RCBARS( 0 ), FIGURE 1: TRADESTATION. This shows an example of a TradeStation daily chart of SVXY with
RC( 0 ), the short VIX ETF strategy applied. Data2 contains the VIX ($VIX.X) and Data3 contains the
BUYCONDITION( false ), S&P 500 ETF SPY.

August 2022 • Technical Analysis of Stocks & Commodities • 49


(Highest(VIXH, STBARSL) - Lowest(VIXL, STBARSL) + SELLCONDITION( false ),
.0001) * 100; SHORTCONDITION( false ),
STVIXL = Average(STOCHVL, 3); COVERCONDITION( false );

STOCHSL = (SPY - Lowest(SPYL, STBARSL)) / // Data2 = $VIX.X


(Highest(SPYH,STBARSL) - Lowest(SPYL, STBARSL) + VIX = Close of Data2;
.0001) * 100; VIXH = High of Data2;
STSPYL = Average(STOCHSL, 3); VIXL = Low of Data2;

// VIX // Data3 = SPY


VIXDN = (VIX / Highest(VIX, VBARS)[1] - 1) * 100; SPY = Close of Data3;
VIXUP = (VIXH / Lowest(VIXL, VBARS)[1] - 1) * 100; SPYH = High of Data3;
SPYL = Low of Data3;
// CORRELATION TREND
RCBARS = VBARS - 1; if CurrentBar > STBARSS + 3 then
RC = CoefficientR(VIX, Cum(1), RCBARS); begin

BUYCONDITION = STVIXL > STSPYL and STVIXS > STSPYS //STOCHASTIC


and STVIXS> STVIXS[1]
and VIXUP>VIXUPMAX and RC > .8 and RC > RC[1]; STOCHVS = (VIX - Lowest(VIXL, STBARSS)) /
(Highest(VIXH, STBARSS) - Lowest(VIXL, STBARSS) +
SELLCONDITION = STSPYS > STVIXS .0001) * 100;
or STVIXS < STVIXS[1]; STVIXS = Average(STOCHVS, 3);
// OR VIX < Lowest(VIX, 3)[1];
// OR VIX <= Highest(VIXH, 3) - 15; STOCHSS = (SPY - Lowest(SPYL, STBARSS)) /
(Highest(SPYH, STBARSS) - Lowest(SPYL, STBARSS) +
SHORTCONDITION = VIX <= Lowest(VIX, 3) .0001) * 100;
and VIXUP < VIXUPMAX STSPYS = Average(STOCHSS, 3);
and VIXDN < -20
and VIX > 15 STOCHVL = (VIX - Lowest(VIXL, STBARSL)) /
and STSPYS > STVIXS (Highest(VIXH, STBARSL) - Lowest(VIXL, STBARSL) +
and STSPYS > STSPYS[1]; .0001) * 100;
STVIXL = Average(STOCHVL, 3);
COVERCONDITION = VIXUP > VIXUPMAX
and STVIXS > STVIXS[1] and RC > .8; STOCHSL = (SPY - Lowest(SPYL, STBARSL)) /
(Highest(SPYH,STBARSL) - Lowest(SPYL, STBARSL) +
if BUYCONDITION then .0001) * 100;
Buy Next Bar at Open; STSPYL = Average(STOCHSL, 3);

if SHORTCONDITION then // VIX


Sell Short Next Bar at Open; VIXDN = (VIX / Highest(VIX, VBARS)[1] - 1) * 100;
VIXUP = (VIXH / Lowest(VIXL, VBARS)[1] - 1) * 100;
if SELLCONDITION then
Sell Next Bar at Open; // CORRELATION TREND
RC = CoefficientR(VIX, Cum(1), VBARS - 1);
if COVERCONDITION then
Buy To Cover Next Bar at Open; SHORTCONDITION= STVIXL > STSPYL
and STVIXS > STVIXS[1]
end; and STVIXS > STSPYS
and VIXUP > VIXUPMAX
Strategy: TASC AUG 2022 Short VIX ETF and RC > .8 and RC > RC[1] ;

// TASC AUG 2022 COVERCONDITION = STSPYS > STVIXS


// DAILY LONG–SHORT TRADING SYSTEM FOR THE or STVIXS < STVIXS[1] ;
// INVERSE ETF SVXY // or VIX < Lowest(VIX, 3)[1];
// To be applied on a daily chart of SVXY // or VIX <= Highest(VIXH, 3) - 15;
// COPYRIGHT MARKOS KATSANOS 2022
BUYCONDITION = VIXDN < -20 and VIX > 15
inputs: and VIX <= Lowest(VIX, 3) and STSPYS > STVIXS
VIXUPMAX( 50 ), // 50 to 60 by 5 and STSPYS > STSPYS[1]
VBARS( 6 ), // 5 to 10 by 1 and VIXUP < VIXUPMAX;
STBARSL( 25 ), // 25 to 30 by 5
STBARSS( 10 ); // 10 to 15 by 5 SELLCONDITION = VIXUP > VIXUPMAX
and STVIXS > STVIXS[1]
variables: and RC > .8;
VIX( 0 ),
VIXH( 0 ), if BUYCONDITION then
VIXL( 0 ), Buy Next Bar at Open;
SPY( 0 ),
SPYH( 0 ), if SHORTCONDITION then
SPYL( 0 ), Sell Short Next Bar at Open;
STOCHVS( 0 ),
STVIXS( 0 ), if SELLCONDITION then
STOCHSS( 0 ), Sell Next Bar at Open;
STSPYS( 0 ),
STOCHVL( 0 ), if COVERCONDITION then
STVIXL( 0 ), Buy To Cover Next Bar at Open;
STOCHSL( 0 ),
STSPYL( 0 ), end;
VIXDN( 0 ),
VIXUP( 0 ),
RC( 0 ),
A sample chart is shown in Figure 1.
BUYCONDITION( false ), This article is for informational purposes. No type of

50 • August 2022 • Technical Analysis of Stocks & Commodities


trading or investment recommendation, advice, or strategy VixDn:= (vix/Ref(HHV(vix,vbars),-1)-1)*100;
VixUp:= (vixh/Ref(LLV(vixl,vbars),-1)-1)*100;
is being made, given, or in any manner provided by TradeS- RC:= Correl( vix, Cum(1), vbars-1, 0 );
tation Securities or its affiliates.
Buy:= StvixS > StspyS AND StvixF > StspyF AND StvixF > Ref(StvixF, -1)
—John Robinson AND VixUp > VUpMax AND RC > .8 AND RC>Ref(RC, -1);
TradeStation Securities, Inc. sell:= StspyF > StvixF OR StvixF < Ref(StvixF,-1);
www.TradeStation.com ltrade:= If(buy, 1, If(sell, 0, PREV));

ltrade = 0 AND Ref(ltrade=1, -1)

Sell short order:


VUpMax:= 50; {min 40/max 60/step 5}
Vbars:= 6; {min 5/max 10/step 1}
StBarsSlow:= 25; {min 25/max 30/step 5}
F METASTOCK: AUGUST 2022 TRADERS’ TIPS CODE StBarsFast:= 10; {min 10/max 15/step 5}
Markos Katsanos’ article in this issue, “Trading The Fear
Index,” provides systems for trading VIX-based instruments. vix:= Security("ONLINE:.VIX", C);
vixh:= Security("ONLINE:.VIX", H);
The MetaStock version of those systems are shown here. The vixl:= Security("ONLINE:.VIX", L);
formulas can be placed in an expert advisor, exploration, or spy:= Security("ONLINE:SPY", C);
spyh:= Security("ONLINE:SPY", H);
system test in MetaStock. The suggested optimization values spyl:= Security("ONLINE:SPY", L);
for a system test are in comments on the first four lines. StVixF:= Mov((vix-LLV(vixl,StBarsFast))/(HHV(vixh, StBarsFast)-LLV(vixl,
StBarsFast)+.0001)*100, 3, S);
VIX ETF System
StSpyF:= Mov((spy-LLV(spyl,StBarsFast))/(HHV(spyh, StBarsFast)-
A VIX ETF daily long-short trading system to be appled to daily charts.
LLV(spyl, StBarsFast)+.0001)*100, 3, S);
Suggested instruments: VXX, VIXY, UVXY, VIXM, VXZ, SVOL
StVixS:= Mov((vix-LLV(vixl,StBarsSlow))/(HHV(vixh, StBarsSlow)-LLV(vixl,
StBarsSlow)+.0001)*100, 3, S);
Buy order:
StSpyS:= Mov((spy-LLV(spyl,StBarsSlow))/(HHV(spyh, StBarsSlow)-
VUpMax:= 50; {min 40/max 60/step 5}
LLV(spyl, StBarsSlow)+.0001)*100, 3, S);
Vbars:= 6; {min 5/max 10/step 1}
StBarsSlow:= 25; {min 25/max 30/step 5}
VixDn:= (vix/Ref(HHV(vix,vbars),-1)-1)*100;
StBarsFast:= 10; {min 10/max 15/step 5}
VixUp:= (vixh/Ref(LLV(vixl,vbars),-1)-1)*100;
RC:= Correl( vix, Cum(1), vbars-1, 0 );
vix:= Security("ONLINE:.VIX", C);
vixh:= Security("ONLINE:.VIX", H);
short:= vix<= LLV(vix,3) AND VixUp < VUpMax AND VixDn< -20 AND Vix >
vixl:= Security("ONLINE:.VIX", L);
15 AND StspyF>StvixF AND StspyF>Ref(StspyF, -1);
spy:= Security("ONLINE:SPY", C);
cover:= VixUp > VUpMax AND StvixF > Ref(StvixF, -1) AND RC>.8;
spyh:= Security("ONLINE:SPY", H);
strade:= If(short, 1, If(cover, 0, PREV));
spyl:= Security("ONLINE:SPY", L);
strade = 1 AND Ref(strade=0, -1)
StVixF:= Mov((vix-LLV(vixl,StBarsFast))/(HHV(vixh, StBarsFast)-LLV(vixl,
StBarsFast)+.0001)*100, 3, S);
Buy to cover order:
StSpyF:= Mov((spy-LLV(spyl,StBarsFast))/(HHV(spyh, StBarsFast)-
VUpMax:= 50; {min 40/max 60/step 5}
LLV(spyl, StBarsFast)+.0001)*100, 3, S);
Vbars:= 6; {min 5/max 10/step 1}
StVixS:= Mov((vix-LLV(vixl,StBarsSlow))/(HHV(vixh, StBarsSlow)-LLV(vixl,
StBarsSlow:= 25; {min 25/max 30/step 5}
StBarsSlow)+.0001)*100, 3, S);
StBarsFast:= 10; {min 10/max 15/step 5}
StSpyS:= Mov((spy-LLV(spyl,StBarsSlow))/(HHV(spyh, StBarsSlow)-
LLV(spyl, StBarsSlow)+.0001)*100, 3, S);
vix:= Security("ONLINE:.VIX", C);
vixh:= Security("ONLINE:.VIX", H);
VixDn:= (vix/Ref(HHV(vix,vbars),-1)-1)*100;
vixl:= Security("ONLINE:.VIX", L);
VixUp:= (vixh/Ref(LLV(vixl,vbars),-1)-1)*100;
spy:= Security("ONLINE:SPY", C);
RC:= Correl( vix, Cum(1), vbars-1, 0 );
spyh:= Security("ONLINE:SPY", H);
spyl:= Security("ONLINE:SPY", L);
Buy:= StvixS > StspyS AND StvixF > StspyF AND StvixF > Ref(StvixF, -1)
AND VixUp > VUpMax AND RC > .8 AND RC>Ref(RC, -1);
StVixF:= Mov((vix-LLV(vixl,StBarsFast))/(HHV(vixh, StBarsFast)-LLV(vixl,
sell:= StspyF > StvixF OR StvixF < Ref(StvixF,-1);
StBarsFast)+.0001)*100, 3, S);
ltrade:= If(buy, 1, If(sell, 0, PREV));
StSpyF:= Mov((spy-LLV(spyl,StBarsFast))/(HHV(spyh, StBarsFast)-
LLV(spyl, StBarsFast)+.0001)*100, 3, S);
ltrade = 1 AND Ref(ltrade=0, -1)
StVixS:= Mov((vix-LLV(vixl,StBarsSlow))/(HHV(vixh, StBarsSlow)-LLV(vixl,
StBarsSlow)+.0001)*100, 3, S);
Sell order:
StSpyS:= Mov((spy-LLV(spyl,StBarsSlow))/(HHV(spyh, StBarsSlow)-
VUpMax:= 50; {min 40/max 60/step 5}
LLV(spyl, StBarsSlow)+.0001)*100, 3, S);
Vbars:= 6; {min 5/max 10/step 1}
StBarsSlow:= 25; {min 25/max 30/step 5}
VixDn:= (vix/Ref(HHV(vix,vbars),-1)-1)*100;
StBarsFast:= 10; {min 10/max 15/step 5}
VixUp:= (vixh/Ref(LLV(vixl,vbars),-1)-1)*100;
RC:= Correl( vix, Cum(1), vbars-1, 0 );
vix:= Security("ONLINE:.VIX", C);
vixh:= Security("ONLINE:.VIX", H);
short:= vix<= LLV(vix,3) AND VixUp < VUpMax AND VixDn< -20 AND Vix >
vixl:= Security("ONLINE:.VIX", L);
15 AND StspyF>StvixF AND StspyF>Ref(StspyF, -1);
spy:= Security("ONLINE:SPY", C);
cover:= VixUp > VUpMax AND StvixF > Ref(StvixF, -1) AND RC>.8;
spyh:= Security("ONLINE:SPY", H);
strade:= If(short, 1, If(cover, 0, PREV));
spyl:= Security("ONLINE:SPY", L);
strade = 0 AND Ref(strade=1, -1)
StVixF:= Mov((vix-LLV(vixl,StBarsFast))/(HHV(vixh, StBarsFast)-LLV(vixl,
StBarsFast)+.0001)*100, 3, S);
StSpyF:= Mov((spy-LLV(spyl,StBarsFast))/(HHV(spyh, StBarsFast)-
Short VIX (SVXY) System:
A SVXY Inverse VIX ETF daily long-short trading system for daily charts.
LLV(spyl, StBarsFast)+.0001)*100, 3, S);
Suggested instrument: SVXY
StVixS:= Mov((vix-LLV(vixl,StBarsSlow))/(HHV(vixh, StBarsSlow)-LLV(vixl,
StBarsSlow)+.0001)*100, 3, S);
Buy order:
StSpyS:= Mov((spy-LLV(spyl,StBarsSlow))/(HHV(spyh, StBarsSlow)-
VUpMax:= 50; {min 40/max 60/step 5}
LLV(spyl, StBarsSlow)+.0001)*100, 3, S);

August 2022 • Technical Analysis of Stocks & Commodities • 51


Vbars:= 6; {min 5/max 10/step 1} StSpyS:= Mov((spy-LLV(spyl,StBarsSlow))/(HHV(spyh, StBarsSlow)-
StBarsSlow:= 25; {min 25/max 30/step 5} LLV(spyl, StBarsSlow)+.0001)*100, 3, S);
StBarsFast:= 10; {min 10/max 15/step 5}
VixDn:= (vix/Ref(HHV(vix,vbars),-1)-1)*100;
vix:= Security("ONLINE:.VIX", C); VixUp:= (vixh/Ref(LLV(vixl,vbars),-1)-1)*100;
vixh:= Security("ONLINE:.VIX", H); RC:= Correl( vix, Cum(1), vbars-1, 0 );
vixl:= Security("ONLINE:.VIX", L);
spy:= Security("ONLINE:SPY", C); short:= StvixS > StspyS AND StvixF > StspyF AND StvixF > Ref(StvixF, -1)
spyh:= Security("ONLINE:SPY", H); AND VixUp > VUpMax AND RC > .8 AND RC>Ref(RC, -1);
spyl:= Security("ONLINE:SPY", L); cover:= StspyF > StvixF OR StvixF < Ref(StvixF,-1);
strade:= If(short, 1, If(cover, 0, PREV));
StVixF:= Mov((vix-LLV(vixl,StBarsFast))/(HHV(vixh, StBarsFast)-LLV(vixl,
StBarsFast)+.0001)*100, 3, S); strade = 1 AND Ref(strade=0, -1)
StSpyF:= Mov((spy-LLV(spyl,StBarsFast))/(HHV(spyh, StBarsFast)-
LLV(spyl, StBarsFast)+.0001)*100, 3, S); Buy to cover order:
StVixS:= Mov((vix-LLV(vixl,StBarsSlow))/(HHV(vixh, StBarsSlow)-LLV(vixl, VUpMax:= 50; {min 40/max 60/step 5}
StBarsSlow)+.0001)*100, 3, S); Vbars:= 6; {min 5/max 10/step 1}
StSpyS:= Mov((spy-LLV(spyl,StBarsSlow))/(HHV(spyh, StBarsSlow)- StBarsSlow:= 25; {min 25/max 30/step 5}
LLV(spyl, StBarsSlow)+.0001)*100, 3, S); StBarsFast:= 10; {min 10/max 15/step 5}

VixDn:= (vix/Ref(HHV(vix,vbars),-1)-1)*100; vix:= Security("ONLINE:.VIX", C);


VixUp:= (vixh/Ref(LLV(vixl,vbars),-1)-1)*100; vixh:= Security("ONLINE:.VIX", H);
RC:= Correl( vix, Cum(1), vbars-1, 0 ); vixl:= Security("ONLINE:.VIX", L);
spy:= Security("ONLINE:SPY", C);
Buy:= vix<= LLV(vix,3) AND VixUp < VUpMax AND VixDn< -20 AND Vix > spyh:= Security("ONLINE:SPY", H);
15 AND StspyF>StvixF AND StspyF>Ref(StspyF, -1); spyl:= Security("ONLINE:SPY", L);
sell:= VixUp > VUpMax AND StvixF > Ref(StvixF, -1) AND RC>.8;
ltrade:= If(buy, 1, If(sell, 0, PREV)); StVixF:= Mov((vix-LLV(vixl,StBarsFast))/(HHV(vixh, StBarsFast)-LLV(vixl,
StBarsFast)+.0001)*100, 3, S);
ltrade = 1 AND Ref(ltrade=0, -1) StSpyF:= Mov((spy-LLV(spyl,StBarsFast))/(HHV(spyh, StBarsFast)-
LLV(spyl, StBarsFast)+.0001)*100, 3, S);
Sell order: StVixS:= Mov((vix-LLV(vixl,StBarsSlow))/(HHV(vixh, StBarsSlow)-LLV(vixl,
VUpMax:= 50; {min 40/max 60/step 5} StBarsSlow)+.0001)*100, 3, S);
Vbars:= 6; {min 5/max 10/step 1} StSpyS:= Mov((spy-LLV(spyl,StBarsSlow))/(HHV(spyh, StBarsSlow)-
StBarsSlow:= 25; {min 25/max 30/step 5} LLV(spyl, StBarsSlow)+.0001)*100, 3, S);
StBarsFast:= 10; {min 10/max 15/step 5}
VixDn:= (vix/Ref(HHV(vix,vbars),-1)-1)*100;
vix:= Security("ONLINE:.VIX", C); VixUp:= (vixh/Ref(LLV(vixl,vbars),-1)-1)*100;
vixh:= Security("ONLINE:.VIX", H); RC:= Correl( vix, Cum(1), vbars-1, 0 );
vixl:= Security("ONLINE:.VIX", L);
spy:= Security("ONLINE:SPY", C); short:= StvixS > StspyS AND StvixF > StspyF AND StvixF > Ref(StvixF, -1)
spyh:= Security("ONLINE:SPY", H); AND VixUp > VUpMax AND RC > .8 AND RC>Ref(RC, -1);
spyl:= Security("ONLINE:SPY", L); cover:= StspyF > StvixF OR StvixF < Ref(StvixF,-1);
strade:= If(short, 1, If(cover, 0, PREV));
StVixF:= Mov((vix-LLV(vixl,StBarsFast))/(HHV(vixh, StBarsFast)-LLV(vixl,
StBarsFast)+.0001)*100, 3, S); strade = 0 AND Ref(strade=1, -1)
StSpyF:= Mov((spy-LLV(spyl,StBarsFast))/(HHV(spyh, StBarsFast)-
LLV(spyl, StBarsFast)+.0001)*100, 3, S); —William Golson
StVixS:= Mov((vix-LLV(vixl,StBarsSlow))/(HHV(vixh, StBarsSlow)-LLV(vixl,
StBarsSlow)+.0001)*100, 3, S); MetaStock Technical Support
StSpyS:= Mov((spy-LLV(spyl,StBarsSlow))/(HHV(spyh, StBarsSlow)- www.MetaStock.com
LLV(spyl, StBarsSlow)+.0001)*100, 3, S);

VixDn:= (vix/Ref(HHV(vix,vbars),-1)-1)*100;
VixUp:= (vixh/Ref(LLV(vixl,vbars),-1)-1)*100;
RC:= Correl( vix, Cum(1), vbars-1, 0 );

Buy:= vix<= LLV(vix,3) AND VixUp < VUpMax AND VixDn< -20 AND Vix >
15 AND StspyF>StvixF AND StspyF>Ref(StspyF, -1); F WEALTH-LAB: AUGUST 2022 TRADERS’ TIPS CODE
sell:= VixUp > VUpMax AND StvixF > Ref(StvixF, -1) AND RC>.8;
ltrade:= If(buy, 1, If(sell, 0, PREV));
We have prepared C# code for Markos Katsanos’ daily long-
short trading system for long volatility ETFs and for his daily
ltrade = 0 AND Ref(ltrade=1, -1) long-short trading system for the inverse ETF for the benefit
Sell short order: of Wealth-Lab 8 users. For details and description of the au-
VUpMax:= 50; {min 40/max 60/step 5}
Vbars:= 6; {min 5/max 10/step 1}
thor’s trading systems, see the article in this issue, “Trading
StBarsSlow:= 25; {min 25/max 30/step 5} The Fear Index.”
StBarsFast:= 10; {min 10/max 15/step 5}
Long-short trading system for long volatility ETFs:
vix:= Security("ONLINE:.VIX", C);
vixh:= Security("ONLINE:.VIX", H); using WealthLab.Backtest;
vixl:= Security("ONLINE:.VIX", L); using System;
spy:= Security("ONLINE:SPY", C); using WealthLab.Core;
spyh:= Security("ONLINE:SPY", H); using WealthLab.Indicators;
spyl:= Security("ONLINE:SPY", L); using System.Drawing;
using System.Linq;
StVixF:= Mov((vix-LLV(vixl,StBarsFast))/(HHV(vixh, StBarsFast)-LLV(vixl, using WealthLab.TASC;
StBarsFast)+.0001)*100, 3, S);
StSpyF:= Mov((spy-LLV(spyl,StBarsFast))/(HHV(spyh, StBarsFast)- namespace WealthScript2
LLV(spyl, StBarsFast)+.0001)*100, 3, S); {
StVixS:= Mov((vix-LLV(vixl,StBarsSlow))/(HHV(vixh, StBarsSlow)-LLV(vixl, public class LongShortVolaETF : UserStrategyBase
StBarsSlow)+.0001)*100, 3, S); {

52 • August 2022 • Technical Analysis of Stocks & Commodities


public LongShortVolaETF() : base()
{
AddParameter("VIX up max", ParameterType.Int32, 50,
40, 60, 5);
AddParameter("Period for VIX Up/Down & RC", Param-
eterType.Int32, 6, 5, 10, 1);
AddParameter("Slow Stoch period", ParameterType.
Int32, 25, 25, 30, 5);
AddParameter("Fast Stoch period", ParameterType.
Int32, 10, 10, 15, 5);
}

public override void Initialize(BarHistory bars)


{
vixUpMax = Parameters[0].AsInt;
vBars = Parameters[1].AsInt;
stBarsL = Parameters[2].AsInt;
FIGURE 2: WEALTH-LAB. This shows sample trades of the inverse ETF system on a chart of
stBarsS = Parameters[3].AsInt;
SVXY in Wealth-Lab 8.
/* obtain the external symbols data */
Long) || (cover && LastOpenPosition.PositionType == PositionType.Short) )
vix = GetHistory(bars, "^VIX");
ClosePosition( LastPosition, OrderType.Market);
spy = GetHistory(bars, "SPY");
}
}
/* Stochastic */
}
stochVs = StochK.Series(vix, stBarsS);
stVixS = SMA.Series(stochVs, 3);
BarHistory vix, spy;
stochSs = StochK.Series(spy, stBarsS);
TimeSeries vixDn, vixUp, stochVs, stVixS, stochSs, stSpyS, stochVl,
stSpyS = SMA.Series(stochSs, 3);
stVixL, stochSl, stSpyL, RC, RC1;
int vBars = 6, vixUpMax = 25, stBarsS = 10, stBarsL = 25;
stochVl = StochK.Series(vix, stBarsL);
}
stVixL = SMA.Series(stochVl, 3);
}
stochSl = StochK.Series(spy, stBarsL);
stSpyL = SMA.Series(stochSl, 3); Long-short trading system for the inverse ETF SVXY:
/* VIX */ using WealthLab.Backtest;
vixDn = ((vix.Close / Highest.Series(vix.Close, vBars) >> 1) - 1) * using System;
100; using WealthLab.Core;
vixUp = ((vix.High / Lowest.Series(vix.Low, vBars) >> 1) - 1) * 100; using WealthLab.Indicators;
using System.Drawing;
/* Correlation Trend */ using System.Linq;
int RCBARS = vBars - 1; using WealthLab.TASC;
RC = CorrelationTrend.Series(vix.Close, RCBARS);
RC1 = CorrelationTrend.Series(bars.Close, RCBARS); namespace WealthScript1
{
PlotBarHistoryStyle( vix, "^vix", "VIX"); public class InverseETF : UserStrategyBase
{
PlotTimeSeriesLine( stochVs, "stochVs", "vix", WLColor.Red); public InverseETF() : base()
PlotTimeSeriesLine( stochVl, "stochVl", "vix", WLColor.Blue); {
PlotTimeSeriesLine( stochSs, "stochSs", "spy", WLColor.Red); AddParameter("VIX up max", ParameterType.Int32, 50, 50, 60, 5);
PlotTimeSeriesLine( stochSl, "stochSl", "spy", WLColor.Blue); AddParameter("Period for VIX Up/Down & RC", ParameterType.
} Int32, 6, 5, 10, 1);
AddParameter("Slow Stoch period", ParameterType.Int32, 25, 25,
public override void Execute( BarHistory bars, int idx) 30, 5);
{ AddParameter("Fast Stoch period", ParameterType.Int32, 10, 10,
if (idx > 0) 10, 5);
{ }
/* LONG */
bool buy = stVixL[idx] > stSpyL[idx] && stVixS[idx] > public override void Initialize(BarHistory bars)
stSpyS[idx] && stVixS[idx] > stVixS[idx - 1] && vixUp[idx] > vixUpMax && {
RC[idx] > 0.8 && RC[idx] > RC[idx -1]; vixUpMax = Parameters[0].AsInt;
bool sell = stSpyS[idx] > stVixS[idx] || stVixS[idx] < stVixS[idx - vBars = Parameters[1].AsInt;
1]; stBarsL = Parameters[2].AsInt;
stBarsS = Parameters[3].AsInt;
/* SHORT */
bool _short = vix.Close[idx] <= Lowest.Series( vix.Close, 3)[idx] /* obtain the external symbols data */
&& vixUp[idx] < vixUpMax && vixDn[idx] < -20 && vix.Close[idx] > 15 && vix = GetHistory( bars, "^VIX");
stSpyS[idx] > stVixS[idx] && stSpyS[idx] > stSpyS[idx - 1]; spy = GetHistory( bars, "SPY");
bool cover = vixUp[idx] > vixUpMax && stVixS[idx] > stVixS[idx
-1] && RC[idx] > 0.8; /* Stochastic */
stochVs = StochK.Series(vix, stBarsS);
if (GetPositions().Where(p => p.IsOpen == true).Count() == 0) stVixS = SMA.Series(stochVs, 3);
{ stochSs = StochK.Series(spy, stBarsS);
if (buy) stSpyS = SMA.Series(stochSs, 3);
PlaceTrade( bars, TransactionType.Buy, OrderType.
Market); stochVl = StochK.Series(vix, stBarsL);
else stVixL = SMA.Series(stochVl, 3);
if (_short) stochSl = StochK.Series(spy, stBarsL);
PlaceTrade( bars, TransactionType.Short, OrderType. stSpyL = SMA.Series(stochSl, 3);
Market);
} /* VIX */
else vixDn = ((vix.Close / Highest.Series(vix.Close, vBars) >> 1) - 1) *
{ 100;
if( (sell && LastOpenPosition.PositionType == PositionType. vixUp = ((vix.High / Lowest.Series(vix.Low, vBars) >> 1) - 1) * 100;

August 2022 • Technical Analysis of Stocks & Commodities • 53


/* Correlation Trend */
int RCBARS = vBars - 1;
RC = CorrelationTrend.Series(vix.Close, RCBARS);

PlotBarHistoryStyle( vix, "^vix", "VIX");

PlotTimeSeriesLine( stochVs, "stochVs", "vix", WLColor.


Red);
PlotTimeSeriesLine( stochVl, "stochVl", "vix", WLColor.
Blue);
PlotTimeSeriesLine( stochSs, "stochSs", "spy", WLColor.
Red);
PlotTimeSeriesLine( stochSl, "stochSl", "spy", WLColor.
Blue);
}

public override void Execute( BarHistory bars, int idx)


{
if (idx > 0)
{
/* SHORT */
bool _short = stVixL[idx] > stSpyL[idx] && stVixS[idx]
> stVixS[idx-1] && stVixS[idx] > stSpyS[idx] && vixUp[idx] >
vixUpMax && RC[idx] > 0.8 && RC[idx] > RC[idx -1];
bool cover = stSpyS[idx] > stVixS[idx] || stVixS[idx] <
stVixS[idx - 1]; FIGURE 3: NINJATRADER. The DailyVolatilityETFLong strategy is shown applied to a daily
VIXY chart from January 2015 to June 2016.
/* LONG */
bool buy = vix.Close[idx] <= Lowest.Series( vix.Close,
3)[idx] && vixUp[idx] < vixUpMax && vixDn[idx] < -20 && vix. NinjaTrader 7: www.ninjatrader.com/SC/August2022SCNT7.zip
Close[idx] > 15 && stSpyS[idx] > stVixS[idx] && stSpyS[idx] > stSpyS[idx -
1];
bool sell = vixUp[idx] > vixUpMax && stVixS[idx] > stVixS[idx - Once the file is downloaded, you can import it into Nin-
1] && RC[idx] > 0.8; jaTader 8 from within the control center by selecting Tools

if (GetPositions().Where(p => p.IsOpen == true).Count() == 0) → Import → NinjaScript Add-On and then selecting the
{ downloaded file for NinjaTrader 8. To import into Ninja-
if (buy)
PlaceTrade( bars, TransactionType.Buy, OrderType. Trader 7, from within the control center window, select the
Market); menu File → Utilities → Import NinjaScript and select the
else
if (_short) downloaded file.
PlaceTrade( bars, TransactionType.Short, OrderType. You can review the strategy’s source code in NinjaTrader
Market);
} 8 by selecting the menu New → NinjaScript Editor → Strat-
else egies from within the control center window and selecting
{
if( (sell && LastOpenPosition.PositionType == PositionType. the DailyVolatilityETFLong or DailyVolatilityETFShort file.
Long) || (cover && LastOpenPosition.PositionType == PositionType.Short) You can review the strategy’s source code in NinjaTrader 7
)
ClosePosition( LastPosition, OrderType.Market); by selecting the menu Tools → Edit NinjaScript → Strat-
egy from within the control center window and selecting the
}
} DailyVolatilityETFLong or DailyVolatilityETFShort file.
} A NinjaTrader chart displaying an example of the long
BarHistory vix, spy; strategy is shown in Figure 3.
TimeSeries vixDn, vixUp, stochVs, stVixS, stochSs, stSpyS, stochVl, NinjaScript uses compiled DLLs that run native, not in-
stVixL, stochSl, stSpyL, RC, RC1;
int vBars = 6, vixUpMax = 25, stBarsS = 10, stBarsL = 25; terpreted, to provide you with the highest performance pos-
} sible.
}
—Brandon Haulk
—Gene Geren (Eugene) NinjaTrader, LLC
Wealth-Lab team www.ninjatrader.com
www.wealth-lab.com

F NEUROSHELL TRADER: AUGUST 2022


TRADERS’ TIPS CODE
The VIX ETF trading systems presented in Markos
F NINJATRADER: AUGUST 2022 TRADERS’ TIPS CODE Katsanos’ article in this issue, “Trading The Fear Index,” can
The DailyVolatilityETF strategies, as detailed in Markos be easily implemented in NeuroShell Trader by combining a
Katsanos’ article in this issue, “Trading The Fear Index,” are few of NeuroShell Trader’s 800+ indicators into two trading
available for download at the following links for NinjaTrader systems. To implement the VIX ETF trading system, select
8 and for NinjaTrader 7: “New strategy…” from the insert menu and use NeuroShell’s
NinjaTrader 8: www.ninjatrader.com/SC/August2022SCNT8.zip
trading strategy wizard to create the following strategy:

54 • August 2022 • Technical Analysis of Stocks & Commodities


BUY LONG CONDITIONS: [All of which must be true] COVER SHORT CONDITIONS: [1 of which must be true]
A>B(Avg(Stoch%K(High,Low,Close,25),3),Avg(Stoch%K(SPY High, A>B(Avg(Stoch%K(SPY High, SPY Low, SPY Close,10),3),Avg(Stoch%
SPY Low, SPY Close,25),3)) K(High,Low,Close,10),3))
A>B(Avg(Stoch%K(High,Low,Close,10),3),Avg(Stoch%K(SPY High, A<B(Momentum(Avg(Stoch%K(High,Low,Close,10),3),1),0)
SPY Low, SPY Close,10),3))
A>B(Momentum(Avg(Stoch%K(High,Low,Close,10),3),1),0)
A>B(Mul2(Sub(Divide(Close,Lag(PriceLow(Low,6),1)),1),100),50)
Users of NeuroShell Trader can go to the Stocks & Com-
A>B(LinTimeReg r(Close,5),0.8) modities section of the NeuroShell Trader free technical
A>B(Momentum(LinTimeReg r(Close,5),1),0)
support website to download a sample chart with the two
SELL LONG CONDITIONS: [1 of which must be true] VIX trading systems.
A>B(Avg(Stoch%K(SPY High, SPY Low, SPY Close,10),3),Avg(Stoch% —Ward Systems Group, Inc.
K(High,Low,Close,10),3))
A<B(Momentum(Avg(Stoch%K(High,Low,Close,10),3),1),0) sales@wardsystems.com
www.neuroshell.com
SELL SHORT CONDITIONS: [All of which must be true]
A<=B(Close,PriceLow(Low,3))
A<B(Mul2(Sub(Divide(Close,Lag(PriceLow(Low,6),1)),1),100),50)
A<B(Mul2(Sub(Divide(Close,Lag(PriceHigh(High,6),1)),1),100),-20)
A>B(Close,15)
A>B(Avg(Stoch%K(SPY High, SPY Low, SPY Close,10),3),Avg(Stoch%
K(High,Low,Close,10),3))
A>B(Momentum(Avg(Stoch%K(SPY High, SPY Low, SPY
F TRADINGVIEW: AUGUST 2022 TRADERS’ TIPS CODE
Close,10),3),1),0) Here is Pine Script code for the TradingView platform that
COVER SHORT CONDITIONS: [All of which must be true]
implements the trading strategies described in Markos Kat-
A>B(Mul2(Sub(Divide(Close,Lag(PriceLow(Low,6),1)),1),100),50) sanos’s article in this issue, “Trading The Fear Index.”
A>B(Momentum(Avg(Stoch%K(High,Low,Close,10),3),1),0)
A>B(LinTimeReg r(Close,5),0.8) // TASC Issue: August 2022 - Vol. 40, Issue 9
// Article: Trading The Fear Index
To implement the short VIX trading system, select “New // There Is Nothing To Fear But Fear Itself
// Article By: Markos Katsanos
strategy…” from the insert menu and use NeuroShell’s // Language: TradingView's Pine Script v5
trading strategy wizard to create the following strategy: // Provided By: PineCoders, for tradingview.com

// @version=5
BUY LONG CONDITIONS: [All of which must be true]
strategy('TASC 2022.08 Trading The Fear Index', 'TTFI', false,
A<B(Mul2(Sub(Divide(Close,Lag(PriceHigh(High,6),1)),1),100),-20)
                 default_qty_type= strategy.percent_of_equity,
A>B(Close,15)
                 commission_type= strategy.commission.percent,
A<=B(Close,PriceLow(Low,3))
                 currency=currency.USD, initial_capital=10000,
A>B(Avg(Stoch%K(SPY High, SPY Low, SPY Close,10),3),Avg(Stoch%
                 default_qty_value=100, commission_value=0.01)
K(High,Low,Close,10),3))
chl() =>
A<B(Mul2(Sub(Divide(Close,Lag(PriceLow(Low,6),1)),1),100),50)
    [close, high, low]
SELL LONG CONDITIONS: [All of which must be true]
isntVixETF() =>
A>B(Mul2(Sub(Divide(Close,Lag(PriceLow(Low,6),1)),1),100),50)
    var VIX_ETFs = array.from('VXX', 'VIXY', 'UVXY',
A>B(Momentum(Avg(Stoch%K(High,Low,Close,10),3),1),0)
                      'VIXM', 'VXZ', 'SVOL', 'SVXY')
A>B(LinTimeReg r(Close,5),0.8)
    var notVETF = not array.includes(VIX_ETFs, syminfo.ticker)
    notVETF
SELL SHORT CONDITIONS: [All of which must be true]
A>B(Avg(Stoch%K(High,Low,Close,25),3),Avg(Stoch%K(SPY High,
if isntVixETF()
SPY Low, SPY Close,25),3))
    runtime.error('ERR: This is only intended for VIX ETFs '+
A>B(Momentum(Avg(Stoch%K(High,Low,Close,10),3),1),0)
     '(tickers: VXX, VIXY, UVXY, VIXM, VXZ, SVOL, and SVXY)')
A>B(Avg(Stoch%K(High,Low,Close,10),3),Avg(Stoch%K(SPY High,
SPY Low, SPY Close,10),3))
var SC = 'Strategy Configurations'
A>B(Mul2(Sub(Divide(Close,Lag(PriceLow(Low,6),1)),1),100),50)
directiv = input.string( 'Long/Short', 'Direction(s) Allowed',
A>B(LinTimeReg r(Close,5),0.8)
  options=['Long Only', 'Long/Short', 'Short Only'], group=SC)
A>B(Momentum(LinTimeReg r(Close,5),1),0)
strtTime = input.time(timestamp('2020-01-01'), 'Start Time:',
                                     inline='sTime', group=SC)
startON = input(true, '', 'Start time of observation window.'
+' The checkbox enables/disables the Start Time','sTime', SC)
endTime = input.time(timestamp('2022-01-01'), '   End Time:',
                                     inline='eTime', group=SC)
lapseON = input(true, '', 'Lapse Time of observation window.'
  +' The checkbox enables/disables the End Time', 'eTime', SC)

showAlgo = input.string('STVIXS/STVIXL', 'Display Indicators',


  options= ['STVIXS/STVIXL', 'STSPYS/STSPYL', 'STVIXL/
STSPYL',
                 'STVIXS/STSPYS', 'VIXUP/VIXDN', 'RC', 'VIX'])

var SIA = 'Stochastic Indicator Adjustments'


STBARSS = input.int(10, 'Fast Period', 10, 15, 5, group=SIA)
STBARSL = input.int(25, 'Slow Period', 25, 30, 5, group=SIA)

var VIA = 'Adjustments for VIX Indicators'


vixIndex = input.string('CBOE:VIX', 'Select Volatility Index',
                   options=['CBOE:VIX', 'TVC:VIX'], group=VIA)
VBARS = input.int( 6, 'VIX Period', 5, 10, 1, group=VIA)
VIXUPMAX = input.int(50, 'VIX Threshold',40, 60, 1, group=VIA)

var TP = 'Table Preferences'


showTable = input.bool(true, 'Display Data Table', group=TP)
FIGURE 4: NEUROSHELL TRADER. This shows the VIX trading systems in NeuroShell Trader.

August 2022 • Technical Analysis of Stocks & Commodities • 55


tableRegion = input.string( position.middle_center, group=TP,
      tooltip='Optimize Your View', title='Table Positioning',
       options=[ position.bottom_left, position.bottom_center,
                 position.middle_left, position.middle_center,
                 position.top_left, position.top_center ])

var TFP = timeframe.period


[VIX, VIXH, VIXL] = request.security(vixIndex, TFP, chl())
[SPY, SPYH, SPYL] = request.security( 'SPY', TFP, chl())

STVIXS = ta.sma(ta.stoch(VIX, VIXH, VIXL, STBARSS), 3)


STSPYS = ta.sma(ta.stoch(SPY, SPYH, SPYL, STBARSS), 3)
STVIXL = ta.sma(ta.stoch(VIX, VIXH, VIXL, STBARSL), 3)
STSPYL = ta.sma(ta.stoch(SPY, SPYH, SPYL, STBARSL), 3)
VIXUP = (VIXH / ta.lowest(VIXL, VBARS)[1] - 1.0) * 100.0
VIXDN = ( VIX / ta.highest( VIX, VBARS)[1] - 1.0) * 100.0
RC = ta.correlation(VIX, bar_index, VBARS-1)

plot(showAlgo=='STVIXS/STVIXL' ? STVIXS : na, '', #FF0000)


plot(showAlgo=='STVIXS/STVIXL' ? STVIXL : na, '', #0080FF)
plot(showAlgo=='STSPYS/STSPYL' ? STSPYS : na, '', #550000,
2) FIGURE 5: TRADINGVIEW. This shows sample trading signals for Markos Katsanos’ VIX trading
plot(showAlgo=='STSPYS/STSPYL' ? STSPYL : na, '', #003060,
2)
system in TradingView.

plot(showAlgo=='STVIXS/STSPYS' ? STVIXS : na, '', #FF0000)


           'VIXDN%:', 'BUY:', 'SELL:','SHORT:', 'COVER:')
plot(showAlgo=='STVIXS/STSPYS' ? STSPYS : na, '', #550000, 2)
var tDT = table.new(tableRegion, 2, 19, #000000DD, #4499FF, 1)
plot(showAlgo=='STVIXL/STSPYL' ? STVIXL : na, '', #0080FF)
if showTable and bar_index >= last_bar_index - 1
plot(showAlgo=='STVIXL/STSPYL' ? STSPYL : na, '', #003060, 2)
    var TICKER_ID = syminfo.prefix + ':' + syminfo.ticker
    var color odd = #FFFFFF0b
plot( showAlgo=='VIXUP/VIXDN' ? VIXUP : na, '', #FF8000)
    string[] aValues = array.from(TICKER_ID,
plot( showAlgo=='VIXUP/VIXDN' ? VIXDN : na, '', #550055, 2)
     str.tostring(bar_index), str.tostring(high ),
hline(showAlgo=='VIXUP/VIXDN' ? VIXUPMAX : na, '', #804000)
     str.tostring(close), str.tostring( open),
hline(showAlgo=='VIXUP/VIXDN' ? -20 : na, '', #550055)
     str.tostring( low ), str.tostring( VIX ),
     str.tostring( VIXH), str.tostring(STVIXS, '.00'),
plot( showAlgo=='RC' ? RC : na, '', #FF40FF)
     str.tostring(STSPYS, '.00'), str.tostring(STVIXL, '.00'),
hline(showAlgo=='RC' ? 0.8 : na)
     str.tostring(STSPYL, '.00'), str.tostring( RC, '.00'),
plot( showAlgo=='VIX' ? VIX : na, '', #FFCC00, 2)
     str.tostring( VIXUP, '.00'), str.tostring( VIXDN, '.00'),
hline(showAlgo=='VIX' ? 15 : na)
     str.tostring( BUY ), str.tostring( SELL),
     str.tostring(SHORT), str.tostring(COVER))
BUY = VIXUP > VIXUPMAX and STVIXL > STSPYL and
    for _i=0 to array.size(aLabels)-1
     STVIXS > STVIXS[1] and STVIXS > STSPYS and
        table.cell( tDT, 0, _i, array.get( aLabels, _i), 0, 0,
  bar_index > STBARSL + 3 and RC > RC[1] and RC > 0.8
         #4499FF, text.align_right, bgcolor=_i % 2 ? na : odd)
SELL = STVIXS < STVIXS[1] or STSPYS > STVIXS
        table.cell( tDT, 1, _i, array.get( aValues, _i), 0, 0,
COVER = STVIXS > STVIXS[1] and VIXUP > VIXUPMAX and RC > 0.8
         #FFFFFF, text.align_center,bgcolor=_i % 2 ? na : odd)
SHORT = STSPYS > STSPYS[1] and VIXUP < VIXUPMAX and
     bar_index > STBARSS + 3 and STSPYS > STVIXS and
   VIX > 15 and VIXDN < -20 and VIX <= ta.lowest(VIX, 3) The code is available on TradingView in the PineCoder-
if syminfo.ticker == 'SVXY'
    temp = SHORT, SHORT := BUY, BUY := temp
sTASC account: https://www.tradingview.com/u/PineCod-
    temp := COVER, COVER := SELL, SELL := temp ers​TASC/#published-scripts
strategyMode = switch directiv
An example chart is shown in Figure 5.
    'Long/Short' => strategy.direction.all —PineCoders, for TradingView
    'Short Only' => strategy.direction.short www.TradingView.com
    => strategy.direction.long
strategy.risk.allow_entry_in(strategyMode)

withinStrategyObservationWindow = if startON F AIQ: AUGUST 2022 TRADERS’ TIPS CODE


    time>=strtTime and (lapseON ? time<=endTime : true)
else The importable AIQ EDS file based on Markos
    lapseON ? time<=endTime : true Katsanos’ article in this issue, “Trading The Fear
if withinStrategyObservationWindow and strategy.equity > 0.0 Index” and the “CUM1.csv” file can be obtained on request
    if strategy.opentrades == 0 via email to info@TradersEdgeSystems.com. Code for the
        if BUY
            strategy.entry('LONG\nENTRY', strategy.long) author’s system is set up in the AIQ code file.
        else if SHORT Figure 6 shows the CUM1.csv file that must be created
            strategy.entry('SHORT\nENTRY', strategy.short)
    else in Excel and then imported using the DTU utility to a new
        if not (directiv == 'Long Only') index ticker called “CUM1.” The file increments one unit,
            if strategy.position_size > 0.0 and SHORT
                strategy.entry('SHORT', strategy.short) like an index, for each trading day starting on 10/1/2003 and
            else if strategy.position_size < 0.0 and COVER continues to the current date. This file would have to be up-
                strategy.entry('COVER', strategy.long)
        else if SELL dated manually via the data manager function.
            strategy.close('ENTRY', comment='EXIT') Figure 7 shows a summary EDS backtest of the system
else if strategy.opentrades > 0
strategy.close_all(comment='Strategy\nWindow\nElapsed') using the VXX and VXZ from 6/21/2018 to 6/21/2022.
var string[] aLabels = array.from( 'Ticker ID:', 'Bar Index:', ! VIX ETF SYSTEM
' High:', 'Close:', 'Open:', 'Low:', 'VIX:', 'VIXH:', ! This should be applied only to long VIX ETF.
'STVIXS:','STSPYS:', 'STVIXL:', 'STSPYL:', 'RC:', 'VIXUP%:',
Continued on page 62
56 • August 2022 • 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
Interactive Brokers 3 MetaStock 64
Analysis of Stocks & Commodities
ibkr.com/sc-trader MetaStock.com/whats-new
magazine and its online publications:
Ninjatrader 5 Ninjatrader 5 Toll-free 800 832-4642
ninjatrader.com ninjatrader.com (800-Technical) or:
TD Ameritrade 13
206 938-0570.
Websites
tdameritrade.com/tradefutures
Stocks & Commodities 2, 58, 63 Email us at:
Store.Traders.com, Traders.com circ@traders.com.
Publications
Stocks & Commodities 2, 58, 63
Or write to us at:
Store.Traders.com, Traders.com
4757 California Ave. SW,
Seattle, WA 98116-4499.
Do your magazines arrive tattered
and torn? Polybagging of magazines
(domestic delivery) is available for
Editorial Resource Index
$6/year.
Single back issues from the current
StockCharts.com. . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 NinjaTrader.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
year (subject to availability) are $8
AmiBroker.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 NeuroShell Trader (Ward Systems Group). . 54 prepaid. Subscribers have access to
Microsoft Excel.. . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Aiq.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 our digital archive of all past articles.
Individual articles can be purchased
www.CapitolTrades.com.. . . . . . . . . . . . . . . . 32 from the Online Store at our website,
TradingView.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 Traders.com.

MetaStock. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 Editorial feedback


We always want to know more about
eSignal.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 the needs of our readers: What kinds of
OptionsAnalysis.com. . . . . . . . . . . . . . . . . . . . 46 articles would you like to see more of?
What do you find useful? Address your
TradeStation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 written questions and comments to edi-
Wealth-Lab.com. . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 tor@traders.com or to: Editor, Stocks
& Commodities, 4757 California Ave
SW, Seattle, WA 98116-4499. Sorry, we
cannot perform research on individual
financial questions not related to this
For more information about our advertisers, go to Traders.com/reader where magazine and we cannot respond to
you will find the alphabetized list of this month’s advertisers. For reference, the all mail. Letters or emails containing
list is also printed above along with the corresponding page number for each ad. questions or information that other
Just follow the simple directions below and the advertisers will get your requests readers may enjoy or that relate to
the same day! our articles or technical analysis top-
ics may be published in our Letters to
Step 1: Go to Traders.com/reader and S&C column.
scroll through the list of our current month’s Join us on Facebook
advertisers.Click the box for each adver- at www.facebook.com/
tiser you’d like to hear from. At the bottom STOCKSandCOMMODITIES
of the list, click Continue when finished.
Follow us on Twitter
Step 2: Fill out your contact information @STOCKSandCOMM
and click Send Request. Your request will
then be sent to the advertisers you selected.
To receive information on the products and services listed in the Editorial
and Advertisers’ Indexes, go to: Traders.com/reader/ These indexes are
And that’s it! published solely as a convenience. While every effort is made to maintain
accuracy, last-minute changes may result in omissions or errors.

August 2022 • Technical Analysis of Stocks & Commodities • 57


S&C Digital Edition
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 to 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. Every subscription includes:

Digital Edition — the complete magazine as PDF, Complete Digital Archive — from 1982 through
available to read in your browser or download to to the present. More than 17,000 pages of articles,
your device for offline viewing. You will still receive product reviews, charts, spreadsheets, and code.
the printed magazine unless you opt for a digital-
only subscription. Working Money — insight on how to minimize
your losses and maximize your profits while invest-
ing for maximum growth.

Traders.com Advantage — whether you need to


learn how an indicator works or just want to know
what a trader is looking at now, this is your source
of real-time information.

Article Code — download or copy & paste code


presented in past issues of Stocks & Commodities
— including Traders’ Tips code.

Optimized Trading — starting points when trying


to decide what values to input into your charting
software. Search for a certain symbol or company
or build your own portfolio.

Visit www.Traders.com to find out more!


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

PitBase.com
Yes, You Can Cash In On Chaos! Certified
Chaos Traders Courses teach you how. Build and test
Learn to earn at http://moneytide.com?r=s systems without
EMini MoonTide Hotline up 244 months in a row
http://daytradingforecasts.com?r=s
coding!
Discount futures & options trading
www.NeuroShell.com

TO ADVERTISE CONTACT:
Ed Schramm
ESchramm@traders.com • (206) 938 0570
TRADERS'
RESOURCE

TOP 10 VIEWED CONSULTANTS FOR TRADERS LINKS


Consultants consult on just about Product Company
every conceivable worry traders
have, from tax advice to weather 1. Divergence Software, Inc. Divergence Software, Inc.
reporting. Can all this help you?
Maybe. 2. Stuart Okorofsky Stuart Okorofsky
The rules for checking out 3. Sunny Harris & Associates, Inc. Sunny Harris & Associates, Inc.
consultants are simple: Check
references, check references, 4. Adrienne Laris Toghraie Adrienne Toghraie: Trading on Target
and (did you guess?) check refer-
ences. Nothing can be more vague than a consultant’s 5. TS support MultiCharts, LLC
initial proposal, but nothing is clearer than a client’s
opinion on the success of a consultant’s engagement. 6. HedgeLender LLC HedgeLender LLC
When checking references, make sure you use some 7. ALVentures ALVentures
references not supplied by the company you are
evaluating. 8. Jan Arps’ Traders’ Toolbox Arps Trading Tools
That said and with that in mind, you must do your
homework before calling a consultant in to help you. 9. Modulus Financial Engineering Modulus Financial Engineering, Inc.
Be sure you can say in one sentence what you want
the consultant to achieve. In addition, be sure you 10. GFT Managed Forex Offerings Global Forex Trading (GFT)
know of and can contact people who truly specialize These are the 10 Consultant listings clicked on most often on the Traders’ Resource
in your area of concern, not simply someone who will website, in order of clicks received. This is not an editorial rating or ranking. For more in-
take on any problem that someone dreams up. Again, formation on specific products and services, try checking store.Traders.com for archived
references from others (and satisfied customers) are S&C product reviews.
great leads.

TRADERS’ RESOURCE AT TRADERS.COM products or services with specific attributes in this or other
Traders’ Resource is available at our website, Traders.com, categories. Services offered by the consultants in our online
where you’ll find information on other products and services Traders’ Resource listing may focus on a single specialty or
in numerous other categories, such as data services, broker- be varied and may include custom software and hardware
ages, seminars, hardware, software, and trading systems. programming; systems integration; money management;
Just click on the Traders’ Resource link. Then follow the trading psychology and coaching; specific markets; trading
Consultants category link, or use the search feature to find systems; and more.

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 im-
plied, 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.

August 2022 • Technical Analysis of Stocks & Commodities • 59


Trading Perspectives

SOME PERSPECTIVES ON THE EQUITIES WORLD


Rob Friesen is a professional trader and president & COO of Bright Trading
(www.stocktrading.com), a proprietary trading firm hosting independent
trader/members, an online trading school, and utilizing the StockOdds
database (www.mystockodds.com). This column shares his thoughts and
outlooks on trading, locating opportunity, probabilistic outcome, and
maintaining perspective throughout industry changes. He can be reached
at robfriesen@brighttrading.pro or via stocktrading.com.
Rob Friesen

REGARDLESS OF TRADING STYLE, contraction of the spread price. This Continuing with the example of
DON’T IGNORE THE MACRO expansion and contraction could be the UAA-UA spread, the differential
PICTURE caused, for example, by the differ- spread number as I write this is 0.79.
Traders come in different stripes and ences in the investors and institutions Say it’s oscillating in a range between
may follow different trading methods, that are positioning in UAA due 0.90 and 0.70; then best practices
styles, and strategies. But no matter to its benefits, and UAA pulls UA would tell you at 0.90 to short UAA
the trading style, very few traders can along albeit somewhat imperfectly. and buy UA, and when at 0.70, buy-
afford to ignore the macro forces and This is actually an efficient relation- ing UAA and shorting UA would
influences at work in the market. ship that invites computer-driven be preferred. This is the oscillation
Even with “macro-neutral” trading trading. What computers can’t do of premium versus discount of the
approaches, returns can be enhanced well, though, is adjust the weight of spread between the two instruments.
and optimized through awareness capital between the two stocks based Taking that a step further, if the spread
of the forces in the market, sector, on items and behavior that humans was near 0.85–0.90, and the market/
industry, or even stocks. This includes observe through experience. group/stocks were declining, the best
being aware of news and sentiment approach is to short UAA first and buy
that may affect companies or the Some macro issues UA if needed. If the market/group/
market itself. can have systemic stocks were rallying, and the spread
Proficient traders will utilize number was closer to 0.70–0.75, then
macro-neutral relationships to take
disruption to others it would be best practices to buy UAA
advantage of the various market so that you end up and short UA if needed.
conditions in play. with multiple macro I haven’t seen a computer able
What is a “macro-neutral” ap- influences. to crutch trade as well as a human
proach to trading? One such approach can. Computers can work the actual
is share class arbitrage. I’ll give an Let’s say there is a risk-off senti- spread, but they can’t slide in and out
example using the company Under ment in the market due to macro of spread relationships with each nu-
Armour. It offers class A (symbol forces, and say we fully expect a ance of the market. Your awareness
UAA) and class C (symbol UA) market decline. In that case, you of the engine that is driving markets,
shares. Class A has voting rights might lighten your capital on either groups, or stocks can assist you in
while class C does not. Class A has UAA or UA, or if you did not have crutch trading.
a few other bonus items as well and a position already, you could initiate This also applies to all your other
trades with greater average volume one side; if wrong, hedge, or if right, activity in the markets as well.
and at a price that’s about 9% higher let it work for you. I refer to this as So what is the engine driving the
than the class C shares. “crutch trading” because you get to do markets currently, or what is an-
Since these two stocks have 98% or something by leaning on information ticipated? And does the engine have
greater correlation, when one moves and your hedge. gas in it?
a full ATR (average true range), the One thing to note with class As food for thought, the following
other does as well. With equal dollars arbitrage pairs: Some have more are some macro forces that could be
positioned on the two stocks, you can movement and some have less, so in play. This is not a complete list of
only make money through production the quality of your spread number the types of macro influences that
that comes from the expansion and is still important. abound, but I’ll take a stab at listing
60 • August 2022 • Technical Analysis of Stocks & Commodities
Trading Perspectives
some of them. stream from Lake Powell and is im- persist and solutions are not found,
Macro forces that could affect the pacted by policies on water controls, or if there is no political will to get
sector level, industry, or individual as well as rainfall, heat, evaporation, out in front of this, then what might
companies could be: and of course usage. happen? How can you as a trader
Water from these two reservoirs think ahead, and act?
• Politics (in our government or serves 40 million people. In addition, It is always important to look back
that of other countries) agriculture uses 75% of the water at history for clues about the present
• Economic factors (includes all supplies, affecting nearly 60% of the and look forward to where and how
leading indicators, FOMC and nation’s food supply. things may change.
central banking and all they are It’s not just about water, which Wars and conflicts are another sig-
responsible for) of course is necessary for life; it’s nificant macro force to pay attention
• Regulatory actions and changes also about electricity. And there are to. Take the recent news about Lithu-
in laws of course concerns with electricity ania, which I think is quite serious.
• Environment (policies and besides being able to charge your Lithuania is a NATO country that
natural disasters or climate electric vehicle and watching Netflix. is enforcing EU sanctions on goods
changes) Electricity is important for comfort, to Russia’s Kaliningrad. Why is this
• Technology (impact, innova- safety, and industry. Consider that important? Kaliningrad is Russia’s
tion, success and failure) Lake Mead’s Hoover Dam supplies only port that is ice-free year round.
• Society and cultural changes electricity for 1.3 million people, The ban covers 40–50% of the items
(what are focused on, disruptive while Lake Powell currently supplies that are imported and exported such
and impactful) 5.8 million homes and businesses in as coal, metals, construction materi-
• Changing demographics (how seven states. als, and advanced technology. There
large the next generation is and are some workarounds, such as flying
what the metrics are) I haven’t seen a or barging items, but those are more
• Moral and ethical issues costly, time consuming, and less
computer able to crutch convenient. Lithuania also closed
Any of those can have a positive or trade as well as a its airspace to flights in and out of
negative impact or can be benign and human can. Kaliningrad. Russia has noted these
have no effect, even when they change. sanctions as a serious violation, and
Some macro issues can have systemic If electricity production gets cut tensions are rising. Of note is that Ka-
disruption to other macro forces so from these and other affected dams, liningrad houses Russia’s Baltic Fleet
that you end up with multiple macro what are the alternative green solu- and is the deployment location for
influences. For example, weather tions? Solar, wind. Can these be Moscow’s nuclear-capable missiles.
systems can affect agriculture, which ramped up? Will they be able to pro- Could all this bring Russia closer
could lead to a food crisis, which could duce enough? What about the costs? to engaging NATO? Such an action
lead to policy changes. Will the obstacles for nuclear-based might bring the Doomsday Clock
I’ll offer a scenario of how environ- power generation be cleared away? needle a bit closer to midnight.
mental factors could influence politi- And if we have no green solutions We have witnessed market sell-offs
cal and economic issues. Something readily available, are we relegated whenever concerns increase about
I have been looking at is water levels to burning fossil fuels? a possible World War III, so it’s
across the country and specifically This all has to do with macro important to keep aware and watch
two large reservoirs. Certainly there environmental, macro economic, for any signs.
are global issues with fresh water, and macro political forces, which By staying aware of macro forces
but the drought situation in the US can impact sectors, industries, and and how they may impact the market,
is becoming more significant. companies. you will be ready for any opportunity
Lake Powell, the second-largest Think of the utility companies and be ready to hedge. It’s not just
reservoir in the US, has only 32 more that rely on our infrastructure and about market movement, but also,
feet to fall before power generation that have signed 20-year contracts how these macro factors impact sec-
will no longer be online at the Glen to supply power. Think also of the tors, industries, and companies.
Canyon Dam. And Lake Mead, the businesses that rely on power and If I am using seasonality data or
largest reservoir in the US, is down- water in those areas. If these patterns statistical probability data, I want to
August 2022 • Technical Analysis of Stocks & Commodities • 61
Trading Perspectives
not only play defense, but be ready It would be great to get into more half of 2022 left, with many events
and responsive to play offense. That macro influences, but this should get yet to come. My intention with this
could mean getting into the stocks that you started. article is to encourage you to always
will benefit from forces in play. Given be reflective, anticipate, and have
that many stocks will be harmed by Summary hedges standing by, as well as to be
the same forces in play, and since it’s I have observed macro influences prepared to capture an opportunity
hard to pick the one right stock, using increasing in intensity and frequency as it presents itself.
a basket approach can be ideal. since September 2021. We have

!VIX
VIXDN is (VIXC/valresult(highresult(VIXC,VBA
RS),1)-1)*100.
VIXUP is (VIXH/valresult(lowresult(VIXL,VBA
RS),1)-1)*100.

! CORRELATION TREND
PeriodToTest is VBARS-1.
!****CUM1 is a custom ticker from DTU
import of a CSV file***************
!*************CUM1 file is required for this
system to work******************
! PEARSON CORRELATION
ValIndex is TickerUDF("VIX", [close]).
ValTkr is TickerUDF("CUM1", [close]).
SumXSquared is Sum(Power(ValIndex,2),
PeriodToTest).
SumX is Sum(ValIndex, PeriodToTest).
SumYSquared is Sum(Power(ValTkr,2),
PeriodToTest).
SumY is Sum(ValTkr, PeriodToTest).
SumXY is Sum(ValTkr*ValIndex, Period-
FIGURE 6: AIQ SYSTEMS. This shows the por- FIGURE 7: AIQ SYSTEMS. This shows a summary EDS back- ToTest).
SP is SumXY - ( (SumX * SumY) / Period-
tion of the CUM1.csv file that must be created test of the system using the VXX and VXZ from 6/21/2018 to ToTest ).
in Excel. 6/21/2022. SSx is SumXSquared - ( (SumX * SumX) /
PeriodToTest ).
TRADERS’ TIPS SSy is SumYSquared - ( (SumY * SumY) / PeriodToTest ).
RC is SP/SQRT(SSx*SSy).
Continued from page 56
!LONG
! VIX ETF DAILY LONG-SHORT TRADING SYSTEM BR1 if HasDataFor(STBARSL+10)>STBARSL+3.
! COPYRIGHT MARKOS KATSANOS 2022 BR2 if STVIXL>STSPYL .
! To be applied on a daily chart of long VIX ETFs: BR3 if STVIXS>STSPYS.
! VXX,VIXY,UVXY,VIXM,VXZ,SVOL BR4 if STVIXS>valresult(STVIXS,1).
BR5 if VIXUP>VIXUPMAX.
! INPUTS: BR6 if RC>0.8.
C is [close]. BR7 if RC>valresult(RC,1).
H is [high]. BUY if BR1 and BR2 and BR3 and BR4 and BR5 and BR6 and BR7.
L is [low].
VIXUPMAX is 50. ! VIX UP% MAX SR1 is STSPYS>STVIXS.
VBARS is 6. ! Number of bars to calculate VIXUP,VIXDN & RC SR2 is STVIXS<valresult(STVIXS,1).
STBARSL is 25. ! Number of bars to calculate slow stochastic SELL if SR1 or SR2.
STBARSS is 10. ! Number of bars to calculate fast stochastic
!SHORT
! COMPARISON INDEX SS1 if HasDataFor(STBARSS+10)>STBARSS+3.
VIXC is TickerUDF("VIX",C). SS2 if VIXC<= lowresult(VIXC,3).
VIXH is TickerUDF("VIX",H). SS3 if VIXUP<VIXUPMAX.
VIXL is TickerUDF("VIX",L). SS4 if VIXDN<-20.
SPYC is TickerUDF("SPY",C). SS5 if VIXC>15.
SPYH is TickerUDF("SPY",H). SS6 if STSPYS>STVIXS.
SPYL is TickerUDF("SPY",L). SS7 if STSPYS>valresult(STSPYS,1).
SHORT if SS1 and SS2 and SS3 and SS4 and SS5 and SS6 and SS7.
! STOCHASTIC
STOCHVS is (VIXC-lowresult(VIXL,STBARSS))/(highresult(VIXH, CR1 if VIXUP>VIXUPMAX.
STBARSS)-lowresult(VIXL, STBARSS)+0.0001)*100. CR2 if STVIXS>valresult(STVIXS,1).
STVIXS is simpleavg(STOCHVS,3). CR3 if RC>0.8.
STOCHSS is (SPYC-lowresult(SPYL,STBARSS))/ COVER if CR1 and CR2 and CR3.
(highresult(SPYH,STBARSS)-lowresult(SPYL,STBARSS)+0.0001)*100.
STSPYS is simpleavg(STOCHSS,3). TEST if 1=1.
STOCHVL is (VIXC-lowresult(VIXL,STBARSL))/
(highresult(VIXH,STBARSL)-lowresult(VIXL,STBARSL)+0.0001)*100. —Richard Denning
STVIXL is simpleavg(STOCHVL,3). info@TradersEdgeSystems.com
STOCHSL is (SPYC-lowresult(SPYL,STBARSL))/
(highresult(SPYH,STBARSL)-lowresult(SPYL,STBARSL)+0.0001)*100. for AIQ Systems
STSPYL is simpleavg(STOCHSL,3).

62 • August 2022 • Technical Analysis of Stocks & Commodities


The TraderS’ MagaZINe SINCe 1982 www.traders.com JuNe 2019

THE TRADERS’ MAGAZINE SINCE 1982 www.traders.com SP BONUS ISSUE 2019 the tRaDeRs’ MagaZine since 1982 www.traders.com May 2019
EC
IAL
The Traders’ MagaZine sinCe 1982 www.traders.com MarCh 2019 TR The Traders’ MaGaZine sinCe 1982 www.traders.com aPril 2019
AD
ER
S’
ISS
UE

Model The MarkeT


The 21sT-CenTury WITh a FourIer The BesT CharT
Covered Call SerIeS INdICaTor Backtesting a PaTTern enTry
How to kill two birds Capture cyclic activity 8
Mean-ReveRsion Better entry timing? 6
with one option 8 stRategy in Python
Here’s a step-by-step guide 8 adaPTive eMa
does hisTory eleCTIoN eFFeCTS oN An indicator to help know
repeaT iTself? The SToCk MarkeT DouBle BottoM when a trend is a trend 10
Looking for time-based And how you can play it 18 PatteRn: selling
patterns for a trading edge 12 inerTia & MoMenTuM
The V-Trade eaRlieR? in The MarkeT
Trading Different exit scenarios 16 A different perspective 16
Part 11: Expert
The fakeouT manual trading 26
Keep an eye on these a visual inDicatoR a reliaBle seT
winning patterns 18 Instant, multi-timeframe of TeChniCal
INTerVIeW trend detection 22 indiCaTors
inTerview Talking volatility with Try this simple set 22
Claudio Demb and John Bollinger 36 inteRvieW
the psychology of trading 34 inTervieW
Creating trading strategies
Breakaway gaps
TradINg MISTakeS with David Pieper 30 Linda Bradford Raschke 30

Testing them for reliability To aVoId The v-Trade


and profitability 38 Be mindful of these 44
the v-tRaDe
Part 10b: Expert Part 10: Trading with
trading system 36 leverage 38
reVIeW
n The 3S Code
MARCH 2019 APRIL 2019
BONUS ISSUE 2019
DISPLAY UNTIL 10/31/2019 MAY 2019

JUNE 2019
Also in this issue: ■ A Challenging Year
■ What’s Controlling The Market? ■ The US Long Wave Revisited
■ The Kondratieff Wave Revisited ■ Forecasting A Market Recovery

subscribe or renew today!


Every Stocks & Commodities subscription (regular and digital) includes:
• Full access to our Digital Edition
The complete magazine as a PDF you can download.
• Full access to our Digital Archives
8999
1 year.................
$
Every article from 1982 onward!

2 years............ 149
• Complete access to WorkingMoney.com
$ 99
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.

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
Method, all for a price that saves you $150 off the year-by-year price!
5 years..........
$
29999
*Shipping & handling charges apply for foreign orders. That’s around $5 a month!

Visit Traders.com to find out more!


Email: Circ@Traders.com • Phone: 206-938-0570 facebook.com/STOCKSandCOMMODITIES @STOCKSandCOMM
37 Years in the Making

metastock.com/whats-new

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.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy