OPEN-SOURCE SCRIPT

AWMA Strategy

399
Strategy Overview
This AWMA (Adaptive Weighted Moving Average) strategy combines multiple short- and long-term WMAs to generate entry signals, and uses the crossover of the average of those groups for exit signals. It’s designed to capture strong trend momentum while providing clear, rule-based exits.

Inputs

Short WMA Periods: 3, 5, 8, 10, 12, 15

Long WMA Periods: 30, 35, 40, 45, 50, 60

Position Size: percentage of equity (default 100%)

Entry Rules

Bullish Entry (Long):

The maximum value among the six short-term WMAs crosses above the minimum value among the six long-term WMAs.

At bar close, the minimum short-term WMA is still above the maximum long-term WMA (i.e. all short WMAs are stacked above all long WMAs).

When both conditions are met, the strategy places a long order and triggers a JSON-formatted alert for external bots.

Bearish Entry (Short):

The maximum short-term WMA crosses below the minimum long-term WMA.

At bar close, the maximum short-term WMA remains below the minimum long-term WMA (all short WMAs stacked below long WMAs).

Executes a short order and sends a JSON alert.

Exit Rules

Exit Long: When the average of the six short-term WMAs crosses below the average of the six long-term WMAs.

Exit Short: When the average short-term WMAs cross above the average long-term WMAs.

Exits are sent with JSON alerts containing ticker, timeframe, average WMA values, and close price.

Alerts
All alerts use the following JSON payload (suitable for Telegram bots):

json
복사
편집
{"text":"<Korean message>\nTicker: <symbol>\nTimeframe: <period>\n…additional data…"}
Replace <Korean message> with one of:

“매수 신호 발생” (Long entry)

“매도 신호 발생” (Short entry)

“롱 포지션 종료” (Long exit)

“숏 포지션 종료” (Short exit)

Plots

Individual short WMAs (turquoise) and long WMAs (pink) are overlaid on price.

Average short and long WMA lines are also plotted for visualizing exit crossover points.

Use this strategy on any timeframe to catch strong trend continuations and systematic exits based on grouped WMA behavior.

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。