VWAP 14 & EMA 8 RibbonIndicator that shows when 8 EMA crosses the VWAP 14. I have found this cross to be very bullish on the weekly timeframe. The VWAP 14 on its own serves as a good support and resistance as well. Very effective on the daily as well and even the 4 hour timeframe.
Cerca negli script per "weekly"
Current Ticker Previous Period High/Low LinesThis Indicator will provide you the Daily, Weekly, Monthly, and Yearly High and Low
Advanced Petroleum Market Model (APMM)Advanced Petroleum Market Model (APMM): A Multi-Factor Fundamental Analysis Framework for Oil Market Assessment
## 1. Introduction
The petroleum market represents one of the most complex and globally significant commodity markets, characterized by intricate supply-demand dynamics, geopolitical influences, and substantial price volatility (Hamilton, 2009). Traditional fundamental analysis approaches often struggle to synthesize the multitude of relevant indicators into actionable insights due to data heterogeneity, temporal misalignment, and subjective weighting schemes (Baumeister & Kilian, 2016).
The Advanced Petroleum Market Model addresses these limitations through a systematic, quantitative approach that integrates 16 verified fundamental indicators across five critical market dimensions. The model builds upon established financial engineering principles while incorporating petroleum-specific market dynamics and adaptive learning mechanisms.
## 2. Theoretical Framework
### 2.1 Market Efficiency and Information Integration
The model operates under the assumption of semi-strong market efficiency, where fundamental information is gradually incorporated into prices with varying degrees of lag (Fama, 1970). The petroleum market's unique characteristics, including storage costs, transportation constraints, and geopolitical risk premiums, create opportunities for fundamental analysis to provide predictive value (Kilian, 2009).
### 2.2 Multi-Factor Asset Pricing Theory
Drawing from Ross's (1976) Arbitrage Pricing Theory, the model treats petroleum prices as driven by multiple systematic risk factors. The five-factor decomposition (Supply, Inventory, Demand, Trade, Sentiment) represents economically meaningful sources of systematic risk in petroleum markets (Chen et al., 1986).
## 3. Methodology
### 3.1 Data Sources and Quality Framework
The model integrates 16 fundamental indicators sourced from verified TradingView economic data feeds:
Supply Indicators:
- US Oil Production (ECONOMICS:USCOP)
- US Oil Rigs Count (ECONOMICS:USCOR)
- API Crude Runs (ECONOMICS:USACR)
Inventory Indicators:
- US Crude Stock Changes (ECONOMICS:USCOSC)
- Cushing Stocks (ECONOMICS:USCCOS)
- API Crude Stocks (ECONOMICS:USCSC)
- API Gasoline Stocks (ECONOMICS:USGS)
- API Distillate Stocks (ECONOMICS:USDS)
Demand Indicators:
- Refinery Crude Runs (ECONOMICS:USRCR)
- Gasoline Production (ECONOMICS:USGPRO)
- Distillate Production (ECONOMICS:USDFP)
- Industrial Production Index (FRED:INDPRO)
Trade Indicators:
- US Crude Imports (ECONOMICS:USCOI)
- US Oil Exports (ECONOMICS:USOE)
- API Crude Imports (ECONOMICS:USCI)
- Dollar Index (TVC:DXY)
Sentiment Indicators:
- Oil Volatility Index (CBOE:OVX)
### 3.2 Data Quality Monitoring System
Following best practices in quantitative finance (Lopez de Prado, 2018), the model implements comprehensive data quality monitoring:
Data Quality Score = Σ(Individual Indicator Validity) / Total Indicators
Where validity is determined by:
- Non-null data availability
- Positive value validation
- Temporal consistency checks
### 3.3 Statistical Normalization Framework
#### 3.3.1 Z-Score Normalization
The model employs robust Z-score normalization as established by Sharpe (1994) for cross-indicator comparability:
Z_i,t = (X_i,t - μ_i) / σ_i
Where:
- X_i,t = Raw value of indicator i at time t
- μ_i = Sample mean of indicator i
- σ_i = Sample standard deviation of indicator i
Z-scores are capped at ±3 to mitigate outlier influence (Tukey, 1977).
#### 3.3.2 Percentile Rank Transformation
For intuitive interpretation, Z-scores are converted to percentile ranks following the methodology of Conover (1999):
Percentile_Rank = (Number of values < current_value) / Total_observations × 100
### 3.4 Exponential Smoothing Framework
Signal smoothing employs exponential weighted moving averages (Brown, 1963) with adaptive alpha parameter:
S_t = α × X_t + (1-α) × S_{t-1}
Where α = 2/(N+1) and N represents the smoothing period.
### 3.5 Dynamic Threshold Optimization
The model implements adaptive thresholds using Bollinger Band methodology (Bollinger, 1992):
Dynamic_Threshold = μ ± (k × σ)
Where k is the threshold multiplier adjusted for market volatility regime.
### 3.6 Composite Score Calculation
The fundamental score integrates component scores through weighted averaging:
Fundamental_Score = Σ(w_i × Score_i × Quality_i)
Where:
- w_i = Normalized component weight
- Score_i = Component fundamental score
- Quality_i = Data quality adjustment factor
## 4. Implementation Architecture
### 4.1 Adaptive Parameter Framework
The model incorporates regime-specific adjustments based on market volatility:
Volatility_Regime = σ_price / μ_price × 100
High volatility regimes (>25%) trigger enhanced weighting for inventory and sentiment components, reflecting increased market sensitivity to supply disruptions and psychological factors.
### 4.2 Data Synchronization Protocol
Given varying publication frequencies (daily, weekly, monthly), the model employs forward-fill synchronization to maintain temporal alignment across all indicators.
### 4.3 Quality-Adjusted Scoring
Component scores are adjusted for data quality to prevent degraded inputs from contaminating the composite signal:
Adjusted_Score = Raw_Score × Quality_Factor + 50 × (1 - Quality_Factor)
This formulation ensures that poor-quality data reverts toward neutral (50) rather than contributing noise.
## 5. Usage Guidelines and Best Practices
### 5.1 Configuration Recommendations
For Short-term Analysis (1-4 weeks):
- Lookback Period: 26 weeks
- Smoothing Length: 3-5 periods
- Confidence Period: 13 weeks
- Increase inventory and sentiment weights
For Medium-term Analysis (1-3 months):
- Lookback Period: 52 weeks
- Smoothing Length: 5-8 periods
- Confidence Period: 26 weeks
- Balanced component weights
For Long-term Analysis (3+ months):
- Lookback Period: 104 weeks
- Smoothing Length: 8-12 periods
- Confidence Period: 52 weeks
- Increase supply and demand weights
### 5.2 Signal Interpretation Framework
Bullish Signals (Score > 70):
- Fundamental conditions favor price appreciation
- Consider long positions or reduced short exposure
- Monitor for trend confirmation across multiple timeframes
Bearish Signals (Score < 30):
- Fundamental conditions suggest price weakness
- Consider short positions or reduced long exposure
- Evaluate downside protection strategies
Neutral Range (30-70):
- Mixed fundamental environment
- Favor range-bound or volatility strategies
- Wait for clearer directional signals
### 5.3 Risk Management Considerations
1. Data Quality Monitoring: Continuously monitor the data quality dashboard. Scores below 75% warrant increased caution.
2. Regime Awareness: Adjust position sizing based on volatility regime indicators. High volatility periods require reduced exposure.
3. Correlation Analysis: Monitor correlation with crude oil prices to validate model effectiveness.
4. Fundamental-Technical Divergence: Pay attention when fundamental signals diverge from technical indicators, as this may signal regime changes.
### 5.4 Alert System Optimization
Configure alerts conservatively to avoid false signals:
- Set alert threshold at 75+ for high-confidence signals
- Enable data quality warnings to maintain system integrity
- Use trend reversal alerts for early regime change detection
## 6. Model Validation and Performance Metrics
### 6.1 Statistical Validation
The model's statistical robustness is ensured through:
- Out-of-sample testing protocols
- Rolling window validation
- Bootstrap confidence intervals
- Regime-specific performance analysis
### 6.2 Economic Validation
Fundamental accuracy is validated against:
- Energy Information Administration (EIA) official reports
- International Energy Agency (IEA) market assessments
- Commercial inventory data verification
## 7. Limitations and Considerations
### 7.1 Model Limitations
1. Data Dependency: Model performance is contingent on data availability and quality from external sources.
2. US Market Focus: Primary data sources are US-centric, potentially limiting global applicability.
3. Lag Effects: Some fundamental indicators exhibit publication lags that may delay signal generation.
4. Regime Shifts: Structural market changes may require model recalibration.
### 7.2 Market Environment Considerations
The model is optimized for normal market conditions. During extreme events (e.g., geopolitical crises, pandemics), additional qualitative factors should be considered alongside quantitative signals.
## References
Baumeister, C., & Kilian, L. (2016). Forty years of oil price fluctuations: Why the price of oil may still surprise us. *Journal of Economic Perspectives*, 30(1), 139-160.
Bollinger, J. (1992). *Bollinger on Bollinger Bands*. McGraw-Hill.
Brown, R. G. (1963). *Smoothing, Forecasting and Prediction of Discrete Time Series*. Prentice-Hall.
Chen, N. F., Roll, R., & Ross, S. A. (1986). Economic forces and the stock market. *Journal of Business*, 59(3), 383-403.
Conover, W. J. (1999). *Practical Nonparametric Statistics* (3rd ed.). John Wiley & Sons.
Fama, E. F. (1970). Efficient capital markets: A review of theory and empirical work. *Journal of Finance*, 25(2), 383-417.
Hamilton, J. D. (2009). Understanding crude oil prices. *Energy Journal*, 30(2), 179-206.
Kilian, L. (2009). Not all oil price shocks are alike: Disentangling demand and supply shocks in the crude oil market. *American Economic Review*, 99(3), 1053-1069.
Lopez de Prado, M. (2018). *Advances in Financial Machine Learning*. John Wiley & Sons.
Ross, S. A. (1976). The arbitrage theory of capital asset pricing. *Journal of Economic Theory*, 13(3), 341-360.
Sharpe, W. F. (1994). The Sharpe ratio. *Journal of Portfolio Management*, 21(1), 49-58.
Tukey, J. W. (1977). *Exploratory Data Analysis*. Addison-Wesley.
BK AK-Scope🔭 Introducing BK AK-Scope — Target Locked. Signal Acquired. 🔭
After building five precision weapons for traders, I’m proud to unveil the sixth.
BK AK-Scope — the eye of the arsenal.
This is not just an indicator. It’s an intelligence system for volatility, signal clarity, and rate-of-change dynamics — forged for elite vision in any market terrain.
🧠 Why “Scope”? And Why “AK”?
Every shooter knows: you can’t hit what you can’t see.
The Scope brings range, clarity, and target distinction. It filters motion from noise. Purpose from panic.
“AK” continues to honor the man who trained my sight — my mentor, A.K.
His discipline taught me to wait for alignment. To move with reason, not emotion.
His vision lives in every code line here.
🔬 What Is BK AK-Scope?
A Triple-Tier TSI Correlation Engine, fused with adaptive opacity logic, a volatility scoring system, and real-time signal clarity. It’s momentum dissected — by speed, depth, and rate of change.
Built to serve traders who:
Need visual hierarchy between fast, mid, and slow TSI responses.
Want adaptive fills that pulse with volatility — not static zones.
Require a volatility scoring overlay that reads the battlefield in real time.
⚙️ Core Systems: How BK AK-Scope Works
✅ Fast/Mid/Slow TSI →
Three layers of correlation: like scopes with zoom levels.
You track micro moves, mid swings, and macro flow simultaneously.
✅ Rate-of-Change Adaptive Opacity →
Momentum fills fade or flash based on speed — giving you movement density at a glance.
Bull vs. Bear zones adapt to strength. You feel the market’s pulse.
✅ Volatility Score Intelligence →
Custom algorithm measuring:
Range expansion
Rate-of-change differentials
ATR dynamics
Standard deviation pressure
All combined into a score from 0–100 with live icons:
🔥 = Extreme Heat (70+)
🧊 = Cold Zone (<30)
⚠️ = ROC Warning
• = Neutral drift
✅ Auto-Detect Volatility Modes →
Scalp = <15min
Swing = intraday/hourly
Macro = daily/weekly
Or override manually with total control.
🎯 How To Use BK AK-Scope
🔹 Trend Continuation → When all three TSI layers align in direction + volatility score climbs, ride with the trend.
🔹 Early Reversals → Opposing TSI + rapid opacity change + volatility shift = sniper reversal zone.
🔹 Consolidation Filter → Neutral fills + score < 30 = stay out, wait for signal surge.
🔹 Signal Confluence → Pair with:
• Gann fans or angles
• Fib time/price clusters
• Elliott Wave structure
• Harmonics or divergence
To isolate entry perfection.
🛡️ Why This Indicator Changes the Game
It's not just momentum. It’s TSI with depth hierarchy.
It’s not just color. It’s real-time strength visualization.
It’s not just volatility. It’s rate-weighted market intelligence.
This is market optics for the advanced trader — built for vision, clarity, and discipline.
🙏 Final Thoughts
🔹 In honor of A.K., my mentor. The man who taught me to see what others miss.
🔹 Inspired by the power of vision — because execution without clarity is chaos.
🔹 Powered by faith — because Gd alone gives sight beyond the visible.
“He gives sight to the blind and wisdom to the humble.” — Psalms 146
Every tool I build is a prayer in code — that it helps someone trade with clarity, integrity, and precision.
⚡ Zoom In. Focus Deep. Trade Clean.
BK AK-Scope — Lock on the target. See what others don’t.
🔫 Clarity is power. 🔫
Gd bless. 🙏
Volume-Enhanced Candlestick Patterns 1
Overview
Scans for four major candlestick reversal patterns:
Harami
Engulfing
Morning/Evening Star
Piercing Line/Dark Cloud Cover
Underlying logic assumes that, at a turning point, the dominant side (bulls or bears) often delivers a “final” push—either a last surge of buying or selling—before the reversal truly takes hold.
Pattern Toggles
Each individual pattern can be turned on or off in the inputs.
Enable only the patterns you want to monitor to reduce chart clutter and speed up performance.
Volume Filter Toggle
On: Requires volume-based exhaustion or climax to confirm each pattern.
Off: Relies purely on price-action candlestick logic (no volume checks).
Grouped Labels & Confluence
When one or more patterns trigger on the same bar close, a single label is drawn:
Grouping multiple confirmed patterns on one bar increases confluence and signal strength.
Climax Volume × Multiplier
Adjusting this input affects signal frequency and conviction:
Higher multiplier → fewer signals but with stronger volume confirmation
Lower multiplier → more signals, each with a looser volume requirement
Alerts
Built-in alert condition for each individual pattern (bullish/bearish Harami, Engulfing, Star, Piercing, Dark Cloud Cover), so you can receive real-time notifications whenever a confirmation occurs.
Follow for Weekly Scripts
If you find this helpful, please hit Follow and 🚀button —I release a new scripts every week.
Disclaimer
Not Financial Advice. This script is for educational and research purposes only.
Use as Part of a Larger System. It should not be used in isolation; combine it with your own risk management rules, additional indicators, and broader market analysis.
No Guarantees. Candlestick patterns and volume filters can improve signal quality, but they do not guarantee profitable trades. Always perform your own due diligence before entering any position.
Monthly Session Divider (Alt Background) | Chart_BullyEasily visualize monthly transitions with alternating background shading. Designed for traders who like to spot macro trends, monthly opens, and institutional order flow.
✅ Alternates background color each month
✅ Auto-detects new months using live date logic
✅ Great for RTH or ETH intraday and swing strategies
✅ Clean gray overlay with low opacity
✅ Works on intraday, daily, and weekly charts
✅ Built for clarity, not clutter
Use this tool to:
Identify monthly pivots or volume rotations
Anchor monthly VWAPs or FVGs with visual context
Frame long-term setups with clean visual breaks
MEDIAS MOVILES ASL//@version=5
indicator("MEDIAS MOVILES ASL",overlay=true, max_bars_back=3000)
// ======== Indicator Input Parameters =========
linew = 2 // line width for moving averages.
var string G_DAILY = "►► Daily Moving Average"
bool ma_c_enable = input(inline = "01", group = G_DAILY, defval=true, title="MM1")
string ma_c = input.string(inline = "01", group = G_DAILY, defval="ASL", title="", options= )
int len_c = input.int(inline = "01", group = G_DAILY, defval=21, minval=1, title="Length:")
color col_c = input(inline = "01", group = G_DAILY, defval=color.blue,title="")
bool ma_i_enable = input(inline = "02", group = G_DAILY, defval=true, title="MM2")
string ma_i = input.string(inline = "02", group = G_DAILY, defval="EMA", title="", options= )
int len_i = input.int(inline = "02", group = G_DAILY, defval=150, minval=1, title="Length:")
color col_i = input(inline = "02", group = G_DAILY, defval=color.red, title="")
bool ma_l_enable = input(inline = "03", group = G_DAILY, defval=true, title="MM3")
string ma_l = input.string(inline = "03", group = G_DAILY, defval="EMA", title="", options= )
int len_l = input.int(inline = "03", group = G_DAILY, defval=200, minval=1, title="Length:")
color col_l = input(inline = "03", group = G_DAILY, defval=color.orange,title="")
bool ma_a_enable = input(inline = "04", group = G_DAILY, defval=true, title="MM4")
string ma_a = input.string(inline = "04", group = G_DAILY, defval="SMA", title="", options= )
int len_a = input.int(inline = "04", group = G_DAILY, defval=30, minval=1, title="Length:")
color col_a = input(inline = "04", group = G_DAILY, defval=color.green,title="")
var string G_WEEKLY = "►► Weekly Moving Average"
bool w_ma_c_enable = input(inline = "01", group = G_WEEKLY, defval=true, title="MM1")
string w_ma_c = input.string(inline = "01", group = G_WEEKLY, defval="WMA", title="", options= )
int w_len_c = input.int(inline = "01", group = G_WEEKLY, defval=10, minval=1, title="Length:")
color w_col_c = input(inline = "01", group = G_WEEKLY, defval=color.blue,title="")
bool w_ma_i_enable = input(inline = "02", group = G_WEEKLY, defval=true, title="MM2")
string w_ma_i = input.string(inline = "02", group = G_WEEKLY, defval="WMA", title="", options= )
int w_len_i = input.int(inline = "02", group = G_WEEKLY, defval=30, minval=1, title="Length:")
color w_col_i = input(inline = "02", group = G_WEEKLY, defval=color.orange, title="")
bool w_ma_l_enable = input(inline = "03", group = G_WEEKLY, defval=true, title="MM3")
string w_ma_l = input.string(inline = "03", group = G_WEEKLY, defval="SMA", title="", options= )
int w_len_l = input.int(inline = "03", group = G_WEEKLY, defval=200, minval=1, title="Length:")
color w_col_l = input(inline = "03", group = G_WEEKLY, defval=color.green,title="")
bool w_ma_a_enable = input(inline = "04", group = G_WEEKLY, defval=true, title="MM4")
string w_ma_a = input.string(inline = "04", group = G_WEEKLY, defval="WMA", title="", options= )
int w_len_a = input.int(inline = "04", group = G_WEEKLY, defval=50, minval=1, title="Length:")
color w_col_a = input(inline = "04", group = G_WEEKLY, defval=color.red,title="")
var string G_MONTHLY = "►► Monthly Moving Average"
bool m_ma_c_enable = input(inline = "01", group = G_MONTHLY, defval=true, title="MM1")
string m_ma_c = input.string(inline = "01", group = G_MONTHLY, defval="WMA", title="", options= )
int m_len_c = input.int(inline = "01", group = G_MONTHLY, defval=12, minval=1, title="Length:")
color m_col_c = input(inline = "01", group = G_MONTHLY, defval=color.orange,title="")
bool m_ma_l_enable = input(inline = "02", group = G_MONTHLY, defval=false, title="MM2")
string m_ma_l = input.string(inline = "02", group = G_MONTHLY, defval="SMA", title="", options= )
int m_len_l = input.int(inline = "02", group = G_MONTHLY, defval=12, minval=1, title="Length:")
color m_col_l = input(inline = "02", group = G_MONTHLY, defval=color.olive,title="")
var color TBL_TXT = color.white
var color TBL_BG = #000000
var string TXT_SIZE = 'auto'
var string G_TABLE = '►► Moving Average and 2Sigma Table (Position & Size)'
bool i_table_enable = input.bool(true, inline='01', group=G_TABLE, title = "Enable? | ")
string i_tableYpos = input.string('bottom', '↕', inline='01', group=G_TABLE, options= )
string i_tableXpos = input.string('right', '↔', inline='01', group=G_TABLE, options= , tooltip='Position on the chart.')
color i_c_tableText = input.color(TBL_TXT, 'Text', inline='03', group=G_TABLE)
color i_c_tableBg = input.color(TBL_BG, 'Background', inline='03', group=G_TABLE)
string i_tableTextSize = input.string(TXT_SIZE, '', inline='03', group=G_TABLE, options= )
var string G_TABLEADD = '►► Table Additional Information'
bool unify_emas = input.bool(true, inline='01', group=G_TABLEADD, title = "Smart Unify Daily EMAS 150 & 200?", tooltip='Consolidate the two percentages in one to show the distance from close price to the long EMAS.')
cell_1 ='2σ Dispersion'
cell_2 = 'β-5Y'
cell_3 = 'Div Yield FQ'
var string G_SIGMAF = '►► 2Sigma and Bollinger Band Format'
string sigma_bb_format = input.string('0-100 inside band',inline='01', group=G_SIGMAF, title = "2σ and BB Format:", options= )
var string G_TABLEPARAM = '►► Beta & ATR Indicator Parameters'
string beta_baseline = input.string('SPY', inline='01', group=G_TABLEPARAM, title = "β Index or Benchmark:")
int beta_years = input.int(5, inline='01', group=G_TABLEPARAM, title = "Window Years:")
var color TBL_TXT2 = color.white
var color TBL_BG2 = #363A45
var string TXT_SIZE2 = 'auto'
var string COMMENT = 'EMAs = EMA(200)+EMA(150) / 2 (not adjusted by dividens) '
// ======== Functions Library =========
// ————— Function returning the leftmost `_n` characters in `_str`.
moving_avg(type, len) =>
value = type == "ASL" ? (ta.ema(close,len-1)+ta.wma(close,len))/2 : type =="EMA" ? ta.ema(close,len) : type=="WMA" ? ta.wma(close,len) : type=="HMA" ? ta.hma(close,len) : type=="L_EMAS_AVG" ? (ta.ema(close,len)+ta.ema(close,len+50))/2: ta.sma(close ,len)
txt = type + str.tostring(len,"#")
//sigma functions
// v=variation vs price
v(float x) => (close-x)/close
sigma2(x) => ta.stdev(x,bar_index > 3000 ? 3000 : (timeframe.isweekly or timeframe.ismonthly) ? 1000/5 : 1000) * 2
bg_mm(v,s) => (v > 0) ? (math.abs(v) > s) ? color.lime : color.green : (math.abs(v) > s) ? #ff0000 : #ad2323
bg_rsi(r) => r>70 ? color.red : r<30 ? color.green : r<35 ? #67Eb65 : r>65 ? #F2A09D : (r > 48 and r <52) ? color.olive : color.gray
bg_sigma2(x) => x < 0 ? #fffbbf : color.gray
fg_sigma2(x) => x < 0 ? #ff0000 : i_c_tableText
// Beta Background Color codes:
bg_beta(b) => b<0 ? color.blue : b<= 1 ? color.green : b>= 3 ? #ff0000 : b>= 1.7 ? #ad2323 : color.olive
// beta < 0 --> blue
// beta = 0 is chash no risk.
// 0 < beta <= 1 --> green
// 1 < beta <= 1.7 --> olive
// 1.7 < beta <= 3 --> dark red
// beta > 3 --> light red
// Div Yield Backgroudn
bg_div(x) => x == 0 ? color.gray : x < 3 ? color.blue : x < 5 ? color.olive : x < 10 ? color.green : color.lime
// identify ticker with operations
spread_symbol(x) =>
str.contains(x,"+") or str.contains(x,"-") or str.contains(x,"/") or str.contains(x,"*") or str.contains(x,"(")
// Table cells output.
print_cell(tbl, col, title_txt, color_txt_tit, color_bg_tit, value_txt, color_txt_val, color_bg_val,txt_size) =>
if barstate.islast
table.cell(tbl,col,0, title_txt, bgcolor = color_bg_tit , text_color = color_txt_tit,text_size = txt_size)
table.cell(tbl,col,1, value_txt, bgcolor = color_bg_val , text_color = color_txt_val,text_size = txt_size)
// formula simplified included in cells --> this function is used to setup if conditions to save execution time.
included(x,a,b,c) => x == a or x == b or x == c
// change funtion for beta
return_percent(src) => ta.change(src) * 100 / src
// bollinger band %B
bg_percentage_BB(x) => x < 0 or x > 100 ? #fffbbf : x <10 ? #30CC5A : x > 90 ? #F63538 : color.gray
fg_percentage_BB(x) => x < 0 ? color.green : x >100 ? #ff0000 : i_c_tableText
ETFs_tickers=' SPY QQQ DIA EWZ XLF XLE XLB XLV XLH XLK XLC XLY XLP XLI XLRE XLU MCHI VGLT VIG VYM VNQ SCHD IWM '
IsETF(x) => str.contains(ETFs_tickers, " " +x+" ")
// ====== End Functions Library =======
// ++++++++++++++++++ moving average calcs
= moving_avg(ma_c,len_c)
plot(timeframe.isdaily and ma_c_enable ? valmm1 : na, color=col_c, linewidth=linew)
= moving_avg(ma_i,len_i)
plot(timeframe.isdaily and ma_i_enable ? valmm2 : na, color=col_i, linewidth=linew)
= moving_avg(ma_l,len_l)
plot(timeframe.isdaily and ma_l_enable ? valmm3 : na, color=col_l,linewidth=linew)
= moving_avg(ma_a,len_a)
plot(timeframe.isdaily and ma_a_enable ? valmm4 : na, color=col_a,linewidth=linew)
if barstate.islast and timeframe.isdaily
ma_c_label = label.new(x=time, y=valmm1,
text=ma_c_enable ? txt1:na, xloc=xloc.bar_time, yloc=yloc.price, color=color.rgb(0, 0, 0, 100), style=label.style_label_left, textcolor=col_c , size=size.small)
ma_i_label = label.new(x=time, y=valmm2,
text=ma_i_enable ? txt2:na, xloc=xloc.bar_time, yloc=yloc.price, color=color.rgb(0, 0, 0, 100), style=label.style_label_left, textcolor=col_i, size=size.small)
ma_l_label = label.new(x=time, y=valmm3,
text=ma_l_enable ? txt3:na, xloc=xloc.bar_time, yloc=yloc.price, color=color.rgb(0, 0, 0, 100), style=label.style_label_left, textcolor=col_l, size=size.small)
ma_a_label = label.new(x=time, y=valmm4,
text=ma_a_enable ? txt4:na, xloc=xloc.bar_time, yloc=yloc.price, color=color.rgb(0, 0, 0, 100), style=label.style_label_left, textcolor=col_a, size=size.small)
xUpMM1 = ta.crossover(close, valmm1)
xDnMM1 = ta.crossunder(close, valmm1)
xUpEMA = ta.crossover(close, (valmm2+valmm3)/2)
xDnEMA = ta.crossunder(close, (valmm2+valmm3)/2)
if timeframe.isdaily and xUpMM1
alert(syminfo.ticker +" crossing UP ASL21 (short MA)")
if timeframe.isdaily and xDnMM1
alert(syminfo.ticker +" crossing DOWN ASL21 (short MA)")
if timeframe.isdaily and xUpEMA
alert(syminfo.ticker +" crossing UP EMAs (avg EMA150,EMA200)")
if timeframe.isdaily and xDnEMA
alert(syminfo.ticker +" crossing DOWN EMAs (avg EMA150,EMA200)")
alertcondition(xUpMM1 or xDnMM1, title="Daily Price x MA1 (ASL21)", message="Crossing ALS21")
alertcondition(xUpEMA or xDnEMA, title="Daily Price x Avg(MM2,MM3) (avg EMA150 & EMA200)",message="Crossing Big EMAs")
= moving_avg(w_ma_c,w_len_c)
plot(timeframe.isweekly and w_ma_c_enable ? w_valmm1 : na, color=w_col_c, linewidth=linew)
= moving_avg(w_ma_i,w_len_i)
plot(timeframe.isweekly and w_ma_i_enable ? w_valmm2 : na, color=w_col_i, linewidth=linew)
= moving_avg(w_ma_l,w_len_l)
plot(timeframe.isweekly and w_ma_l_enable ? w_valmm3 : na, color=w_col_l,linewidth=linew)
= moving_avg(w_ma_a,w_len_a)
plot(timeframe.isweekly and w_ma_a_enable ? w_valmm4 : na, color=w_col_a,linewidth=linew)
if barstate.islast and timeframe.isweekly
w_ma_c_label = label.new(x=time, y=w_valmm1,
text=w_ma_c_enable ? w_txt1:na, xloc=xloc.bar_time, yloc=yloc.price, color=color.rgb(0, 0, 0, 100), style=label.style_label_left, textcolor=w_col_c, size=size.small)
w_ma_i_label = label.new(x=time, y=w_valmm2,
text=w_ma_i_enable ? w_txt2:na, xloc=xloc.bar_time, yloc=yloc.price, color=color.rgb(0, 0, 0, 100), style=label.style_label_left, textcolor=w_col_i, size=size.small)
w_ma_l_label = label.new(x=time, y=w_valmm3,
text=w_ma_l_enable ? w_txt3:na, xloc=xloc.bar_time, yloc=yloc.price, color=color.rgb(0, 0, 0, 100), style=label.style_label_left, textcolor=w_col_l, size=size.small)
w_ma_a_label = label.new(x=time, y=w_valmm4,
text=w_ma_a_enable ? w_txt4:na, xloc=xloc.bar_time, yloc=yloc.price, color=color.rgb(0, 0, 0, 100), style=label.style_label_left, textcolor=w_col_a, size=size.small)
= moving_avg(m_ma_c,m_len_c)
plot(timeframe.ismonthly and m_ma_c_enable ? m_valmm1 : na, color= m_col_c, linewidth=linew)
= moving_avg(m_ma_l,m_len_l)
plot(timeframe.ismonthly and m_ma_l_enable ? m_valmm2 : na, color=m_col_l,linewidth=linew)
// ***** TABLE SETUP AND PRINT
unify_emas := unify_emas and timeframe.isdaily and ma_i_enable and ma_l_enable and len_i == 150 and len_l == 200 and ma_i == "EMA" and ma_l == "EMA" and
math.abs(v(valmm2)-v(valmm3)) /( math.abs(v(valmm2)+v(valmm3))/2) < 0.2 and
bg_mm(v(valmm2),sigma2(v(valmm2))) == bg_mm(v(valmm3),sigma2(v(valmm3)))
total_col = 1 // 1 is RSI
total_col += timeframe.isdaily ? ((ma_c_enable ? 1 : 0) + (ma_i_enable ? 1 : 0) + (ma_l_enable ? 1 : 0) + (ma_a_enable ? 1 : 0 )) : 0
total_col += unify_emas ? -1 : 0
total_col += timeframe.isweekly ? ((w_ma_c_enable ? 1 : 0) + (w_ma_i_enable ? 1 : 0) + (w_ma_l_enable ? 1 : 0) + (w_ma_a_enable ? 1 : 0)) : 0
total_col += timeframe.ismonthly ? ((m_ma_c_enable ? 1 : 0) + (m_ma_l_enable ? 1 : 0)) : 0
// not inluding for intraday ((i_ma_c_enable ? 1 : 0) + (i_ma_i_enable ? 1 : 0)
// additional info
total_col += cell_1 == 'None' ? 0 : 1
total_col += cell_2 == 'None' ? 0 : 1
total_col += cell_3 == 'None' ? 0 : 1
border = i_tableTextSize == "tiny" ? 0 : i_tableTextSize == "small" ? 1 : i_tableTextSize == "normal" ? 2 : 3
frame = i_tableTextSize == "tiny" ? 1 : i_tableTextSize == "small" ? 2 : i_tableTextSize == "normal" ? 3 : 4
var table display = table.new(i_tableYpos + '_' + i_tableXpos, total_col, 2 ,border_width=border, frame_width = frame, frame_color = i_c_tableBg, border_color = i_c_tableBg)
// calcs
// ++++++++++++++++++++++++++ Beta
float beta = na
smooth = 1
length = timeframe.ismonthly ? 12 * beta_years + 1 : timeframe.isweekly ? 52 * beta_years + 1 : timeframe.isdaily ? 252 * beta_years + 1 : 300
instrument = not spread_symbol(syminfo.ticker) ? request.security(syminfo.tickerid, 'M', ta.ema(close, smooth)) : na
benchmark = not spread_symbol(syminfo.ticker) ? request.security(beta_baseline, 'M', ta.ema(close, smooth)) : na
inst_return = return_percent(instrument)
bench_return = return_percent(benchmark)
avg_inst_return = ta.sma(inst_return, length)
avg_bench_return = ta.sma(bench_return, length)
sum = 0.0
for idx = length to 0 by 1
inst_variance = inst_return - avg_inst_return
bench_variance = bench_return - avg_bench_return
sum += inst_variance * bench_variance
sum
covariance = sum / (length - 1)
beta := covariance / ta.variance(bench_return, length)
// Print Table with Moving Average variation vs price percentages
i=0
if timeframe.isdaily and i_table_enable
bg_mm2 = nz(bg_mm(v(valmm2),sigma2(v(valmm2))),color.gray)
bg_mm3 = nz(bg_mm(v(valmm2),sigma2(v(valmm2))),color.gray)
if ma_c_enable
print_cell(display, i, txt1, i_c_tableText, i_c_tableBg, str.tostring(v(valmm1),'#.#%'), i_c_tableText,bg_mm(v(valmm1),sigma2(v(valmm1))),i_tableTextSize)
i+=1
if ma_i_enable and not unify_emas
print_cell(display, i, txt2, i_c_tableText, i_c_tableBg, str.tostring(v(valmm2),'#.#%'), i_c_tableText,bg_mm2,i_tableTextSize)
i+=1
if ma_l_enable and not unify_emas
print_cell(display, i, txt3, i_c_tableText, i_c_tableBg, str.tostring(v(valmm3),'#.#%'), i_c_tableText,bg_mm3,i_tableTextSize)
i+=1
if unify_emas
unified_var = (valmm2 > close) ? math.max(v(valmm2), v(valmm3)) : math.min(v(valmm2),v(valmm3))
print_cell(display, i, "EMAs", i_c_tableText, i_c_tableBg, str.tostring(unified_var,'#.#%'), i_c_tableText,bg_mm2,i_tableTextSize)
i+=1
if ma_a_enable
print_cell(display, i, txt4, i_c_tableText, i_c_tableBg, str.tostring(v(valmm4),'#.#%'), i_c_tableText,bg_mm(v(valmm4),sigma2(v(valmm4))),i_tableTextSize)
i+=1
print_cell(display, i, "RSI", i_c_tableText, i_c_tableBg, str.tostring(ta.rsi(close,14),'##'), i_c_tableText,bg_rsi(ta.rsi(close,14)),i_tableTextSize)
i+=1
d = math.abs(sigma2(v(valmm1))) - math.abs(v(valmm1))
if timeframe.isweekly and i_table_enable
if w_ma_c_enable
print_cell(display, i, w_txt1, i_c_tableText, i_c_tableBg, str.tostring(v(w_valmm1),'#.#%'), i_c_tableText,bg_mm(v(w_valmm1),sigma2(v(w_valmm1))),i_tableTextSize)
i+=1
if w_ma_i_enable
print_cell(display, i, w_txt2, i_c_tableText, i_c_tableBg, str.tostring(v(w_valmm2),'#.#%'), i_c_tableText,bg_mm(v(w_valmm2),sigma2(v(w_valmm2))),i_tableTextSize)
i+=1
if w_ma_l_enable
print_cell(display, i, w_txt3, i_c_tableText, i_c_tableBg, str.tostring(v(w_valmm3),'#.#%'), i_c_tableText,bg_mm(v(w_valmm3),sigma2(v(w_valmm3))),i_tableTextSize)
i+=1
if w_ma_a_enable
print_cell(display, i, w_txt4, i_c_tableText, i_c_tableBg, str.tostring(v(w_valmm4),'#.#%'), i_c_tableText,bg_mm(v(w_valmm4),sigma2(v(w_valmm4))),i_tableTextSize)
i+=1
print_cell(display, i, "RSI", i_c_tableText, i_c_tableBg, str.tostring(ta.rsi(close,14),'##'), i_c_tableText,bg_rsi(ta.rsi(close,14)),i_tableTextSize)
i+=1
d = math.abs(sigma2(v(w_valmm1))) - math.abs(v(w_valmm1))
if timeframe.ismonthly and i_table_enable
if m_ma_c_enable
print_cell(display, i, m_txt1, i_c_tableText, i_c_tableBg, str.tostring(v(m_valmm1),'#.#%'), i_c_tableText,bg_mm(v(m_valmm1),sigma2(v(m_valmm1))),i_tableTextSize)
i+=1
if m_ma_l_enable
print_cell(display, i, m_txt2, i_c_tableText, i_c_tableBg, str.tostring(v(m_valmm2),'#.#%'), i_c_tableText,bg_mm(v(m_valmm2),sigma2(v(m_valmm2))),i_tableTextSize)
i+=1
print_cell(display, i, "RSI", i_c_tableText, i_c_tableBg, str.tostring(ta.rsi(close,14),'##'), i_c_tableText,bg_rsi(ta.rsi(close,14)),i_tableTextSize)
i+=1
d = math.abs(sigma2(v(m_valmm1))) - math.abs(v(m_valmm1))
print_cell(display, i, "2σ", i_c_tableText, i_c_tableBg, str.tostring(d ,'####.#%'), fg_sigma2(d),bg_sigma2(d),i_tableTextSize)
// ++++++++++++++++++++++++++ Yield
temp_ticker = spread_symbol(syminfo.tickerid) ? "NASDAQ:TSLA" : syminfo.tickerid // Tesla is a dummy stock to have 0 div to execute the formula.
_divYield = barstate.islast ? request.financial(temp_ticker, "DIVIDENDS_YIELD", "FQ", ignore_invalid_symbol = true) : 0.0
s1 = IsETF(syminfo.ticker) ? request.dividends(temp_ticker) : na // no se puede poner barstate.islast al preguntar por anteriores s1 +s1 +s1 +s1
dividendPeriodicity = 4 // checkear como validar la periodicidad diferente de 4 para ETFs
_divYield := IsETF(syminfo.ticker) ? (s1 +s1 +s1 +s1 ) / close * 100 : _divYield
// ++++++++++++++++++++++++++ 2sigma percentage and 0-100 like %B
float bb_2sigma = na
d = 0.0
if sigma_bb_format == '0-100 inside band'
mid2sigma =
timeframe.isdaily ? valmm1 :
timeframe.isweekly ? w_valmm1 :
timeframe.ismonthly ? m_valmm1 : na
bandwidth2sigma =
timeframe.isdaily ? sigma2(v(valmm1)) :
timeframe.isweekly ? sigma2(v(w_valmm1)) :
timeframe.ismonthly ? sigma2(v(m_valmm1)) : na
upbb2 = mid2sigma + bandwidth2sigma * close
dnbb2 = mid2sigma - bandwidth2sigma * close
bb_2sigma := (close - dnbb2) / (upbb2 - dnbb2) * 100
if sigma_bb_format == '% to up/dn band'
d := timeframe.isdaily ? math.abs(sigma2(v(valmm1))) - math.abs(v(valmm1)) :
timeframe.isweekly ? math.abs(sigma2(v(w_valmm1))) - math.abs(v(w_valmm1)) :
timeframe.ismonthly ? math.abs(sigma2(v(m_valmm1))) - math.abs(v(m_valmm1)) : na
// // ++++++++++++++++++++++++++ PRINT SELECTIONS
if i_table_enable and barstate.islast
// cell 1 - 2 sigma dispesion
if sigma_bb_format == '0-100 inside band'
if timeframe.isdaily or timeframe.isweekly or timeframe.ismonthly
print_cell(display, i, "2σ", i_c_tableText, i_c_tableBg, str.tostring(bb_2sigma,'#'), fg_percentage_BB(bb_2sigma),bg_percentage_BB(bb_2sigma),i_tableTextSize)
i+=1
else
if timeframe.isdaily or timeframe.isweekly or timeframe.ismonthly
print_cell(display, i, "2σ", i_c_tableText, i_c_tableBg, str.tostring(d ,'####.#%'), fg_sigma2(d),bg_sigma2(d),i_tableTextSize)
i+=1
// cell 2 - beta
beta_txt = "β-5Y"
print_cell(display, i, beta_txt , i_c_tableText, i_c_tableBg, str.tostring(beta,'#.#'), i_c_tableText,bg_beta(beta),i_tableTextSize)
i+=1
// cell 3 - div
yield_txt = "Div Yield"
print_cell(display,i, yield_txt, i_c_tableText, i_c_tableBg, str.tostring(_divYield/100,'#.#%'), i_c_tableText,bg_div(nz(_divYield,0.0)),i_tableTextSize)
i+=1
Combined IndicatorYearly, Quarterly, Monthly, Weekly VWAPs, volume profile, and EMAs. Mostly for confluence. I tend to use the VWAPs, daily +/-1 band on VWAP, and 21 EMA
BTC 200-Week SMA Zones (Daily + Weekly) + Time + % + LinesShowing Cheap, Fair Value, Expensive, and Very Expensive regions. Inspired by Crypto Currently.
Institutional Volume Footprint ProOVERVIEW
The Institutional Volume Footprint Pro is a comprehensive volume analysis indicator designed to identify institutional trading activity and significant volume patterns. Based on the proven Pocket Pivot Volume methodology by Chris Kacher and Gil Morales, this indicator has been enhanced with multiple additional volume analysis techniques to provide traders with a complete picture of smart money movements.
KEY FEATURES
1. Pocket Pivot Volume (PPV) Detection
- Identifies bullish volume patterns where current volume exceeds the highest down-day volume of the past 10 days
- Blue volume bars with "PPV" labels mark potential institutional accumulation
- Customizable lookback period (5-20 days)
2. Pivot Negative Volume (PNV) Detection
- Spots bearish volume patterns where selling volume exceeds recent up-day volumes
- Orange bars with "PNV" labels indicate potential institutional distribution
- Early warning system for trend reversals
3. Advanced Institutional Patterns
- Accumulation Detection (Aqua): High volume with narrow price range - classic stealth accumulation
- Churning/Distribution (Yellow): Heavy volume with minimal price progress - potential topping pattern
- Volume Dry-up (Purple): Extremely low volume periods that often precede significant moves
- Volume Climax (Fuchsia): Extreme volume spikes signaling potential exhaustion
4. Real-time Analytics Dashboard
- Relative Volume: Current volume compared to 10-day average
- Volume vs MA: Multiple of current volume to selected moving average
- Price Range Analysis: Narrow/Normal/Wide range classification
5. Accumulation/Distribution Trend
- Background coloring shows overall money flow direction
- Green tint: Net accumulation phase
- Red tint: Net distribution phase
HOW TO USE
Entry Signals:
- PPV (Blue): Consider long positions when price breaks above resistance with PPV confirmation
- Accumulation (Aqua): Watch for breakouts following multiple accumulation days
- Volume Dry-up (Purple): Prepare for potential explosive moves
Exit/Warning Signals:
- PNV (Orange): Consider taking profits or tightening stops
- Churning (Yellow): Distribution may be occurring despite stable prices
- Volume Climax (Fuchsia): Potential reversal point - extreme caution advised
CUSTOMIZATION OPTIONS
Analysis Parameters:
- PPV Lookback Period (5-20 days)
- Volume MA Length & Type (SMA/EMA/WMA)
- Relative Volume Threshold
- Climax Volume Multiplier
Visual Controls:
- Toggle Info Table display
- Enable/disable individual label types (PPV, PNV, ACC)
- Show/hide volume moving averages
- Control A/D trend background
- Customize threshold lines
BUILT-IN ALERTS
- Pocket Pivot Volume detected
- Pivot Negative Volume detected
- Institutional Accumulation pattern
- Volume Climax warning
- Volume Dry-up alert
PRO TIPS
1. Combine with Price Action: Volume confirms price - look for PPV at breakouts and PNV at breakdowns
2. Multiple Timeframes: Check daily and weekly charts for confluence
3. Relative Volume Matters: Patterns are stronger when relative volume > 1.5x
4. Watch for Divergences: Price up with decreasing volume = weakness
COLOR LEGEND
- Blue: Pocket Pivot Volume (Bullish)
- Orange: Pivot Negative Volume (Bearish)
- Aqua: Institutional Accumulation
- Yellow: Churning/Distribution
- Purple: Volume Dry-up
- Fuchsia: Volume Climax
- Green: Above-average up volume
- Red: Above-average down volume
- Gray: Below-average volume
EDUCATIONAL BACKGROUND
This indicator implements concepts from:
- "Trade Like an O'Neil Disciple" by Gil Morales & Chris Kacher
- William O'Neil's volume analysis principles
- Richard Wyckoff's accumulation/distribution methodology
Happy Trading! May the volume be with you!
1A Monthly P&L Table - Using Library1A Monthly P&L Table: Track Your Performance Month-by-Month
Overview:
The 1A Monthly P&L Table is a straightforward yet powerful indicator designed to give you an immediate overview of your asset's (or strategy's) percentage performance on a monthly basis. Displayed conveniently in the bottom-right corner of your chart, this tool helps you quickly assess historical gains and losses, making it easier to analyze trends in performance over time.
Key Features:
Monthly Performance at a Glance: Clearly see the percentage change for each past month.
Cumulative P&L: A running total of the displayed monthly P&L is provided, giving you a quick sum of performance over the selected period.
Customizable Display:
Months to Display: Choose how many past months you want to see in the table (from 1 to 60 months).
Text Size: Adjust the text size (Tiny, Small, Normal, Large, Huge) to fit your viewing preferences.
Text Color: Customize the color of the text for better visibility against your chart background.
Intraday & Daily Compatibility: The table is optimized to display on daily and intraday timeframes, ensuring it's relevant for various trading styles. (Note: For very long-term analysis on weekly/monthly charts, you might consider other tools, as this focuses on granular monthly P&L.)
How It Works:
The indicator calculates the percentage change from the close of the previous month to the close of the current month. For the very first month displayed, it calculates the P&L from the opening price of the chart's first bar to the close of that month. This data is then neatly organized into a table, updated on the last bar of the day or session.
Ideal For:
Traders and investors who want a quick, visual summary of monthly performance.
Analyzing seasonal trends or consistent periods of profitability/drawdown.
Supplementing backtesting results with a clear month-by-month breakdown.
Settings:
Text Color: Changes the color of all text within the table.
Text Size: Controls the font size of the table content.
Months to Display: Determines the number of recent months included in the table.
Range Progress TrackerRANGE PROGRESS TRACKER(RPT)
PURPOSE
This indicator helps traders visually and statistically understand how much of the typical price range (measured by ATR) has already been covered in the current period (Daily, Weekly, or Monthly). It includes key features to assist in trend exhaustion analysis, reversal spotting, and smart alerting.
CORE LOGIC
The indicator calculates the current range of the selected time frame (e.g., Daily), which is:
Current Range = High - Low
This is then compared to the ATR (Average True Range) of the same time frame, which represents the average price movement range over a defined period (default is 14).
The comparison is expressed as a percentage, calculated with this formula:
Range % = (Current Range / ATR) × 100
This percentage shows how much of the “average expected move” has already occurred.
WHY IT MATTERS
When the current range approaches or exceeds 100% of ATR, it means the price has already moved as much as it typically does in a full session.
This indicates a lower probability of continuing the trend with a new high or low, especially when the price is already near the session's high or low.
This setup can signal:
A possible consolidation phase
A reversal in trend
The market entering a corrective phase
SMART ALERTS
The indicator can alert you when:
A new high is made after the range percentage exceeds your set threshold.
A new low is made after the range percentage exceeds your set threshold.
You can adjust the Range % Alert Threshold in the settings to tailor it to your trading style.
EWMA & EWVar + EWStd Expansion with MTF_V.5EWMA & EWVar + EWStd Expansion with MTF_V.5
This indicator combines adaptive trend smoothing (EWMA), variance estimation (EWVar) and dynamic volatility “bursts” (EWStd Expansion) with optional higher-timeframe confirmation. It’s designed both for visual chart analysis and for automated alerts on regime changes.
Key Features
EWMA (Exponential Smoothing):
• Computes an exponential moving average with either a custom α or a length-derived α = 2/(N+1).
• Option to recalculate only every N bars (reduces CPU load).
EWVar & EWStd (Variance & Standard Deviation):
• Exponentially weighted variance tracks recent price dispersion.
• EWStd (σ) is computed alongside the EWMA.
• Z-score (deviation in σ units) shows how far price has diverged from trend.
Multi-Timeframe Filter (MTF):
• Optionally require the same trend direction on a chosen higher timeframe (e.g. Daily, Weekly, H4).
• Real-time lookahead available (may repaint).
Gradient Around EWMA:
• A multi-layer “glow” zone of ±1σ, broken into up to 10 steps.
• Color interpolates between “upper” and “lower” shades for bullish, bearish and neutral regimes.
Instantaneous Trendline (ITL):
• Ultra-fast trend filter with slope-based coloring.
• Highlights micro-trends and short-lived accelerations.
Cross-Over Signals (ITL ↔ EWMA):
• Up/down triangles plotted when the ITL crosses the main EWMA.
EWStd Expansion (Volatility Bursts):
• Automatically detects σ expansions (σ growth above a set % threshold).
• Price filter: only when price moves beyond EWMA ± (multiplier·σ).
• Optional higher-timeframe confirmation.
Labels & Alerts:
• Text labels and circular markers on bars where a volatility burst occurs.
• Built-in alertcondition calls for both bullish and bearish expansions.
How to Use
Visual Analysis:
• The gradient around EWMA shows the width of the volatility channel expanding or contracting.
• ITL color changes instantly highlight short-term impulses.
• EWMA line color switches (bullish/bearish/neutral) indicate trend state.
Spotting Volatility Breakouts:
• “EWStd Expansion” labels and circles signal the onset of strong moves when σ spikes.
• Useful for entering at the start of new impulses.
Automated Alerts:
• Set alerts on the built-in conditions “Bullish EWStd Expansion Alert” or “Bearish EWStd Expansion Alert” to receive a popup or mobile push when a burst occurs.
This compact tool unifies trend, volatility and multi-timeframe analysis into a single indicator—ideal for traders who want to see trend direction, current dispersion, and timely volatility burst signals all at once.
Bear Market Probability Model# Bear Market Probability Model: A Multi-Factor Risk Assessment Framework
The Bear Market Probability Model represents a comprehensive quantitative framework for assessing systemic market risk through the integration of 13 distinct risk factors across four analytical categories: macroeconomic indicators, technical analysis factors, market sentiment measures, and market breadth metrics. This indicator synthesizes established financial research methodologies to provide real-time probabilistic assessments of impending bear market conditions, offering institutional-grade risk management capabilities to retail and professional traders alike.
## Theoretical Foundation
### Historical Context of Bear Market Prediction
Bear market prediction has been a central focus of financial research since the seminal work of Dow (1901) and the subsequent development of technical analysis theory. The challenge of predicting market downturns gained renewed academic attention following the market crashes of 1929, 1987, 2000, and 2008, leading to the development of sophisticated multi-factor models.
Fama and French (1989) demonstrated that certain financial variables possess predictive power for stock returns, particularly during market stress periods. Their three-factor model laid the groundwork for multi-dimensional risk assessment, which this indicator extends through the incorporation of real-time market microstructure data.
### Methodological Framework
The model employs a weighted composite scoring methodology based on the theoretical framework established by Campbell and Shiller (1998) for market valuation assessment, extended through the incorporation of high-frequency sentiment and technical indicators as proposed by Baker and Wurgler (2006) in their seminal work on investor sentiment.
The mathematical foundation follows the general form:
Bear Market Probability = Σ(Wi × Ci) / ΣWi × 100
Where:
- Wi = Category weight (i = 1,2,3,4)
- Ci = Normalized category score
- Categories: Macroeconomic, Technical, Sentiment, Breadth
## Component Analysis
### 1. Macroeconomic Risk Factors
#### Yield Curve Analysis
The inclusion of yield curve inversion as a primary predictor follows extensive research by Estrella and Mishkin (1998), who demonstrated that the term spread between 3-month and 10-year Treasury securities has historically preceded all major recessions since 1969. The model incorporates both the 2Y-10Y and 3M-10Y spreads to capture different aspects of monetary policy expectations.
Implementation:
- 2Y-10Y Spread: Captures market expectations of monetary policy trajectory
- 3M-10Y Spread: Traditional recession predictor with 12-18 month lead time
Scientific Basis: Harvey (1988) and subsequent research by Ang, Piazzesi, and Wei (2006) established the theoretical foundation linking yield curve inversions to economic contractions through the expectations hypothesis of the term structure.
#### Credit Risk Premium Assessment
High-yield credit spreads serve as a real-time gauge of systemic risk, following the methodology established by Gilchrist and Zakrajšek (2012) in their excess bond premium research. The model incorporates the ICE BofA High Yield Master II Option-Adjusted Spread as a proxy for credit market stress.
Threshold Calibration:
- Normal conditions: < 350 basis points
- Elevated risk: 350-500 basis points
- Severe stress: > 500 basis points
#### Currency and Commodity Stress Indicators
The US Dollar Index (DXY) momentum serves as a risk-off indicator, while the Gold-to-Oil ratio captures commodity market stress dynamics. This approach follows the methodology of Akram (2009) and Beckmann, Berger, and Czudaj (2015) in analyzing commodity-currency relationships during market stress.
### 2. Technical Analysis Factors
#### Multi-Timeframe Moving Average Analysis
The technical component incorporates the well-established moving average convergence methodology, drawing from the work of Brock, Lakonishok, and LeBaron (1992), who provided empirical evidence for the profitability of technical trading rules.
Implementation:
- Price relative to 50-day and 200-day simple moving averages
- Moving average convergence/divergence analysis
- Multi-timeframe MACD assessment (daily and weekly)
#### Momentum and Volatility Analysis
The model integrates Relative Strength Index (RSI) analysis following Wilder's (1978) original methodology, combined with maximum drawdown analysis based on the work of Magdon-Ismail and Atiya (2004) on optimal drawdown measurement.
### 3. Market Sentiment Factors
#### Volatility Index Analysis
The VIX component follows the established research of Whaley (2009) and subsequent work by Bekaert and Hoerova (2014) on VIX as a predictor of market stress. The model incorporates both absolute VIX levels and relative VIX spikes compared to the 20-day moving average.
Calibration:
- Low volatility: VIX < 20
- Elevated concern: VIX 20-25
- High fear: VIX > 25
- Panic conditions: VIX > 30
#### Put-Call Ratio Analysis
Options flow analysis through put-call ratios provides insight into sophisticated investor positioning, following the methodology established by Pan and Poteshman (2006) in their analysis of informed trading in options markets.
### 4. Market Breadth Factors
#### Advance-Decline Analysis
Market breadth assessment follows the classic work of Fosback (1976) and subsequent research by Brown and Cliff (2004) on market breadth as a predictor of future returns.
Components:
- Daily advance-decline ratio
- Advance-decline line momentum
- McClellan Oscillator (Ema19 - Ema39 of A-D difference)
#### New Highs-New Lows Analysis
The new highs-new lows ratio serves as a market leadership indicator, based on the research of Zweig (1986) and validated in academic literature by Zarowin (1990).
## Dynamic Threshold Methodology
The model incorporates adaptive thresholds based on rolling volatility and trend analysis, following the methodology established by Pagan and Sossounov (2003) for business cycle dating. This approach allows the model to adjust sensitivity based on prevailing market conditions.
Dynamic Threshold Calculation:
- Warning Level: Base threshold ± (Volatility × 1.0)
- Danger Level: Base threshold ± (Volatility × 1.5)
- Bounds: ±10-20 points from base threshold
## Professional Implementation
### Institutional Usage Patterns
Professional risk managers typically employ multi-factor bear market models in several contexts:
#### 1. Portfolio Risk Management
- Tactical Asset Allocation: Reducing equity exposure when probability exceeds 60-70%
- Hedging Strategies: Implementing protective puts or VIX calls when warning thresholds are breached
- Sector Rotation: Shifting from growth to defensive sectors during elevated risk periods
#### 2. Risk Budgeting
- Value-at-Risk Adjustment: Incorporating bear market probability into VaR calculations
- Stress Testing: Using probability levels to calibrate stress test scenarios
- Capital Requirements: Adjusting regulatory capital based on systemic risk assessment
#### 3. Client Communication
- Risk Reporting: Quantifying market risk for client presentations
- Investment Committee Decisions: Providing objective risk metrics for strategic decisions
- Performance Attribution: Explaining defensive positioning during market stress
### Implementation Framework
Professional traders typically implement such models through:
#### Signal Hierarchy:
1. Probability < 30%: Normal risk positioning
2. Probability 30-50%: Increased hedging, reduced leverage
3. Probability 50-70%: Defensive positioning, cash building
4. Probability > 70%: Maximum defensive posture, short exposure consideration
#### Risk Management Integration:
- Position Sizing: Inverse relationship between probability and position size
- Stop-Loss Adjustment: Tighter stops during elevated risk periods
- Correlation Monitoring: Increased attention to cross-asset correlations
## Strengths and Advantages
### 1. Comprehensive Coverage
The model's primary strength lies in its multi-dimensional approach, avoiding the single-factor bias that has historically plagued market timing models. By incorporating macroeconomic, technical, sentiment, and breadth factors, the model provides robust risk assessment across different market regimes.
### 2. Dynamic Adaptability
The adaptive threshold mechanism allows the model to adjust sensitivity based on prevailing volatility conditions, reducing false signals during low-volatility periods and maintaining sensitivity during high-volatility regimes.
### 3. Real-Time Processing
Unlike traditional academic models that rely on monthly or quarterly data, this indicator processes daily market data, providing timely risk assessment for active portfolio management.
### 4. Transparency and Interpretability
The component-based structure allows users to understand which factors are driving risk assessment, enabling informed decision-making about model signals.
### 5. Historical Validation
Each component has been validated in academic literature, providing theoretical foundation for the model's predictive power.
## Limitations and Weaknesses
### 1. Data Dependencies
The model's effectiveness depends heavily on the availability and quality of real-time economic data. Federal Reserve Economic Data (FRED) updates may have lags that could impact model responsiveness during rapidly evolving market conditions.
### 2. Regime Change Sensitivity
Like most quantitative models, the indicator may struggle during unprecedented market conditions or structural regime changes where historical relationships break down (Taleb, 2007).
### 3. False Signal Risk
Multi-factor models inherently face the challenge of balancing sensitivity with specificity. The model may generate false positive signals during normal market volatility periods.
### 4. Currency and Geographic Bias
The model focuses primarily on US market indicators, potentially limiting its effectiveness for global portfolio management or non-USD denominated assets.
### 5. Correlation Breakdown
During extreme market stress, correlations between risk factors may increase dramatically, reducing the model's diversification benefits (Forbes and Rigobon, 2002).
## References
Akram, Q. F. (2009). Commodity prices, interest rates and the dollar. Energy Economics, 31(6), 838-851.
Ang, A., Piazzesi, M., & Wei, M. (2006). What does the yield curve tell us about GDP growth? Journal of Econometrics, 131(1-2), 359-403.
Baker, M., & Wurgler, J. (2006). Investor sentiment and the cross‐section of stock returns. The Journal of Finance, 61(4), 1645-1680.
Baker, S. R., Bloom, N., & Davis, S. J. (2016). Measuring economic policy uncertainty. The Quarterly Journal of Economics, 131(4), 1593-1636.
Barber, B. M., & Odean, T. (2001). Boys will be boys: Gender, overconfidence, and common stock investment. The Quarterly Journal of Economics, 116(1), 261-292.
Beckmann, J., Berger, T., & Czudaj, R. (2015). Does gold act as a hedge or a safe haven for stocks? A smooth transition approach. Economic Modelling, 48, 16-24.
Bekaert, G., & Hoerova, M. (2014). The VIX, the variance premium and stock market volatility. Journal of Econometrics, 183(2), 181-192.
Brock, W., Lakonishok, J., & LeBaron, B. (1992). Simple technical trading rules and the stochastic properties of stock returns. The Journal of Finance, 47(5), 1731-1764.
Brown, G. W., & Cliff, M. T. (2004). Investor sentiment and the near-term stock market. Journal of Empirical Finance, 11(1), 1-27.
Campbell, J. Y., & Shiller, R. J. (1998). Valuation ratios and the long-run stock market outlook. The Journal of Portfolio Management, 24(2), 11-26.
Dow, C. H. (1901). Scientific stock speculation. The Magazine of Wall Street.
Estrella, A., & Mishkin, F. S. (1998). Predicting US recessions: Financial variables as leading indicators. Review of Economics and Statistics, 80(1), 45-61.
Fama, E. F., & French, K. R. (1989). Business conditions and expected returns on stocks and bonds. Journal of Financial Economics, 25(1), 23-49.
Forbes, K. J., & Rigobon, R. (2002). No contagion, only interdependence: measuring stock market comovements. The Journal of Finance, 57(5), 2223-2261.
Fosback, N. G. (1976). Stock market logic: A sophisticated approach to profits on Wall Street. The Institute for Econometric Research.
Gilchrist, S., & Zakrajšek, E. (2012). Credit spreads and business cycle fluctuations. American Economic Review, 102(4), 1692-1720.
Harvey, C. R. (1988). The real term structure and consumption growth. Journal of Financial Economics, 22(2), 305-333.
Kahneman, D., & Tversky, A. (1979). Prospect theory: An analysis of decision under risk. Econometrica, 47(2), 263-291.
Magdon-Ismail, M., & Atiya, A. F. (2004). Maximum drawdown. Risk, 17(10), 99-102.
Nickerson, R. S. (1998). Confirmation bias: A ubiquitous phenomenon in many guises. Review of General Psychology, 2(2), 175-220.
Pagan, A. R., & Sossounov, K. A. (2003). A simple framework for analysing bull and bear markets. Journal of Applied Econometrics, 18(1), 23-46.
Pan, J., & Poteshman, A. M. (2006). The information in option volume for future stock prices. The Review of Financial Studies, 19(3), 871-908.
Taleb, N. N. (2007). The black swan: The impact of the highly improbable. Random House.
Whaley, R. E. (2009). Understanding the VIX. The Journal of Portfolio Management, 35(3), 98-105.
Wilder, J. W. (1978). New concepts in technical trading systems. Trend Research.
Zarowin, P. (1990). Size, seasonality, and stock market overreaction. Journal of Financial and Quantitative Analysis, 25(1), 113-125.
Zweig, M. E. (1986). Winning on Wall Street. Warner Books.
Multi-Session ORBThe Multi-Session ORB Indicator is a customizable Pine Script (version 6) tool designed for TradingView to plot Opening Range Breakout (ORB) levels across four major trading sessions: Sydney, Tokyo, London, and New York. It allows traders to define specific ORB durations and session times in Central Daylight Time (CDT), making it adaptable to various trading strategies.
Key Features:
1. Customizable ORB Duration: Users can set the ORB duration (default: 15 minutes) via the inputMax parameter, determining the time window for calculating the high and low of each session’s opening range.
2. Flexible Session Times: The indicator supports user-defined session and ORB times for:
◦ Sydney: Default ORB (17:00–17:15 CDT), Session (17:00–01:00 CDT)
◦ Tokyo: Default ORB (19:00–19:15 CDT), Session (19:00–04:00 CDT)
◦ London: Default ORB (02:00–02:15 CDT), Session (02:00–11:00 CDT)
◦ New York: Default ORB (08:30–08:45 CDT), Session (08:30–16:00 CDT)
3. Session-Specific ORB Levels: For each session, the indicator calculates and tracks the high and low prices during the specified ORB period. These levels are updated dynamically if new highs or lows occur within the ORB timeframe.
4. Visual Representation:
◦ ORB high and low lines are plotted only during their respective session times, ensuring clarity.
◦ Each session’s lines are color-coded for easy identification:
▪ Sydney: Light Yellow (high), Dark Yellow (low)
▪ Tokyo: Light Pink (high), Dark Pink (low)
▪ London: Light Blue (high), Dark Blue (low)
▪ New York: Light Purple (high), Dark Purple (low)
◦ Lines are drawn with a linewidth of 2 and disappear when the session ends or if the timeframe is not intraday (or exceeds the ORB duration).
5. Intraday Compatibility: The indicator is optimized for intraday timeframes (e.g., 1-minute to 15-minute charts) and only displays when the chart’s timeframe multiplier is less than or equal to the ORB duration.
How It Works:
• Session Detection: The script uses the time() function to check if the current bar falls within the user-defined ORB or session time windows, accounting for all days of the week.
• ORB Logic: At the start of each session’s ORB period, the script initializes the high and low based on the first bar’s prices. It then updates these levels if subsequent bars within the ORB period exceed the current high or fall below the current low.
• Plotting: ORB levels are plotted as horizontal lines during the respective session, with visibility controlled to avoid clutter outside session times or on incompatible timeframes.
Use Case:
Traders can use this indicator to identify key breakout levels for each trading session, facilitating strategies based on price action around the opening range. The flexibility to adjust ORB and session times makes it suitable for various markets (e.g., forex, stocks, or futures) and time zones.
Limitations:
• The indicator is designed for intraday timeframes and may not display on higher timeframes (e.g., daily or weekly) or if the timeframe multiplier exceeds the ORB duration.
• Time inputs are in CDT, requiring users to adjust for their local timezone or market requirements.
• If you need to use this for GC/CL/SPY/QQQ you have to adjust the times by one hour.
This indicator is ideal for traders focusing on session-based breakout strategies, offering clear visualization and customization for global market sessions.
Bitcoin Open Interest [SAKANE]Bitcoin Open Interest
— Unveiling the True Flow of Capital
PurposeVisualize and compare Bitcoin open interest (OI) from CME and Binance, the leading derivatives exchanges, in a single intuitive chart, providing traders with clear insights into crypto market capital dynamics.
Background & MotivationIn the 24/7 crypto market, price movements alone reveal only part of the story. Open interest (OI)—the total outstanding futures contracts—offers critical clues to the market’s next move. Yet, accessing and interpreting OI data is challenging:
CME Constraints: Commitment of Traders (COT) reports are weekly, and standalone BTC1! or BTC2! OI is noisy due to contract rollovers, obscuring true OI changes.
Existing Tool Limitations: Most OI indicators are fixed to either USD or BTC, limiting flexible analysis.
This indicator overcomes these hurdles, enabling seamless comparison of CME and Binance OI to track the market’s “capital center of gravity” in real time.
Key Features
Synthetic CME OI: Combines BTC1! and BTC2! to deliver high-accuracy OI, eliminating rollover noise.
Multi-Timeframe Analysis: Displays daily CME OI as pseudo-candlestick (OHLC) on any timeframe (e.g., 4H), allowing intuitive capital flow tracking across timeframes.
CME/Binance One-Click Toggle: Instantly compare institutional-driven CME and retail-driven Binance OI.
USD/BTC Flexibility: Switch between BTC (real demand) and USD (margin) perspectives for OI analysis.
Robust Design: Concise, global-scope code ensures stability and adaptability to TradingView updates.
Insights & Use Cases
Holistic Market Sentiment: Analyze capital flows by region and exchange for a multidimensional view.
Signal Detection: E.g., a sharp drop in CME OI during a sell-off may signal institutional withdrawal.
Retail Trends: A surge in Binance OI suggests retail-driven inflows.
Event-Driven Insights: E.g., during a hypothetical April 2025 “Trump Tariff Shock,” instantly identify which exchange drives capital shifts.
Unique ValueUnlike price-centric indicators, this tool focuses on capital flow (OI). It’s the only indicator offering one-click multi-timeframe and multi-exchange OI comparison, empowering traders to uncover the market’s “true intent” and gain a strategic edge.
ConclusionBitcoin Open Interest makes the market’s hidden capital movements accessible to all. By capturing market dynamics and pinpointing the “leading forces” during events, it sets a new standard for traders seeking a revolutionary perspective.
HTF High/Low Targets This script plots the previous Highs and Lows of the 1HR, 4HR, Daily, and Weekly timeframes.
Each level is color-coded, extends across the chart, and includes labels to help you spot key areas of past support and resistance.
Use this tool to:
- Confirm intraday price reactions at HTF zones
- Identify high-probability reversal or breakout areas
- Get notified with built-in alerts when price crosses a level
You can toggle each timeframe level on/off in the settings panel.
Great for:
- Day traders and scalpers who trade off 1-minute or 5-minute charts
-Swing traders looking for confluence with HTF zones
- Anyone using a multi-timeframe analysis approach
Created by @mychaellesliemedia.
Supertrend with Volume Filter AlertSupertrend with Volume Filter Alert - Indicator Overview
What is the Supertrend Indicator?
The Supertrend indicator is a popular trend-following tool used by traders to identify the direction of the market and potential entry/exit points. It is based on the Average True Range (ATR), which measures volatility, and plots a line on the chart that acts as a dynamic support or resistance level. When the price is above the Supertrend line, it signals an uptrend (bullish), and when the price is below, it indicates a downtrend (bearish). The indicator is particularly effective in trending markets but can generate false signals during choppy or sideways conditions.
How This Script Works
The "Supertrend with Volume Filter Alert" enhances the classic Supertrend indicator by adding a customizable volume filter to improve signal reliability.
Here's how it functions:
Supertrend Calculation:The Supertrend is calculated using the ATR over a user-defined period (default: 55) and a multiplier (default: 1.85). These parameters control the sensitivity of the indicator:A higher ATR period smooths out volatility, making the indicator less reactive to short-term price fluctuations.The multiplier determines the distance of the Supertrend line from the price, affecting how quickly it responds to trend changes.The script plots the Supertrend line in cyan for uptrends and red for downtrends, making it easy to visualize the market direction.
Volume Filter:A key feature of this script is the volume filter, which helps filter out false signals in choppy markets. The filter compares the current volume to the average volume over a lookback period (default: 20) and only triggers signals if the volume exceeds the average by a specified multiplier (default: 2.0).This ensures that trend changes are accompanied by significant market participation, increasing the likelihood of a genuine trend shift.
Signals and Alerts:
Buy signals (cyan triangle below the bar) are generated when the price crosses above the Supertrend line (indicating an uptrend) and the volume condition is met.Sell signals (red triangle above the bar) are generated when the price crosses below the Supertrend line (indicating a downtrend) and the volume condition is met.Alerts are set up for both buy and sell signals, notifying traders only when the volume filter confirms the trend change.
Customizable Settings for Multiple Markets
The default settings in this script (ATR Period: 55, ATR Multiplier: 1.85, Volume Lookback Period: 20, Volume Multiplier: 2.0) were carefully chosen to provide a balance of sensitivity and reliability across various markets, including stocks, indices (like the S&P 500), forex, and cryptocurrencies.
Here's why these settings work well:
ATR Period (55): A longer ATR period smooths out volatility, making the indicator less prone to whipsaws in volatile markets like crypto or forex, while still being responsive enough for trending markets like indices.
ATR Multiplier (1.85): This multiplier strikes a balance between capturing early trend changes and avoiding noise. A smaller multiplier would make the indicator too sensitive, while a larger one might miss early opportunities.
Volume Lookback Period (20): A 20-bar lookback for volume averaging provides a robust baseline for identifying significant volume spikes, adaptable to both short-term (e.g., daily charts) and longer-term (e.g., weekly charts) timeframes.
Volume Multiplier (2.0): Requiring volume to be at least 2x the average ensures that only high-conviction moves trigger signals, which is crucial for markets with varying liquidity levels.
These parameters are fully customizable, allowing traders to adjust the indicator to their specific market, timeframe, or trading style. For example, you might reduce the ATR period for faster-moving markets or increase the volume multiplier for more conservative signal filtering.
How the Volume Filter Reduces Bad Trades in Choppy Markets
One of the main drawbacks of the Supertrend indicator is its tendency to generate false signals during choppy or ranging markets, where price fluctuates without a clear trend. The volume filter in this script addresses this issue by ensuring that trend changes are backed by significant market activity:
In choppy markets, price movements often lack strong volume, leading to false breakouts or reversals. By requiring volume to be a multiple (default: 2x) of the average volume over the lookback period, the script filters out these low-volume, low-conviction moves.This reduces the likelihood of taking bad trades during sideways markets, as only trend changes with strong volume confirmation will trigger signals. For example, on a daily chart of the S&P 500, a buy signal will only fire if the price crosses above the Supertrend line and the volume on that day is at least twice the 20-day average, indicating genuine buying pressure.
Usage Tips
Markets and Timeframes: This indicator is versatile and can be used on various assets (stocks, indices, forex, crypto) and timeframes (1-minute, 1-hour, daily, etc.). Adjust the settings based on the market's volatility and your trading strategy.
Combine with Other Indicators: While the volume filter improves reliability, consider using additional indicators like RSI or MACD to confirm trends, especially in ranging markets.
Backtesting: Test the indicator on historical data for your chosen market to optimize the settings and ensure they align with your trading goals.
Alerts: Set up alerts for buy and sell signals to stay informed of high-probability trend changes without constantly monitoring the chart.
ConclusionThe "Supertrend with Volume Filter Alert" is a powerful tool for trend-following traders, combining the simplicity of the Supertrend indicator with a volume-based filter to enhance signal accuracy. Its customizable settings make it adaptable to multiple markets, while the volume filter helps reduce false signals in choppy conditions, allowing traders to focus on high-probability trades. Whether you're trading stocks, indices, forex, or crypto, this indicator can help you identify trends with greater confidence.
Anchored VWAP by Time (Math by Thomas)📄 Description
This tool lets you plot an Anchored Volume Weighted Average Price (VWAP) starting from any specific date and time you choose. Unlike standard VWAPs that reset daily or weekly, this version gives you full control to track institutional pricing zones from precise anchor points—such as key swing highs/lows, market open, or news-driven candles.
It’s especially useful for price action and Smart Money Concepts (SMC) traders who track liquidity, fair value gaps (FVGs), and institutional zones.
🇮🇳 For NSE India Traders
You can anchor VWAP to Indian market open (e.g., 9:15 AM IST) or major events like RBI policy, earnings, or breakout candles.
The time input uses UTC by default, so for Indian Standard Time (IST), remember:
9:15 AM IST = 3:45 AM UTC
3:30 PM IST = 10:00 AM UTC
⚙️ How to Use
Add the indicator to your chart.
Open the settings panel.
Under “Anchor Start Time”, choose the date & time to begin the VWAP.
Use UTC format (adjust from IST if needed).
Customize the line color and thickness to suit your chart style.
The VWAP will begin plotting from that time forward.
🔎 Best Use Cases
Track VWAP from intraday range breakouts
Anchor from swing highs/lows to identify mean reversion zones
Combine with your FVGs, Order Blocks, or CHoCHs
Monitor VWAP reactions during key macro events or expiry days
🔧 Clean Design
No labels are used, keeping your chart clean.
Works on all timeframes (1min to Daily).
Designed for serious intraday & positional traders.
Candle Range DetectorCandle Range Detector
// Pine Script v6
// Detects candle-based ranges, mitigations, and sweeps with advanced logic
Overview
This indicator automatically detects price ranges based on candle containment, then tracks when those ranges are mitigated (broken) and when a sweep occurs. It is designed for traders who want to identify liquidity events and range breaks with precision.
How It Works
- Range Detection: A range is formed when a candle is fully contained within the previous candle (its high is lower and its low is higher). This marks a potential area of price balance or liquidity.
- Mitigation: A range is considered mitigated when price closes beyond its extension levels (configurable by normal or Fibonacci logic). This signals that the range has been invalidated or "taken out" by price action.
- Sweep Detection: After mitigation, the script watches for a sweep event: a candle that both trades through the range extreme and closes decisively beyond the log-mid of the candle itself. This is a strong sign of a liquidity grab or stop run.
- Alerts & Visuals: You can enable alerts and on-chart labels for sweeps. Only the most recent mitigated range can be swept, and each range can only be swept once.
- Timeframe Sensitivity: On weekly or monthly charts, a candle can both mitigate and sweep a range on the same bar. On lower timeframes, only one event can occur per bar.
Why It Works
- Candle containment is a robust way to identify natural price ranges and liquidity pools, as it reflects where price is consolidating or being absorbed.
- Mitigation marks the moment when a range is no longer defended, often leading to new directional moves.
- Sweeps are powerful signals of stop hunts or liquidity grabs, especially when confirmed by a close beyond the log-mid of the candle, indicating strong intent.
Visual Explanation
Tip: Use this tool to spot high-probability reversal or continuation zones, and to get alerted to key liquidity events in real time.
10 Monday's 1H Avg Range + 30-Day Daily RangeWhat This Script Does
This indicator is designed for traders who want to monitor volatility and range behavior at the start of the trading week . It focuses specifically on the first four 15-minute candles of each Monday and tracks their combined high-low range over time.
How It Works
Monday 1H Range Detection:
Each week, it automatically detects and highlights the first 4 candles of Monday on a 15-minute chart (1 hour total). It calculates the range between the highest high and lowest low of these candles.
10-Week Average of Monday 1H Ranges:
It stores and averages the last 10 such ranges, displaying this average in a table for weekly comparison.
30-Day Daily Range Average:
Separately, it calculates the average daily range (high – low) of the last 30 daily candles. This value helps put the Monday 1H range into broader context and can guide Stop Loss or TP planning.
Dynamic Labeling & Visual Highlights:
The script visually highlights the first 4 candles of Monday and places a label showing the pip range once the 4 candles have completed. It also updates a small table with the two averages described above.
How to Use It
Use it on the 15-minute timeframe to activate the Monday 1H logic.
Compare the current week’s Monday range to the 10-week average to see if volatility is increasing or decreasing.
Use the 30-day daily range to determine if the Monday opening movement is unusually large or small.
Consider adjusting trade entries, stops, or targets if the Monday range is disproportionately large compared to recent historical behavior.
What Makes It Original?
This is not a typical volatility indicator like ATR or standard deviation. Instead, it’s a purpose-built tool combining:
Time-specific behavior (first hour of the week),
Historical contextualization (10-week average tracking),
A dual-timeframe analysis (15-min + daily),
A user-friendly table and visual interface.
This script helps intraday or swing traders spot abnormal volatility early in the week and adjust their strategies accordingly—especially in fast-moving Forex or Index markets.
Ichimoku Cloud Breakout Only LongThis is a very simple trading strategy based exclusively on the Ichimoku Cloud. There are no additional indicators or complex rules involved. The key condition is that we only open long positions when the price is clearly above the cloud — indicating a bullish trend.
For optimal results, the recommended timeframes are 1D (daily) or 1W (weekly) charts. These higher timeframes help filter out market noise and provide more reliable trend signals.
We do not short the market under any circumstances. The focus is purely on riding upward momentum when the price breaks out or stays above the cloud.
This strategy works best when applied to growth stocks with strong upward trends and good fundamentals — such as Google (GOOGL), Tesla (TSLA), Apple (AAPL), or NVIDIA (NVDA).
Sunday OpenSunday Open – Weekly Open Levels
Description
The "Sunday Open" indicator automatically displays the market open levels for Sunday. These levels are often used by traders as potential support and resistance zones. The script requires no manual data input and works on any timeframe.
Functionality
- Displays the N most recent Sunday Open levels, including the current and previous ones.
- The color of the current level differs from the older ones, making it easier to identify on the chart.
- Lines can be customized by style, thickness, and label visibility.
- Alerts are triggered when the price crosses any Sunday Open level (either up or down).
User Settings
- Number of levels to display (1–100)
- Color for the current and past levels
- Line style: solid, dashed, dotted
Line thickness
- Display text labels on the chart
- Enable/disable alerts for price crossing
Useful For
- Quickly identifying key reference points at the beginning of the week
- Setting up trading scenarios around the open zone
- Receiving signals for breakouts or touches of the levels
Important !
All elements are created automatically—no manual drawing required.
If you want to create alerts for when the price crosses a Sunday Open level, you need to go to "Alerts" at the top of the screen and select "SO" in the "Condition" field.