OPEN-SOURCE SCRIPT

Trend Follow Daily

Hello,

here's a simple trend following system using D timeframe.

we buy at the close when:

market is been raising for 2 days in a row, current close is higher than previous close, current low is higher than previous low, current close is higher than previous close and the current close is above 21-period simple moving average.

we sell at the close when:

current close is higher than previous day's high.

Strategy works best on stock indices due to the long-term upward drift.

Commission is set to $2.5 per side and slippage is set to 1 tick.

You can adjust commission for your instrument, as well play around with the moving average period.

Moving average is there to simply avoid periods when market is the selloff state.
CyclesSimple Moving Average (SMA)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?

Disclaimer