OPEN-SOURCE SCRIPT

Moving Average Channel (MAC)

The strategy uses two Simple Moving Averages (SMA): an upper MA based on the high price and a lower MA based on the low price. Key features include:

Entry Condition: Enter a long position after five consecutive bars close above the upper MA.
Exit Conditions:
Close the position if five consecutive bars close below the lower MA.
Close the position if the price drops below 25% of the highest price recorded since entry (stop-loss).

Key Features:
Dynamic Entry: Long position is triggered only after consistent strength in price (5 bars above the upper MA).
Dynamic Exit:
Tracks weakness (5 bars below the lower MA) for exit.
Implements a stop-loss based on 25% retracement from the highest price recorded post-entry.
Customizable Parameters: MA lengths and stop-loss percentage are adjustable to fit different trading styles and market conditions.
This script provides a simple yet effective trend-following strategy with built-in risk management.






Bands and ChannelsTrend Analysis

开源脚本

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

想在图表上使用此脚本?

免责声明