Algorithmic and Mechanical Forex Strategies | OneStepRemoved

  • Articles
  • Sophisticated Web Sites
  • Automated Trading
  • Testimonials
  • Contact

Enhance your Moving Average with VIDYA

October 10, 2016 by Lior Alkalay 2 Comments

The Moving Average is, perhaps, the most popular indicator in trading for a reason. Comparatively, the crossing average can tell you plenty about a trend, i.e. whether it’s broken or unbroken, changing or holding. But the Moving Average isn’t perfect; there is one area where it falls short and that is volatility. Even an Exponential Moving Average, which places more emphasis on the latest data, can miss the mark when it comes to a sudden change in volatility, rising or falling. Consequently, it can either give a fake signal or else generate a signal only when it is too late to trade on. Volatility is where the Variable Index Dynamic Average comes in, or VIDYA for short.

The Variable Index Dynamic Average or VIDYA was developed by Tushar Chande, and its focus is precisely on volatility. In other words, the VIDYA is an average that adjusts itself to changing volatility. When volatility is high, the VIDYA becomes more sensitive and when volatility is low, the VIDYA becomes less sensitive. That allows you to assess the trend according to current market conditions (and not irrelevant conditions that had earlier prevailed).

The VIDYA in Essence

The math behind the VIDYA formula is quite complicated, but the logic is not.

The VIDYA essentially has two components, the first being the Exponential Moving Average (aka EMA). The second indicator is in the “oscillator family” and it is known as the Chande Momentum Oscillator (aka CMO). Like most oscillators, the Chande Momentum Oscillator generates a signal of -100 and 100, with -100 being oversold and 100 overbought. The EMA is the anchor index, and the CMO’s job is to adjust the exponential average to volatility. The closer the CMO is to 100 or -100 the higher the volatility and the more sensitive our exponential average will turn. Conversely, the closer the CMO is to 0 the less sensitive our exponential average will turn. The final reading after the volatility adjustment is the VIDYA.

As you can see below, once you add the Variable Index Dynamic Average in MetaTrader you get a window with two parameters from which to choose: One is the Period CMO and the other is Period EMA. We can then decide which period the CMO will run on (and thus affect the sensitivity of our EMA) and which period the EMA will run on (to capture our trend). Usually, the best CMO to plug in is a third of the value of the EMA duration; this is to allow the latest change in volatility to impact to the greatest degree. If the CMO period is too long, it will likewise spread over the period too long and consequently fail to reflect current levels of volatility, thus defeating the VIDYA’s purpose.

VIDYA

Comparing the VIDA to the EMA

When we compare the two, we can see the clear advantages the VIDYA(Red) has over the EMA(Green). Both the VIDYA and the EMA run on a 30-week period, but the VIDYA is smoothed out by the Chande Momentum Oscillator running on a 10-week period (again, a third of the whole period). The VIDYA simply captures the trend much more accurately. We can see how, in Point A, when momentum weakens, the Variable Index Dynamic Average starts to flatten, while the EMA just moves across the price and fails to adjust.

This quality is especially beneficial when we want to get an indication if a trend has broken or not. The EMA, in this case, suggests the trend has, indeed, broken but when we look at the VIDYA we quickly get a more accurate picture. We can see that the downtrend has not been broken which allows us to prepare for another bearish round rather than mistakenly expect a rebound.

VIDYA

Of course, for every upside there is a downside and the downside of the VIDYA is that it becomes less effective on a very high duration, such as above 90. The Chande Momentum Oscillator cannot reflect sentiment very well when the duration ןד high and therefore it stops being effective at balancing the Exponential Moving Average within the Variable Index Dynamic Average. One way to tackle or mitigate this is to go higher in the intervals whenever possible, such as from days to weeks or weeks to months. Nonetheless, you should be cognizant of this in inherent weakness in the Variable Index Dynamic Average. Yet, despite that, the Variable Index Dynamic Average does a very effective job. If you are trading under volatile conditions and want to figure out if a trend is broken or set to continue, the Variable Index Dynamic Average could be the solution. When combined with other indicators of momentum, the VIDYA can give you the bigger, clearer picture.

 

Filed Under: Indicators Tagged With: Chande, moving average

Trading the Alligator Indicator

August 1, 2016 by Lior Alkalay 8 Comments

The Alligator Index, as its name suggests, is highly effective at biting down on trading opportunities, or more appropriately, momentum opportunities. The Alligator Indicator is comprised of three SMMAs, or three Simple Moving Averages, that run on averages. The three SMMAs are aptly named the Jaw, the Teeth and the Lips.

