TradingView
TradeAutomation
8 Th12 2021 22:30

Multi MA Trend Following Strategy Template 

ProShares UltraPro QQQNASDAQ

Mô tả

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.

Phát hành các Ghi chú

Fixed typo

Phát hành các Ghi chú

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

Phát hành các Ghi chú

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.

Phát hành các Ghi chú

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.
Bình luận
mrtrendmaker
Never change this honestly.
mrtrendmaker
Time to play with this for hours(Thanks)
TradeAutomation
👍
Hassan_Sheikh2
Is realtime work or not?
TradeAutomation
@hassansheikh1996, Your question is somewhat unclear. You can add this to any chart and it will also plot entry and exit arrows when its conditions are met going forward. The default setting in the script is for it to calculate on the close of each bar.
danielw21
Great work, I like it very match. Do you see an possibility to include an Buy and Sell signal for alerts?
Regards Daniel
Tom1trader
Great job, thanks; especially for this example of how to pull any single bar from a session! Keep up the good work and keep smiling!
vmnov21
repaint?
TradeAutomation
@vmnov21, Doesn't repaint, processes orders/signals on the close of a bar
Saudia100
Hello my honorable teacher
Thank you for your wonderful effort.. and I have a small request, please. I want to help me write a buying and selling strategy that states the following
Access

1/ The volume is greater than the last 3 bars or candles
2/ The candle is the largest average of 7 exponential (break it)
3/ MACD gave a positive crossover (MACD the fast line is greater than the slow)
4/rsi is greater than the 50th line
5/ If the candle broke out at a price higher than the closing price of the previous candle

Exit
It is the negative crossover of the downside stochastic with settings 25/k4/d2
If possible, there is a possibility to change the settings

stop loss
It is about 5% and it is moving. Every time the price rises, the stop will rise and never go down

And if it is possible to draw on the chart the entry and exit signal and draw the stop loss in the form of a moving line

Waiting for your kind reply
Thank you for your effort
Thêm nữa