INVITE-ONLY SCRIPT
更新済 RSI & VWAP Strategy

RSI & VWAP 'Buy the Dip' Strategy with Advanced Trailing Stop
Strategy Overview
This is a long-only, mean-reversion "buy the dip" strategy designed to identify and capitalize on oversold conditions in the market. The core philosophy is to enter positions when an asset is technically oversold (confirmed by RSI) and trading at a "discount" relative to its recent volume (confirmed by VWAP).
The strategy does not just look for weakness; it waits for a single bar of bullish confirmation (a green candle) before triggering an entry. This helps to filter out "falling knives" and improves the quality of the entry signal.
The true power of this script lies in its sophisticated position management, which includes:
Smart Pyramiding: A "scale-in" feature that allows you to add to your position at cheaper prices.
Dual-Mode Exit System: You can choose between a simple, fixed Stop-Loss/Take-Profit or an advanced, multi-stage trailing stop designed to protect profits and let winners run.
1. The Entry Signal: "The Dip"
A buy signal (marked by a green triangle below the bar) is generated only when all three of the following conditions are met simultaneously:
RSI is Oversold: The RSI value drops below the user-defined RSI Oversold Level (default: 30). This identifies technically oversold weakness.
Price is Below VWAP: The closing price is below the Volume-Weighted Average Price. This indicates the price is "cheap" relative to where the majority of volume has traded.
Bullish Confirmation Bar: The bar itself must be green (close > open). This acts as a confirmation signal, showing that buyers are stepping in to defend the oversold/undervalued level.
2. Position Management: Smart Pyramiding
This strategy allows for pyramiding (default: 1 additional entry). However, it doesn't just buy every new signal. It uses a "Smart Pyramiding" feature controlled by the "Percent Decrease" input.
How it works: When a new buy signal appears after you are already in a position, the strategy checks the Percent Decrease value.
Example (Percent Decrease = 5%): The strategy will only add to your position if the new entry price is at least 5% lower than your last entry price. This is an "average down" or "scale-in" feature that ensures you only add to your position at significantly better prices.
If set to 0%: The strategy will add to the position on any new valid buy signal (up to the pyramid limit).
3. The Dual-Mode Exit System
This is the most advanced feature of the script. You can choose your exit logic using the "Enable Trailing Stop" checkbox.
Mode 1: Standard SL/TP (Trailing Stop = OFF)
This is the simple, traditional exit mode.
It uses a fixed percentage-based Stop Loss and Take Profit.
These are calculated from the strategy.position_avg_price (your average entry cost).
Ideal for straightforward backtesting or a "set it and forget it" approach.
Mode 2: Advanced Trailing Stop (Trailing Stop = ON)
This is a dynamic, multi-phase exit logic designed to maximize gains and protect profits. It works in three distinct phases:
Phase 1: Entry (No Stop-Loss)
CRITICAL: When a position is first opened in this mode, no stop-loss is active. This is a deliberate design choice to avoid being stopped out by initial volatility before the trade has a chance to move in your favor. The position is "naked" until it hits the first profit target.
Phase 2: Activation (Breakeven Trigger)
When the price's high reaches your "First Profit Target (%)" (default: 5%), the trailing stop activates.
The script now begins tracking the highestPrice achieved since activation.
Phase 3: Trailing & Profit Protection
Once activated, the script places a dynamic stop-loss at a distance of "Trailing Pullback Stop (%)" (default: 3%) below the highestPrice.
Profit Lock-In: This stop-loss can only move up. It includes a breakeven-plus feature (math.max(trailingStopLevel, entryPrice)). This means that once your stop is activated, it will never move back below your average entry price, effectively guaranteeing that a winning trade cannot turn into a loss.
Example: Your First Profit Target is 5% and Trailing Pullback is 3%. The trade goes to +5% (trail activates, breakeven stop is placed). It then goes to +10% (stop moves up to +7%). If the price then falls to +6.9%, you are stopped out with a +7% gain.
Pyramid-Reset Logic: If you pyramid into a position (add a second entry), the entire Trailing Stop mechanism resets. The strategy.position_avg_price is recalculated, and the logic returns to Phase 1 (No Stop-Loss) until the new First Profit Target is hit based on the new average cost.
Key Inputs & Features
RSI Settings: RSI Period and RSI Oversold Level to fine-tune the entry signal.
ADVANCE SETTINGS:
Use Percentage Decrease?: Enables the "Smart Pyramiding" feature.
Percent Decrease: The percentage discount required for a pyramid entry.
TRAILING STOP (Group):
Enable Trailing Stop: The master switch for the exit logic (Mode 1 vs. Mode 2).
First Profit Target (%): The percentage gain required to activate the trailing stop.
Trailing Pullback Stop (%): How "tight" the trailing stop will be once active.
Standard SL/TP (Group):
Stop Loss %: Used only if the Trailing Stop is OFF.
Take Profit %: Used only if the Trailing Stop is OFF.
Backtesting Date Range: Built-in date filters allow you to easily test the strategy's performance during specific market periods (e.g., bull markets, bear markets, or choppy ranges).
How to Use & Recommendations
Test Both Exit Modes: Run backtests using both the Standard SL/TP mode and the Advanced Trailing Stop mode to see which performs better on your asset and timeframe.
Understand the Risk: Be fully aware that in Advanced Trailing Mode, there is no hard stop-loss between your entry and the "First Profit Target." This requires a higher risk tolerance but can prevent premature stop-outs.
Tune for Your Asset: This is a mean-reversion strategy. It may perform best in markets that are ranging or "choppy." It may perform poorly in very strong, one-directional trending markets. Adjust the RSI and Percent Decrease settings to match the volatility of your chosen asset.
Disclaimer: This script is for educational and informational purposes only. It is not financial advice. All trading involves risk, and past performance is not indicative of future results. Please conduct your own thorough backtesting and research before using this strategy with real funds.
Strategy Overview
This is a long-only, mean-reversion "buy the dip" strategy designed to identify and capitalize on oversold conditions in the market. The core philosophy is to enter positions when an asset is technically oversold (confirmed by RSI) and trading at a "discount" relative to its recent volume (confirmed by VWAP).
The strategy does not just look for weakness; it waits for a single bar of bullish confirmation (a green candle) before triggering an entry. This helps to filter out "falling knives" and improves the quality of the entry signal.
The true power of this script lies in its sophisticated position management, which includes:
Smart Pyramiding: A "scale-in" feature that allows you to add to your position at cheaper prices.
Dual-Mode Exit System: You can choose between a simple, fixed Stop-Loss/Take-Profit or an advanced, multi-stage trailing stop designed to protect profits and let winners run.
1. The Entry Signal: "The Dip"
A buy signal (marked by a green triangle below the bar) is generated only when all three of the following conditions are met simultaneously:
RSI is Oversold: The RSI value drops below the user-defined RSI Oversold Level (default: 30). This identifies technically oversold weakness.
Price is Below VWAP: The closing price is below the Volume-Weighted Average Price. This indicates the price is "cheap" relative to where the majority of volume has traded.
Bullish Confirmation Bar: The bar itself must be green (close > open). This acts as a confirmation signal, showing that buyers are stepping in to defend the oversold/undervalued level.
2. Position Management: Smart Pyramiding
This strategy allows for pyramiding (default: 1 additional entry). However, it doesn't just buy every new signal. It uses a "Smart Pyramiding" feature controlled by the "Percent Decrease" input.
How it works: When a new buy signal appears after you are already in a position, the strategy checks the Percent Decrease value.
Example (Percent Decrease = 5%): The strategy will only add to your position if the new entry price is at least 5% lower than your last entry price. This is an "average down" or "scale-in" feature that ensures you only add to your position at significantly better prices.
If set to 0%: The strategy will add to the position on any new valid buy signal (up to the pyramid limit).
3. The Dual-Mode Exit System
This is the most advanced feature of the script. You can choose your exit logic using the "Enable Trailing Stop" checkbox.
Mode 1: Standard SL/TP (Trailing Stop = OFF)
This is the simple, traditional exit mode.
It uses a fixed percentage-based Stop Loss and Take Profit.
These are calculated from the strategy.position_avg_price (your average entry cost).
Ideal for straightforward backtesting or a "set it and forget it" approach.
Mode 2: Advanced Trailing Stop (Trailing Stop = ON)
This is a dynamic, multi-phase exit logic designed to maximize gains and protect profits. It works in three distinct phases:
Phase 1: Entry (No Stop-Loss)
CRITICAL: When a position is first opened in this mode, no stop-loss is active. This is a deliberate design choice to avoid being stopped out by initial volatility before the trade has a chance to move in your favor. The position is "naked" until it hits the first profit target.
Phase 2: Activation (Breakeven Trigger)
When the price's high reaches your "First Profit Target (%)" (default: 5%), the trailing stop activates.
The script now begins tracking the highestPrice achieved since activation.
Phase 3: Trailing & Profit Protection
Once activated, the script places a dynamic stop-loss at a distance of "Trailing Pullback Stop (%)" (default: 3%) below the highestPrice.
Profit Lock-In: This stop-loss can only move up. It includes a breakeven-plus feature (math.max(trailingStopLevel, entryPrice)). This means that once your stop is activated, it will never move back below your average entry price, effectively guaranteeing that a winning trade cannot turn into a loss.
Example: Your First Profit Target is 5% and Trailing Pullback is 3%. The trade goes to +5% (trail activates, breakeven stop is placed). It then goes to +10% (stop moves up to +7%). If the price then falls to +6.9%, you are stopped out with a +7% gain.
Pyramid-Reset Logic: If you pyramid into a position (add a second entry), the entire Trailing Stop mechanism resets. The strategy.position_avg_price is recalculated, and the logic returns to Phase 1 (No Stop-Loss) until the new First Profit Target is hit based on the new average cost.
Key Inputs & Features
RSI Settings: RSI Period and RSI Oversold Level to fine-tune the entry signal.
ADVANCE SETTINGS:
Use Percentage Decrease?: Enables the "Smart Pyramiding" feature.
Percent Decrease: The percentage discount required for a pyramid entry.
TRAILING STOP (Group):
Enable Trailing Stop: The master switch for the exit logic (Mode 1 vs. Mode 2).
First Profit Target (%): The percentage gain required to activate the trailing stop.
Trailing Pullback Stop (%): How "tight" the trailing stop will be once active.
Standard SL/TP (Group):
Stop Loss %: Used only if the Trailing Stop is OFF.
Take Profit %: Used only if the Trailing Stop is OFF.
Backtesting Date Range: Built-in date filters allow you to easily test the strategy's performance during specific market periods (e.g., bull markets, bear markets, or choppy ranges).
How to Use & Recommendations
Test Both Exit Modes: Run backtests using both the Standard SL/TP mode and the Advanced Trailing Stop mode to see which performs better on your asset and timeframe.
Understand the Risk: Be fully aware that in Advanced Trailing Mode, there is no hard stop-loss between your entry and the "First Profit Target." This requires a higher risk tolerance but can prevent premature stop-outs.
Tune for Your Asset: This is a mean-reversion strategy. It may perform best in markets that are ranging or "choppy." It may perform poorly in very strong, one-directional trending markets. Adjust the RSI and Percent Decrease settings to match the volatility of your chosen asset.
Disclaimer: This script is for educational and informational purposes only. It is not financial advice. All trading involves risk, and past performance is not indicative of future results. Please conduct your own thorough backtesting and research before using this strategy with real funds.
リリースノート
Just change strategy exit comment lines.招待専用スクリプト
こちらのスクリプトにアクセスできるのは投稿者が承認したユーザーだけです。投稿者にリクエストして使用許可を得る必要があります。通常の場合、支払い後に許可されます。詳細については、以下、作者の指示をお読みになるか、TrendciHocaに直接ご連絡ください。
スクリプトの機能を理解し、その作者を全面的に信頼しているのでなければ、お金を支払ってまでそのスクリプトを利用することをTradingViewとしては「非推奨」としています。コミュニティスクリプトの中で、その代わりとなる無料かつオープンソースのスクリプトを見つけられる可能性もあります。
作者の指示
trendcihoca@gmail.com or with tradingview chat panel.
免責事項
これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。
招待専用スクリプト
こちらのスクリプトにアクセスできるのは投稿者が承認したユーザーだけです。投稿者にリクエストして使用許可を得る必要があります。通常の場合、支払い後に許可されます。詳細については、以下、作者の指示をお読みになるか、TrendciHocaに直接ご連絡ください。
スクリプトの機能を理解し、その作者を全面的に信頼しているのでなければ、お金を支払ってまでそのスクリプトを利用することをTradingViewとしては「非推奨」としています。コミュニティスクリプトの中で、その代わりとなる無料かつオープンソースのスクリプトを見つけられる可能性もあります。
作者の指示
trendcihoca@gmail.com or with tradingview chat panel.
免責事項
これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。