The Jaw, the slowest SMMA, runs on a 13-day period.

The Teeth, in the middle, is an SMMA that runs on 8-day period

And the Lips, the most important, is a 5-day SMMA and it is the fastest.

The logic is simple and resembles the moving averages cross strategy. The strategy has three different signals.

The Alligator Mouth Open Bullish—that is when the Lips are above the Teeth and the Teeth is above the Jaw. When the three SMMAs align this way it is a signal for a bullish momentum and a buy.

 The Alligator Mouth Open Bearish—this is the exact opposite of the bullish signal, with the Lips below the Teeth and the Teeth below the Jaw.

The Alligator is Sleeping—if the price starts to move in a more horizontal manner or if the averages diverge, it is called an Alligator Sleeping, which is another way to say there’s no trend.

When to use the Alligator Indicator

The Alligator Index’ strength is in its unique quality. It is a momentum index and yet it is most effective over the long term rather than short term as may be expected with a momentum index.

Alligator Indicator

“Eating” and that is a bearish trend. Naturally, an Alligator Eating Bullish signal would be the mirror of the bearish signal with the Lips on top.

When the Alligator is Sleeping

The reason that the Alligator  Indicator Sleeping mode is somewhat more complicated is because it is more difficult to recognize and also because it could either be a signal to keep holding the position or to close it, depending upon the buildup.

Using the same chart but with a different overlay we can focus on the tools and rules that help us recognize a Sleeping Alligator.

Alligator Index

The first notable sign our Alligator Indicator has gone to “Sleep” is a wave that moves horizontally, or at least more horizontally than the preceding wave. This is clearly demonstrated by the blue arrows overlaid on the chart. When the price wave moves more horizontally and as long as the Lips are not crossing the Jaw, it is a signal to hold your position rather than close it—the trend is not over.

The second sign, which is also a warning, is if the averages start to diverge and cross one another. The Lips crossing the Jaw is not only a sign of a Sleeping Alligator but also a sign to close the position.

An important pitfall to avoid could occur after the cross; the Lips returns to cross below while the wave is still horizontal, as seen in the final wave in the chart. Because the wave is still horizontal the Alligator is still sleeping and because it was a close sign, it means we should not have reopened a position.

It is also important to look at the length of the Alligator Sleeping Phase compared to the Eating Phase that preceded it. If the Alligator Sleeping Phase is much shorter, don’t expect a trend change. Only after the Alligator is sleeping longer than the preceding Alligator Eating wave can a change in trend be the logical assumption.

Finally, another important practice that will help you avoid an Alligator pitfall is to always use an Alligator Indicator in conjunction with an MACD indicator. If the Alligator was Sleeping and suddenly turns into an Alligator Eating Bearish signal (or Bullish Signal if it is a bullish trade), and the MACD suggests weakening momentum, then the Alligator might be sending a false signal and is therefore still in a Sleeping Phase.

 

Filed Under: Trading strategy ideas Tagged With: Alligator, moving average

Optimizing Your Algo: Tips for Beginners

June 6, 2016 by Lior Alkalay Leave a Comment

You have created a trading algo. The Algo is profitable in the backtester. Before unleashing it with real money, you’ve got to first tighten the screws. That is, ensure your algo is fine-tuned so it can deliver optimal returns. There’s one major challenge ahead of you.

Firstly, your strategy is rather simple. You may go through the detailed process of building and optimizing a strategy, including curve fitting, correlation and so on. But you want a simpler process; something leaner, that will fit your modest needs.

Secondly, you may not yet have mastered the full technique of optimizing. You are still learning and want to try off with a simple process.

One technique I find especially simple in optimizing your algo is probability. The probability method, in essence, contains many components of a full optimization technique. However, it tends to rely more on common sense and logic to narrow the options and optimise the algo. That makes it a pretty good way to begin the entire concept of optimizing a strategy. Moreover, you will find it easier to digest.

The essence of the strategy—optimize by elimination.

Algo Case Study

The following Algo is a simple one. Let’s call it RSIMV which is RSI and Moving Average. Here is what RSIMV describes through conditioning:

If Open Positions = 0 then

If (MA(30)>MA(14)) and RSI=<60 then

                                                Open Buy (50,000) {It will buy 50 lots}

                                             Set Stop Loss = Price – 50{Pips}

                                                Set Limit= Price+ (50*2)

End

The strategy: If the moving average cross points on a bullish trend and the RSI is equal or below 60 it means that the rally has some length before reaching an oversold level (RSI above 80). That points to a good buying opportunity.

