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!
Skrypt open-source

Zgodnie z prawdziwym duchem TradingView, autor tego skryptu opublikował go jako open-source, aby traderzy mogli go zrozumieć i zweryfikować. Brawo dla autora! Możesz używać go za darmo, ale ponowne wykorzystanie tego kodu w publikacji jest regulowane przez Dobre Praktyki. Możesz go oznaczyć jako ulubione, aby użyć go na wykresie.

Wyłączenie odpowiedzialności

Informacje i publikacje przygotowane przez TradingView lub jego użytkowników, prezentowane na tej stronie, nie stanowią rekomendacji ani porad handlowych, inwestycyjnych i finansowych i nie powinny być w ten sposób traktowane ani wykorzystywane. Więcej informacji na ten temat znajdziesz w naszym Regulaminie.

Chcesz użyć tego skryptu na wykresie?