OPEN-SOURCE SCRIPT

MA with Difference GROK3

293
What This Indicator Does

This indicator enhances a simple moving average (SMA) with two key features:
Color-Changing Moving Average:
The moving average line changes color based on whether the current closing price is above or below it.
Green: Price is above the MA (potential bullish signal).
Red: Price is below the MA (potential bearish signal).
Dynamic Percentage Difference Label:
A label appears on the chart near the MA on the last bar, showing the percentage difference between the current closing price and the MA.
Positive percentage (e.g., "Diff: 2.34%"): Price is above the MA.
Negative percentage (e.g., "Diff: -1.87%"): Price is below the MA.

Clause de non-responsabilité

Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.