Looking at RSIMV, you can conclude there are four parameters to optimize: RSI and two Moving Averages

Starting with the Moving Averages, we will look at the 14 and the 30 days. Seemingly, the options are endless, with many combinations of moving averages to test. In theory, that is correct, but that is where probability comes in.

Algo

MT4

When we look at the chart, we can see that the longer the averages (orange and red) the lesser the chance that there is a combination of a low RSI and a bullish momentum.

Moreover, a combination of a low RSI and a bullish signal only occurs when the two averages, the fast and the slow, have more or less a 2 to 1 ratio (such as a 30 and 14).

Those two conclusions help us narrow the parameters we are looking for.

The highest likelihood of finding a better set of averages is with faster averages, not slower, and those that have a ratio of 2 to 1. And let’s not forget we already know that 14 and 30 works. So we shouldn’t move too far up the scale.

We will use 25 and 12 as the first combination and 20 and 10 for the second. Both are faster than the original parameters, have a roughly 2 to 1 ratio, and are close to the original settings.

  1. 25,12
  2. 20,10

Moving into the RSI parameter, narrowing the options is even simpler. We know the RSI cannot possibly be higher than 60, because then we will be left with insufficient upside before the pair turns oversold.

On the other hand, if we try an RSI below 40 it’s unlikely that it will occur while the moving average cross is bullish.

Since, as in the Moving Averages case we know the original setting worked, we know we only need a minor tweak. With no way to go but up we are left with two reliable options – RSI<55 and RSI<50.

Hence our options are:

  1. C) (55)
  2. D) (50)

As we can see from testing all the alternative parameters, what we needed was a better entry for the RSI. As we intended… minor tweaks.

Algo

Don’t Optimize Too Much

Ironic as it may sound, optimization sometimes has a downside. At times, we are tempted to over-optimize to such an extent that our newest strategy no longer resembles our original, pre-optimization plans. That can throw us into an eternal loop and waste precious time. Don’t be tempted! Don’t fall in love with the optimization process. After all, optimization is merely tightening the screws, not building the engine. If your strategy works, confine your optimization to minor tweaks. If it doesn’t, optimization won’t help and you’ll need to start from scratch.

And, finally, a practical tip; always keep records of the results of your original strategy and compare it to your current, post-optimization strategy. This way you can always make sure that you’ve really optimized your strategy.

The Bottom Line

Sure, the optimization technique isn’t perfect. But the take away here is that if you really understand your strategy, you can use logic to in order to find better settings. If you’re a beginner and lack the knowledge for advanced optimization techniques, optimizing through the logic of probability is a powerful tool to have.

 

Filed Under: Test your concepts historically Tagged With: moving average, optimization, RSI

Correction vs Change in Trend

May 3, 2016 by Lior Alkalay 4 Comments

How many times you have seen an FX pair, or any other instrument for that matter, start moving opposite to the trend? Did you wonder was it a mere correction or were you perhaps witnessing a change in trend? Your conclusion will have an acute impact on how you choose your next trade and thus your profit or loss.

Of course, it’s impossible to be 100% certain. But here are three simple methods that could help you decide which could dramatically improve your odds of being right.

Correction zone

The first method to identify a correction or a change in trend is one I like to call the “zone method.” The idea behind it is rather simple.

When a support line has also been a resistance line it’s no longer just support and resistance. Rather, it is a border trimming between two separate zones. One is a zone where the pair is bullish and likely to move higher. The other is a zone where the pair is bearish and likely to move lower.

If that zone hasn’t changed, then it’s a temporary correction. If the zone has changed, then it’s a change in trend. From the EURUSD chart below you can see when the 1.168 was broken back in 2014, the pair moved into a bearish zone. If the EURUSD had rebounded back to the bullish zone, then that would mean the trend had changed to bullish.

zones_fin

The Trend Average

The second method that is useful in gauging a correction or trend change is done by running a moving average. The trick here is to play with the average period until it captures nearly all the trend. You can also switch between an exponential moving average and a simple moving average. Sometimes, an exponential captures the trend better and other times, a simple moving average is all you need. The idea here is to tweak, or fine tune, if you will. In our case, the trend has to be below the average.

Once you have done that, you need to see how the current correction stakes up against the rest. If the latest correction is below the average then it’s a mere correction. If the average is broken, the trend has changed, just as can be seen in the chart below.

Notice that this method is usually effective where the trend is on a rather linear path. It might work on more volatile trends but it will not always be effective.

Correction

Failed Record

