MACD Divergence

While comparing the TrendZ indicator against MACD, I noticed a bunch of good signals from divergence patterns in MACD. In the chart below, the first A-E crosses are divergence. F-J isn’t but still worked. I wanted to see if this really works so I coded a strategy to trade when it detects divergence, or even […]

There is no perfect strategy

Staring at the backtesting charts, and optimizing using my gradient checker, I can easily reduce the number of loss trades (and profit trades) during sideways market periods. However, the discovery of the slowly trending in the non-volatile market mentioned in the previous log entry has bothered me a bit. There is a long trend right […]

Preventing Whipsaw – Using a longer moving average?

Can we possibly utilize a third, much longer time frame MA to prevent whipsaw and loss trades? Possible ideas are Only trade in the direction of the trend indicated by the longer MA If the longer MA has a flat gradient, we are in a sideways market so avoid trading. Add envelopes to possibly switch […]

Limiting losses during spikes – must use Stop Orders

Something I noticed today while investigating loss trades in my backtesting results. Suppose our strategy will automatically close out the position if on some condition, say either we have lost a certain amount of pips, or some lines cross signaling an exit. However, the strategies logic is only executed per update of the instrument. Let’s […]

Preventing Whipsaw using a Gradient Calculation

Continuing on from June 28th investigation… I extended the strategy to calculate the angle of the gradient for the moving averages and integrated this into the trading signals. Initial tests over a small window (Dec 2010) show less loss trades – this is good news, but also some bad news. Without gradient angle checking enabled Here […]

Stop Loss / Take Profit

Today I did some optimizations on Stop loss and Take Profit with the Omar_MACD strat. Obviously the trending strategy will close out its own positions when the market turns against it, so strictly speaking a stop loss may not be necessary. However, in the case of flash crashes or perhaps network problems, I would feel […]

Sideways Markets and MACD, RSI

MACD loses money in a sideways market and if we can do something to identify that the market is so, then we can get the MACD to ignore trade signals until it appears to be trending again. The use of Bollinger Bands can help identify sideways markets it seems. –       If the price has moved […]

Backtesting – it’s easy!

Ok so today I was playing with the backtesting if the Omar_MACD strategy more and I noticed the difference between the two Moving Averages seem to be different when I backtested multiple times. It turns out that this is because the start date was different. The start date has to be more than n-periods away […]