OPEN-SOURCE SCRIPT

Buy/Sell Signals (MACD + RSI) 1H

This is a Pine Script indicator for TradingView that plots Buy/Sell signals based on the combination of MACD and RSI indicators on a 1-hour chart.

Description of the Code:
Indicator Setup:

The script is set to overlay the Buy/Sell signals directly on the price chart (using overlay=true).
The indicator is named "Buy/Sell Signals (MACD + RSI) 1H".
MACD Settings:

The MACD (Moving Average Convergence Divergence) uses standard settings of:
Fast Length: 12
Slow Length: 26
Signal Line Smoothing: 9
The MACD line and the Signal line are calculated using the ta.macd() function.
RSI Settings:

The RSI (Relative Strength Index) is calculated with a 14-period setting using the ta.rsi() function.
Buy/Sell Conditions:

Buy Signal:
Triggered when the MACD line crosses above the Signal line (Golden Cross).
RSI value is below 50.
Sell Signal:
Triggered when the MACD line crosses below the Signal line (Dead Cross).
RSI value is above 50.
Signal Visualization:

Buy Signals:
Green "BUY" labels are plotted below the price bars where the Buy conditions are met.
Sell Signals:
Red "SELL" labels are plotted above the price bars where the Sell conditions are met.
Chart Timeframe:

While the code itself doesn't enforce a specific timeframe, the name indicates that this indicator is intended to be used on a 1-hour chart.
To use it effectively, apply the script on a 1-hour chart in TradingView.
How It Works:
This indicator combines MACD and RSI to generate Buy/Sell signals:
The MACD identifies potential trend changes or momentum shifts (via crossovers).
The RSI ensures that Buy/Sell signals align with broader momentum (e.g., Buy when RSI < 50 to avoid overbought conditions).
When the defined conditions for Buy or Sell are met, visual signals (labels) are plotted on the chart.
How to Use:
Copy the code into the Pine Script editor in TradingView.
Save and apply the script to your 1-hour chart.
Look for:
"BUY" signals (green): Indicating potential upward trends or buying opportunities.
"SELL" signals (red): Indicating potential downward trends or selling opportunities.
This script is simple and focuses purely on providing actionable Buy/Sell signals based on two powerful indicators, making it ideal for traders who prefer a clean chart without clutter. Let me know if you need further customization!






buy_signalsdeadcrossgolden-crossMoving Average Convergence / Divergence (MACD)Relative Strength Index (RSI)sell_signals

Script de código aberto

No verdadeiro espírito do TradingView, o autor desse script o publicou como código aberto, para que os traders possam compreendê-lo e analisá-lo. Parabéns ao autor! Você pode usá-lo gratuitamente, mas a reutilização desse código em publicações é regida pelas Regras da Casa. Você pode favoritá-lo para usá-lo em um gráfico.

Quer usar esse script no gráfico?

Aviso legal