The Average Investor's Blog

A software developer view on the markets

Peeking Ahead at an EMA

Posted by The Average Investor on Oct 17, 2010

When using a daily average, the maximum loss one can incur, is the maximum the market can lose on any single day. However unlikely this is, one should keep in mind that the biggest single day loss in Dow history is about 27%! Even 27% is significant, but consider for a moment you used double or triple leveraged ETFs – one would have been wiped in a single day!

Where I am getting is that stop losses are a must. The need of them is even more obvious when one is trading using longer term periods, for example, weekly or monthly.

Let’s assume we are using a 10-month EMA. One way to compute a stop loss, is to predict the end month value whether we would have sold, then (optionally) add a penetration cushion before this predicted price. Once the daily price goes below cushioned price, we sell.

How do we predict the ending month value? It requires a little bit of math, but in general it’s as simple as solving an equation with a single unknown.

Computing the Closing Price that Would Trigger a Sell

In other words, a sell signal at the end of the current month will be triggered if the closing price for the current month is below the EMA computed at the end of the previous month.

As an example, at the end of September (the last full month at the time of this post, today is October 17th), the closing price was $1141.20 and the EMA was $1089.64. Thus, there will be a sell signal at the end of October if the closing price for October is below $1089.64. If we want to add some cushion, we can subtract another 1% from $1089.64 and arrive at a sell stop of $1078.74.

Similar tactics can be used to get into the market ahead of the period end – if the intra-period price penetrates and stays above the end period price.


5 Responses to “Peeking Ahead at an EMA”

  1. […] the current 20-week EMA for the Nasdaq 100 is at 8.54% above it’s EMA, which, according to another recent post of mine, means that the index needs to shed more than 8.54% in a week in order to trigger a sell signal at […]

  2. […] On Wednesday VNQ reached lows that if held would have triggered a sell at the end of the week (a previous post shows how to pre-compute the exit points). In fact, if stop losses would have been used, two of the […]

  3. […] computing the actions for all possible scenarios. Sometimes that’s easy. For example in this earlier article I have shown how to pre-compute the EMA which would trigger a change in the position. Although it […]

  4. […] The bigger problem was that quite often the computations were not stable enough. In the above example there was a single switch between the long and the short position (at -0.95%). Thus, at 15:55, if the instrument is away from this point, one can take the position with confidence that it won’t cross the line in the last second. Of course, it’s not going to be perfectly on the close, but on average, you shouldn’t expect high negative impact from this type of slippage. Same holds if one is trading moving averages – there is a single prices that separates the long and short position and it can be even determined mathematically. […]

  5. […] close above its 10-month EMA, the S&P 500 needs to close above $1,267.79 (for more details see this previous post), which is more than 9% above today’s close. The trigger point is even higher using the […]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: