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!
Mã nguồn mở

Với tinh thần TradingView, tác giả của tập lệnh này đã xuất bản nó dưới dạng mã nguồn mở, vì vậy các nhà giao dịch có thể hiểu và xác minh nó. Chúc mừng tác giả! Bạn có thể sử dụng mã này miễn phí, nhưng việc sử dụng lại mã này trong một ấn phẩm chịu sự điều chỉnh của Nội quy nội bộ. Bạn có thể yêu thích nó để sử dụng nó trên biểu đồ.

Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.

Bạn muốn sử dụng tập lệnh này trên biểu đồ?