Harrocop

Triple MA HTF strategy - Dynamic Smoothing

The triple MA strategy is a simple but effective method to trade the trend. The advantage of this script over the existing triple MA strategies is that the user can open a lower time frame chart and select higher time frame inputs for different MA types mainting the visibility on the chart. The dynamic smoothing code makes sure the HTF trendlines are not jagged, but a fluid line visiable on the lower time frame chart. The script comes with a MA crossover and crossunder strategy explained below.

Moving Averages (MA) Crossover for Entry:
Long Entry: A long entry signal is triggered when the moving average line 1 crosses above the moving average line 2. This crossover indicates a potential shift in market sentiment towards the upside. However, to validate this signal, the strategy checks if the moving average 3 on a higher time frame (eg. 4 hour) is in an upward trend. This additional filter ensures that the trade aligns with the prevailing trend on a broader time scale, increasing the probability of success.

Short Entry: Conversely, a short entry signal occurs when the moving average line 1 crosses below the moving average line 2. This crossover suggests a possible downturn in market momentum. However, for a short trade to be confirmed, the strategy verifies that the moving average 3 on the higher time frame is in a downward trend. This confirmation ensures that the trade is in harmony with the overarching market direction.

Exit from Long Position: The strategy triggers an exit signal from a long position when the moving average line 1 crosses below the moving average line 2. This crossover indicates a potential reversal in the market trend, prompting the trader to close their long position and take profits or minimize losses.

Exit from Short Position: Similarly, an exit signal from a short position occurs when the moving average line 1 crosses above the moving average line 2. This crossover suggests a potential shift in market sentiment towards the upside, prompting the trader to exit their short position and manage their risk accordingly.

Features of the script
This Triple MA Strategy is basically the HTF Trend Filter displayed 3 times on the chart. For more infomation on how the MA with dynamic smoothing is calculated I recommend reading the following script:
For risk management I included a simple script to opt for % of eauity or # of contracts of in the instrument. For explanation on how the risk management settings work I refer to my ealier published script:
The strategy is a simplified example for setting up an entry and exit logic based on multiple moving avarages. Hence the script is meant for educational purposes only.


开源脚本

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

免责声明

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

想在图表上使用此脚本?