The last of the simple signals is actually more a matter of probability than a proper signal. And it’s actually the simplest to identify. Simply put it is when a pair fails to break a record and it doesn’t matter if it’s a record high or record low.

Usually, three is the lucky charm. Say the pair fails to break a record on the third attempt, as in the examples below. Then, there’s a higher likelihood that this is more than a mere correction. When a record high or record low is involved, there’s a much higher likelihood that this is not a mere correction but a change in trend.

Correction

In Conclusion

As you may expect, there are many more methods to differentiate between a correction and a change in trend. Some are more advanced and complicated. Others, like Fibonacci retracement which often times is used incorrectly, tend to be misleading.

While the methods above are far from perfect, the average trader might find that they are simple and easy to implement. They could, therefore, serve him well as he tries to determine if the pair is in correction mode or an actual change in trend.

Filed Under: How does the forex market work? Tagged With: eurusd, moving average, resistance, support, trend

Beware of a Fake Trading Signal

October 29, 2015 by Lior Alkalay 9 Comments

How many times were you certain of that one trading signal that told you that a trend was over? Or what about the one that indicted a trend was just about to begin?  Of course, that “prophecy” was eventually dispelled and the market turned against you. It probably happens quite a lot, maybe even more than you’d care to admit.

Those are fake signals. That’s when you think you’re getting a clear signal, but… you aren’t. Sometimes identifying a fake trading signal can be tricky.  Often, a little alertness can save you the pain of following the wrong trend. In this article, I will focus on some tips that will allow you to avert some of the more common fake signals.

Moving Average Fake Trading Signal 

This is a classic fake trading signal. The Moving Average Cross, where the fast moving average crosses the slow moving average, signals a trend change. For this example, let’s look at the chart below. When the fast moving average (blue) crossed above the slow moving average (green) the trend didn’t change. In fact, the fast moving average later crossed the slow a few more times.

Fake Signals

Source: esignal

How Can You Avoid this Tricky One?

You must validate the change  of trend signal with another trading  signal. For example, in our sample, the pair had not broken the 1.17 resistance that caps the pair in bearish territory. We can’t expect a trend to be changed before the resistance that trims that trend has been broken.

Another helpful tool would be to move one level up and run a long term EMA. In the case of weekly, 52 weeks is the most effective in giving a general indication of momentum. Again, it’s not definitive by itself.

First you need to determine if the moving average cross suggests a changing trend. Then, see if key resistance has been broken. If both have, then the pair should also trade above its 52 week EMA. As we can see, those conditions were not fulfilled. The combination of the supplemental conditions should lead to one conclusion. That is that trading signal was, indeed, a fake moving average cross signal.

Trading Signal

Source: esignal

The Fake Double Bottom 

The second most common fake trading signal is the fake double bottom. The Double Bottom is a classic signal traders often rely on. When you see the pair forming that classic M shape you instinctively take the opposite trade. Then you ride out the counter bullish trend. After all, if this is a bottom, the pair can only go up right?

But as is clearly shown in the chart below, the trend didn’t change. And after reaching the shoulder (see chart) the pair flipped again into bearish and broke the support.

Trading Signal

Source: Financial Times

How to Avoid this Trap

In order for the double bottom M shape to confirm a trend change the pair must close above the shoulder. If it doesn’t, the trend is capped on a bearish momentum. Then the likelihood for the trend to continue with its bearish trajectory is high. A close above the shoulder, however, is a good validation that the trend is bottoming.

Fake Correction

This is another classic; you get a trend line broken(in blue) and immediately conclude that the trend is going to flip. Of course, you jump on the band wagon and open a short. Later, you encounter a brick wall at support and have the bullish trend resume.

Trading Signal

Source: esignal

Once again, my main tip here is to go one level up. Now you can see the broader channel and clearly see that we are still within the trend. That way you save yourself from a false entry.

Trading Signal

Source: esignal

Fake Fibonacci

Closing out our list is a pure classic: the fake Fibonacci trading signal which is support that you mistakenly rely on. This is usually driven by human error of stretching from the wrong points.

How to avoid the Fake Fibonacci?

The Parabolic SAR is very effective at this. Luckily, this is a subject we’ve already covered and you can read all about it here.

In Conclusion

There are many, many more fake signals and an equal number of ways to identify them. The problem is very often you won’t be able to spot the fake. But at least, with these basic rules of thumb, you’ll get an edge up. If you can spot the obvious ones you can improve your statistics and your odds. And trading is all about tilting the odds in your favor.

Filed Under: How does the forex market work? Tagged With: double bottom, Fibonacci, moving average, moving average crossover, resistance

