TradeStation

How Old Is this Bull Run Getting? Check MA Test Bars Since

There are many price-based techniques for anticipating the end of a move. However, the simple passage of time can also help because bull markets don’t last forever. While old age doesn’t necessarily cause investors to sell, a reversal becomes more likely the longer a trend lasts.

So, how long have prices been going up? There are various ways to measure that. Our earlier script, MA streak, offered one solution by counting the number of bars that a given moving average has been rising or falling.

Today’s script takes a different approach by counting the number of candles since price touched or crossed a given moving average. It tracks the 50-day simple moving average (SMA) by default. It can be adjusted to other types like exponential and weighted with the AvgType input.

In the chart above, Bars Since MA Test was adjusted to use the 200-day SMA. Viewing the S&P 500 with this study helps put the current market into context.

We can see that prices last touched the 200-day SMA 386 sessions ago (June 29, 2020). That’s relatively long based on history, but not unprecedented. For example, the indicator was at 407 in February 2018 as the market pulled back. It also hit 475 in October 2014 (following the breakout above 2007 highs).

Additionally, the S&P 500 is nearing the record of the 1990s bull market (393 candles on July 12, 1996).

Before that, you have to look all the way back to the 1950s, when it twice peaked at 627.

The conclusion? The current run without a test of the 200-day SMA is above average, but not yet record-setting. It may be interesting to watch as earnings season approaches and the Federal Reserve looks to tighten monetary policy.

TradeStation is a pioneer in the trading industry, providing access to stocks, options, futures and cryptocurrencies. See our Overview for more.

Important Information
TradingView is not affiliated with TradeStation Securities Inc. or its affiliates. TradeStation Securities, Inc., TradeStation Crypto, Inc., and TradeStation Technologies, Inc. are each wholly owned subsidiaries of TradeStation Group, Inc., all operating, and providing products and services, under the TradeStation brand and trademark. When applying for, or purchasing, accounts, subscriptions, products and services, it is important that you know which company you will be dealing with. Please click here for further important information explaining what this means.

This content is for informational and educational purposes only. This is not a recommendation regarding any investment or investment strategy. Any opinions expressed herein are those of the author and do not represent the views or opinions of TradeStation or any of its affiliates.

Investing involves risks. Past performance, whether actual or indicated by historical tests of strategies, is no guarantee of future performance or success. There is a possibility that you may sustain a loss equal to or greater than your entire investment regardless of which asset class you trade (equities, options, futures, or digital assets); therefore, you should not invest or risk money that you cannot afford to lose. Before trading any asset class, first read the relevant risk disclosure statements on the Important Documents page, found here: www.tradestation.com/important-information.
开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?