OPEN-SOURCE SCRIPT

Three EMAs Trend-following Strategy (by Coinrule)

Trend-following strategies are great because they give you the peace of mind that you're trading in line with the market.

However, by definition, you're always following. That means you're always a bit later than your want to be. The main challenges such strategies face are:

Confirming that there is a trend
Following the trend, hopefully, early enough to catch the majority of the move
Hopping off the trade when it seems to have run its course

This EMA Trend-following strategy attempts to address such challenges while allowing for a dynamic stop loss.

ENTRY

The trading system requires three crossovers on the same candle to confirm that a new trend is beginning:

Price crossing over EMA 7
Price crossing over EMA 14
Price crossing over EMA 21

The first benefit of using all three crossovers is to reduce false signals. The second benefit is that you know that a strong trend is likely to develop relatively soon, with the help of the fast setup of the three EMAs.

EXIT

The strategy comes with a fixed take profit and a volatility stop, which acts as a trailing stop to adapt to the trend's strength. That helps you get out of the way as soon as market conditions change. Depending on your long-term confidence in the asset, you can edit the fixed take profit to be more conservative or aggressive.

The position is closed when:

The price increases by 4%
The price crosses below the volatility stop.

The best time frame for this strategy based on our backtest is the 4-hr. Shorter timeframes can also work well, although they exhibit larger volatility in their returns. In general, this approach suits medium timeframes. A trading fee of 0.1% is taken into account. The fee is aligned to the base fee applied on Binance, which is the largest cryptocurrency exchange.
binanceBitcoin (Cryptocurrency)BTCCandlestick analysiscoinbasecoinrulecryptoCryptocurrencyExponential Moving Average (EMA)Ethereum (Cryptocurrency)Trend Analysis

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?


Also on:

Disclaimer