Swing Trading Strategy: The Golden Cross and Death Cross

October 27, 2014 by Shaun Overton 3 Comments

Swing trading broadly refers to a segment of trading strategies that combine technical momentum and pattern recognition with a smaller emphasis on fundamental analysis. On the whole, swing trading is a great strategy for individuals unwilling to the devote the time and energy necessary for successful day-trading while seeking to be more active in managing funds than simply participating in buy-and-hold strategies. This strategy is largely employed by speculators and retail investors seeking to benefit from the confluence of short-term price momentum and economic fundamentals. This requires a modicum of flexibility unavailable to large institutional investors that are bound by large trade sizes and are often less adaptable to evolving short-term conditions. The time horizon for swing trades is typically a day to several weeks depending on the investor’s strategy and risk tolerance.

Two very famous technical patterns that fall under the category of swing trading strategies include the “golden cross” and “death cross”. Each of these strategies depend on the trends of moving averages, specifically the 50-day and 200-day moving averages (taken from closing prices). These technical patterns rely on more medium-term charts, primarily 4-hour to 1-day charts. Periodicity is especially important as shorter-term charts are not relevant and useful in assessing these patterns.

Golden Cross

The golden cross is a technical pattern where the shorter-term 50-day moving average crosses a longer-term 200-day moving average to the upside. This is a bullish pattern, signifying a situation where upside momentum is forecast to increase, marked in conjunction with higher than average volumes. The 200 day moving average also becomes a support level for prices. This pattern is currently evident in the U.S. dollar index (DXY) which has witnessed a meteoric rise of 6.87% since the 50-DMA crossed the 200-DMA to the upside on July 16th.

 Golden crossDeath Cross

The death cross, although dark in name, is merely the opposite of a golden cross, with the shorter-term moving average crossing the longer-term moving average to the downside. This is typically indicative of a possible bear-market on the horizon and is usually confirmed by higher than average trading volumes. After crossing, the longer-term moving average serves as a resistance level for prices and is a great area to short the instrument on momentum pullbacks. A great present-day example of the death cross is in the West Texas Intermediate crude oil benchmark which saw the 50-dma cross the 200-dma on July 22nd, causing losses to-date of -17.12%.

death cross

Suggestions for Swing Trading the Golden Cross and Death Cross

Speed is Key

The earlier the entry to a momentum trade the better the risk-reward conditions. As the phrase goes, the early bird catches the word. Quick entry also means more security in exiting a position without worrying about momentum chasing from picking a bad entry point.

Choose Liquidity

A careful exit and entry strategy is essential for any successful trade, especially in the shorter-term time horizons. Instruments that don’t trend for long periods of time and lack liquidity for entering/exiting position are not useful in this particular strategy no matter how pretty the setup. In thinly traded stocks, traders might encounter a sharp price impact from entering/exiting which is likely to create problems for strategies that require nimble maneuvering.

What Not to Do

Avoid fundamental analysis. Although swing trading typically relies heavily on careful reading of the technical indicators, fundamental analysis can still have a dramatic impact on an instrument’s price. Keeping up to date with the news, having familiarity with economics if trading currencies, or earnings if trading stocks is indispensable when swing trading and cannot be ignored. Remember, information is power.

Fight the trend

While not necessarily a trend following strategy, swing trading requires careful examination of the prevailing trend for benchmarks to which an instrument may be closely correlated. For instance, if finding a golden cross in a stock that is a component of a broader index that is trending lower, the relationships between stocks may negate the pattern. Situational awareness is key.

Chase momentum

If late to a trade, wait for a pullback or retrace before entering. Buying highs and selling lows is every investor’s worst nightmare. Timing is everything, so be wary of eagerness to enter a trade.

Filed Under: Trading strategy ideas Tagged With: death cross, dollar index, DXY, golden cross, momentum, moving average, moving average crossover, oil, swing trading, WTI

SPY Crisis Strategy

October 11, 2013 by Shaun Overton 3 Comments

Yesterday’s musings on an S&P 500 doji strategy led to a general discussion of stocks and market crises. I promised to analyze a price-moving average cross strategy and to analyze the performance in times of exceptional volatility.

The results are in and they’re exactly what I predicted. I’m shamelessly tooting my own horn on this one – it’s so rare where strategies do exactly what I predicts.

SPY Crisis Strategy Returns

The direction of the returns matches any traders definition of crisis and regular trading periods over the past decade

SPY Crisis Strategy Rules

The trading rules only initiate short trades. No long positions are allowed.

