Chart patterns
Bollinger Bounce Reversal Strategy – Visual EditionOverview:
The Bollinger Bounce Reversal Strategy – Visual Edition is designed to capture potential reversal moves at price extremes—often termed “bounce points”—by using a combination of technical indicators. The strategy integrates Bollinger Bands, MACD, and volume analysis, and it provides rich on‑chart visual cues to help traders understand its signals and conditions. Additionally, the strategy enforces a maximum of 5 trades per day and uses fixed risk management parameters. This publication is intended for educational purposes and offers a systematic, transparent approach that you can further adjust to fit your market or risk profile.
How It Works:
Bollinger Bands:
A 20‑period simple moving average (SMA) and a user‑defined standard deviation multiplier (default 2.0) are used to calculate the Bollinger Bands.
When the price reaches or crosses these bands (i.e. falls below the lower band or rises above the upper band), it suggests that the price is in an extreme, potentially oversold or overbought, state.
MACD Filter:
The MACD (calculated with standard lengths, e.g. 12, 26, 9) provides momentum information.
For a bullish (long) signal, the MACD line should be above its signal line; for a bearish (short) signal, the MACD line should be below.
Volume Confirmation:
The strategy uses a 20‑period volume moving average to determine if current volume is strong enough to validate a signal.
A signal is confirmed only if the current volume is at or above a specified multiple (by default, 1.0×) of this moving average, ensuring that the move is supported by increased market participation.
Visual Cues:
Bollinger Bands and Fill: The basis (SMA), upper, and lower Bollinger Bands are plotted, and the area between the upper and lower bands is filled with a semi‑transparent color.
Signal Markers: When a long or short signal is generated, corresponding markers (labels) appear on the chart.
Background Coloring: The chart’s background changes color (green for long signals and red for short signals) on the bars where signals occur.
Information Table: An on‑chart table displays key indicator values (MACD, signal line, volume, average volume) and the number of trades executed that day.
Entry Conditions:
Long Entry:
A long trade is triggered when the previous bar’s close is below the lower Bollinger Band and the current bar’s close crosses above it, combined with a bullish MACD condition and strong volume.
Short Entry:
A short trade is triggered when the previous bar’s close is above the upper Bollinger Band and the current bar’s close crosses below it, with a bearish MACD condition and high volume.
Risk Management:
Daily Trade Limit: The strategy restricts trading to no more than 5 trades per day.
Stop-Loss and Take-Profit:
For each position, a stop loss is set at a fixed percentage away from the entry price (typically 2%), and a take profit is set to target a 1:2 risk-reward ratio (typically 4% from the entry price).
Backtesting Setup:
Initial Capital: $10,000
Commission: 0.1% per trade
Slippage: 1 tick per bar
These realistic parameters help ensure that backtesting results reflect the conditions of an average trader.
Disclaimer:
Past performance is not indicative of future results. This strategy is experimental and provided solely for educational purposes. It is essential to backtest extensively and paper trade before any live deployment. All risk management practices are advisory, and you should adjust parameters to suit your own trading style and risk tolerance.
Conclusion:
By combining Bollinger Bands, MACD, and volume analysis, the Bollinger Bounce Reversal Strategy – Visual Edition provides a clear, systematic method to identify potential reversal opportunities at price extremes. The added visual cues help traders quickly interpret signals and assess market conditions, while strict risk management and a daily trade cap help keep trading disciplined. Adjust and refine the settings as needed to better suit your specific market and risk profile.
shubham 2.00one of the best strategy you ever get must give it a try or not i don care it works for me the best
RSI Stoic Strategy 15minit works best for bitcoin RSI Stoic Strategy for 15-Minute Bitcoin Chart
This strategy combines the powerful RSI (Relative Strength Index) with a disciplined approach inspired by Stoicism. It aims to help traders maintain emotional control and make logical, rational decisions by setting clear boundaries for trade entries and exits.
Key Features:
RSI Extremes: The strategy uses RSI levels of 90 (overbought) and 10 (oversold) to generate buy and sell signals. This helps identify extreme market conditions where price corrections are more likely.
Risk Management: Built-in Stop Loss and Take Profit levels with a Risk-Reward Ratio of 2:1. This allows traders to control their risk and reward while remaining calm and focused.
Patience and Discipline: Inspired by Stoicism, the strategy waits for extreme market conditions to enter trades, helping traders avoid impulsive actions and remain consistent with their strategy.
Automatic Entry and Exit: The strategy automatically enters positions when the RSI hits the predefined extreme levels (below 10 for buy and above 90 for sell) and sets appropriate stop loss and take profit levels.
Backtestable: This script is fully backtestable and can be applied to any 15-minute chart, particularly useful for volatile assets like Bitcoin.
How It Works:
Buy Signal: Triggered when RSI falls below 10 (oversold condition).
Sell Signal: Triggered when RSI rises above 90 (overbought condition).
Risk Management: The strategy automatically calculates the Sto
Dynamic Trend Line Pro📌 Detailed Explanation of the TradingView Indicator Code**
This **Pine Script v6** indicator dynamically **draws trend lines** based on pivot highs and pivot lows, helping traders visualize market trends in real-time.
---
## **🔹 How the Indicator Works**
This script detects key **pivot points** (local highs and lows) in the price chart and connects them to draw **trend lines**. Here's a breakdown of the process:
1. **Detects Pivot Highs and Lows**:
- **Pivot High:** A local maximum where the price is higher than surrounding bars.
- **Pivot Low:** A local minimum where the price is lower than surrounding bars.
2. **Stores the Last Pivot Points**:
- The script remembers the **last pivot high** and **last pivot low** points to **draw dynamic trend lines**.
3. **Draws Trend Lines**:
- The **uptrend** (support) line is drawn from two **pivot lows**.
- The **downtrend** (resistance) line is drawn from two **pivot highs**.
- Trend lines are continuously updated and extended.
---
## **🔹 Code Breakdown**
### **1️⃣ Inputs for User Customization**
```pinescript
leftLen = input.int(2, 'Left Pivots')
rightLen = input.int(2, 'Right Pivots')
lineThickness = input.int(3, 'Trend Line Thickness')
lineTransparency = input.int(20, 'Line Transparency')
```
- **leftLen & rightLen:** Set the number of bars on the left and right of the pivot point to confirm its validity.
- **lineThickness:** Controls the **thickness** of the trend line.
- **lineTransparency:** Adjusts the **opacity** of the trend line (0 = fully opaque, 100 = fully transparent).
---
### **2️⃣ Detect Pivot Highs and Lows**
```pinescript
pivotHigh = ta.pivothigh(leftLen, rightLen)
pivotLow = ta.pivotlow(leftLen, rightLen)
```
- **ta.pivothigh(leftLen, rightLen):** Identifies a **pivot high**, where the price is higher than the surrounding bars.
- **ta.pivotlow(leftLen, rightLen):** Identifies a **pivot low**, where the price is lower than the surrounding bars.
---
### **3️⃣ Store the Last Pivot Points**
#### **Storing the Last Pivot High (Resistance)**
```pinescript
var float lastHP = na
var int lastHPIndex = na
```
- These variables store the most recent **pivot high** (`lastHP`) and its **bar index** (`lastHPIndex`).
#### **Storing the Last Pivot Low (Support)**
```pinescript
var float lastLP = na
var int lastLPIndex = na
```
- These variables store the most recent **pivot low** (`lastLP`) and its **bar index** (`lastLPIndex`).
---
### **4️⃣ Update Pivot Points When New Ones Are Found**
#### **Updating Pivot Highs (Resistance)**
```pinescript
if not na(pivotHigh)
lastHP := pivotHigh
lastHPIndex := bar_index - rightLen
```
- If a new **pivot high** is found:
- Update `lastHP` with the new pivot high.
- Update `lastHPIndex` with the current bar index.
#### **Updating Pivot Lows (Support)**
```pinescript
if not na(pivotLow)
lastLP := pivotLow
lastLPIndex := bar_index - rightLen
```
- Similarly, if a new **pivot low** is found:
- Update `lastLP` with the new pivot low.
- Update `lastLPIndex` with the current bar index.
---
### **5️⃣ Detect Trend Direction**
```pinescript
trendUp = lastLP > lastLP and not na(lastLP )
trendDown = lastHP < lastHP and not na(lastHP )
```
- **Uptrend Condition:** If the most recent pivot low (`lastLP`) is higher than the previous one, it indicates an uptrend.
- **Downtrend Condition:** If the most recent pivot high (`lastHP`) is lower than the previous one, it indicates a downtrend.
---
### **6️⃣ Drawing Trend Lines**
#### **Drawing the Uptrend (Support) Line**
```pinescript
if trendUp
if na(trendLine)
trendLine := line.new(lastLPIndex , lastLP , lastLPIndex, lastLP, color=color.new(color.green, lineTransparency), width=lineThickness, extend=extend.right)
else
line.set_xy1(trendLine, lastLPIndex , lastLP )
line.set_xy2(trendLine, lastLPIndex, lastLP)
line.set_color(trendLine, color.new(color.green, lineTransparency))
line.set_width(trendLine, lineThickness)
```
- **Uptrend Line:** If the uptrend is detected (`trendUp`), the script either creates a new **green trend line** connecting the last two pivot lows or updates the existing one with the latest points.
#### **Drawing the Downtrend (Resistance) Line**
```pinescript
if trendDown
if na(trendLine)
trendLine := line.new(lastHPIndex , lastHP , lastHPIndex, lastHP, color=color.new(color.red, lineTransparency), width=lineThickness, extend=extend.right)
else
line.set_xy1(trendLine, lastHPIndex , lastHP )
line.set_xy2(trendLine, lastHPIndex, lastHP)
line.set_color(trendLine, color.new(color.red, lineTransparency))
line.set_width(trendLine, lineThickness)
```
- **Downtrend Line:** If the downtrend is detected (`trendDown`), the script either creates a new **red trend line** connecting the last two pivot highs or updates the existing one with the latest points.
---
## **🔹 How to Use This Indicator**
1. **Apply the Script in TradingView**:
- Open **Pine Script Editor** → Paste the code → Click **"Add to Chart"**.
2. **Interpret the Trend Lines**:
- **Green Line (Support):** Indicates potential support levels. Price may **bounce** off this line.
- **Red Line (Resistance):** Indicates potential resistance levels. Price may **struggle** to break above this line.
3. **Trading Strategy**:
- **Breakout Strategy:**
- If the price **breaks resistance** (red line), it may signal a **bullish** move.
- If the price **breaks support** (green line), it may signal a **bearish** move.
- **Reversal Strategy:**
- Look for **bounces** off support or resistance for potential reversals.
---
## **🔹 Key Features of This Indicator**
✅ **Automatically detects pivot highs and lows.**
✅ **Real-time updates** as new pivot points form.
✅ **Customizable settings** for line thickness and transparency.
✅ Helps traders visualize key **support** and **resistance** levels.
This indicator is perfect for **trend traders**, **support/resistance traders**, and anyone interested in **breakout** or **reversal strategies**. 🚀
[COG] Adaptive Squeeze Intensity 📊 Adaptive Squeeze Intensity (ASI) Indicator
🎯 Overview
The Adaptive Squeeze Intensity (ASI) indicator is an advanced technical analysis tool that combines the power of volatility compression analysis with momentum, volume, and trend confirmation to identify high-probability trading opportunities. It quantifies the degree of price compression using a sophisticated scoring system and provides clear entry signals for both long and short positions.
⭐ Key Features
- 📈 Comprehensive squeeze intensity scoring system (0-100)
- 📏 Multiple Keltner Channel compression zones
- 📊 Volume analysis integration
- 🎯 EMA-based trend confirmation
- 🎨 Proximity-based entry validation
- 📱 Visual status monitoring
- 🎨 Customizable color schemes
- ⚡ Clear entry signals with directional indicators
🔧 Components
1. 📐 Squeeze Intensity Score (0-100)
The indicator calculates a total squeeze intensity score based on four components:
- 📊 Band Convergence (0-40 points): Measures the relationship between Bollinger Bands and Keltner Channels
- 📍 Price Position (0-20 points): Evaluates price location relative to the base channels
- 📈 Volume Intensity (0-20 points): Analyzes volume patterns and thresholds
- ⚡ Momentum (0-20 points): Assesses price momentum and direction
2. 🎨 Compression Zones
Visual representation of squeeze intensity levels:
- 🔴 Extreme Squeeze (80-100): Red zone
- 🟠 Strong Squeeze (60-80): Orange zone
- 🟡 Moderate Squeeze (40-60): Yellow zone
- 🟢 Light Squeeze (20-40): Green zone
- ⚪ No Squeeze (0-20): Base zone
3. 🎯 Entry Signals
The indicator generates entry signals based on:
- ✨ Squeeze release confirmation
- ➡️ Momentum direction
- 📊 Candlestick pattern confirmation
- 📈 Optional EMA trend alignment
- 🎯 Customizable EMA proximity validation
⚙️ Settings
🔧 Main Settings
- Base Length: Determines the calculation period for main indicators
- BB Multiplier: Sets the Bollinger Bands deviation multiplier
- Keltner Channel Multipliers: Three separate multipliers for different compression zones
📈 Trend Confirmation
- Four customizable EMA periods (default: 21, 34, 55, 89)
- Optional trend requirement for entry signals
- Adjustable EMA proximity threshold
📊 Volume Analysis
- Customizable volume MA length
- Adjustable volume threshold for signal confirmation
- Option to enable/disable volume analysis
🎨 Visualization
- Customizable bullish/bearish colors
- Optional intensity zones display
- Status monitor with real-time score and state information
- Clear entry arrows and background highlights
💻 Technical Code Breakdown
1. Core Calculations
// Base calculations for EMAs
ema_1 = ta.ema(close, ema_length_1)
ema_2 = ta.ema(close, ema_length_2)
ema_3 = ta.ema(close, ema_length_3)
ema_4 = ta.ema(close, ema_length_4)
// Proximity calculation for entry validation
ema_prox_raw = math.abs(close - ema_1) / ema_1 * 100
is_close_to_ema_long = close > ema_1 and ema_prox_raw <= prox_percent
```
### 2. Squeeze Detection System
```pine
// Bollinger Bands setup
BB_basis = ta.sma(close, length)
BB_dev = ta.stdev(close, length)
BB_upper = BB_basis + BB_mult * BB_dev
BB_lower = BB_basis - BB_mult * BB_dev
// Keltner Channels setup
KC_basis = ta.sma(close, length)
KC_range = ta.sma(ta.tr, length)
KC_upper_high = KC_basis + KC_range * KC_mult_high
KC_lower_high = KC_basis - KC_range * KC_mult_high
```
### 3. Scoring System Implementation
```pine
// Band Convergence Score
band_ratio = BB_width / KC_width
convergence_score = math.max(0, 40 * (1 - band_ratio))
// Price Position Score
price_range = math.abs(close - KC_basis) / (KC_upper_low - KC_lower_low)
position_score = 20 * (1 - price_range)
// Final Score Calculation
squeeze_score = convergence_score + position_score + vol_score + mom_score
```
### 4. Signal Generation
```pine
// Entry Signal Logic
long_signal = squeeze_release and
is_momentum_positive and
(not use_ema_trend or (bullish_trend and is_close_to_ema_long)) and
is_bullish_candle
short_signal = squeeze_release and
is_momentum_negative and
(not use_ema_trend or (bearish_trend and is_close_to_ema_short)) and
is_bearish_candle
```
📈 Trading Signals
🚀 Long Entry Conditions
- Squeeze release detected
- Positive momentum
- Bullish candlestick
- Price above relevant EMAs (if enabled)
- Within EMA proximity threshold (if enabled)
- Sufficient volume confirmation (if enabled)
🔻 Short Entry Conditions
- Squeeze release detected
- Negative momentum
- Bearish candlestick
- Price below relevant EMAs (if enabled)
- Within EMA proximity threshold (if enabled)
- Sufficient volume confirmation (if enabled)
⚠️ Alert Conditions
- 🔔 Extreme squeeze level reached (score crosses above 80)
- 🚀 Long squeeze release signal
- 🔻 Short squeeze release signal
💡 Tips for Usage
1. 📱 Use the status monitor to track real-time squeeze intensity and state
2. 🎨 Pay attention to the color gradient for trend direction and strength
3. ⏰ Consider using multiple timeframes for confirmation
4. ⚙️ Adjust EMA and proximity settings based on your trading style
5. 📊 Use volume analysis for additional confirmation in liquid markets
📝 Notes
- 🔧 The indicator combines multiple technical analysis concepts for robust signal generation
- 📈 Suitable for all tradable markets and timeframes
- ⭐ Best results typically achieved in trending markets with clear volatility cycles
- 🎯 Consider using in conjunction with other technical analysis tools for confirmation
⚠️ Disclaimer
This technical indicator is designed to assist in analysis but should not be considered as financial advice. Always perform your own analysis and risk management when trading.
Trend Lines by Pivots (Enhanced)### **📌 Detailed Explanation of the TradingView Indicator Code**
This **Pine Script v5** indicator automatically **detects trend lines** based on pivot highs and pivot lows. It helps traders visualize **support and resistance levels** using dynamic trend lines.
---
## **🔹 How the Indicator Works**
The indicator identifies **key pivot points** in price action and then **draws trend lines** connecting them. It works as follows:
1. **Detects Pivot Highs and Lows**:
- A **pivot high** is a local maximum where the price is higher than surrounding bars.
- A **pivot low** is a local minimum where the price is lower than surrounding bars.
2. **Stores the Last Two Pivot Points**:
- The script remembers the last **two pivot highs** and **two pivot lows**.
- These points are used to **draw resistance and support lines** dynamically.
3. **Plots Resistance and Support Lines**:
- The script continuously **updates** and **extends** the trend lines to the right as new pivots are found.
- **Red Line (Resistance):** Connects the last two pivot highs.
- **Green Line (Support):** Connects the last two pivot lows.
---
## **🔹 Code Breakdown**
### **1️⃣ Inputs for User Customization**
```pinescript
leftLen = input.int(2, "Left Pivot Length")
rightLen = input.int(2, "Right Pivot Length")
highLineColor = input.color(color.red, "Resistance Line Color")
lowLineColor = input.color(color.green, "Support Line Color")
```
- **leftLen & rightLen:** Define how many bars on the left and right should be used to confirm a pivot.
- **highLineColor:** Sets the color of the resistance trend line (default: **red**).
- **lowLineColor:** Sets the color of the support trend line (default: **green**).
---
### **2️⃣ Detect Pivot Highs & Lows**
```pinescript
pivotHigh = ta.pivothigh(leftLen, rightLen)
pivotLow = ta.pivotlow(leftLen, rightLen)
```
- `ta.pivothigh(leftLen, rightLen)`: Detects a **pivot high** if it's the highest price in a certain range.
- `ta.pivotlow(leftLen, rightLen)`: Detects a **pivot low** if it's the lowest price in a certain range.
---
### **3️⃣ Store the Last Two Pivot Points**
#### **🔺 Storing Resistance (Pivot Highs)**
```pinescript
var float lastPivotHigh1 = na
var int lastPivotHighIndex1 = na
var float lastPivotHigh2 = na
var int lastPivotHighIndex2 = na
```
- These variables store **the last two pivot highs** and their **bar indices** (position on the chart).
#### **🔻 Storing Support (Pivot Lows)**
```pinescript
var float lastPivotLow1 = na
var int lastPivotLowIndex1 = na
var float lastPivotLow2 = na
var int lastPivotLowIndex2 = na
```
- These variables store **the last two pivot lows** and their **bar indices**.
---
### **4️⃣ Update Pivot Points When New Ones Are Found**
#### **Updating Resistance (Pivot Highs)**
```pinescript
if not na(pivotHigh)
lastPivotHigh2 := lastPivotHigh1
lastPivotHighIndex2 := lastPivotHighIndex1
lastPivotHigh1 := pivotHigh
lastPivotHighIndex1 := bar_index - rightLen
```
- If a new **pivot high** is found:
- The **previous pivot** becomes `lastPivotHigh2`.
- The **new pivot** becomes `lastPivotHigh1`.
- The index (`bar_index - rightLen`) marks where the pivot occurred.
#### **Updating Support (Pivot Lows)**
```pinescript
if not na(pivotLow)
lastPivotLow2 := lastPivotLow1
lastPivotLowIndex2 := lastPivotLowIndex1
lastPivotLow1 := pivotLow
lastPivotLowIndex1 := bar_index - rightLen
```
- Similar to pivot highs, this section updates **pivot lows** dynamically.
---
### **5️⃣ Create and Update Trend Lines**
#### **🔺 Drawing the Resistance Line**
```pinescript
var line highLine = na
if not na(lastPivotHigh2) and not na(lastPivotHigh1)
if na(highLine)
highLine := line.new(lastPivotHighIndex2, lastPivotHigh2, lastPivotHighIndex1, lastPivotHigh1, color=highLineColor, extend=extend.right)
else
line.set_xy1(highLine, lastPivotHighIndex2, lastPivotHigh2)
line.set_xy2(highLine, lastPivotHighIndex1, lastPivotHigh1)
line.set_color(highLine, highLineColor)
```
- If **two pivot highs** exist:
- **First time:** Creates a new **resistance line** connecting them.
- **Updates dynamically:** Adjusts the line when a new pivot appears.
#### **🔻 Drawing the Support Line**
```pinescript
var line lowLine = na
if not na(lastPivotLow2) and not na(lastPivotLow1)
if na(lowLine)
lowLine := line.new(lastPivotLowIndex2, lastPivotLow2, lastPivotLowIndex1, lastPivotLow1, color=lowLineColor, extend=extend.right)
else
line.set_xy1(lowLine, lastPivotLowIndex2, lastPivotLow2)
line.set_xy2(lowLine, lastPivotLowIndex1, lastPivotLow1)
line.set_color(lowLine, lowLineColor)
```
- Same logic applies for **support levels**, creating or updating a **green trend line**.
---
## **🔹 How to Use This Indicator**
1. **Apply the script in TradingView**:
- Open **Pine Script Editor** → Paste the code → Click **"Add to Chart"**.
2. **Interpret the Lines**:
- **Red line (Resistance):** Price may struggle to break above it.
- **Green line (Support):** Price may bounce off it.
3. **Trading Strategy**:
- **Breakout Strategy:**
- If the price **breaks resistance**, expect a bullish move.
- If the price **breaks support**, expect a bearish move.
- **Reversal Trading:**
- Look for **bounces off support/resistance** for potential reversals.
---
## **🔹 Key Features of This Indicator**
✅ **Automatically detects pivot highs and lows.**
✅ **Draws real-time trend lines for support and resistance.**
✅ **Updates dynamically with new price action.**
✅ **Customizable settings for pivot sensitivity and colors.**
This indicator is useful for **trend traders, breakout traders, and support/resistance traders**. 🚀
Let me know if you need **further improvements or additional features!** 😊
RSI T/MRSI Trend/Mean
Utilizes upper and lower bands to identify trending and mean-reverting market conditions.
Default settings for 2D
EMA + ADX StrategyThis script utilizes the Exponential Moving Average (EMA) and the Average Directional Index (ADX) to identify trend strength and potential trade signals.
Baxing-WatermarkWatamark ที่สามารถแสดงบน Chart
- ใส่ข้อความ และข้อความย่อยได้เอง พร้อมสามารถปรับแต่สีสัน และตำแหน่ง ได้ตามต้องการ
- มีส่วนของการแสดงผลิตภัณฑ์ กับ Timeframe
- สามาาถแสดงวันที่ และเวลา ได้ตาม Format ที่ระบุได้เอง และเลือก TimeZone(TZ) เพื่อให้แสดงวันที่และเวลาได้อย่างถูกต้อง
------------------------------
Watamark that can be displayed on Chart
- Insert title and sub-title by yourself, and can adjust the color and position as desired
- There is a section for displaying products and Timeframe
- Can display the date and time according to the specified Format and select TimeZone(TZ) to display the date and time correctly
------------------------------
------------------------------
RSI Deviation & Correlation by DINVESTORQOverview:
This indicator analyzes the Relative Strength Index (RSI) over 252 days, calculating its mean (average) and standard deviation. Based on this, it sets an upper and lower threshold to determine overbought and oversold conditions.
Additionally, it calculates the correlation between RSI and price using a moving average, helping traders understand if RSI is moving in sync with price trends.
Key Features:
✅ RSI Deviation Bands
Upper Limit = RSI Avg + (2 × SD × 2.5)
Lower Limit = RSI Avg - (2 × SD × 2.5)
✅ Trading Signals:
Sell Signal: RSI crosses above the upper limit
Buy Signal: RSI drops below the lower limit
✅ RSI-Price Correlation Moving Average
Uses 50-day correlation between RSI and price
Helps confirm trend strength
✅ Customizable Parameters
RSI Length (Default: 252 Days)
Correlation Period (Default: 50 Days)
✅ Chart Visuals:
Plots RSI (blue), Upper Band (red), Lower Band (green)
Plots RSI-Price Correlation (orange)
Buy/Sell signals appear on chart
TradingView Indicator: RSI Deviation & Correlation Indicator
Overview:
This indicator analyzes the Relative Strength Index (RSI) over 252 days, calculating its mean (average) and standard deviation. Based on this, it sets an upper and lower threshold to determine overbought and oversold conditions.
Additionally, it calculates the correlation between RSI and price using a moving average, helping traders understand if RSI is moving in sync with price trends.
Key Features:
✅ RSI Deviation Bands
Upper Limit = RSI Avg + (2 × SD × 2.5)
Lower Limit = RSI Avg - (2 × SD × 2.5)
✅ Trading Signals:
Sell Signal: RSI crosses above the upper limit
Buy Signal: RSI drops below the lower limit
✅ RSI-Price Correlation Moving Average
Uses 50-day correlation between RSI and price
Helps confirm trend strength
✅ Customizable Parameters
RSI Length (Default: 252 Days)
Correlation Period (Default: 50 Days)
✅ Chart Visuals:
Plots RSI (blue), Upper Band (red), Lower Band (green)
Plots RSI-Price Correlation (orange)
Buy/Sell signals appear on chart
Pine Script for TradingView:
pinescript
Copy
Edit
//version=5
indicator("RSI Deviation & Correlation Indicator", overlay=false)
// User Inputs
length = input.int(252, title="RSI Period")
corr_length = input.int(50, title="Correlation Period")
// RSI Calculation
rsi_value = ta.rsi(close, length)
// Calculate Mean and Standard Deviation of RSI
rsi_avg = ta.sma(rsi_value, length)
rsi_sd = ta.stdev(rsi_value, length) * 2.5
// Define Upper and Lower Limits
upper_limit = rsi_avg + (rsi_sd * 2)
lower_limit = rsi_avg - (rsi_sd * 2)
// Buy and Sell Signals
buy_signal = rsi_value < lower_limit
sell_signal = rsi_value > upper_limit
// Correlation Moving Average between RSI and Price
rsi_price_correlation = ta.correlation(rsi_value, close, corr_length)
// Plot RSI with Bands
plot(rsi_value, title="RSI", color=color.blue)
plot(upper_limit, title="Upper Limit", color=color.red, linewidth=2)
plot(lower_limit, title="Lower Limit", color=color.green, linewidth=2)
plot(rsi_avg, title="Average RSI", color=color.gray, linewidth=2)
// Display Buy/Sell Signals on Chart
plotshape(buy_signal, location=location.bottom, color=color.green, style=shape.labelup, title="BUY Signal", size=size.small)
plotshape(sell_signal, location=location.top, color=color.red, style=shape.labeldown, title="SELL Signal", size=size.small)
// Plot Correlation Moving Average
plot(rsi_price_correlation, title="RSI-Price Correlation", color=color.orange, linewidth=2)
// Alerts for Buy/Sell
alertcondition(buy_signal, title="BUY Alert", message="RSI is below the Lower Limit - BUY Signal")
alertcondition(sell_signal, title="SELL Alert", message="RSI is above the Upper Limit - SELL Signal")
How to Use in TradingView:
1️⃣ Open TradingView and go to the Pine Editor
2️⃣ Paste the above Pine Script
3️⃣ Click Add to Chart
4️⃣ Adjust RSI Length and Correlation Period if needed
5️⃣ Buy/Sell alerts will trigger when conditions match
Trading Strategy:
📉 Sell (Short Entry) when RSI crosses above the upper limit
📈 Buy (Long Entry) when RSI drops below the lower limit
📊 Confirm trends with RSI-Price Correlation:
+1 means RSI and price are moving together
-1 means RSI and price are diverging
Final Notes:
Works best on higher timeframes (Daily, Weekly)
Helps filter overbought/oversold false signals
Can be combined with other indicators (MACD, Bollinger Bands, etc.)
5-Min Trendline Breakout Based on H1 S/R [ABU SETTS]Trail, just wrote and still doing tuning.
What Changed?
Fixed plotshape Size Argument:- Added a switch statement to convert the input string (breakout_label_size) into a const string (label_size).
This ensures the size argument in plotshape receives a valid const string.
Improved Flexibility: - The breakout_label_size input now works correctly with plotshape and label.new.
How to Use
Adjust the Pivot Length, Slope Multiplier, and other inputs to customize the script.
Use the Breakout Label Size dropdown to select the size of the breakout labels (tiny, small, or normal).
Toggle Show Only Confirmed Breakouts to filter out unconfirmed signals.
Quarterly Performance█ OVERVIEW
The Quarterly Performance indicator is designed to visualise and compare the performance of different Quarters of the year. This indicator explores one of the many calendar based anomalies that exist in financial markets.
In the context of financial analysis, a calendar based anomaly refers to patterns or tendencies that are linked to specific time periods, such as days of the week, weeks of the month, or months of the year. This indicator helps explore whether such a calendar based anomaly exists between quarters.
By calculating cumulative quarterly performance and counting the number of quarters with positive returns, it provides a clear snapshot of whether one set of quarters tends to outperform the others, potentially highlighting a calendar based anomaly if a significant difference is observed.
█ FEATURES
Customisable time window through input settings.
Tracks cumulative returns for each quarter separately.
Easily adjust table settings like position and font size via input options.
Clear visual distinction between quarterly performance using different colours.
Built-in error checks to ensure the indicator is applied to the correct timeframe.
█ HOW TO USE
Add the indicator to a chart with a 3 Month (Quarterly) timeframe.
Choose your start and end dates in the Time Settings.
Enable or disable the performance table in the Table Settings as needed.
View the cumulative performance, with Q1 in blue, Q2 in red, Q3 in green and Q4 in purple.
Filtered Trend Levels with FibonacciCurrent Timeframe Check: I added isCurrentTimeframe to only display Fibonacci levels, trend labels, and other elements when the current timeframe matches the chart’s timeframe.
For example, this will show the Fibonacci levels only on a "5-minute" timeframe if timeframe.period == "5" or on a daily chart if timeframe.period == "1D".
Limit to Current Timeframe: All the labels and shapes (for Fibonacci levels, HH/HL, etc.) will only be shown if the isCurrentTimeframe condition is true, which ensures they only appear on the active timeframe.
How to Use:
Change your chart to different time frames (e.g., 5-minute, 1-hour, or daily).
The labels and circles will only show up when the script is applied to that specific timeframe.
This version ensures that only the relevant data for the currently active time frame is displayed, while you can also adjust the Fibonacci levels as needed.
Let me know if this works for you!
NFP High/Low LevelsChart the last 12 NFP Day High and Low values automatically.
Review and update indicator settings accordingly.
*Feel free to use/edit/improve
*shoutout to DeepSeek for coding help
XAU/USD Strategy: Candlestick Patterns Buy/SellThis indicator combines several technical analysis tools to generate buy and sell signals for XAU/USD (gold) based on candlestick patterns, RSI, Supertrend, and market structure (Swing High/Low). Here's a breakdown of how it works:
1. Input Parameters:
RSI Length & Levels:
rsi_length: The period for calculating the Relative Strength Index (RSI), defaulted to 14.
rsi_overbought: The overbought level for RSI, defaulted to 70.
rsi_oversold: The oversold level for RSI, defaulted to 30.
Supertrend Settings:
supertrend_atr: The period for the Average True Range (ATR), defaulted to 10.
supertrend_mult: The multiplier for the ATR in the Supertrend calculation, defaulted to 3.
Label Size: Controls the text size for the labels (Small, Normal, or Large).
Swing Length: Determines the lookback period to identify the highest high and lowest low for market structure analysis.
2. Exponential Moving Averages (EMAs):
Four EMAs (20, 50, 100, and 200 periods) are calculated, though they aren't directly used in the signal generation in this script.
3. RSI Calculation:
The RSI is calculated with the user-defined length (rsi_length) and is used to identify overbought and oversold conditions. If RSI is below the oversold level (30), it suggests a potential buy, and if RSI is above the overbought level (70), it suggests a potential sell.
4. Supertrend Calculation:
The Supertrend is calculated based on the ATR (with supertrend_atr length) and the user-defined multiplier (supertrend_mult).
The Supertrend Direction is determined by whether the price is above or below the Supertrend:
Direction = 1 (bullish) when the close is above the Supertrend upper band.
Direction = -1 (bearish) when the close is below the Supertrend lower band.
Direction = 0 (neutral) when the close is in between the bands.
5. Market Structure (SMC):
Swing Highs and Lows: The script identifies the highest high and lowest low over the last swing_length periods.
Last High and Last Low: These values are stored to be used in the signal generation logic.
6. Candlestick Patterns:
Bullish Engulfing: This pattern occurs when the current candle is bullish and fully engulfs the previous bearish candle.
Bearish Engulfing: This pattern occurs when the current candle is bearish and fully engulfs the previous bullish candle.
7. Signal Generation:
Buy Signal:
The RSI is below the oversold level (RSI < 30).
The Supertrend is bullish (direction = 1).
The price is above the last low.
OR: A bullish engulfing candlestick pattern occurs.
Sell Signal:
The RSI is above the overbought level (RSI > 70).
The Supertrend is bearish (direction = -1).
The price is below the last high.
OR: A bearish engulfing candlestick pattern occurs.
8. Label Plotting:
When a buy signal is generated:
A label is plotted below the candlestick indicating a "Buy" action, showing whether it was triggered by the RSI + Supertrend or by a Bullish Engulfing pattern.
A green line is drawn from the candlestick low to the buy label.
When a sell signal is generated:
A label is plotted above the candlestick indicating a "Sell" action, showing whether it was triggered by the RSI + Supertrend or by a Bearish Engulfing pattern.
A red line is drawn from the candlestick high to the sell label.
9. Alert Conditions:
Alerts are set for both buy and sell signals so that traders can receive notifications when a signal occurs for XAU/USD.
Summary:
This indicator generates buy and sell signals based on a combination of the RSI (for overbought/oversold conditions), Supertrend (for trend direction), market structure (Swing High/Low), and candlestick patterns (Bullish/Bearish Engulfing). Labels are plotted on the chart indicating the trade type, and lines connect the labels to the respective candlesticks. Alerts can be triggered when buy or sell conditions are met, making it a comprehensive strategy for trading XAU/USD (gold).
Optimized Smart Money Concept for BTCUSDThis indicator is designed to detect breakouts based on a simplified version of the Smart Money Concept (SMC) for BTCUSD and uses risk/reward calculations for trade management. Here's how it works:
1. Input Parameters:
Risk/Reward Ratio: This determines the target profit relative to the stop loss. For BTCUSD, the default is set to a 2:1 ratio (i.e., for every dollar risked, the target profit is two dollars).
Lookback Period for Swing High/Low: This is the number of bars used to look back to identify the highest high and lowest low, which help in determining the stop-loss levels. A larger lookback is used to account for BTCUSD's volatility.
2. Breakout Pattern:
Bullish Breakout Condition:
The first candle (index 2) is bearish (close < open).
The second candle (index 1) is bullish (close > open).
The third candle is also bullish (close > open), and it closes higher than the second candle.
Bearish Breakout Condition:
The first candle (index 2) is bullish (close > open).
The second candle (index 1) is bearish (close < open).
The third candle is also bearish (close < open), and it closes lower than the second candle.
3. Swing Points for Stop Loss:
Lowest Low (Long Stop Loss): The lowest low over the defined lookback period.
Highest High (Short Stop Loss): The highest high over the defined lookback period.
4. Stop Loss and Take Profit Calculation:
For Long (Buy) Trades:
Stop Loss is placed at the lowest low over the lookback period.
Take Profit is calculated by adding the difference between the entry price (current close) and the stop loss, multiplied by the risk/reward ratio (e.g., 2:1).
For Short (Sell) Trades:
Stop Loss is placed at the highest high over the lookback period.
Take Profit is calculated by subtracting the difference between the entry price and the stop loss, multiplied by the risk/reward ratio.
5. Conditions for Buy and Sell:
A buy condition is triggered when the bullish breakout pattern occurs.
A sell condition is triggered when the bearish breakout pattern occurs.
6. Plotting Buy/Sell Signals:
When a long (buy) condition is met, a label is placed below the candlestick with the entry price, take-profit (TP), and stop-loss (SL) levels. A line is drawn connecting the label to the low of the candlestick.
When a short (sell) condition is met, a label is placed above the candlestick with the entry price, TP, and SL levels. A line is drawn connecting the label to the high of the candlestick.
7. Breakout Debugging:
The indicator uses plotshape() to visually mark where bullish and bearish breakout patterns are detected on the chart with green (bullish) and red (bearish) shapes, respectively.
In Summary:
The indicator looks for specific bullish and bearish breakout patterns, calculates the stop-loss and take-profit levels based on swing points and a risk/reward ratio, and then plots buy/sell labels on the chart with the corresponding entry, TP, and SL values. It also provides a visual marker for each breakout pattern detected for debugging or confirmation purposes.
Three Bar Reversal & Pattern Signals with TP, SL This indicator identifies a "Three Bar Reversal" pattern and provides buy/sell signals along with stop-loss (SL), take-profit (TP), and entry prices based on mean reversion. Here’s a breakdown of how it works:
Inputs:
Text Size: The user can choose the size of the label text displayed on the chart, with options like tiny, small, normal, large, and huge.
Buy/Sell Label Colors: Users can set the colors for the buy and sell labels.
Buy/Sell Text Colors: The user can set the text color for the buy and sell labels.
Identifying Reversal Patterns:
Bullish Reversal: The indicator looks for a bullish reversal pattern where:
The first bar (index 2) is bullish (close > open).
The second bar (index 1) has a low price lower than the first bar.
The close of the current bar is higher than the high of the second bar.
Bearish Reversal: A bearish reversal is identified when:
The first bar (index 2) is bearish (close < open).
The second bar (index 1) has a high price higher than the first bar.
The close of the current bar is lower than the low of the second bar.
Mean Reversion (SMA) Calculation:
The script calculates a 20-period simple moving average (SMA) of the close prices (mean_price), which is used as a reference for setting stop-loss and take-profit levels.
Risk to Reward Ratio (1:1.5):
The risk-to-reward ratio is set at 1.5:1. This means the take-profit target is 1.5 times the distance from the entry price to the stop-loss.
Stop-Loss and Take-Profit Calculation:
Buy Signal:
Stop-Loss is placed 1% below the mean price.
Take-Profit is calculated based on the risk-to-reward ratio from the entry price.
Sell Signal:
Stop-Loss is placed 1% above the mean price.
Take-Profit is calculated similarly based on the risk-to-reward ratio.
Creating Labels:
When a bullish or bearish reversal pattern is detected:
A label is drawn on the chart showing the entry price, TP, and SL for the trade.
Alerts are triggered when a buy or sell signal is detected, displaying the relevant entry, TP, and SL levels.
Line Drawing:
A blue line is drawn at the low price of the reversal pattern to visually represent the reversal point.
In summary, the indicator combines a reversal pattern detection (Three Bar Reversal) with mean reversion, setting stop-loss and take-profit levels based on the 20-period moving average and a defined risk-to-reward ratio. Labels with the trade details (entry, TP, SL) are plotted, and alerts are triggered whenever a reversal pattern is identified.
Bollinger Band Breakout Signals **Bollinger Band Breakout Signals – Buy & Sell Alerts**
🚀 **Overview:**
This **Pine Script** generates **buy and sell signals** based on Bollinger Band breakouts. When the price crosses **below the lower Bollinger Band**, it triggers a **BUY signal** 📈. When the price crosses **above the upper Bollinger Band**, it triggers a **SELL signal** 📉.
🔔 **Key Features:**
✅ **Clear Buy & Sell Signals** – Visual markers on the chart for easy trading decisions.
✅ **Automatic Alerts** – Get notified instantly when breakouts occur.
✅ **Customizable Bollinger Bands** – Uses a 20-period moving average with 2 standard deviations (default settings).
✅ **Works on Any Market** – Use it on **stocks, crypto, forex, or commodities**.
📊 **How It Works:**
- **BUY Alert**: When price crosses **below** the lower Bollinger Band.
- **SELL Alert**: When price crosses **above** the upper Bollinger Band.
- Green **BUY arrows** appear below bars for buy signals.
- Red **SELL arrows** appear above bars for sell signals.
⚙️ **How to Set Up Alerts:**
1️⃣ Add the script to your TradingView chart.
2️⃣ Click the **Alerts (🔔) button** and select `"Bollinger Band Breakout Signals"`.
3️⃣ Choose **"Any alert function call"** to enable alerts.
4️⃣ Select your **preferred notification method** (popup, email, SMS, or webhook).
📢 **Perfect for traders looking to capitalize on momentum breakouts with precision!** 💰🔥
#TradingView #BollingerBands #BreakoutTrading #BuySellSignals #Crypto #Forex #Stocks
MA Crossover Strategy//@version=5
strategy("MA Crossover Strategy", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100)
// Define Moving Averages
maShort = ta.sma(close, 20)
maLong = ta.sma(close, 50)
// Define crossover conditions
longCondition = ta.crossover(maShort, maLong)
shortCondition = ta.crossunder(maShort, maLong)
// Define stop loss and target levels
stopLossPercent = 0.01 // 1% stop loss
targetPercent = 0.02 // 2% target profit
// Calculate stop loss and target prices
longStopLoss = close * (1 - stopLossPercent)
longTarget = close * (1 + targetPercent)
shortStopLoss = close * (1 + stopLossPercent)
shortTarget = close * (1 - targetPercent)
// Execute Buy Order
if longCondition
strategy.entry("Long", strategy.long)
strategy.exit("Take Profit", from_entry="Long", limit=longTarget, stop=longStopLoss)
// Execute Sell Order
if shortCondition
strategy.entry("Short", strategy.short)
strategy.exit("Take Profit", from_entry="Short", limit=shortTarget, stop=shortStopLoss)
// Plot Moving Averages
plot(maShort, title="MA 20", color=color.blue)
plot(maLong, title="MA 50", color=color.red)
NR7 Highlight (Day Timeframe Only) by rsavalagiNr7 Highlight by rsavalagi works in Daily time frame only