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**. 🚀
Indicateurs et stratégies
SatoshiSteps Swing StrategyCore Components:
The indicator combines three popular technical analysis tools:
Ichimoku Cloud: This helps identify the trend, support, and resistance levels.
RSI (Relative Strength Index): This momentum oscillator identifies overbought and oversold conditions.
MACD (Moving Average Convergence Divergence): This trend-following momentum indicator shows the relationship between two moving averages1 of prices.
Logic:
The strategy aims to identify potential swing trading opportunities by combining signals from these three components. It essentially looks for:
Trend Confirmation (Ichimoku):
Price should be above the Ichimoku cloud for buy signals.
Price should be below the Ichimoku cloud for sell signals.
The Tenkan-sen (conversion line) should cross above the Kijun-sen (base line) for buy signals.
The Tenkan-sen should cross below the Kijun-sen for sell signals.
Overbought/Oversold Conditions (RSI):
RSI should be below the overbought level for buy signals (avoiding buying when the market is potentially overextended).
RSI should be above the oversold level for sell signals (avoiding selling when the market is potentially oversold).
Momentum Confirmation (MACD):
The MACD line should be above the signal line for buy signals (indicating upward momentum).
The MACD line should be below the signal line for sell signals (indicating downward momentum).
Buy Signal:
A buy signal is generated when all the following conditions are met:
The Tenkan-sen crosses above the Kijun-sen.
The price is above both the Senkou Span A and Senkou Span B (the cloud).
The RSI is below the overbought level.
The MACD line is above the signal line.
Sell Signal:
A sell signal is generated when all the following conditions are met:
The Tenkan-sen crosses below the Kijun-sen.
The price is below both the Senkou Span A and Senkou Span B (the cloud).
The RSI is above the oversold level.
The MACD line is below the signal line.
Key Considerations:
Time Frame: The indicator has built-in adjustments for 1-hour and 4-hour timeframes, optimizing the parameters for each.
Customization: You can customize the overbought/oversold RSI levels and the styles of the buy/sell signals (triangle, label, arrow, circle) through the indicator's settings.
Accuracy: While the strategy combines multiple indicators to improve accuracy, remember that no trading indicator is perfect. Market conditions can change rapidly, and false signals can occur.
Risk Management: Always use proper risk management techniques, such as stop-loss orders, and never risk more than you can afford to lose.
Mixed Moving Averages Bias Indicator with easy to read boxThis indicator uses 3 pairs of Ma's to establish the direction of the price.
These are labelled as short term, mid term and long term.
the purpose is to gain an edge for trading with the trend.
It also allows you to colour code the back ground for trending markets to clearly see if price is bullish or bearish
Three-Strike StrategyPivot Null Check: Handles potential na errors for pivot points, ensuring stability.
Cloud Fill: Proper EMA cloud visualization with adjustable transparency.
Label Duplication Prevention: Tooltip label added only on the last bar without cluttering the chart.
Better Alerts: Enhanced messages to match trading signals.
Global Inflation Indicator🔹 Overview:
The Global Inflation Indicator is a macro-analysis tool designed to track and compare inflation trends across major economies. It pulls Consumer Price Index (CPI) data from multiple regions, helping traders and investors analyze how inflation impacts global markets, particularly gold, forex, and commodities.
📊 Key Features:
✅ Tracks inflation in six major economies:
🇺🇸 USA (CPIAUCSL) – Key driver for USD and gold prices
🇪🇺 Eurozone (CPHPTT01EZM659N) – Euro inflation impact
🇬🇧 United Kingdom (GBRCPIALLMINMEI) – GBP & economic trends
🇨🇳 China (CHNCPIALLMINMEI) – Emerging market impact
🇯🇵 Japan (JPNCPIALLMINMEI) – Yen & inflation control policies
🇮🇳 India (INDCPIALLMINMEI) – Key gold-consuming economy
✅ Real-time Inflation Trends:
Provides a visual comparison of inflation levels in different regions.
Helps traders identify inflationary cycles & their effect on global assets.
✅ Macro-Driven Trading Decisions:
Gold & Forex Correlation: High inflation may increase demand for gold.
Interest Rate Expectations: Central banks respond to inflation shifts.
Currency Strength: Inflation impacts USD, EUR, GBP, JPY, CNY, INR.
📉 How to Use It:
Gold traders can assess inflation trends to predict potential price movements.
Forex traders can compare inflation effects on major currency pairs (EUR/USD, USD/JPY, GBP/USD, etc.).
Stock investors can evaluate how inflation affects central bank policies and interest rates.
📌 Conclusion:
The Global Inflation Indicator is a powerful tool for macroeconomic analysis, providing real-time insights into global inflation trends. By integrating this indicator into your gold, forex, and commodity trading strategies, you can make more informed investment decisions in response to economic changes.
AE - ATR Exhaustion ChannelAE - ATR Exhaustion Channel
📈 Overview
Identify Exhaustion Zones & Trend Breakouts with ATR Precision!
The AE - ATR Exhaustion Channel is a powerful volatility-based trading tool that combines an averaged SMA with ATR bands to dynamically highlight potential trend exhaustion zones. It provides real-time breakout detection by marking when price moves beyond key volatility bands, helping traders spot overextensions and reversals with ease.
🔑 Key Features
✔️ ATR-SMA Hybrid Channel: Uses an averaged SMA as the core trend filter while incorporating adaptive ATR-based bands for precise volatility tracking.
✔️ Dynamic Exhaustion Markers: Marks red crosses when price exceeds the upper band and green crosses when price drops below the lower band.
✔️ Customizable ATR Sensitivity: Adjust the ATR multiplier and length settings to fine-tune band sensitivity based on market conditions.
✔️ Clear Channel Visualization: A gray SMA midpoint and a blue-filled ATR band zone make it easy to track market structure.
📚 How It Works
1️⃣ Averaged SMA Calculation: The script calculates an averaged SMA over a user-defined range (min/max period). This smooths out short-term fluctuations while preserving trend direction.
2️⃣ ATR Band Construction: The ATR value (adjusted by a multiplier) is added to/subtracted from the SMA to form dynamic upper and lower volatility bands.
3️⃣ Exhaustion Detection:
If high > upper ATR band, a red cross is plotted (potential overextension).
If low < lower ATR band, a green cross is plotted (potential reversal zone).
4️⃣ Filled ATR Channel: The area between the upper and lower bands is shaded blue, providing a visual trading range.
🎨 Customization & Settings
⚙️ ATR Length – Adjusts the ATR calculation period (default: 14).
⚙️ ATR Multiplier – Scales the ATR bands for tighter or wider volatility tracking (default: 0.8, adjustable in 0.1 steps).
⚙️ SMA Range (Min/Max Length) – Defines the period range for calculating the averaged SMA (default: 5-20).
⚙️ Rolling Lookback Length – Controls how far back the high/low comparison is calculated (default: 50 bars).
🚀 Practical Usage
📌 Spotting Exhaustion Zones – Look for red/green markers appearing outside the ATR bands, signaling potential trend exhaustion and possible reversal opportunities.
📌 Breakout Confirmation – Price consistently breaching the upper band with momentum could indicate continuation, while repeated touches without strong closes may hint at reversal zones.
📌 Trend Reversal Signals – Watch for green markers below the lower band in uptrends (buy signals) and red markers above the upper band in downtrends (sell signals).
🔔 Alerts & Notifications
📢 Set Alerts for Exhaustion Signals!
Traders can configure alerts to trigger when price breaches the ATR bands, allowing for instant notifications when volatility-based exhaustion is detected.
📊 Example Scenarios
✔ Trend Exhaustion in Overextended Moves – A series of red crosses near resistance may indicate a short opportunity.
✔ Trend Exhaustion in Overextended Moves – A series of red crosses near resistance may indicate an opportunity to open a short trade.
✔ Volatility Compression Breakouts – If price consolidates within the ATR bands and suddenly breaks out, it could signify a momentum shift.
✔ Reversal Catching in Trending Markets – Spot potential trend reversals by looking for green markers below the ATR bands in bullish markets.
🌟 Why Choose AE - ATR Exhaustion Channel?
Trade with Confidence. Spot Volatility. Catch Breakouts.
The AE - ATR Exhaustion Channel is an essential tool for traders looking to identify trend exhaustion, detect breakouts, and manage volatility effectively. Whether you're trading stocks, crypto, or forex, this ATR-SMA hybrid system provides clear visual cues to help you stay ahead of market moves.
✅ Customizable to Fit Any Market
✅ Combines Volatility & Trend Analysis
✅ Easy-to-Use with Instant Breakout Detection
[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.
DSA Multi-Indicator Strategy with TargetsThe provided script integrates multiple technical indicators—Exponential Moving Averages (EMA), Lorentzian Average, Average Directional Index (ADX), Moving Average Convergence Divergence (MACD), and SuperTrend—to generate buy and sell signals. Here's a breakdown of the criteria used for these signals:
Buy Signal Criteria:
A buy signal is triggered when any of the following conditions are met:
EMA Fast Crosses Above Lorentzian Line: The 7-period EMA crosses above the 21-period Lorentzian average.
EMA Fast Crosses Above EMA Slow: The 7-period EMA crosses above the 19-period EMA, and both are above the Lorentzian line.
EMA Fast Slope Exceeds Threshold: The slope of the 7-period EMA is greater than 0.4%.
Price Closes Above Lorentzian Line: The current closing price is above the Lorentzian line.
SuperTrend Turns Bullish: The SuperTrend indicator shifts to a bullish trend.
Sell Signal Criteria:
A sell signal is generated when the following condition is met:
Two Consecutive Closes Below Lorentzian Line: The price closes below the Lorentzian line for two consecutive periods.
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!** 😊
Opening ScoreOverview:
The Composite Open Strategy Indicator is designed to provide traders with a unified, early-session directional bias by aggregating multiple non-correlated signals. By combining diverse analytical methods—spanning price action, volume, volatility, and time—the indicator helps you gauge whether the market is leaning bullish or bearish during the critical opening hours.
How It Works:
• Open Range Breakout (ORB) Signal:
The indicator captures the opening range (defined up to a user-specified time, e.g., 9:45 AM ET) and assigns a bullish signal when the price breaks above the high of that range, and a bearish signal when it drops below the low.
• VWAP Signal:
It compares the current price to the Volume Weighted Average Price (VWAP). A price above VWAP suggests buying pressure, while below indicates selling pressure.
• Trend Signal:
Using a simple moving average (with an adjustable period, typically around 20 bars), the indicator determines the prevailing trend. Price above the MA contributes a bullish bias, and price below contributes a bearish bias.
• Volatility Signal:
A volatility filter is applied via the Average True Range (ATR). An increasing ATR relative to the previous bar suggests rising volatility (bullish if combined with upward moves), whereas a decreasing ATR indicates the opposite.
Each of these four signals is assigned an equal weight (modifiable as needed), and their sum forms the composite score.
Display and Timing:
• Separate Panel:
The composite score is plotted as a histogram in its own indicator panel, ensuring your main price chart remains uncluttered.
• Session Filter:
The indicator is active only during the early session—from 9:30 AM to 12:30 PM Eastern Time—when the initial directional move is most relevant. Outside this time window, the indicator remains inactive.
Trading Insights:
• A positive composite score suggests a bullish bias, indicating that the aggregated signals lean toward an upward trend.
• A negative composite score points to a bearish bias, indicating a downward directional outlook.
Usage:
Ideal for traders looking to capture the market’s early trend direction, this indicator can be used as part of a broader strategy. Its design encourages consistency by combining multiple perspectives (price, volume, volatility, time) into one clear signal, allowing you to focus on setups that align with the dominant early-session move.
Before fully automating your trading approach, you can test and refine this composite method on TradingView using the built-in manual review process. Once confident in its performance, further automation can help integrate this directional bias seamlessly into your overall trading strategy.
Waldo's RSI Color Trend Candles
TradingView Description for Waldo's RSI Color Trend Candles
Title: Waldo's RSI Color Trend Candles
Short Title: Waldo RSI CTC
Overview:
Waldo's RSI Color Trend Candles is a visually intuitive indicator designed to enhance your trading experience by color-coding candlesticks based on the integration of Relative Strength Index (RSI) momentum and moving average trend analysis. This innovative tool overlays directly on your price chart, providing a clear, color-based representation of market sentiment and trend direction.
What is it?
This indicator combines the power of RSI with the simplicity of moving averages to offer traders a unique way to visualize market conditions:
RSI Integration: The RSI is computed with customizable parameters, allowing traders to adjust how momentum is interpreted. The RSI values influence the primary color of the candles, indicating overbought or oversold market states.
Moving Averages: Utilizing two Simple Moving Averages (SMAs) with user-defined lengths, the indicator helps in identifying trend directions through their crossovers. The fast MA and slow MA can be toggled on/off for visual clarity.
Color Trend Candles: The 'Color Trend Candles' feature uses a dynamic color scheme to reflect different market conditions:
Purple for overbought conditions when RSI exceeds the set threshold (default 70).
Blue for oversold conditions when RSI falls below the set threshold (default 44).
Green indicates a bullish trend, confirmed by both price action and RSI being bullish (fast MA crossing above slow MA, with price above the slow MA).
Red signals a bearish trend, when both price and RSI are bearish (fast MA crossing below slow MA, with price below the slow MA).
Gray for neutral or mixed market sentiment, where signals are less clear or contradictory.
How to Use It:
Waldo's RSI Color Trend Candles is tailored for traders who appreciate visual cues in their trading strategy:
Trend and Momentum Insight: The color of each candle gives an immediate visual representation of both the trend (via MA crossovers) and momentum (via RSI). Green and red candles align with bullish or bearish trends, respectively, providing a quick reference for market direction.
Identifying Extreme Conditions: Purple and blue candles highlight potential reversal zones or areas where the market might be overstretched, offering opportunities for contrarian trades or to anticipate market corrections.
Customization: Users can adjust the RSI length, overbought/oversold levels, and the lengths of the moving averages to align with their trading style or the specific characteristics of the asset they're trading.
This customization ensures the indicator can be tailored to various market conditions.
Simplified Decision Making: Designed for traders who prefer a visual approach, this indicator simplifies the decision-making process by encoding complex market data into an easy-to-understand color system.
However, for a robust trading strategy, it's recommended to use it alongside other analytical tools.
Control Over Display: The option to show or hide moving averages and to enable or disable the color-coding of candles provides users with control over how information is presented, allowing for a cleaner chart or more detailed analysis as preferred.
Conclusion:
Waldo's RSI Color Trend Candles offers a fresh, visually appealing method to interpret market trends and momentum through the color of candlesticks. It's ideal for traders looking for a straightforward way to gauge market sentiment at a glance. While this indicator can significantly enhance your trading setup, remember to incorporate it within a broader strategy, using additional confirmation from other indicators or analysis methods to manage risk and validate trading decisions. Dive into the colorful world of trading with Waldo's RSI Color Trend Candles and let the market's mood guide your trades with clarity and ease.
Dynamic RSI Bollinger Bands with Waldo Cloud
TradingView Indicator Description: Dynamic RSI Bollinger Bands with Waldo Cloud
Title: Dynamic RSI Bollinger Bands with Waldo Cloud
Short Title: Dynamic RSI BB Waldo
Overview:
Introducing an experimental indicator, the Dynamic RSI Bollinger Bands with Waldo Cloud, designed for adventurous traders looking to explore new dimensions in technical analysis. This indicator overlays on your chart, providing a unique perspective by integrating the Relative Strength Index (RSI) with Bollinger Bands, creating a dynamic trading tool that adapts to market conditions through the lens of momentum and volatility.
What is it?
This innovative indicator combines the traditional Bollinger Bands with the RSI in a way that hasn't been commonly explored. Here's a breakdown:
RSI Integration: The RSI is calculated with customizable length settings, and its values are used not just for momentum analysis but as the basis for the Bollinger Bands. This means the position and width of the bands are directly influenced by the RSI, offering a visual representation of momentum within the context of price volatility.
Dynamic Bollinger Bands: Instead of using price directly, the Bollinger Bands are calculated using a scaled version of the RSI. This scaling is done to fit the RSI values into the price range, ensuring the bands are relevant to the actual price movement. The standard deviation for these bands is also scaled accordingly, providing a unique volatility measure that's momentum-driven.
Waldo Cloud: Named after a visual representation concept, the 'Waldo Cloud' refers to the colored area between the Bollinger Bands, which changes based on various conditions:
Purple when RSI is overbought.
Blue when RSI is oversold.
Green for bullish conditions, defined by the fast-moving average crossing above the slow one, RSI is bullish, and the price is above the slow MA.
Red for bearish conditions, when the fast MA crosses below the slow MA, the RSI is bearish, and the price is below the slow MA.
Gray for neutral market conditions.
Moving Averages: Two simple moving averages (Fast MA and Slow MA) are included, which can be toggled on or off, offering additional trend analysis through crossovers.
How to Use It:
Given its experimental nature, this indicator should be used with caution and in conjunction with other analysis methods:
Identifying Market Conditions: Use the color of the Waldo Cloud to gauge market sentiment. A green cloud might suggest a good time to consider long positions, while a red cloud could indicate potential shorting opportunities. Purple and blue clouds highlight extreme conditions that might precede reversals.
Volatility and Momentum: The dynamic nature of the Bollinger Bands based on RSI provides insight into how momentum is affecting price volatility. When the bands are wide, it might indicate high momentum and potential trend continuation or reversal, depending on the RSI's position relative to its overbought/oversold levels.
Trend Confirmation: The moving average crossovers can act as confirmation signals. For instance, a bullish crossover (fast MA over slow MA) within a green cloud might strengthen a buy signal, whereas a bearish crossover in a red cloud might reinforce a sell decision.
Customization: Adjust the RSI length, overbought/oversold levels, and moving average lengths to suit different trading styles or market conditions. Experiment with these settings to find what works best for your strategy.
Combining with Other Indicators: Since this is an experimental tool, it's advisable to use it alongside established indicators like traditional Bollinger Bands, MACD, or trend lines to validate signals.
Conclusion:
The Dynamic RSI Bollinger Bands with Waldo Cloud is an experimental venture into combining momentum with volatility visually and interactively. It's designed for traders who are open to exploring new methods of market analysis.
Remember, due to its experimental status, this indicator should be part of a broader trading strategy, and backtesting or paper trading is recommended before applying it in live trading scenarios. Keep an eye on how the market reacts to the signals provided by this indicator and always consider risk management practices.
Trendlines with Breaks and EMAs with Buy SellThis indicator is designed to assist traders by analyzing market trends and identifying potential buy or sell signals. Here's how it works:
Trendlines Detection:
The indicator identifies significant price points called swing highs and swing lows. These points are used to plot upper and lower trendlines that visually represent the market's trend direction.
Slope Calculation:
The slope of the trendlines is determined using one of three methods selected by the user:
ATR (Average True Range) for volatility-based slope calculation
Standard Deviation (Stdev) for measuring price dispersion
Linear Regression (Linreg) for statistical trend analysis
Moving Averages (EMAs):
The indicator includes three EMAs (Exponential Moving Averages) with periods of 9, 21, and 99. These EMAs help visualize the short-term, medium-term, and long-term price trends.
Breakout Detection:
When the price breaks above the upper trendline, a green "B" (Buy) signal appears, indicating a potential upward trend. Conversely, when the price breaks below the lower trendline, a red "S" (Sell) signal is displayed, suggesting a potential downward trend.
Extended Lines and Alerts:
The trendlines can be extended for better visualization, and alerts are triggered when breakouts occur, enabling traders to react promptly.
By combining trendline analysis with moving averages and breakout signals, this indicator offers a comprehensive tool for identifying trading opportunities in the market
RSI T/MRSI Trend/Mean
Utilizes upper and lower bands to identify trending and mean-reverting market conditions.
Default settings for 2D
Daily Bias IndicatorBasic ICT Daily Bias Indicator
When yesterday's price breaks above and closes above the high of the day before yesterday, it indicates a bullish bias.
When yesterday's price tests the low of the day before yesterday but does not break below it, it indicates a bullish bias.
When yesterday's price breaks below and closes below the low of the day before yesterday, it indicates a bearish bias.
When yesterday's price tests the high of the day before yesterday but does not break above it, it indicates a bearish bias.
Waldo Cloud Bollinger Bands
Waldo Cloud Bollinger Bands Indicator Description for TradingView
Title: Waldo Cloud Bollinger Bands
Short Title: Waldo Cloud BB
Overview:
The Waldo Cloud Bollinger Bands indicator is a sophisticated tool designed for traders looking to combine the volatility analysis of Bollinger Bands with the momentum insights of the Relative Strength Index (RSI) and moving average crossovers. This indicator overlays on your chart, providing a visual representation that helps in identifying potential trading opportunities based on price action, momentum, and trend direction.
Concept:
This indicator merges three key technical analysis concepts:
Bollinger Bands: These are used to measure market volatility. The bands consist of a central moving average (basis) with an upper and lower band that are standard deviations away from this average. In this indicator, you can customize the type of moving average used for the basis (SMA, EMA, SMMA, WMA, VWMA), the length of the period, the source price, and the standard deviation multiplier, offering flexibility to adapt to different market conditions.
Relative Strength Index (RSI): The RSI is incorporated to provide insight into the momentum of price movements. Users can adjust the RSI length and overbought/oversold levels and even choose the price source for RSI calculation, allowing for tailored momentum analysis. The RSI values influence the cloud color between the Bollinger Bands, signaling market conditions.
Moving Average Crossovers: Two moving averages with customizable lengths and types are used to identify trend direction through crossovers. A fast MA (default 20 periods) and a slow MA (default 50 periods) are plotted when enabled, helping to signal potential bullish or bearish market conditions when they cross over each other.
Functionality:
Bollinger Bands Calculation: The basis of the Bollinger Bands is calculated using a user-defined moving average type, with a customizable length, source, and standard deviation multiplier. The upper and lower bands are then plotted around this basis.
RSI Calculation: The RSI is computed using a user-specified source, length, and overbought/oversold levels. This RSI value is used to determine the color of the cloud between the Bollinger Bands, which visually represents market sentiment:
Purple when RSI is overbought.
Blue when RSI is oversold.
Green for bullish conditions (when the fast MA crosses above the slow MA, RSI is bullish, and the price is above the slow MA).
Red for bearish conditions (when the fast MA crosses below the slow MA, RSI is bearish, and the price is below the slow MA).
Gray for neutral conditions.
Trend Analysis: The indicator uses two moving averages to help determine the trend direction.
When the fast MA crosses over the slow MA, it suggests a potential change in trend direction, which, combined with RSI conditions, provides a more comprehensive trading signal.
Customization:
Users can select the type of moving average for all calculations through the "Global MA Type" setting, ensuring consistency in how trends and volatility are interpreted.
The Bollinger Bands settings allow for adjustments in length, source, standard deviation, and offset, giving traders control over how volatility is measured.
RSI settings include the ability to change the RSI source, length, and overbought/oversold thresholds, which can be fine-tuned to match trading strategies.
The option to show or hide moving averages provides clarity on the chart, focusing on either the Bollinger Bands or including the MA crossovers for trend analysis.
Usage:
This indicator is ideal for traders who incorporate both volatility and momentum in their trading decisions.
By observing the color changes in the cloud, along with the position of the price relative to the moving averages, traders can gauge potential entry and exit points.
For instance, a green cloud with a price above the slow MA might suggest a strong buying opportunity, while a red cloud with a price below might indicate selling pressure.
Conclusion:
The Waldo Cloud Bollinger Bands indicator offers a unique blend of volatility, momentum, and trend analysis, providing traders with a multi-faceted view of market conditions. Its customization options make it adaptable to various trading styles and market environments, making it a valuable addition to any trader's toolkit on Trading View.
Averaged Stochastic RSI by TenozenSimplicity beats everything! Averaged Stochastic RSi is calculated using the 2 points of stochastic of the RSI, where the difference is by 2 (larger), and averaged out the stochastic's values. In result it is less noisy and more responsive towards the market's momentum.
I hope you guys find this indicator useful! So far this is the best indicator I ever had! And I also learned that simplicity is better than complex blurry/abstract problems. Ciao!
custom ema strategya trend following strategy basically it uses two emas 100 and 200 when the 100 crosses 200 it will tell about trend and we take trade when the price closes above or below 100 ema. Usually gives best results on 1h and 4h time frame targeting 1:3 rr. Good luck
BTC Bollinger Band Reversion Bot### **BTC Bollinger Band Reversion Strategy** 📊
This strategy is designed to **identify potential reversals** in Bitcoin’s price by leveraging **Bollinger Bands, RSI confirmation, and volume filtering**. It helps traders spot **overbought and oversold conditions**, allowing them to enter high-probability trades.
---
### **🔹 Strategy Logic:**
1️⃣ **BUY Signal (Long Entry) 🚀**
- Price **touches or drops below the lower Bollinger Band** (indicating oversold conditions).
- RSI (14) **falls below 30** (confirming oversold momentum).
- Volume **is above the 20-period average** (to avoid false signals).
2️⃣ **SELL Signal (Short Entry) 🔻**
- Price **touches or moves above the upper Bollinger Band** (indicating overbought conditions).
- RSI (14) **rises above 70** (confirming overbought momentum).
- Volume **is above the 20-period average** (to confirm strength).
---
### **🔹 Why This Works?**
✅ **Mean Reversion Concept:** Assets tend to revert to their average price after extreme movements.
✅ **RSI Confirmation:** Ensures signals are backed by actual momentum shifts.
✅ **Volume Filter:** Reduces false signals caused by low liquidity.
✅ **Color-Coded Alerts:** Enhances readability for quick decision-making.
This strategy is ideal for **scalping or swing trading**, depending on the timeframe used. 📈
Would you like me to tweak it further or add stop-loss/take-profit levels? 🚀
Week division This TradingView Pine Script indicator works exclusively on the hourly timeframe. Its primary functions are:
1. Marking the Opening of Each Weekday:
• It places a vertical line at the opening hour of each day (Sunday to Friday).
2. Dividing the Week by Days:
• It visually separates each day within the weekly structure to help traders analyze price movements per day.
3. Displaying the Day Name:
• The script labels each day’s opening with its respective name (e.g., “Sunday”, “Tuesday”, etc.) at the bottom of the chart.
Key Features:
✔️ Works only on the hourly timeframe
✔️ Highlights the start of each weekday
✔️ Divides the week into separate days
✔️ Displays the day’s name on the chart
Let me know if you need any modifications! 🚀
1H Week division NY Time(-5UTC)This TradingView Pine Script indicator works exclusively on the hourly timeframe. Its primary functions are:
1. Marking the Opening of Each Weekday:
• It places a vertical line at the opening hour of each day (Monday to Friday).
2. Dividing the Week by Days:
• It visually separates each day within the weekly structure to help traders analyze price movements per day.
3. Displaying the Day Name:
• The script labels each day’s opening with its respective name (e.g., “Monday”, “Tuesday”, etc.) at the bottom of the chart.
Key Features:
✔️ Works only on the hourly timeframe
✔️ Highlights the start of each weekday
✔️ Divides the week into separate days
✔️ Displays the day’s name on the chart
Let me know if you need any modifications! 🚀
CME_MINI:MNQ1!
950 StandardNQ 9:50 AM Candle Strategy v3 (Trade at 9:55AM) - 1 Contract
Also called 950 Standard, 950 Bar, or The 950 Strategy.
This strategy places its trade at 9:55am each day based on the close of the 9:50am candle. Uses 5min timeframe candles. If candle closes red, or bearish, the strategy goes short. If candle closes green, or bullish, the strategy goes long. Brackets are 150tick TP and 200tick SL.
Bracket IndicatorThis is an indicator that shows tick target above and below the chart. Allows for visualizing continual bracket target moving with price before getting into trade.
So, for example, if you are watching price and wanting to target 10 points above or below. You can set this bracket indicator on the chart and you will be able to in real time see 10 points above/below the current price.