Enter short next bar at market when:
The price crossed and closed below the 20 day SMA on the last closed bar
The trader believes that a crisis environment either currently exists or is about to exist

Exit an open short trade when:
The price crosses and closes above the 20 day SMA on the last closed bar

The position size is equal to a fixed dollar value divided by the current share price. As an example, SPY currently trades at $169.24. If you wanted to control a position size worth $1,000, then the number of shares is the floor of $1,000/$169.24 = 5 shares.

This strategy is intended to be timely for the current trading environment. Based on all of my proposed definitions below, most of the crisis alarm bells are ringing at the moment.

Defining a crisis

The most difficult part of this type of strategy comes from defining a “crisis environment” quantitatively. Crises don’t happen very often by definition, so I don’t think it’s a worthwhile endeavor to try to quantity the crisis bit. That said, a few obvious crisis indicators come to mind based on basic market mechanics.

PE Ratio

The morons on Tout TV (CNBC and company) keep on screaming how cheap stocks are. I’m not a fundamental trader, but the PE ratio contains useful information. Even the most hard core technical analysis buff would agree that companies generating huge positive cash flow and earning growth have to appreciate at some point. The argument isn’t about if that type of stock will rise; it’s just a question of when.

I don’t see how anyone could possibly look at the current PE ratio of 19.3 and argue that stocks are cheap. They aren’t. Stocks are currently very expensive based on a historical comparison.

VIX

VIX is a CBOE benchmark index that allows traders to compare the price of front month options traded on the S&P 500. A more detailed explanation of the VIX is available on Wikipedia if the concept is new. There’s nothing magical about the 20 level. It’s my general experience that most traders consider that number the one to watch. They think of VIX < 20 as "normal" and VIX > 20 as a severe market move.

VIX danger level

Most traders regard a VIX above 20 as a dangerous level.

Put-Call Ratio

Options are effectively leveraged bets on market movements with fixed downside risk. When traders load up on puts, they’re expecting the market to fall. When traders buy more calls, they’re expecting the market to rise.

The put call ratio is simply the number of put contracts traded / the number of call contracts traded. A number > 1 means that more puts were purchased that day than calls, indicating an expectation of a market drop.

Theory has it that short term traders are wrong, making the put call ratio a contrarian indicator. I see the put call ratio as more of a lagging indicator.

ES Put call ratio

When a move is real and already happened, traders react too late and buy protection that they no longer need. The 2008 financial crisis a great example when the ratio spiked to 1.5, a wild number. Just in the past week the ratio went as high as 1.3 before settling back down. The volatility in the number indicates a panicky crowd in my opinion.

Margin debt

Leverage is a two way sword. The theory is that it’s a way to multiply returns by risking debt in the market.

Most traders, and especially retail traders, wind up using leverage as the rope to hang themselves with. Stocks are most commonly purchased with cash among investors. Unlike forex and futures where almost every trader enters a position with leverage, the average retail stock trader enters a position using only the cash present in his account.

An increased willingness among traders to move from cash to margin debt is typically a sign of froth, bubble fever or whatever you want to call it. The chart of margin debt from Business Insider and Zero Hedge show that stocks are currently trading near historical highs.

margin debt business insider

Margin debt Zero Hedge

Conclusion

The 20 day SMA price cross strategy is a great way to run account protection whenever market warning signs are going off. The warning signs may not predict the precise market turning point, but the strategy can function as an effective form of insurance.

The strategy would roughly break even over time if someone were foolish enough to run it that way. Say that you mistime the crisis. Big deal. This type of strategy can run for months without causing irreparable harm to the account.

The signals can run in the background. If you’re only a little bit right with your crisis predictions, the risk reward ratio is massively in your favor. If you’re wrong, the consequences appear to be slow losses that lose a couple of percentage points per quarter. If you’re feeling edgy, I think it’s a great strategy to run in the background to calm your mind.

Filed Under: Trading strategy ideas Tagged With: contrarian, dot com bubble, ES, etf, financial crisis, forex, futures, margin debt, moving average, Put call ratio, risk reward ratio, S&P 500, SPY, stocks, VIX, volatility

SPY and Dojis

October 10, 2013 by Shaun Overton Leave a Comment

Everyone here knows that I’m a fan of the dumbest possible strategy. The less complex that rules are, the easier it is to understand when something inevitably breaks.

The SPY and Doji strategy from paststat most certainly fits the bill. The SPY is the ETF that tracks the S&P 500 index.

They tested a simple idea: does a doji on the SPY contain any predictive value? The short answer is a qualified yes.

