OPEN-SOURCE SCRIPT

Buy in long term uptrend (Weekly and Daily)

Condition: in uptrend, EMA8 > EMA144 (User can change the EMA# from input);
Price Action: (Price crossover EMA144) or (price touched EMA144 and close above it);
Trading Plan: Buy at close or next open; Initial Stop below EMA144;

No Exit strategy in this study, trader needs to move stop by other rules; such as, uptrend line break;

Back test Weekly and daily chart for SPY, QQQ, TLT, GLD, IWM, XLF, XLK, XOP, GS, IBM, APPL, CAT, LVS
1. When side way move or price From uptrend to Down trend, Entry could be stopped quickly with small loss;
2. When buy in trending move, the position could be hold for few years.

The best sample is QQQ weekly chart.

This is my first tradingview script. I created this script file and tested in one week.
Maybe, this script is too simple, other people published similar code already; Sorry, I didn't Check that yet.
Exponential Moving Average (EMA)uptrend

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