TradeAutomation

Multi MA Trend Following Strategy Template

TradeAutomation Mis à jour   
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.
Notes de version:
Fixed typo
Notes de version:
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
Notes de version:
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.
Notes de version:
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
Script open-source

Dans le véritable esprit de TradingView, l'auteur de ce script l'a publié en open-source, afin que les traders puissent le comprendre et le vérifier. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais la réutilisation de ce code dans une publication est régie par le règlement. Vous pouvez le mettre en favori pour l'utiliser sur un graphique.

Clause de non-responsabilité

Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.

Vous voulez utiliser ce script sur un graphique ?