The dojis offered no predictive value on their own. However, teaming them up with a 200 period moving average showed much better results. Use the location above or below the moving average showed a clear relationship between profit and loss.

SPY Doji

So am I not touting this to all my readers? The biggest problem with a strategy like this is the sample size: there are only 40 trades in the largest sample. Some of the posted results only analyze the outcomes of 12 trades. That’s not a strategy. It’s hardly an observation, either.

What I do like about the idea is that it hightlights something fundamental about how the stock market works. I always think of it as a pair trade. You buy 1 unit of stock for every X dollars of currency.

You’re really pair trading two asset classes: one is a stock, the other is dollars. The flow of the forex market dominates stocks. A surge in dollar strength almost certainly anticipates a down day in stocks.

The fits and starts of the forex market lead stocks to crawl their way upward. Bull markets last for years and years. Unless you’re counting Fed days, there’s no particular move that dominates in stocks.

SPY Strategy Idea

Contrast that with bear moves and the difference is night and day. Everyone knows about the 1987 crash when the market crashed 22% in a single day. Our more recent crisis in 2008 inflicted similar damage over a period of weeks.

Price crossing the moving average is one of my favorite strategies. It’s dummy proof and I’ve seen it work in several markets, especially forex commodity crosses.

The SMA filter that paststat applied in the doji strategy might just make for a better daily trading strategy altogether. I’d even be tempted to ignore the long trades and take short only signals. A simple filter like the put-call ratio might help filter out the worst of the noise trades.

What I like even more is that it’s a strategy that could apply in today’s market:

  • The stock market is trading on record margins of debt
  • Selling the idea of a crisis isn’t hard with the potential US default looming

We’ll have to take a look at this in more detail tomorrow.

Filed Under: Trading strategy ideas Tagged With: default, doji, dollars, forex, leverage, moving average, SMA, SPY

Moving Average Crossover System with RSI Filter

July 29, 2013 by Andrew Selby 8 Comments

Simple systems stand the best chances of succeeding by not becoming overly curve-fit. However, adding a simple filter to a robust system can be a great way to improve its profitability, provided you also analyze how it may alter any risks or biases built into the system.  The Moving Average Crossover System with RSI Filter is an excellent example of this.

About The System

This system uses the 30 unit SMA for the fast average and the 100 unit SMA for the slow average. Because its fast moving average is a good bit slower than the SPY 10/100 Long Only Moving Average Crossover System, it should generate less total trade signals. It will be interesting to see if this leads to a higher win rate.

The system also uses the RSI indicator as a filter. This is designed to keep the system out of trades in markets that are not trending, which should also lead to a higher win rate.

The system enters a long position when the 30 unit SMA crosses above the 100 unit SMA if the RSI is above 50. It enters a short position when the 30 unit SMA crosses below the 100 unit SMA if the RSI is below 50.

The system exits a long position if the 30 unit SMA crosses back below the 100 unit SMA, or if the RSI drops below 30. It exits a short position if the 30 unit SMA crosses back above the 100 unit SMA, or if the RSI rises above 70. It also implements a trailing stop that is based on the volatility of the market and sets an initial stop at the most recent low for a long position or the most recent high for a short position.

moving average crossover system

A daily FXI chart, the EURUSD ETF, shows the system rules in action

Trading Rules

Go Long When:

  • 30 unit SMA crosses above 100 unit SMA
  • RSI > 50

Go Short When:

  • 30 unit SMA crosses below 100 unit SMA
  • RSI < 50

Exit Long When:

  • 30 unit SMA crosses below 100 unit SMA, or
  • RSI drops below 30, or
  • Trailing Stop is hit, or
  • Initial Stop is hit

Exit Short When:

  • 30 unit SMA crosses above the 100 unit SMA, or
  • RSI rises above 70, or
  • Trailing Stop is hit, or
  • Initial Stop is hit

Backtesting Results

The backtesting results I found for this system were from the Euro vs US Dollar market from 2004 through 2011 using a daily time period. During those seven years, the system only made 14 trades, so it definitely filtered out a large portion of the action. The question is whether or not it filtered out the good trades or the bad ones.

Of those 14 trades, eight were winners and six were losers. That gives the system a 57% win rate, which we know can be traded very successfully provided the profit rate is also strong.

Backtesting reports for forex systems use a stat called profit factor. This number is calculated by dividing the gross profit by the gross loss. This gives us the average profit we can expect per unit of risk. The results for this backtesting report gave this system a profit factor of 3.61. This means that over the long run, this system will provide positive returns.

