Updated
TPG.Buy sell RSI Scapl XAU

This is a tool that is widely used
Especially for Overbought and Oversold systems, but I have made some changes in this indicator,
How to use it...
I have set it as the default setting
- RSI Length: 6 (<10 for scalping - 5m-15m)
- Overbought: 70
- Oversold: 30
What is unique about this tool?
we can see 3 conditions:
1) RSI Overbought / Oversold with Bullish Engulfing / Bearish Engulfing
2) RSI Overbought / Oversold with Hammer and Shooting Star
3) RSI Overbought / Oversold with 2 Bullish Bars / 2 Bearish Bars
4) RSI Overbought / Oversold with All Patterns at the same time
When the RSI reaches its Oversold line, the code will wait for Bullish Engulfing pattren, when oversold and Bullish engulfing matched, This indicator will generate a buy signal when the condition is met,
and same as for Bear market, When the RSI reaches its Overbought line, the code will wait for Bearish Engulfing pattren, This indicator will generate a sell/exit signal when the condition is met,
2nd condition is that a Hammer candle will be waited for when RSI touches the Overbought line, for Bullish Move
and Shooting Star candle will be waited for when RSI touches the Overbought line, for Bullish Move, for Bearish Move
3rd Condition is also the same as Condition 1 and Condition 2,
When the RSI reaches its Oversold line, the code will wait for 2 Bullish Bars, when oversold and 2 Bullish Bars matched then this indicator will generate a buy signal, and same as for Bear market,
When the RSI reaches its Overbought line, the code will wait for 2 Bearish Bars, when overbought and 2 Bearish Bars matched then this indicator will generate a Sell signal,
4th Condition is that we can use All Conditions at the same time,
- Bullish Engulfing / Bearish Engulfing
- Hammer and Shooting Star
- 2 Bullish Bars / 2 Bearish Bars
Especially for Overbought and Oversold systems, but I have made some changes in this indicator,
How to use it...
I have set it as the default setting
- RSI Length: 6 (<10 for scalping - 5m-15m)
- Overbought: 70
- Oversold: 30
What is unique about this tool?
we can see 3 conditions:
1) RSI Overbought / Oversold with Bullish Engulfing / Bearish Engulfing
2) RSI Overbought / Oversold with Hammer and Shooting Star
3) RSI Overbought / Oversold with 2 Bullish Bars / 2 Bearish Bars
4) RSI Overbought / Oversold with All Patterns at the same time
When the RSI reaches its Oversold line, the code will wait for Bullish Engulfing pattren, when oversold and Bullish engulfing matched, This indicator will generate a buy signal when the condition is met,
and same as for Bear market, When the RSI reaches its Overbought line, the code will wait for Bearish Engulfing pattren, This indicator will generate a sell/exit signal when the condition is met,
2nd condition is that a Hammer candle will be waited for when RSI touches the Overbought line, for Bullish Move
and Shooting Star candle will be waited for when RSI touches the Overbought line, for Bullish Move, for Bearish Move
3rd Condition is also the same as Condition 1 and Condition 2,
When the RSI reaches its Oversold line, the code will wait for 2 Bullish Bars, when oversold and 2 Bullish Bars matched then this indicator will generate a buy signal, and same as for Bear market,
When the RSI reaches its Overbought line, the code will wait for 2 Bearish Bars, when overbought and 2 Bearish Bars matched then this indicator will generate a Sell signal,
4th Condition is that we can use All Conditions at the same time,
- Bullish Engulfing / Bearish Engulfing
- Hammer and Shooting Star
- 2 Bullish Bars / 2 Bearish Bars
Release Notes
//version=5indicator("KenshinyTrump Editter", "TPG RSI Pro")
//------------------------------------------------------------------------------
//Settings
//-----------------------------------------------------------------------------{
length = input.int(14, minval = 2)
smoType1 = input.string('EMA', 'Method', options = ['EMA', 'SMA', 'RMA', 'TMA', 'WMA'])
src = input(close, 'Source')
arsiCss = input(color.silver, 'Color', inline = 'rsicss')
autoCss = input(true, 'Auto', inline = 'rsicss')
//Signal Line
smooth = input.int(21, minval = 1, group = 'Signal Line')
smoType2 = input.string('WMA', 'Method', options = ['EMA', 'SMA', 'RMA', 'TMA', 'WMA'], group = 'Signal Line')
signalCss = input(#ff5d00, 'Color', group = 'Signal Line')
//OB/OS Style
obValue = input.float(80, 'Overbought', inline = 'ob', group = 'OB/OS Style')
obCss = input(color.rgb(1, 122, 102), '', inline = 'ob', group = 'OB/OS Style')
obAreaCss = input(color.new(#089981, 80), '', inline = 'ob', group = 'OB/OS Style')
obValue1 = input.float(90, 'Overbought', inline = 'ob', group = 'OB/OS Style')
obCss1 = input(color.rgb(1, 122, 102), '', inline = 'ob', group = 'OB/OS Style')
obAreaCss1 = input(color.new(#089981, 80), '', inline = 'ob', group = 'OB/OS Style')
osValue = input.float(20, 'Oversold ', inline = 'os', group = 'OB/OS Style')
osCss = input(#f23645, '', inline = 'os', group = 'OB/OS Style')
osAreaCss = input(color.new(#f23645, 80), '', inline = 'os', group = 'OB/OS Style')
osValue1 = input.float(10, 'Oversold ', inline = 'os', group = 'OB/OS Style')
osCss1 = input(#f23645, '', inline = 'os', group = 'OB/OS Style')
osAreaCss1 = input(color.new(#f23645, 80), '', inline = 'os', group = 'OB/OS Style')
//-----------------------------------------------------------------------------}
//Functions
//-----------------------------------------------------------------------------{
ma(x, len, maType)=>
switch maType
'EMA' => ta.ema(x, len)
'SMA' => ta.sma(x, len)
'RMA' => ta.rma(x, len)
'WMA' => ta.ema(x, len)
'TMA' => ta.sma(ta.sma(x, len), len)
//-----------------------------------------------------------------------------}
//Augmented RSI
//-----------------------------------------------------------------------------{
upper = ta.highest(src, length)
lower = ta.lowest(src, length)
r = upper - lower
d = src - src[1]
diff = upper > upper[1] ? r
: lower < lower[1] ? -r
: d
num = ma(diff, length, smoType1)
den = ma(math.abs(diff), length, smoType1)
arsi = num / den * 50 + 50
signal = ma(arsi, smooth, smoType2)
//-----------------------------------------------------------------------------}
//Plots
//-----------------------------------------------------------------------------{
plot_rsi = plot(arsi, 'Ultimate RSI'
, arsi > obValue ? obCss
: arsi < osValue ? osCss
: autoCss ? chart.fg_color : arsiCss)
plot(signal, 'Signal Line', signalCss)
//Levels
plot_up = plot(obValue, color = na, editable = false)
plot_up1 = plot(obValue1, color = na, editable = false)
plot_avg = plot(50, color = na, editable = false)
plot_dn = plot(osValue, color = na, editable = false)
plot_dn1 = plot(osValue1, color = na, editable = false)
//OB-OS
fill(plot_rsi, plot_up, arsi > obValue ? obAreaCss : na)
fill(plot_dn, plot_rsi, arsi < osValue ? osAreaCss : na)
//Gradient
fill(plot_rsi, plot_avg, obValue, 50, obAreaCss, color.new(chart.bg_color, 100))
fill(plot_avg, plot_rsi, 50, osValue, color.new(chart.bg_color, 100), osAreaCss)
hline(obValue, 'Overbought')
hline(obValue1, 'Overbought')
hline(50, 'Midline')
hline(osValue, 'Oversold')
hline(osValue1, 'Oversold')
//-----------------------------------------------------------------------------}
//Signal Labels
//-----------------------------------------------------------------------------{
buySignal = ta.crossover(arsi, signal) and arsi < 50
sellSignal = ta.crossunder(arsi, signal) and arsi > 50
if buySignal
label.new(bar_index, signal, 'B', style=label.style_label_down, color=color.green, textcolor=color.white, size=size.small)
if sellSignal
label.new(bar_index, signal, 'S', style=label.style_label_up, color=color.red, textcolor=color.white, size=size.small)
Release Notes
This script is designed to provide RSI-based buy and sell signals for scalping, specifically targeting XAU (Gold). It integrates RSI overbought/oversold conditions with various candlestick patterns like engulfing patterns, hammer/shooting star, and two consecutive bullish/bearish bars to identify potential entry points.Here's a quick breakdown of the features and logic:
RSI Setup:
RSI length is set by the input rsiL, defaulting to 7.
Overbought (rsiOBI) and oversold (rsiOSI) levels are set by inputs and default to 85 and 15, respectively.
RSI is calculated using the ta.rsi function, which drives the overbought and oversold logic for trade signals.
Hammer & Shooting Star Detection:
Hammers and shooting stars are detected by comparing the body of the candles relative to the fib level, combined with RSI oversold/overbought conditions.
If a valid hammer/shooting star forms and hammerShooting is enabled, signals are plotted.
Engulfing Candles:
Bullish and bearish engulfing candles are identified when one candle fully engulfs the previous one. This is combined with RSI overbought/oversold conditions for trade signals.
The user can enable/disable engulfing detection with BullBearEngulf.
Two Green/Red Bars:
Two consecutive bullish/bearish bars with RSI overbought/oversold are detected as potential signals when twoBullBearBar is enabled.
Trade Signal:
A trade signal is generated if RSI conditions (overbought/oversold) align with a bullish/bearish engulfing pattern, hammer/shooting star, or two consecutive bullish/bearish bars.
Visual labels are plotted on the chart for scalp sell/buy, hammer/shooting star, and two bullish/bearish bars, depending on conditions.
Alerts:
Alerts are set up to trigger when the TradeSignal condition is met. These can notify the user of a potential RSI scalp entry point.
Release Notes
📌 OverviewRSI Signals Upgraded is an enhanced RSI-based scalp trading tool combining:
• RSI overbought / oversold logic
• Engulfing pattern detection
• Hammer & Shooting Star filters
• Two-bar continuation setups
The script is optimized for fast intraday trading and works particularly well on volatile instruments such as gold (XAUUSD), indices, and major FX pairs.
🔎 Core Logic
The indicator identifies potential reversal zones when:
1️⃣ RSI reaches extreme levels
2️⃣ Candlestick confirmation appears
3️⃣ Structural pattern aligns with momentum shift
Signals include:
• Scalp.Buy
• Scalp.Sell
• Hammer (HMR)
• Shooting Star (SS)
• 2Bull / 2Bear continuation setups
Alerts are built-in for automation and trade monitoring.
⚙ Signal Types
🟢 Scalp.Buy – RSI Oversold + Bullish Engulfing
🔴 Scalp.Sell – RSI Overbought + Bearish Engulfing
🔵 HMR – Oversold Hammer confirmation
🟣 SS – Overbought Shooting Star
🟡 2Bull – Dual bullish continuation
🔵 2Bear – Dual bearish continuation
📈 Recommended Settings
• Timeframes: M5 – M30 (scalp focus)
• RSI Length: 7 (default)
• Works best in trending intraday volatility
Users can customize:
• RSI levels
• Pattern filters
• Hammer body size
🔔 Alerts
Built-in alert condition:
“RSI Scalp Entry”
Can be used for:
• Manual trade execution
• Semi-auto systems
• Bot integrations
⚠ Risk Disclaimer
This script is for educational and analytical purposes only.
No strategy guarantees profits. Always apply proper risk management.
Release Notes
# RSI Signals Tpg.invest Pro V2## Overview
RSI Signals Tpg.invest Pro V2 is a technical indicator designed to identify RSI-based trading signals and regular/hidden RSI divergences, with an optional EMA trend filter.
The goal is to help traders focus on signals aligned with the broader market direction while preserving the original RSI signal logic.
## Key Features
**1. RSI-Based BUY/SELL Signals**
- Identifies signals using RSI overbought/oversold conditions and configurable candlestick patterns.
- Preserves the original signal logic while allowing trend-based filtering.
**2. Regular and Hidden RSI Divergence**
- Regular Bullish Divergence
- Regular Bearish Divergence
- Hidden Bullish Divergence
- Hidden Bearish Divergence
- Customizable divergence lines, labels, colors, and styles.
**3. Internal EMA 9/13/34 Trend Filter**
- Bullish trend: EMA 9 > EMA 13 > EMA 34, with price above EMA 34.
- Bearish trend: EMA 9 < EMA 13 < EMA 34, with price below EMA 34.
- Neutral conditions allow the original RSI signals to pass through.
- The EMA trend filter operates internally and does not plot EMA lines or trend labels on the chart.
- Confirmed signal logic is evaluated at candle close.
**4. Configurable Risk and Signal Statistics**
- ATR-based or fixed-price Stop Loss and Take Profit distances.
- Configurable maximum waiting bars.
- Simulated WIN, LOSS, and TIMEOUT statistics.
- Rolling statistics based on a configurable sample size.
**5. Alerts**
- RSI BUY and SELL signals.
- Regular Bullish and Bearish Divergence.
- Hidden Bullish and Bearish Divergence.
- Any confirmed RSI signal.
## How to Use
1. Add the indicator to your chart.
2. Configure RSI and divergence settings.
3. Enable or disable the EMA 9/13/34 trend filter.
4. Review BUY/SELL signals and divergence markers.
5. Configure alerts according to your trading plan.
6. Test different settings on historical charts before using them in live trading.
## Important Notes
This indicator is a technical analysis tool, not an automated trading strategy. Its statistics are simulated according to the configured SL/TP and waiting-bar rules. They do not represent guaranteed results or actual broker execution.
The indicator does not execute orders or automatically close broker positions. Always apply independent risk management and test the indicator on your preferred markets and timeframes.
© TrungChuThanh
Release Notes
# RSI Signals Tpg.invest Pro V2 — Update## What's New
### 1. Dynamic Entry Volume (% Vol)
- Added a dynamic position allocation percentage to BUY/SELL entry labels.
- The suggested % Vol is determined by the signal score.
- Higher-scoring signals can receive a higher suggested allocation, subject to the configured limits.
- Entry labels display the signal direction, suggested % Vol, and entry price.
**Example:**
- SELL 50%
- 4126.42
### 2. Customizable Price Precision
- Added an option to display entry prices with 1, 2, or 3 decimal places.
- Suitable for instruments with different price precision requirements, including Gold (XAUUSD) and Forex pairs.
### 3. Customizable Divergence Line Style
- Added Solid, Dashed, and Dotted line styles.
- Supports Regular Bullish/Bearish and Hidden Bullish/Bearish Divergence.
- Line color, width, and transparency remain configurable.
### 4. Internal EMA Trend Filter
- Uses EMA 9, EMA 13, and EMA 34 to filter RSI signals.
- Bullish and bearish trend conditions are evaluated at candle close.
- EMA lines, MACD, and trend labels are not plotted on the chart.
- Original RSI BUY/SELL and divergence signals remain part of the indicator.
### 5. Original Features
- RSI-based BUY/SELL signals.
- Regular and Hidden RSI Divergence.
- Configurable signal and divergence alerts.
- ATR-based or fixed-price SL/TP simulation and statistics.
## Important Notes
The displayed % Vol is a suggested capital allocation based on a heuristic signal score. It is not a probability of winning, a guaranteed return, or an order automatically executed by a broker.
Backtest statistics are simulated and may differ from actual trading results. Please test the indicator on historical data and verify all settings before live use.
© TrungChuThanh
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.