PineCodersTASC

TASC 2022.04 S&P500 Hybrid Seasonal System

█ OVERVIEW

TASC's April 2022 edition of Traders' Tips includes the "Sell In May? Stock Market Seasonality" article authored by Markos Katsanos. This is the code implementing the "Hybrid ​Seasonal System" from the article.



█ CONCEPTS


In his article, Markos Katsanos takes an updated look at the "Sell in May" adage by reviewing recent historical data for ​seasonal equity market tendencies. The author explores the development of a trading strategy (a set of buy and sell rules) based on this research.

He starts from the enhanced buy & hold system featured in his July 2021 TASC article, and adds additional technical conditions. These include volatility conditions (VIX and ATR) plus the "Volume Flow Indicator" (VFI), which is a custom money flow indicator that Katsanos introduced in his June 2004 TASC article. He provides an example of a trading system that others can test for themselves and modify as they see fit. The author notes that the system could likely be improved further by adding money management conditions (such as a stop-loss), or by adding more technical conditions not considered in the ​scope of this article.



█ CALCULATIONS


The entry and exit rules that constitute the trading system are defined below. The critical values of ​VIX, ​ATR and VFI (specified below) used in the calculations were determined by optimization for a daily chart of the SPY ETF. By default, the strategy only allows long entries. However, the script offers the possibility to initiate short entries upon exiting long trades through the "Long Only" toggle in the script's inputs.


Long Entry Rules

​• Seasonal: The ​seasonal trade is initiated on the first business day October at the open.
Volatility: In case of high ​volatility, that is if the ​VIX is above 60% or the 15-day ​​ATR was above 90% over the past 25 days, the ​seasonal trade is deferred until later in the month or year, when the ​volatility subsides.


Exit/Short Entry Rules

Seasonal: The exit/short signal is triggered on the first business day of August at the open.
Volatility: The exit/short signal is triggered if ​VIX is above 120 % (i.e. 2 times the corresponding threshold parameter).
Money flow (VFI): The exit/short signal is triggered if the VFI crosses under a critical value (-20) while its 10-day moving average is pointing down.


Join TradingView!
Release Notes:
Small bug fixed.

Tools and ideas for all Pine coders: www.tradingview.com/u/PineCoders/
Pine news broadcasts: t.me/PineCodersSquawkBox or twitter.com/PineCoders
TASC: traders.com/
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.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?