For a comparison point, the Triple Moving Average Crossover System only had a profit factor of 1.10, so the Moving Average Crossover System with RSI is likely to be three times more profitable. This means that using a larger number for the fast moving average and adding the RSI filter must be filtering out some of the less productive trades.

These numbers are further supported by the fact that the average profit was just over twice as large as the average loss. However, despite these positive ratios, the system did suffer a maximal drawdown of almost 40%.

Sample Size

The fact that this system gives so few signals is both its biggest strength and its biggest weakness. Placing fewer trades and holding them for longer periods of time will keep transaction costs from becoming a factor. However, analyzing 14 trades that occurred over seven years could lead the results to be skewed because of small sample size.

I am curious how this system would have performed if it was traded across a dozen different currency pairs over the same time period. Furthermore, how would it have performed if the backtest went back 50 years or tested the system on stock indexes or commodities. There is clearly positive stats to warrant further exploration of this system, but it would be foolish to trade real money based on the results of 14 trades.

Trading Example

An example of this system at work can be seen on the current chart of the FXI. Around March 18 of this year, the 30 day SMA crossed below the 100 day SMA. At that time, the RSI was also below 50. This would have triggered a short position somewhere just below 36. The initial stop would probably have been placed above the recent high at 38.

By mid-April, the price had dropped to 34 and we would have been sitting on a nice profit. The price then rebounded to almost trigger our initial stop at 38 in early May before crashing almost all the way down to 30 at the end of June. It has since bounced back to the 34 range.

At no point during any of this action did the 30 day SMA cross back above the 100 day SMA, and the RSI remained below 70. Therefore, neither of those would have triggered an exit. While the price came close to our initial stop, it did not quite get there, so that would have kept us in the trade as well.

The only thing that could have caused an exit would have been the trailing stop, which would have depended on how much volatility we set it to allow for. It is still to early to say whether we would want to have been stopped out or not.

About the RSI Indicator

The RSI indicator was developed by J. Welles Wilder and was featured in his 1978 book, New Concepts in Technical Trading Systems. It is a momentum indicator that oscillates between zero and 100, indicating the speed and change in price. Many momentum traders use RSI as an overbought/oversold indicator.

RSI is calculated by first calculating RS, which is the average gain of the last n periods divided by the average loss of the last n periods. The value for n is generally 14 days.

RS = (Average Gain) / (Average Loss)

Once RS is calculated, the following equation is used to make that value into an oscillating indicator:

RSI = 100 – [ 100 / (1 + RS) ]

This will give us a value between zero and 100. Any value above 70 is generally considered overbought, and any value below 30 is considered oversold. However, since this system is a trend following system, overbought and oversold do not have their usual negative connotations.

Filed Under: Test your concepts historically, Trading strategy ideas Tagged With: crossover system, moving average, RSI

You cannot measure the angle of price

June 8, 2011 by Shaun Overton 2 Comments

Traders commonly refer to the angle formed when the price or moving average changes.  Big changes form big angles, while small changes form small angles.

That's the idea, anyway.  The mathematically reality is that the concept of angle does not exist.  Let's take a look at an example that most people would be comfortable with.

A simple overview of a triangle measured in feet

The angle θ in this triangle is 48.59°.  The reason we can do this simple geometric comparison is that the units of each side of the triangle are measured in feet.  If the units are not the same, it is not possible to take the angle.  Now let's do an absurd example to prove the point.

A triangle with incorrect units

 

A 4 foot long triangle that's only 3 inches high does not have an angle of 48.59°.  We expect the small height to produce a small angle.  This is correct.  The actual height of the triangle is 0.25 feet, which forms an angle θ = 3.58°.

Turning our attention back to trading, think about each leg of the triangle as it appears on your chart.  The horitzontal leg is time.  The vertical leg is price.  Are these units identical?  No, they are clearly different.  Therefore, you cannot find the angle between them.

A triangle showing price and time

 

Filed Under: Trading strategy ideas Tagged With: angle, moving average, price

FREE trading strategies by email

Trending

Sorry. No data so far.

Archives

  • Dominari
  • How does the forex market work?
  • Indicators
  • MetaTrader Tips
  • MQL (for nerds)
  • NinjaTrader Tips
  • Pilum
  • QB Pro
  • Stop losing money
  • Test your concepts historically
  • Trading strategy ideas
  • Uncategorized
  • What's happening in the current markets?

Translation


Free Trading Strategies

Privacy PolicyRisk Disclosure

Copyright © 2023 OneStepRemoved.com, Inc. All Rights Reserved.