LucF

Volatility System by Wilder [LucF]

The Volatility System was created by J. Welles Wilder, Jr. It first appeared in his seminal masterpiece, "New Concepts in Technical Trading Systems" (1978). He describes the system on pp .23-26, in the chapter discussing the first presentation ever of the "Volatility Index", built using a novel way of calculating a value representing volatility that he named Average True Range (ATR). The latter stuck.

The system is a pure reversal system (it is always either long or short). One of its characteristics is that its stop strategy moves up and down during a trade, widening the gap from price when volatility (ATR) increases. Because of this, this strategy can suffer large drawdowns and is not for the faint of heart.

The strategy uses a length (n) to calculate an ATR. ATR(n) is then multiplied by a factor to calculate the Average Range Constant (ARC). The ARC is then added to the lowest close n bars back to form the high Stop and Reverse points ( SAR ), and subtracted from the highest close n bars back to calculate the low SAR . Reversals occur when price closes above the high SAR or below the low SAR .

The system is best suited to higher time frames: 12H and above. Its performance depends heavily on calibration of the length and ARC factor. Wilder proposes a length of 7 and a factor between 2.8 to 3.1. My summary tests at 12H, 1D and 3D on stocks and cryptos yield better results with values of approximately 9-10/1.8-2.5 for cryptos and 9-10/3.0-4.0 for stocks. Small changes in the values will sometimes yield large variations in results, which I don’t particularly like because it tends to imply fragility, whereas I’d expect more robustness from a system with such simple rules. Additionally, backtests at 1D on cryptos provide so little data that no solid conclusions can be drawn from them.

All in all, the system is not very useful in my opinion; I publish it more for completeness, since as far as I can tell, it did not exist on this platform before. I also publish it out of respect for Wilder’s work. His book laid the foundation for many of the building blocks used by system designers, even today. In less than a hundred pages he presented RSI , ATR, DMI, ADXR and the Parabolic SAR indicators, some of which have become built-in functions in programming languages. This is a colossal feat and has not been repeated. Wilder is a monument.

Some lesser-known facts about his book:
  • It sells for the exact same price it cost in 1978: 65$,
  • The book has always been published by Wilder himself,
  • The layout hasn’t changed in 40 years,
  • He sells >35K copies/year.
Gotta love the guy.

The strategy is shown here on BTC /USD with settings of 12/1.8 (the defaults are 9/1.8). It shows the system under its best light. Other markets will most not reproduce such results. Also, the drawdown is as scary as the results are impressive.

Features
  • The code is written as a strategy but can easily be converted to an indicator if you want to use the alerts it can produce. Instructions are in the code.
  • You can change the length and ARC factor.
  • You can choose to trade only long or short positions.
  • You can choose to display the SARs (the stops) in multiple ways.
  • You can show trigger markers.
  • A date range can be defined.
  • 3 alerts: reversals (both long and short), longs, shorts. Remember that for the moment, strategies cannot generate alerts in TradingView, so the strategy must be converted to an indicator in order to make the alerts available.
Release Notes: Tidied up the code.
Release Notes: Same.
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Want to use this script on a chart?
"The stock market is a device for transferring money from the impatient to the patient."
— Buffet

Tools and ideas for all Pine coders: http://www.pinecoders.com

Comments

I really love your work dude. Interesting, easy-to-read and new. Thank you and know that your efforts are hugely appreciated. I look forward to seeing what else you cook up
+3 Reply
Is this like the supertrend? The book is a little hard to understand but the formula, the multiplier constant, and the ATR involved in the book seems a lot like supertrend to me.
+1 Reply
LucF SparkyFlary
@SparkyFlary, The building blocks are the same because both use ATR, and so depend on an ATR period and factor, but the logic is very different. You can quickly ascertain this if you load both on your chart, using the same ATR settings on both. As I mention in the description, this logic is interesting because the stop can move against price. The Chandelier stop also does that, but its logic is also different from that of the Volatility System, which is also different from the "Volatility Stop" which I like very much, and rewrote with @midtownsk8rguy for the TradingView account:
Reply
@LucF, oh right because supertrend uses something like hl2 whereas volatility system uses something called a sic in its calculation
Reply
I'm having a problem getting this to work on lower time frames
Reply
diogopaim SparkyFlary
@SparkyFlary, read the last note of the author. "The stock market is a device for transferring money from the impatient to the patient." — Buffet.
Bad position trader doesn't make money - Bad Day-traders loose the account.
Good position trader, makes some money - Good Day-Traders loose money.
Excelent position trader, make a lot of money. - Excelent Day-Traders make some money.
Superb position trader, makes a fortune. - Superb Day-Traders, make a lot more than Superb Position Traders. But they usually protect at least 90% of their wallets in some long-short position while waiting for the breakout.
Reply