Trinity Triple RMATrinity 3 Dynamic RMA. This custom Pine Script helps you spot trend direction with three smoothed moving averages (RMAs) that change color in real time.
### What the Indicator Does
The script plots three independent **Relative Moving Averages (RMAs)** — also known as Wilder's Smoothed Moving Averages. Each line represents a different speed of trend:
- RMA 1 (default period 9) — reacts fastest to price changes.
- RMA 2 (default period 21) — medium speed.
- RMA 3 (default period 50) — slowest, shows broader direction.
Each RMA line turns **green** when it is rising (bullish momentum) and **red** when it is falling (bearish momentum). You can fully customize the periods, sources, colors, and line thickness for every RMA separately through grouped settings.
Additional visual and alert features include:
- A background color that highlights when **all three RMAs align** (all green for bullish or all red for bearish) — this tint is semi-transparent and fully editable.
- Alerts for individual RMA direction changes, when exactly **two out of three** are bullish, and when **all three** are aligned.
The goal is to give you quick visual confirmation of trend strength and momentum without clutter.
Customizing the Settings
Once added, click the gear icon next to the indicator name to open settings. Everything is organized into clean groups:
- **RMA 1**, **RMA 2**, and **RMA 3** groups let you change:
- Period (how many bars it looks back).
- Source (close, open, high, low, etc.).
- Bullish color (when rising).
- Bearish color (when falling).
- Line width.
- **Alerts & Background** group controls:
- Whether to enable the "2 out of 3 Bullish" alert.
- Whether to show the background color when all RMAs align.
- The exact colors and transparency for the all-bullish and all-bearish background tints.
Adjust these freely — changes apply instantly. You can save your favorite setup as a template via the indicator menu for reuse across charts.
### Understanding the Visuals
- Watch the lines for direction: Green means the RMA is sloping upward (price momentum building higher), red means downward slope.
- When all three lines turn green and stay green, the background lightly fills with your chosen bullish color, signaling strong alignment.
- The same happens in red for bearish alignment.
- The "2 out of 3 bullish" condition often appears before full alignment — it can act as an early warning for building momentum.
These visuals help filter noise and focus on higher-probability trend continuation or shifts.
### Setting Up Alerts
Alerts keep you informed without staring at the screen:
1. With the indicator on the chart, right-click anywhere on the chart and choose **Add Alert**, or click the clock/alarm icon at the top.
2. In the **Condition** dropdown, scroll to find this indicator's name.
3. Select one of the available triggers, such as:
- RMA 1 (or 2 or 3) Turned Bullish / Bearish
- 2 out of 3 RMAs Bullish (only triggers if you enabled it in settings)
- All 3 RMAs Bullish
- All 3 RMAs Bearish
4. Choose how often the alert should fire (once per bar, once per bar close, etc.).
5. Customize the message if you want, then set notifications (pop-up, email, SMS, webhook, or app push).
6. Click **Create**.
Alerts fire only on the exact conditions coded in the script, so they stay reliable even if you change colors or periods.
### Recommended Timeframes and Usage Tips
The default periods (9, 21, 50) work well across many styles because they combine short-term sensitivity with longer-term confirmation.
- For **day trading or scalping**, try 5-minute or 15-minute charts — the faster RMA reacts quickly to intraday swings while the slower ones filter noise.
- For **swing trading**, the 1-hour or 4-hour timeframe often gives the cleanest signals with fewer false moves.
- On the **daily chart**, the setup shines for position trading or spotting multi-day trends.
A common approach is to look for **confluence**: price pulling back to a green RMA line in an overall bullish setup, or all lines turning the same color together. Use the background tint as a quick bias filter — trade in the direction of the alignment and be cautious when colors are mixed.
Start on the 1-hour chart to get comfortable, then experiment with other timeframes. Combine it with volume or basic support/resistance for even stronger context if you like.
This indicator is flexible, so tweak the defaults to match your personal style.
Chỉ báo Pine Script®






















