TrendsAreSexy

Easy to Use 50/100/200 Day Moving Average Strategy

Whenever you see someone publish a chart or idea, what's the one thing you almost always see? Moving Averages!

Many investors focus on these indictors solely as entry and exit points, so here's an easy to manipulate strategy to backtest and see if this is feasible on your security.

CODE VARIABLES
LINE 2 - Here you can change your currency and amount you want to invest on each entry.
LINE 8/9/10 - Here we establish the 50 (Fast), 100 (Medium) and 200 (Slow) day variables. These can be adjusted to your choosing.
LINE 13/14/15 - Here we establish what date we want to start backtesting from. Simple change the defval on each line to change the date (In the code below we start on Jan 1st, 2010).
LINE 20/23 - Here, within the crossover and crossunder functions, we set which MA's must cross to enter and exit a trade. Below we have the 50 day moving above and under the 200 day. Simple change the variables to FastMA, MediumMA and SlowMA to your choosing.

NOTE: As a beginner you may not want to short stock, therefore LINE 5 was added to only allow long positions.

Hope this helps, from one beginner to another.

Cheers!
Script de código aberto

Dentro do verdadeiro espírito TradingView, o autor deste script publicou ele como um script de código aberto, para que os traders possam compreender e checar ele. Um viva ao autor! Você pode usá-lo gratuitamente, mas a reutilização deste código em uma publicação é regida pelas Regras da Casa. Você pode favoritá-lo para usá-lo em um gráfico.

Aviso legal

As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.

Quer usar esse script no gráfico?