# Where Does the S&P 500 Stand?

Last week was brutal for pretty much all markets. Surprisingly, it was bad even for the US dollar. The sharp and straight downward move was reminiscent of the descent of 2011. It’s time to review where does the major index stands from technical point of view.

Clearly the 200-day moving average is gone. In fact, it was Thursday which closed below it. On it’s own, it doesn’t mean much – one should also take into account when the eventual entry occurs. For instance, it’s obvious from this chart that the previous two signals from this average were whipsaws, which ended up losing money compared to buy and hold.

The other moving average is the 150-day. The reason it’s plotted is because it works reasonably well (for such a simple indicator) as a long-term indicator in mean reversion strategies. In other words, long trades are considered only if the price is above, short trades only if the price is below. Based on that – we are in “short the rallies” mode right now.

Let’s take a look at some number then:

```require(quantmod)

spy = getSymbols("SPY",from="1900-01-01",auto.assign=F)

# Confirm the SMA situation first
spy.sma = runMean(Cl(spy), 200)
mm = merge(Cl(spy), spy.sma, all=F)
ind = mm[,1] >= mm[,2]
print(tail(ind,4))

# 2015-08-18      TRUE
# 2015-08-19      TRUE
# 2015-08-20     FALSE
# 2015-08-21     FALSE
# Yep, sell on the Thu's close

# Compute the returns
rets = ROC(Cl(spy),type="discrete")

# The moving average

ind = sma >= 0
print(tail(ind,4))

# 2015-08-18  TRUE
# 2015-08-19  TRUE
# 2015-08-20 FALSE
# 2015-08-21 FALSE
# Yep, sell on the Thu's close

# The standard deviation
lower.band = -0.05*stddev

ind = sma < lower.band
print(tail(ind,4))

# 2015-08-18 FALSE
# 2015-08-19 FALSE
# 2015-08-20 FALSE
# 2015-08-21 FALSE
# Nope, no signal yet from this conservative version

```

Using the 200-day moving average both on the price and on the returns yields the same result – out. Only the system introduced in this post hasn’t triggered a signal yet, but it’s quite conservative by design.

How bad can it get? My answer is very, don’t even try to contemplate it. In severe downturns, like 2008 and in 2011, it is extremely painful to sit on the winning long positions, while the market is relentlessly shaving off points. To me it’s a much better approach to sit it out. And if I feel like doing something – small (volatility adjusted), short-term positions are the way to go. Just my two cents.