Daily Weekly Monthly Yearly previous and Opens ( ehab )Daily / Weekly / Monthly / Yearly — Opens & Previous Opens
Lightweight indicator that plots the current open and the previous period’s open for the four key cycles: Daily, Weekly, Monthly, and Yearly. It’s built for quick bias reads, gap context, and clean retest zones.
Features
Toggle each timeframe independently (D/W/M/Y).
Clean lines with customizable color and width.
Optional labels for level name and price.
Works on any symbol and timeframe.
No repaint (levels are fixed once the period opens).
How to use
Trading above today’s open skews bullish; below skews bearish.
Watch price reaction at previous period opens as support/resistance.
Add confluence with your S/R, VWAP, or pivots for higher-quality setups.
Note: This is a reference-level tool, not an entry/exit signal. Keep only the levels you need to avoid chart clutter.
지표 및 전략
Moving Average Ribbon AZlyThe Moving Average Ribbon AZly is a customizable indicator that plots six moving averages and highlights their interactions with colored fills. It gives traders a layered view of trend strength, direction, and momentum across multiple timeframes, making it easier to spot trend continuations or reversals.
Moving Average Function
The script includes a helper function ma() that allows each moving average to be calculated using different methods:
SMA (Simple Moving Average)
EMA (Exponential Moving Average)
SMMA/RMA (Smoothed Moving Average)
WMA (Weighted Moving Average)
VWMA (Volume-Weighted Moving Average)
HMA (Hull Moving Average – approximated using SMA in this script)
Default Setup
MA #1: EMA 10 (blue)
MA #2: EMA 20 (orange)
MA #3: EMA 75 (yellow)
MA #4: EMA 150 (transparent red)
MA #5: EMA 200 (black)
MA #6: EMA 250 (transparent red)
This default configuration covers short-, medium-, and long-term averages, giving a full market structure overview.
EMA + Volume + RSI Buy/Sell Signals//@version=5
indicator("EMA + Volume + RSI Buy/Sell Signals", overlay=true)
// === Inputs ===
ema20 = ta.ema(close, 20)
ema50 = ta.ema(close, 50)
ema200 = ta.ema(close, 200)
rsi = ta.rsi(close, 14)
// === Conditions ===
// Price % change from yesterday
priceChange = (close - close ) / close * 100
// Volume condition
volCondition = volume > 1.5 * volume
// RSI
rsiOverbought = rsi > 70
rsiOversold = rsi < 30
// Price move conditions
priceUp5 = priceChange > 5
priceDown5 = priceChange < -5
// === Buy & Sell Conditions ===
buySignal = close > ema20 and close > ema50 and close > ema200 and priceUp5 and volCondition and rsiOversold
sellSignal = close < ema20 and close < ema50 and close < ema200 and priceDown5 and volCondition and rsiOverbought
// === Plot EMAs ===
plot(ema20, color=color.yellow, title="EMA 20")
plot(ema50, color=color.blue, title="EMA 50")
plot(ema200, color=color.red, title="EMA 200")
// === Plot Signals on Chart ===
plotshape(buySignal, title="BUY Signal", style=shape.labelup, color=color.green, text="BUY", location=location.belowbar, size=size.normal)
plotshape(sellSignal, title="SELL Signal", style=shape.labeldown, color=color.red, text="SELL", location=location.abovebar, size=size.normal)
// === Background Highlight for Visuals ===
bgcolor(buySignal ? color.new(color.green, 85) : na)
bgcolor(sellSignal ? color.new(color.red, 85) : na)
M Killzones[by vetrivel]Cool free style Session indicator, Inspired by TJR trader session times and it's easily changeable. Really this session times changes everything. Basic requirement to use this Discipline and Mindset
Señales de Compra/Venta - KUSKUS + MACD AlgoAlphaseñales de compra/venta con base en la alineación de dos indicadores
Adaptive HMA SignalsAdaptive HMA Signals
This indicator pairs nicely with the Contrarian 100 MA and can be located here:
Overview
The "Adaptive HMA Signals" indicator is a sophisticated technical analysis tool designed for traders aiming to capture trend changes with precision. By leveraging Hull Moving Averages (HMAs) that adapt dynamically to market conditions (volatility or volume), this indicator generates actionable buy and sell signals based on price interactions with adaptive HMAs and slope analysis. Optimized for daily charts, it is highly customizable and suitable for trading forex, stocks, cryptocurrencies, or other assets. The indicator is ideal for swing traders and trend followers seeking to time entries and exits effectively.
How It Works
The indicator uses two adaptive HMAs—a primary HMA and a minor HMA—whose periods adjust dynamically based on user-selected market conditions (volatility via ATR or volume via RSI). It calculates the slope of the primary HMA to identify trend strength and generates exit signals when the price crosses the minor HMA under specific slope conditions. Signals are plotted as circles above or below the price, with inverted colors (white for buy, blue for sell) to enhance visibility on any chart background.
Key Components
Adaptive HMAs: Two HMAs (primary and minor) with dynamic periods that adjust based on volatility (ATR-based) or volume (RSI-based) conditions. Periods range between user-defined minimum and maximum values, adapting by a fixed percentage (3.141%).
Slope Analysis: Calculates the slope of the primary HMA over a 34-bar period to gauge trend direction and strength, normalized using market range data.
Signal Logic: Generates buy signals (white circles) when the price falls below the minor HMA with a flat or declining slope (indicating a potential trend reversal) and sell signals (blue circles) when the price rises above the minor HMA with a flat or rising slope.
Signal Visualization: Plots signals at an offset based on ATR for clarity, using semi-transparent colors to avoid chart clutter.
Mathematical Concepts
Dynamic Period Adjustment:
Primary HMA period adjusts between minLength (default: 144) and maxLength (default: 200).
Minor HMA period adjusts between minorMin (default: 55) and minorMax (default: 89).
Periods decrease by 3.141% under high volatility/volume and increase otherwise.
HMA Calculation:
Uses the Hull Moving Average formula: WMA(2 * WMA(src, length/2) - WMA(src, length), sqrt(length)).
Provides a smoother, faster-responding moving average compared to traditional MAs.
Slope Calculation:
Computes the slope of the primary HMA using a 34-bar period, normalized by the market range (highest high - lowest low over 34 bars).
Slope angle is converted to degrees using arccosine for intuitive trend strength interpretation.
Signal Conditions:
Buy: Slope ≥ 17° (flat or rising), price < minor HMA, low volatility/volume.
Sell: Slope ≤ -17° (flat or declining), price > minor HMA, low volatility/volume.
Signals are triggered only on confirmed bars to avoid repainting.
Entry and Exit Rules
Buy Signal (White Circle): Triggered when the price crosses below the minor HMA, the slope of the primary HMA is flat or rising (≥17°), and volatility/volume is low. The signal appears as a white circle above the price bar, offset by 0.72 * ATR(5).
Sell Signal (Blue Circle): Triggered when the price crosses above the minor HMA, the slope of the primary HMA is flat or declining (≤-17°), and volatility/volume is low. The signal appears as a blue circle below the price bar, offset by 0.72 * ATR(5).
Exit Rules: Exit a buy position on a sell signal and vice versa. Combine with other tools (e.g., support/resistance, RSI) for additional confirmation. Always apply proper risk management.
Recommended Usage
The "Adaptive HMA Signals" indicator is optimized for daily charts but can be adapted to other timeframes (e.g., 1H, 4H) with adjustments to period lengths. It performs best in trending or range-bound markets with clear reversal points. Traders should:
Backtest the indicator on their chosen asset and timeframe to validate signal reliability.
Combine with other technical tools (e.g., trendlines, Fibonacci retracements) for stronger trade setups.
Adjust minLength, maxLength, minorMin, and minorMax based on market volatility and timeframe.
Use the Charger input to toggle between volatility (ATR) and volume (RSI) adaptation for optimal performance in specific market conditions.
Customization Options
Source: Choose the price source (default: close).
Show Signals: Toggle visibility of buy/sell signals (default: true).
Charger: Select adaptation trigger—Volatility (ATR-based) or Volume (RSI-based) (default: Volatility).
Main HMA Periods: Set minimum (default: 144) and maximum (default: 200) periods for the primary HMA.
Minor HMA Periods: Set minimum (default: 55) and maximum (default: 89) periods for the minor HMA.
Slope Period: Fixed at 34 bars for slope calculation, adjustable via code if needed.
Why Use This Indicator?
The "Adaptive HMA Signals" indicator combines the responsiveness of HMAs with dynamic adaptation to market conditions, offering a robust tool for identifying trend reversals. Its clear visual signals, customizable periods, and adaptive logic make it versatile for various markets and trading styles. Whether you’re a beginner or an experienced trader, this indicator enhances your ability to time entries and exits with precision.
Tips for Users
Test the indicator thoroughly on your chosen market and timeframe to optimize settings (e.g., adjust period lengths for non-daily charts).
Use in conjunction with price action or other indicators (e.g., RSI, MACD) for stronger trade confirmation.
Monitor volatility/volume conditions to ensure the Charger setting aligns with market dynamics.
Ensure your chart timeframe aligns with the selected period lengths for accurate signal generation.
Apply strict risk management to protect against false signals in choppy markets.
Happy trading with the Adaptive HMA Signals indicator! Share your feedback and strategies in the TradingView community!
CME Gap Finder - BTC (Adjustable TF)This is a CME Futures gap finder that has a variable timeframe. Great for finding long term trades or short term depending on the time frame. 1hr chart to 3 hr gaps. 4 hr chart to 3 day on gaps.
RSI Zones Background + Optional RSI PaneOverview
This Pine Script indicator does two things at once:
Colors the background of the main price chart whenever the RSI value is below a lower threshold (default 30) or above an upper threshold (default 70). This highlights oversold and overbought zones directly on the price chart itself.
Optionally displays a separate RSI panel with the RSI line and shaded region between the two threshold levels for reference.
The indicator is fully customizable through the settings panel—color choices, transparency, and whether to show the separate RSI pane can all be adjusted.
Key Parts of the Code
1. Inputs
src: The source price series for RSI calculation.
len: RSI lookback length (default 14).
lowerThr and upperThr: The lower and upper thresholds (defaults: 30 and 70).
lowColor and highColor: Colors for the background when RSI is below or above the thresholds.
bgTrans: Transparency level for the background shading.
showRSI: Boolean to toggle the optional RSI pane on or off.
2. RSI Calculation
rsi = ta.rsi(src, len)
This computes the RSI from the chosen price source.
3. Background Coloring on the Price Chart
bgCol = rsi <= lowerThr ? color.new(lowColor,bgTrans) :
rsi >= upperThr ? color.new(highColor,bgTrans) :
na
bgcolor(bgCol)
If RSI ≤ lower threshold: background turns lowColor (oversold zone).
If RSI ≥ upper threshold: background turns highColor (overbought zone).
Otherwise, no background color.
4. Optional RSI Pane
plot(showRSI ? rsi : na, display=display.pane)
Plots the RSI line in a separate pane when showRSI is true; otherwise hides it.
5. Horizontal Lines for Thresholds
hLower = hline(lowerThr, ...)
hUpper = hline(upperThr, ...)
Two horizontal lines at the lower and upper thresholds.
Because hline() can’t be wrapped inside if blocks, the script always creates them but makes them transparent (using na color) when the pane is hidden.
6. Filling Between Threshold Lines
fill(hLower, hUpper, color=showRSI ? color.new(color.gray,95) : na)
When the RSI pane is visible, the area between the two threshold lines is shaded in gray to create a “mid-zone” effect. This fill also switches off (becomes na) if the pane is hidden.
7. Alerts
The script also includes two alert conditions:
When RSI crosses below the lower threshold.
When RSI crosses above the upper threshold.
How It Works in Practice
On the price chart, you’ll see the background turn blue (or your chosen color) when RSI is ≤30, and red when RSI is ≥70.
If you enable “Show RSI” in the settings, a separate RSI pane will appear below the price chart, plotting the RSI line with two threshold lines and a shaded region in between.
You can fully adjust transparency and colors to suit your chart style.
Benefits
Quickly visualize overbought and oversold conditions without opening a separate RSI window.
Optional RSI pane provides context when needed.
Customizable colors and transparency make it easy to integrate with any chart theme.
Alerts give you automatic notifications when RSI crosses key levels.
------------------------------------------------------------------------------------------------------------------
개요
이 지표는 두 가지 기능을 동시에 수행합니다.
가격 차트 뒤 배경에 색상 표시
RSI 값이 설정한 하단 임계값(기본 30) 이하이거나 상단 임계값(기본 70) 이상일 때, 가격 차트 뒤쪽에 과매도·과매수 구간을 색으로 표시해줍니다.
선택적으로 RSI 보조창 표시
옵션을 켜면 별도의 RSI 패널이 나타나서 RSI 라인과 두 임계값(30, 70)을 연결한 구간을 음영 처리하여 보여줍니다.
설정 창에서 색상·투명도·보조창 표시 여부를 전부 조정할 수 있습니다.
코드 핵심 설명
1. 입력값
src: RSI 계산에 사용할 가격 소스(기본 종가).
len: RSI 기간(기본 14).
lowerThr / upperThr: RSI 하단·상단 임계값(기본 30, 70).
lowColor / highColor: RSI가 각각 하단 이하·상단 이상일 때 배경 색상.
bgTrans: 배경 투명도(0=불투명, 100=투명).
showRSI: RSI 보조창을 켜고 끌 수 있는 스위치.
2. RSI 계산
rsi = ta.rsi(src, len)
지정한 가격 소스를 기반으로 RSI를 계산합니다.
3. 가격 차트 배경 색칠
bgCol = rsi <= lowerThr ? color.new(lowColor,bgTrans) :
rsi >= upperThr ? color.new(highColor,bgTrans) :
na
bgcolor(bgCol)
RSI ≤ 하단 임계값 → lowColor(과매도 색)
RSI ≥ 상단 임계값 → highColor(과매수 색)
나머지 구간은 색상 없음.
4. 선택적 RSI 보조창
plot(showRSI ? rsi : na, display=display.pane)
showRSI가 켜져 있으면 RSI 라인을 보조창에 표시하고, 꺼져 있으면 숨깁니다.
5. 임계값 가로선
hLower = hline(lowerThr, ...)
hUpper = hline(upperThr, ...)
하단·상단 임계값을 가로선으로 표시합니다.
hline은 if 블록 안에서 쓸 수 없기 때문에 항상 그려지지만, 보조창이 꺼지면 색을 na로 처리해 안 보이게 합니다.
6. 임계값 사이 영역 음영 처리
fill(hLower, hUpper, color=showRSI ? color.new(color.gray,95) : na)
보조창이 켜져 있을 때만 두 가로선 사이를 회색으로 채워 “중립 구간”을 강조합니다.
7. 알림 조건
RSI가 하단 임계값을 아래로 돌파할 때 알림.
RSI가 상단 임계값을 위로 돌파할 때 알림.
실제 작동 모습
가격 차트 뒤쪽에 RSI ≤30이면 파란색, RSI ≥70이면 빨간색 배경이 나타납니다(색상은 설정에서 변경 가능).
RSI 보조창을 켜면, RSI 라인과 임계값 가로선, 그리고 그 사이 음영 영역이 함께 나타납니다.
투명도를 높이거나 낮추어 강조 정도를 조절할 수 있습니다.
장점
별도의 RSI창을 열지 않고도 가격 차트 배경만으로 과매수·과매도 상태를 직관적으로 확인 가능.
필요하면 보조창으로 RSI를 직접 확인하면서 임계값 가이드와 음영 영역을 함께 볼 수 있음.
색상·투명도를 자유롭게 조절할 수 있어 차트 스타일에 맞게 커스터마이징 가능.
RSI가 임계값을 돌파할 때 자동 알림을 받을 수 있음.
Smart Session Levels - Step 1 (NY Prep Lines)this indicator shows 3 vertical lines at 18:00, 00:00, 06:00 . For easier way to see Asian high Asian low London high and London low levels for preparation before trading at New York session.
LDR 2025 — DayTHIS IS NOT AN INDICATOR!
It's a loving gentle reminder for traders to keep an eye if this LDR day might impact your trading.
Lakshman Rekha Level IndicatorThis script gives the upper and lower limit, calculated by adding and subtracting the daily range from the close point
Moving Average Convergence Divergence Zero LagMACD with zero lag. Implementation - double MACD on fast and slow timeframes before MACD on the difference between the two.
34 EMA Cross Alert (Once per sequence)This script is used when 5-12 EMA is above 34-50 EMA and if price corrects to 34-50 cloud and bounces i.e. price crosses below 34 EMA and then cross above 34 EMA, it will trigger alert.
Smart Session Levels - Step 1 (NY Prep Lines)It shows three vertical lines at 6 PM 12 AM and 6 AM for preparation at New York session to determine Asian high and Asia low levels also London high and London low levels
Hedge Pressure Index (HPI)Hedge Pressure Index (HPI)
Overview
The Hedge Pressure Index (HPI) is a flow-aware indicator that fuses daily options Open Interest (OI) with intraday put/call volume to estimate the directional hedging pressure of market makers and dealers. It helps traders visualize whether options flow is creating mechanical buy/sell pressure in IWM, and when that pressure may be shifting.
What HPI Shows
Daily OI Baseline (white line): Net OI carried forward intraday (Put OI − λ × Call OI). Updated once daily before the open.
Intraday Flow (teal line): Net put minus λ × call volume in real time. Smoothed to show underlying flow.
Spread Histogram (gray): Divergence between intraday flow and daily OI.
HPI Proxy Histogram (blue): Intraday hedge-pressure intensity. Strong extremes indicate heavy one-sided dealer hedging.
Trading Signals
Crossover:
When intraday Volume line crosses above OI, it suggests bullish hedge pressure.
When Volume line crosses below OI, it suggests bearish hedge pressure.
Z-Score Extremes:
HPI ≥ +1.5 → strong mechanical bid.
HPI ≤ −1.5 → strong mechanical offer.
Alerts: Built in for both crossovers and extreme readings.
How to Use HPI
1. Confirmation Tool (recommended for most traders):
Trade your usual price/technical setups.
Use HPI as a confirmation: only take trades that align with the hedge pressure direction.
2. Flow Bias (advanced):
Use HPI direction intraday as a standalone bias.
Fade signals when the histogram mean-reverts or crosses zero.
Best practice: Focus on the open and first 2 hours where hedging flows are most active. Combine with ATR/time-based stops.
Inputs
Demo Mode: If no OI/volume feed is set, the script uses chart volume for layout.
λ (Call Weight): Adjusts how much call volume offsets put volume (default = 1.0).
Smoothing Length: Smooths intraday flow line.
Z-Score Lookback: Sets lookback window for HPI extremes.
Custom Symbols:
Daily Net OI (pre-open OI difference).
Intraday Put Volume.
Intraday Call Volume.
Setup Instructions
Add the indicator to an IWM chart.
In Inputs, either keep Demo Mode ON (for layout) or enter your vendor’s Daily Net OI / Put Volume / Call Volume symbols.
Set alerts for crossovers and strong HPI readings to catch flow shifts in real time.
Optionally tune λ and smoothing to match your feed’s scale.
Notes
This is a proxy for dealer hedge pressure. For highest accuracy, replace the proxy histogram with gamma-weighted flow by strike/DTE when your data feed supports it.
Demo mode is for visualization only; live use requires a valid OI and volume feed.
Disclaimer
This script is for educational and research purposes only. It is not financial advice. Options and derivatives carry significant risk. Always test in a demo environment before using live capital.
Alerte Croisement EMA9 & SMA12 (Zone remplie)📊 Moving Average 1
Period: 9 → The average is calculated over the last 9 candles (or time periods).
Shift: 0 → No shift; the average is aligned with the current data.
Method: Exponential → Uses an Exponential Moving Average (EMA), which gives more weight to recent data.
Apply to: Close → The average is based on the closing price of each candle.
📊 Moving Average 2
Period: 12 → Calculated over the last 12 periods.
Shift: 0 → No shift.
Method: Simple → Uses a Simple Moving Average (SMA), which gives equal weight to each period.
Apply to: Close → Based on closing prices.
ARGT Possible entry and exit points:This is just an observation, and not any type of financial advice.
]To identify key entry and exit points. In addition, this is based on YTD and yearly charts. This is a work in progress.
SuperScript Filtered (Stable)🔎 What This Indicator Does
The indicator is a trend and momentum filter.
It looks at multiple well-known technical tools (T3 moving averages, RSI, TSI, and EMA trend) and assigns a score to the current market condition.
• If most tools are bullish → score goes up.
• If most tools are bearish → score goes down.
• Only when the score is very strong (above +75 or below -75), it prints a Buy or Sell signal.
This helps traders focus only on high-probability setups instead of reacting to every small wiggle in price.
________________________________________
⚙️ How It Works
1. T3 Trend Check
o Compares a fast and slow T3 moving average.
o If the fast T3 is above the slow T3 → bullish signal.
o If it’s below → bearish signal.
2. RSI Check
o Uses the Relative Strength Index.
o If RSI is above 50 → bullish momentum.
o If RSI is below 50 → bearish momentum.
3. TSI Check
o Uses the True Strength Index.
o If TSI is above its signal line → bullish momentum.
o If TSI is below → bearish momentum.
4. EMA Trend Check
o Looks at two exponential moving averages (fast and slow).
o If price is above both → bullish.
o If price is below both → bearish.
5. Score System
o Each condition contributes +25 (bullish) or -25 (bearish).
o The total score can range from -100 to +100.
o Score ≥ +75 → Strong Buy
o Score ≤ -75 → Strong Sell
6. Signal Filtering
o Only one buy is allowed until a sell appears (and vice versa).
o A minimum bar gap is enforced between signals to avoid clutter.
________________________________________
📊 How It Appears on the Chart
• Green “BUY” label below candles → when multiple signals agree and the market is strongly bullish.
• Red “SELL” label above candles → when multiple signals agree and the market is strongly bearish.
• Background softly shaded green or red → highlights bullish or bearish conditions.
No messy tables, no clutter — just clear trend-based entries.
________________________________________
🎯 How Traders Can Use It
This indicator is designed to help traders by:
1. Filtering Noise
o Instead of reacting to every small crossover or RSI blip, it waits until at least 3–4 conditions agree.
o This avoids entering weak trades.
2. Identifying Strong Trend Shifts
o When a Buy or Sell arrow appears, it usually signals a shift in momentum that can lead to a larger move.
3. Reducing Overtrading
o By limiting signals, traders won’t be tempted to jump in and out unnecessarily.
4. Trade Confirmation
o Traders can use the signals as confirmation for their own setups.
o Example: If your strategy says “go long” and the indicator also shows a strong Buy, that trade has more conviction.
5. Alert Automation
o Built-in alerts mean you don’t have to watch the chart all day.
o You’ll be notified only when a strong signal appears.
________________________________________
⚡ When It Helps the Most
• Works best in trending markets (bullish or bearish).
• Very useful on higher timeframes (1h, 4h, daily) for swing trading.
• Can also work on lower timeframes (5m, 15m) if combined with higher timeframe trend filtering.
________________________________________
👉 In short
This indicator is a signal filter + trend detector. It combines four powerful tools into one scoring system, and only tells you to act when the odds are stacked in your favor.
________________________________________
Gold NY Session Key TimesJust showing to us that news come out, open market, close bond for NY Session Time For Indonesia
SMA 50–200 Fill (Bull/Bear Colors)Overview
This TradingView Pine Script plots two simple moving averages (SMAs): one with a period of 50 and one with a period of 200. It also fills the area between the two SMAs. The fill color automatically changes depending on whether the 50-period SMA is above or below the 200-period SMA:
Bullish scenario (50 > 200): uses one color (bullFillColor)
Bearish scenario (50 < 200): uses another color (bearFillColor)
You can also customize the transparency of the filled area and the colors/widths of the SMA lines.
Key Parts of the Code
Inputs
src: The price source (default: close).
fastColor and slowColor: Colors for the 50- and 200-SMA lines.
bullFillColor and bearFillColor: The two fill colors used depending on whether the 50 SMA is above or below the 200 SMA.
fillTrans: The transparency of the fill (0 = fully opaque, 100 = fully transparent).
lwFast and lwSlow: Line widths of the 50- and 200-SMA lines.
Calculations
sma50 = ta.sma(src, 50)
sma200 = ta.sma(src, 200)
These two lines compute the moving averages of the chosen source price.
Plotting the SMAs
p50 and p200 use plot() to draw the SMA lines on the chart.
Each plot uses the chosen color and line width.
Dynamic Fill Color
A conditional determines which color to use:
fillColor = sma50 > sma200 ? color.new(bullFillColor, fillTrans) : color.new(bearFillColor, fillTrans)
If the 50 SMA is greater than the 200 SMA, the bullish color is used; otherwise, the bearish color is used.
Filling the Area
fill(p50, p200, color=fillColor) creates a shaded area between the two SMAs.
Because fillColor changes depending on the condition, the filled area automatically changes color when the SMAs cross.
How to Use It
Add to Chart: When you add this script to your chart, you’ll see the 50 and 200 SMAs with a shaded area between them.
Customize Colors: You can change line colors, fill colors, and transparency directly from the indicator’s settings panel.
Visual Cues: The fill color gives you an instant visual cue whether the short-term trend (50 SMA) is above or below the long-term trend (200 SMA).
Benefits
Gives a clear, simple visual representation of the trend’s strength and direction.
The customizable transparency lets you make the shading subtle or bold depending on your chart style.
Works on any time frame or instrument where you’d like to compare a short-term and long-term moving average.
ERL & IRL (Swing Levels) Sunnat//@version=5
indicator("ERL & IRL (Swing Levels)", overlay=true)
// Inputs
left_bars = input.int(5, "Left bars (swing strength)", minval=1)
right_bars = input.int(5, "Right bars (swing strength)", minval=1)
line_len = input.int(10, "Line length (bars)", minval=1) // short line
// Detect swing high (ERL) and swing low (IRL)
swingHigh = ta.pivothigh(high, left_bars, right_bars)
swingLow = ta.pivotlow(low, left_bars, right_bars)
// Draw ERL when swing high is found
if not na(swingHigh)
line.new(bar_index - right_bars, swingHigh,
bar_index - right_bars + line_len, swingHigh,
xloc=xloc.bar_index, extend=extend.none,
color=color.aqua, width=2)
label.new(bar_index - right_bars + line_len, swingHigh, "ERL",
xloc=xloc.bar_index, yloc=yloc.price,
color=color.new(color.aqua, 0), textcolor=color.black)
// Draw IRL when swing low is found
if not na(swingLow)
line.new(bar_index - right_bars, swingLow,
bar_index - right_bars + line_len, swingLow,
xloc=xloc.bar_index, extend=extend.none,
color=color.orange, width=2)
label.new(bar_index - right_bars + line_len, swingLow, "IRL",
xloc=xloc.bar_index, yloc=yloc.price,
color=color.new(color.orange, 0), textcolor=color.black)