OPEN-SOURCE SCRIPT

MAD Ratio with Buy/Sell Signals

This code creates an indicator that generates Buy and Sell signals based on the Moving Average Distance (MAD) Ratio and the crossover/crossunder of two Simple Moving Averages (SMA). Here's a breakdown of what it does:

What the Indicator Shows:
Moving Averages:

21-day SMA (shortMA): Plotted in blue.
200-day SMA (longMA): Plotted in red.
These lines visually represent short-term and long-term trends in price.
Horizontal Reference Line:

A gray horizontal line at Ratio = 1 marks when the 21-day SMA and 200-day SMA are equal. This is the neutral point for the MAD ratio.
Buy and Sell Signals:

Buy Signal (Green Label):

Triggered when:
MAD Ratio > 1 (shortMA is greater than longMA, indicating upward momentum).
The 21-day SMA crosses above the 200-day SMA.
Displays a green "BUY" label below the price chart.
Sell Signal (Red Label):

Triggered when:
MAD Ratio < 1 (shortMA is less than longMA, indicating downward momentum).
The 21-day SMA crosses below the 200-day SMA.
Displays a red "SELL" label above the price chart.
Trend Analysis

Script open-source

Dans le plus pur esprit TradingView, l'auteur de ce script l'a publié en open-source, afin que les traders puissent le comprendre et le vérifier. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais la réutilisation de ce code dans une publication est régie par nos Règles. Vous pouvez le mettre en favori pour l'utiliser sur un graphique.

Vous voulez utiliser ce script sur un graphique ?


Aussi sur:

Clause de non-responsabilité