OPEN-SOURCE SCRIPT

Trend Trade ( in W, D, H, 15M )

Condition:
Uptrend, EMA5 > EMA8 > EMA13
Downtrend, EMA5 < EMA8 < EMA13

EMA# input can be changed by user.

Trading Plan:
1. Long in Uptrend when Price croseover EMA5;
Buy EMA5 + 0.03 (Do not wait for close), initial stop EMA13-0.03
If it is a big Gap up, do not chase. Let it go;

2. Short in Downtrend when Price croseunder EMA5;
Short EMA5 - 0.03 (Do not wait for close), initial stop EMA13+0.03
If it is a big Gap Down, do not chase. Let it go;

3. No target strategy in this study;

Back test Weekly, daily, hourly, 15M chart for ES1!, CL1!, GC1!, SPY, QQQ, TLT, IWM, XLF, XLK, XOP, GS, IBM, APPL, AMD, MMM, WBA
When side way move, Entry could be stopped quickly with small loss;
When entry in trending move, the position could be hold for a good range, and keep adding to winner.
Using this study, Futures and ETFs are better than single stock. Big Gap can break the trend, and trigger big stop loss;

This study is designed to join an existing trend. Try not use this in the time frame below 15 min.
To catch the turning point of a swing, Price action (Demand/Supply Confirmation) and trendlineBreak could be more accurate than EMA/SMA lines.
Exponential Moving Average (EMA)trend

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