LANZ Strategy 4.0Lanz Strategy 4.0 creada con amor para que te cambie la vida, como lo cambió la mía.
01/05/2025
Cerca negli script per "Cycle"
Trump/Biden Market RegimesHave you ever wondered if it's Trump's stock market (up) or Biden's stock market (down)? Think no more!
Simple Spread Viewer (con texto)Indica spread con numeros, en tiempo real. Ademas lo marca tambien con un grafico
EMA200/EMA7 HA w/ TP/SL & Markdown AlertsEnglish Description
Name: EMA200 / EMA7 Heikin Ashi Strategy with TP/SL & Markdown Alerts
Type: Spot‐only long (optional short) strategy on Heikin Ashi candles
Key Inputs & Settings:
Enable Longs: Toggle on/off long entries
Enable Shorts: Toggle on/off short entries
Thresholds:
Long entry when price is at least X% below EMA200 (default 2%) and HA close crosses above EMA7
Short entry when price is at least X% above EMA200 (default 2%) and HA close crosses below EMA7
Take Profit & Stop Loss: Percentage‐based TP/SL (default 2% each)
Signal Filters:
Heikin Ashi Trend: HA close > HA open for longs; HA close < HA open for shorts
HA Momentum: Two consecutive HA closes rising (longs) or falling (shorts)
Entries & Exits:
On a filtered crossover, enters market (“Long” or “Short”) at current close
Sets TP and SL levels immediately (limit & stop orders)
Exits automatically when TP or SL is hit
Alerts:
Sends a detailed Markdown‐formatted alert on every entry, including symbol, exchange, entry price, leverage (“5x”), TP & SL levels
Also defines succinct alertcondition() messages for “Signal Achat” and “Signal Vente”
Visuals & Stats Table:
Plots EMA200 (red) and EMA7 (blue) on the chart
Draws current TP/SL lines while in a position
Displays a bottom‐right table updated every 10 bars, showing total trades, win rate, net profit, average profit/trade, and max drawdown
Zero Lag Trend Signals (MTF) + Sideways FilterAbsolutely! Here's a **plain-language description** of what the script does **without diving into code**:
---
### 🔍 **What This Script Does:**
This is a **technical indicator** for TradingView that helps you identify:
1. **When the market is trending** (either bullish or bearish).
2. **When the market is moving sideways** (range-bound or choppy).
3. **Entry signals** during strong trends.
4. **Confirmation signals** across **multiple timeframes** (from 5-minute to daily).
5. **Visual cues and alerts** to guide trading decisions.
---
### 📈 **How It Works:**
#### 1. **Zero Lag Trend Detection**
- It uses a special moving average called **ZLEMA** (Zero Lag Exponential Moving Average) that reacts faster to price changes than traditional ones.
- If the price moves strongly above or below this average, the script recognizes it as a **new trend starting**.
#### 2. **Sideways Market Filter**
- It checks whether the market is **moving within a tight range** by analyzing:
- RSI (Relative Strength Index)
- ADX (Average Directional Index)
- If the market is sideways, it **avoids showing trend signals** and displays a gray circle instead to indicate indecision or no clear trend.
#### 3. **Visual Trend Markers**
- **Green arrows** appear when an upward trend begins.
- **Red arrows** appear when a downward trend begins.
- **Smaller arrows** suggest continuation or entry points during an ongoing trend.
#### 4. **Multi-Timeframe Confirmation**
- It looks at the trend across **five different timeframes** (e.g., 5 min, 15 min, 1 hour, 4 hour, 1 day).
- A **table appears on your chart** showing whether each timeframe is bullish or bearish — helping you make better-informed decisions.
#### 5. **Alerts**
- The script can send **alerts when trend signals appear**, so you don’t miss a potential trade setup even if you're away from the screen.
---
### ✅ **Why Use It:**
This script is ideal for:
- Traders who want to **follow trends and avoid choppy markets**.
- Those who prefer **clear visual signals** and multi-timeframe analysis.
- Anyone using **momentum or trend-following strategies**, especially with indicators like ZLEMA or ADX.
---
sideways market for strangleThis Pine Script is designed to identify **sideways or range-bound markets**, which are often ideal conditions for trading **options strangle strategies**. Here's a breakdown of what the script does:
---
### 🛠 **Purpose:**
To **detect low-volatility, sideways market conditions** where price is not trending strongly in either direction — suitable for **neutral options strategies like short strangles**.
---
### 📌 **Key Components:**
#### 1. **Inputs:**
- `RSI Length`: Default 14 — used for calculating the Relative Strength Index (RSI).
- `ADX Length`: Default 14 — used for calculating the Average Directional Index (ADX), DI+ (positive directional movement), and DI- (negative directional movement).
#### 2. **RSI Calculation:**
- `rsiValue` is calculated using the built-in `ta.rsi(close, rsiLength)`.
- A **sideways market** is expected when RSI is in the **40–60 range**, indicating lack of strong momentum.
#### 3. **ADX and Directional Indicators (DI+ and DI-):**
- `diPlus` and `diMinus` are calculated based on recent price movements and the True Range.
- `dx` (Directional Index) measures the strength of trend direction using the difference between DI+ and DI-.
- `adx` is a smoothed version of `dx` and represents **overall trend strength**.
#### 4. **Sideways Market Conditions:**
- **RSI Condition**: RSI is between 40 and 60.
- **ADX Condition**:
- `adx <= 25` → Weak or no trend.
- `adx < diPlus` and `adx < diMinus` → Confirms ADX is lower than directional components, reducing likelihood of a trending market.
#### 5. **Signal Plot:**
- A **green label below the bar** (`shape.labelup`) is plotted when both conditions are met.
- Indicates potential sideways market conditions.
---
### ✅ **Use Case:**
- This signal can help identify **low-volatility zones** suitable for **short strangles** or **iron condors**, where you profit from time decay while expecting the price to stay within a range.
Zero Lag Trend Signals (MTF) + Sideways FilterThis script is a custom indicator for TradingView that combines two major components: the **Zero Lag Trend** (with MTF support) and a **Sideways Market Filter**. Let me break down the key features and functions of the script:
### Key Components:
1. **Zero Lag Trend Signals**:
- **Zero Lag Trend (ZLEMA)**: A smoothed moving average designed to minimize lag and give faster responses to price movements. This is used to determine the trend.
- **Trend Bands**: Upper and lower bands are derived from the ZLEMA value and adjusted by volatility (calculated using Average True Range or ATR).
- **Trend Direction**: The trend direction is determined by whether the price crosses over the upper or lower band of the ZLEMA, indicating bullish or bearish trends.
2. **Sideways Market Filter**:
- **RSI (Relative Strength Index)**: Measures the speed and change of price movements. It's used here to identify neutral or sideways market conditions when RSI is between 40 and 60.
- **ADX (Average Directional Index)**: Measures the strength of a trend. The script considers a sideways market when ADX is less than 25 and both DI+ and DI- are low.
- **Sideways Market Condition**: A sideways market is defined when the RSI is in the range of 40 to 60 and the ADX is below 25, indicating weak trends.
### Main Features:
1. **Sideways Market Indicators**:
- **Sideways Circles**: When the market is identified as "sideways" based on RSI and ADX conditions, a small circle is plotted either above or below the bars on the chart. The user can adjust the color of the circles via the indicator settings.
- **Sideways Market Filter**: This filter helps to determine when to stay out of trend-based signals, and its detection is visually marked by the circles.
2. **Zero Lag Trend (ZLEMA) Plot**:
- **ZLEMA**: The Zero Lag Exponential Moving Average is plotted as a baseline, and the direction of the trend is indicated by color changes. Green is used for bullish trends, and red is used for bearish trends.
- **Trend Bands**: The script calculates upper and lower bands around the ZLEMA using volatility, and these bands help identify areas of potential trend reversal.
3. **Trend Plotting**:
- **Trend Arrows**: When the trend crosses from bullish to bearish or vice versa, the script plots arrows ("▲" for bullish and "▼" for bearish) above or below the bars on the chart to indicate the signal.
- **Trend Entry Points**: Small arrows are plotted when an entry point is detected for a long (bullish) or short (bearish) position.
4. **Multi-Timeframe (MTF) Trend Signals**:
- The script includes multi-timeframe (MTF) analysis by checking the trend on different timeframes (5m, 15m, 60m, 240m, and 1D).
- A **data table** is displayed on the chart showing the trend status for each of these timeframes (Bullish or Bearish), helping the trader visualize the trend across multiple timeframes.
5. **Alerts**:
- **Alert Conditions**: Alerts are triggered when specific conditions are met, such as:
- Bullish or bearish trend crossover.
- Zero Lag Trend crossing the price.
- Trend change signals on any of the timeframes.
- Alerts for bullish and bearish entry signals based on the trend.
### Inputs for Customization:
- **Zero Lag Trend Parameters**: Length, multiplier for the band, and timeframes for MTF analysis (t1, t2, t3, t4, t5).
- **Color Customization**: Colors for bullish and bearish trends, as well as the fill colors for the bands and the sideways market circles.
- **Sideways Market Filter Parameters**: RSI length, ADX length, and options for showing sideways market circles.
- **Circle Customization**: You can adjust the size, color, and location (above or below bars) of the sideways market circles.
### Summary:
This indicator is a sophisticated tool that combines the **Zero Lag Trend** and **Sideways Market Filter** to help traders:
- Identify strong trends (bullish or bearish) using the ZLEMA and volatility bands.
- Stay out of choppy or sideways markets using the RSI and ADX filter.
- Make trading decisions based on trend confirmation across multiple timeframes (MTF).
- Customize the visual appearance, including color schemes, circle size, and alert conditions.
This script is perfect for traders who want to focus on trading trends while avoiding market conditions that are not conducive to strong directional moves.
Custom 4 Moving Averages可自由調整 4 條均線的週期(透過輸入欄位)。
均線會顯示在 K 棒圖(主圖)上。
The periods of the 4 moving averages can be freely adjusted (via input fields).
The moving average will be displayed on the K-bar chart (main chart).
Price for 1 Gold Baht ราคา ทองคำ หนึ่งบาท📘 Indicator Description
🔧 English Version
Name: Price for 1 Gold Baht – ราคา ทองคำ หนึ่งบาท
Short title: 1 Baht Gold (THB)
Purpose:
This indicator calculates and visualizes the real-time price of 1 Thai Gold Baht (15.244 grams) based on the global gold price (XAU/USD) and the USD/THB exchange rate. It allows users to simulate the domestic Thai gold price with customizable inputs for gold weight and purity.
What it does:
Retrieves live gold price per troy ounce in USD (XAU/USD) Retrieves the current USD to Thai Baht exchange rate (USD/THB)
Converts the value into Thai Baht using:
User-defined weight in grams (default: 15.244 g)
User-defined purity in % (default: 96.5% for standard Thai gold)
Displays the result as a real-time chart line
Adds reference values to the Data Window for detailed tracking
Ideal for:
Traders who want to monitor local Thai gold price movements in global markets Analysts comparing spot gold to domestic bullion prices Anyone needing a precise, configurable conversion of international gold data into local Thai currency
📘 คำอธิบายอินดิเคเตอร์
🔧 ภาษาไทย
ชื่อ: ราคา ทองคำ หนึ่งบาท – Price for 1 Gold Baht
ชื่อย่อ: 1 Baht Gold (THB)
วัตถุประสงค์:
อินดิเคเตอร์นี้ออกแบบมาเพื่อแสดงราคาทองคำไทย 1 บาท (น้ำหนัก 15.244 กรัม) แบบเรียลไทม์ โดยใช้ราคาทองคำสากล (XAU/USD) และอัตราแลกเปลี่ยน USD/THB พร้อมทั้งให้ผู้ใช้สามารถปรับแต่งค่าน้ำหนักและความบริสุทธิ์ของทองได้ตามต้องการ
สิ่งที่อินดิเคเตอร์นี้ทำ:
ดึงราคาทองคำต่อทรอยออนซ์ในรูปแบบ USD (XAU/USD) แบบเรียลไทม์
ดึงอัตราแลกเปลี่ยน USD → บาท (USD/THB)
คำนวณราคาทองคำไทยโดยใช้: - น้ำหนักทองที่กำหนดโดยผู้ใช้ (ค่าเริ่มต้น 15.244 กรัม) - ความบริสุทธิ์ของทองที่กำหนดได้ (ค่าเริ่มต้น 96.5% สำหรับทองไทย) แสดงผลราคาทองคำ 1 บาทในรูปแบบกราฟเส้น แสดงข้อมูลเสริมใน Data Window เช่น ราคาทองสากล อัตราแลกเปลี่ยน และข้อมูลการคำนวณ
เหมาะสำหรับ:
นักเทรดที่ต้องการติดตามราคาทองคำไทยจากความเคลื่อนไหวในตลาดโลก
นักวิเคราะห์ที่เปรียบเทียบราคาทองคำ Spot กับราคาทองคำภายในประเทศ
ผู้ใช้งานที่ต้องการแปลงข้อมูลทองคำระหว่างประเทศให้เป็นราคาท้องถิ่นอย่างแม่นยำ
💡 Tip:
To use this script: Add it to any chart Customize gold weight or purity (if needed) Observe how international gold price movements translate to Thai domestic gold prices
ICT Macro H1 v2"H1 Candle Time Box" is a custom TradingView indicator that highlights a configurable time window surrounding the close of each 1-hour (H1) candle. The indicator draws a transparent box 15 minutes before and after each H1 candle close (by default), helping traders visualize time-based reaction zones.
🔍 Features:
Custom time window: Users can set how many minutes before and after the H1 close the box should appear.
Dynamic positioning: Boxes are drawn slightly above the candles to avoid overlap with price bars.
Live time labels: Each box displays its time range (e.g., "08:45 - 09:15") based on the start and end time of the zone.
Auto-cleaning: Only a limited number of recent boxes (default: 5) are shown, keeping the chart clean.
Requires 1-minute chart for precise timing.
This tool is especially helpful for intraday traders to identify areas of interest or market reactions before and after key hourly closes.
ICT Macro H1"H1 Candle Time Box" is a custom TradingView indicator that highlights a configurable time window surrounding the close of each 1-hour (H1) candle. The indicator draws a transparent box 15 minutes before and after each H1 candle close (by default), helping traders visualize time-based reaction zones.
🔍 Features:
Custom time window: Users can set how many minutes before and after the H1 close the box should appear.
Dynamic positioning: Boxes are drawn slightly above the candles to avoid overlap with price bars.
Live time labels: Each box displays its time range (e.g., "08:45 - 09:15") based on the start and end time of the zone.
Auto-cleaning: Only a limited number of recent boxes (default: 5) are shown, keeping the chart clean.
Requires 1-minute chart for precise timing.
This tool is especially helpful for intraday traders to identify areas of interest or market reactions before and after key hourly closes.
ICT Macro H1"H1 Candle Time Box" is a custom TradingView indicator that highlights a configurable time window surrounding the close of each 1-hour (H1) candle. The indicator draws a transparent box 15 minutes before and after each H1 candle close (by default), helping traders visualize time-based reaction zones.
🔍 Features:
Custom time window: Users can set how many minutes before and after the H1 close the box should appear.
Dynamic positioning: Boxes are drawn slightly above the candles to avoid overlap with price bars.
Live time labels: Each box displays its time range (e.g., "08:45 - 09:15") based on the start and end time of the zone.
Auto-cleaning: Only a limited number of recent boxes (default: 5) are shown, keeping the chart clean.
Requires 1-minute chart for precise timing.
This tool is especially helpful for intraday traders to identify areas of interest or market reactions before and after key hourly closes.
Global Liquidity IndexThis indicator tracks worldwide liquidity by aggregating the sum of the global M2 money supply, and major central bank balance sheets and subtracting the U.S. Treasury General Account (TGA), the Federal Reserve’s Reverse Repo (RRP) facility. It offers insight into the overall liquidity environment, often a key driver of risk asset performance.
EMA200 Golden/Death Cross Gradient // (\_/)
// ( •.•)
// (")_(")
EMA200 Golden/Death Cross Gradient
A Pine Script v6 overlay that highlights trend-change signals with a volatility-based color gradient.
*Moving Averages
*Short EMA (default 50 periods) in bright yellow
*Long EMA (default 200 periods) in vivid red
*Cross Detection
*Golden Cross: when the short EMA crosses above the long EMA → signals bullish shift
*Death Cross: when the short EMA crosses below the long EMA → signals bearish shift
Volatility Filter
*Uses ATR (default 14) to gauge current market volatility
*User-set Min/Max Volatility thresholds map ATR values onto a color gradient
Dynamic Background
*On a Golden Cross, the background glows with a semi-transparent gold gradient, growing more intense as volatility increases
*On a Death Cross, the background glows with a semi-transparent red gradient, likewise scaling with volatility
*No background fill when no cross is active
Customizable Inputs
*Short/Long EMA periods
*ATR length
*Minimum & maximum ATR values for gradient scaling
Coinbase BTC Premium by BIGTAKERBTC Premium Gap Analysis: Binance, Coinbase, Upbit
This indicator provides real-time analysis and visualization of the premium gap between the Binance BTCUSDT price and the BTC prices on Coinbase (BTCUSD) and Upbit (BTCKRW).
Key Features
Coinbase Premium Gap
Measures the price difference between Coinbase and Binance as a percentage.
To improve visibility, the Coinbase premium is visually amplified by 10x.
Upbit Premium Gap
Calculates the premium by comparing Upbit's BTCKRW price (converted into USD using the real-time USDKRW exchange rate) against Binance BTCUSDT.
Dynamic Color Coding
Premiums above 0% are displayed in lime green, indicating positive premiums.
Premiums below 0% are displayed in red, indicating discounts.
Real-Time Labels
Displays real-time premium values for both Coinbase and Upbit on the right side of the chart.
Additional Notes
Upbit premiums are adjusted for the USD/KRW exchange rate to ensure accurate USD-based comparison.
The Coinbase premium is magnified visually (10x) to better capture minor movements, while the actual premium value remains correctly displayed.
The indicator is optimized for traders who monitor global BTC market price disparities across major exchanges.
How to Use
Quickly track global BTC price discrepancies across Binance, Coinbase, and Upbit.
Detect "Kimchi Premium" conditions in the Korean market through Upbit premiums.
Analyze buying and selling pressure in North American markets through Coinbase premiums.
Day Range DividerThe indicator divides the chart into Israeli trading days, starting at one o’clock after midnight and ending a minute before the next midnight, marking each day’s open with a thin vertical line whose color and width you can choose. A label with the day’s name (in Hebrew) can appear on the very first bar of the session, while another label is placed midway through the previous day, beneath the candles at a fixed distance from the bottom so it doesn’t obscure price. You can adjust the label’s color, size, and letter spacing, customize the line style, and decide whether to show the early-session label. The indicator ignores Saturday and Sunday, works on any intraday timeframe, never repaints after plotting, and lets you quickly spot daily sequences and time-of-day patterns for market analysis.
RAZ G. MACD PRICE TRIGGER - SHORT(!)
"First, we determine the desired price level for entry and wait for a MACD cross to confirm the signal.
We can customize both the entry time frame and a separate time frame for taking profit or closing the position
Arun - TimingSession Timing:
This script allows you to visualize key trading sessions (Asian, Frankfurt, London, and New York) by drawing boxes and lines around those time periods.
It has the ability to adjust the time range for each session using input variables. For example:
Asian Range: rangeTime = input.session(title='Session Time', defval='1700-0100')
Frankfurt: rangeTime0 = input.session(title='FRANKFURT', defval='0200-0301')
London: rangeTime4 = input.session(title='LONDON KZ', defval='0300-0500')
New York: rangeTime5 = input.session(title='NEWYORK KZ', defval='0800-1000')
Box Creation for Sessions:
The script creates boxes that highlight the high and low values of each session.
The boxes are drawn based on session time intervals and can be extended into the future (if extendLines is true).
You can also enable or disable the background color and middle line for the boxes.
Previous High/Low for Various Timeframes:
Previous Daily High/Low: Plots the high and low of the previous day.
Previous Weekly High/Low: Plots the high and low of the previous week.
Previous Monthly High/Low: Plots the high and low of the previous month.
These levels can be displayed on the chart with configurable colors and options.
MMM (Market Maker Movements) Levels:
The script allows you to plot "Market Maker Movements" (MMM), which are key levels that may act as support or resistance during specific times of the trading day. It includes:
mmm1Range = input.session(title='MMM', defval='0330-0331')
You can configure the color and style of the lines for these levels as well.
Daily Open:
The Daily Open is shown on the chart as a labeled point, so you can easily track the opening price of the day.
Dynamic Features:
Real-Time Adjustments: The script dynamically updates the lines and boxes when the session starts and ends. It can delete and redraw lines and boxes based on whether the session is active or extended.
Line/Box Styles: You can customize the appearance of the lines (solid, dotted, or dashed) and set the color of the session boxes and lines.
Background and Middle Lines: You can choose to display the background color of the session ranges and a middle line that divides the high and low of the session.
How It Works:
Boxes and Lines: For each session (like the Asian range), the script draws a box between the session’s high and low values. You can also draw vertical lines marking the start and end of the session. These are updated in real-time as new bars are formed.
Previous High/Low: The script plots the previous day's, week's, or month's high and low prices, helping traders identify important support and resistance levels from earlier time periods.
Market Maker Movements (MMM): These levels are drawn at specific times of the day based on your input and are often used by traders who believe that institutional players move the market at specific times.
User Input Options:
Show/Hide Options: You can enable or disable the display of various features like the daily open, previous daily/weekly highs, and the MMM levels.
Customization: You can set the colors, line styles, and the timeframes for each session and other levels.
Text Labels: The script supports labeling the session lines and high/low points, with customizable text color.
Example Visualization:
Asian Session Box: A box is drawn for the Asian session range (from 1700 to 0100), with the session’s high and low price points marked.
Previous High/Low: You would see circles or labels for the previous day's high and low.
MMM Lines: Horizontal lines or areas drawn at specific times based on the user input for the "Market Maker Movement".
🌎 Modern Economic Eras - Visual Backgrounds & LabelsModern Economic Eras - Visual Backgrounds & Labels
This indicator highlights key modern economic eras with distinct background shading and floating labels, based on the structural macroeconomic periods identified by Deutsche Bank in their Long-Term Asset Return Study (2020).
🌎 First Era of Globalization (1860–1914)
A period of strong global growth, trade expansion, and low inflation, ending with World War I.
⚔️ Great Wars and the Depression (1914–1945)
The most turbulent period in modern history, marked by conflict, economic hardship, and volatile inflation.
🪙 Bretton Woods & Gold System (1945–1971)
Post-war stability driven by gold-backed currencies, strong growth, and the creation of modern welfare states.
💸 Fiat Money & High Inflation Era (1971–1980)
After the collapse of Bretton Woods, fiat currencies led to global inflation surges and economic instability.
🌍 Second Era of Globalization (1980–2020?)
A golden age of asset returns, global trade boom, China's reintegration, and falling inflation supported by demographic trends.
⚡ Age of Disorder (2020–????)
Characterized by rising geopolitical tensions (especially US-China), high debt levels, political fragmentation, demographic reversals, inequality challenges, and environmental pressures.
Each era is visually segmented and labeled above the chart for intuitive historical context.
This tool helps traders and investors understand the broader macro context behind asset price movements across different long-term regimes.
Useful for:
✅ Macro analysis
✅ Historical financial studies
✅ Long-term strategic planning
Compatible with any asset and timeframe, although it is intended primarily for use on indices like the S&P 500 (SPX).
V3 Theonator Bank Volume Entry & Exitsnipe the huz out of the banks like tralala leo trlala like this indicator is fine shi liek fr
Williams Percent Range proOverview
Williams Percent Range Pro is a powerful divergence detection tool based on the Williams %R oscillator.
It automatically identifies and plots regular and hidden divergences between price action and the %R oscillator, providing traders with early indications of potential trend reversals or trend continuations.
This indicator enhances the classic Williams %R by adding intelligent divergence detection logic, customizable visualization, and integrated alert conditions — making it a highly versatile tool for both manual and automated trading.
Features
Automatic Divergence Detection
Regular Divergence (signals trend reversals)
Hidden Divergence (signals trend continuations)
Customizable Settings
Period length, source price, color customization for each divergence type
Visual Enhancements
Overbought, Mid, and Oversold levels (-20, -50, -80)
Shaded background for easier visual interpretation
Pivot Detection
Identifies key swing points on the Williams %R line for divergence comparison
Integrated Alerts
Set up alerts for each type of divergence without coding
Lightweight and Optimized
Designed for fast loading and efficient operation on any timeframe
How It Works
Williams %R Calculation
The script calculates the Williams %R as follows:
%R = 100 × (Close - Highest High over Period) ÷ (Highest High - Lowest Low)
This results in a value that moves between -100 and 0, indicating overbought and oversold conditions.
Pivot Detection
The indicator uses pivot highs and pivot lows on the %R line to determine important swing points.
Pivot logic is based on comparing neighboring candles (5 bars to the left and 5 bars to the right by default).
Divergence Detection
1. Regular Divergence
Regular Bullish Divergence:
Price makes a Lower Low
Williams %R makes a Higher Low
→ Signals potential upward reversal
Regular Bearish Divergence:
Price makes a Higher High
Williams %R makes a Lower High
→ Signals potential downward reversal
2. Hidden Divergence
Hidden Bullish Divergence:
Price makes a Higher Low
Williams %R makes a Lower Low
→ Signals potential upward continuation
Hidden Bearish Divergence:
Price makes a Lower High
Williams %R makes a Higher High
→ Signals potential downward continuation
Each type of divergence is plotted with a specific label and customizable color on the indicator.
Input Parameters
Input Description
Length Period length for Williams %R calculation (default: 14)
Source Data source (default: Close)
Show Regular Divergence Enable/disable regular divergence detection
Show Hidden Divergence Enable/disable hidden divergence detection
Regular Bullish Color Color for regular bullish divergence labels
Regular Bearish Color Color for regular bearish divergence labels
Hidden Bullish Color Color for hidden bullish divergence labels
Hidden Bearish Color Color for hidden bearish divergence labels
Visual Elements
Horizontal Lines:
-20: Overbought zone
-50: Mid-level (dashed line)
-80: Oversold zone
Background Shading:
Fills between -20 and -80 for better visual focus on active trading zones.
Divergence Labels:
Bull = Regular Bullish Divergence
Bear = Regular Bearish Divergence
H Bull = Hidden Bullish Divergence
H Bear = Hidden Bearish Divergence
Each label appears exactly at the pivot points of the Williams %R line, offset slightly for clarity.
Alerts
You can create TradingView alerts based on the following conditions:
Regular Bullish Divergence Detected
Regular Bearish Divergence Detected
Hidden Bullish Divergence Detected
Hidden Bearish Divergence Detected
This allows fully automated trading setups or mobile push notifications.
Example alert message:
"Williams %R Regular Bullish Divergence Detected"
Usage Tips
Entry Strategy:
Combine divergence signals with trend confirmation indicators like EMA/SMA, MACD, or Volume.
Exit Strategy:
Monitor when price reaches key resistance/support zones or overbought/oversold levels on the %R.
Higher Accuracy:
Always confirm divergences with price action patterns such as breakouts, candlestick formations, or trendline breaks.
Conclusion
The Williams Percent Range Pro indicator brings powerful divergence detection and customization features to a classic momentum oscillator.
It provides clear visual and alert-based trading signals that help you anticipate major turning points or trend continuations in any market and timeframe.
Whether you are a swing trader, day trader, or scalper, this tool can be an essential addition to your technical analysis toolkit.
Gaussian Channel StrategyGaussian Channel Strategy — User Guide
1. Concept
This strategy builds trades around the Gaussian Channel. Based on Pine Script v4 indicator originally published by Donovan Wall. With rework to v6 Pine Script and adding entry and exit functions.
The channel consists of three dynamic lines:
Line Formula Purpose
Filter (middle) N-pole Gaussian filter applied to price Market "equilibrium"
High Band Filter + (Filtered TR × mult) Dynamic upper envelope
Low Band Filter − (Filtered TR × mult) Dynamic lower envelope
A position is opened when price crosses a user-selected line in a user-selected direction.
When the smoothed True Range (Filtered TR) becomes negative, the raw bands can flip (High drops below Low).
The strategy automatically reorders them so the upper band is always above the lower band.
Visual colors still flip, but signals stay correct.
2. Entry Logic
Choose a signal line for longs and/or shorts: Filter, Upper band, or Lower band.
Choose a cross direction (Cross Up or Cross Down).
A signal remains valid for Lookback bars after the actual cross, as long as price is still on the required side of the line.
When the opposite signal appears, the current position is closed or reversed depending on Reverse on opposite.
3. Parameters
Group Setting Meaning
Source & Filter Source Price series used (close, hlc3, etc.)
Poles (N) Number of Gaussian filter poles (1-9). More poles ⇒ smoother but laggier
Sampling Period Main period length of the channel
Filtered TR Multiplier Width of the bands in fractions of smoothed True Range
Reduced Lag Mode Adds a lag-compensation term (faster but noisier)
Fast Response Mode Blends 1-pole & N-pole outputs for quicker turns
Signals Long → signal line / Short → signal line Which line generates signals
Long when price / Short when price Direction of the cross
Lookback bars for late entry Bars after the cross that still allow an entry
Trading Enable LONG/SHORT-side trades Turn each side on/off
On opposite signal: reverse True: reverse -- False: flat
Misc Start trading date Ignores signals before this timestamp (back-test focus)
4. Quick Start
Add the strategy to a chart. Default: hlc3, N = 4, Period = 144.
Select your signal lines & directions.
Example: trend trading – Long: Filter + Cross Up, Short: Filter + Cross Down.
Disable either side if you want long-only or short-only.
Tune Lookback (e.g. 3) to catch gaps and strong impulses.
Run Strategy Tester, optimise period / multiplier / stops (add strategy.exit blocks if needed).
When satisfied, connect alerts via TradingView webhooks or use the builtin broker panel.
5. Notes
Commission & slippage are not preset – adjust them in Properties → Commission & Slippage.
Works on any market and timeframe, but you should retune Sampling Period and Multiplier for each symbol.
No stop-loss / take-profit is included by default – feel free to add with strategy.exit.
Start trading date lets you back-test only recent history (e.g. last two years).
6. Disclaimer
This script is for educational purposes only and does not constitute investment advice.
Use entirely at your own risk. Back-test thoroughly and apply sound risk management before trading real capital.