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

Mã nguồn mở

Theo tinh thần TradingView thực sự, tác giả của tập lệnh này đã xuất bản dưới dạng nguồn mở để các nhà giao dịch có thể hiểu và xác minh. Chúc mừng tác giả! Bạn có thể sử dụng miễn phí. Tuy nhiên, bạn cần sử dụng lại mã này theo Quy tắc nội bộ. Bạn có thể yêu thích nó để sử dụng nó trên biểu đồ.

Bạn muốn sử dụng tập lệnh này trên biểu đồ?


Ngoài ra, trên:

Thông báo miễn trừ trách nhiệm