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

Script de código aberto

No verdadeiro espírito do TradingView, o autor desse script o publicou como código aberto, para que os traders possam compreendê-lo e analisá-lo. Parabéns ao autor! Você pode usá-lo gratuitamente, mas a reutilização desse código em publicações é regida pelas Regras da Casa. Você pode favoritá-lo para usá-lo em um gráfico.

Quer usar esse script no gráfico?

Aviso legal