TradeAutomation

Multi MA Trend Following Strategy Template

TradeAutomation 已更新   
Trend following is one of the better known technical trading strategies. But, which trend should you follow? Today I am sharing with the community a trend following template script that includes a selection of over 20 different trends / regressions. Some of these are in the Pine library, and some have been custom coded and contributed over time by the beloved Pine Coder community.

How it works:
This template will plot any of the 20+ trends that you can select in the settings. The strategy component will buy if the trend line is moving up, and will sell if it moves down. If the line is green that indicates that the trend is higher than the prior bar. If the line is red that indicates that the trend is lower than the prior bar. This script is different from many moving average scripts in that it follows the trend itself and doesn't look for a cross of multiple trends.

How to use it:
When wanting to trend follow an instrument, you can use this template to help identify what approach you might want to take and/or which indicator you might want to use. You can also modify the strategy as you see fit and make use of the 20+ incorporated indicators. Incorporate your trade and risk management strategy, or use it as an indicator.

Disclaimer: Open source scripts I publish in the community are largely meant to spark ideas that can be used as building blocks for part of a more robust trade management strategy. Even though this example script might beat buy and hold over the back-test time-frame, I wouldn't advise using it as a stand-alone strategy without significant additions/modifications to the strategy and risk management functions.
版本注释:
Fixed typo
版本注释:
Current list of indicators/trends integrated into this strategy:
ALMA, DEMA, EMA, HMA, JMA, KAMA, Linear Regression (LSMA), RMA, SMA, SMMA, Price Source, SuperTrend, TEMA, TMA, VAMA, VIDYA, VMA, VWMA, WMA, WWMA, ZLEMA
版本注释:
Updated version: Adds an option to model short trades, replaces JMA with the Everget version (that has more options), and adds more decimal points in the trend calculation to increase its accuracy.
版本注释:
Added Ehlers Deviation-Scaled Moving Average indicator to the strategy/trend options (DSMA). Originally developed by John F. Ehlers (Stocks & Commodities V. 36:8: The Deviation-Scaled Moving Average). Originally coded in Pine v3 as an indicator by Everget, translated into a Pine v5 strategy by TradeAutomation.

Want to build custom alerts and custom strategies? Interested in automated trading?

Hire me to code or automate your trading strategy, or schedule a free consultation at:
www.TradeAutomation.net
开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?