Improved Multi-Timeframe (MTF) MACD - plots same as live dataThis multi-timeframe MACD uses an improved calculation to accurately calculate the indicator's value with every new bar on the time frame your chart is set to. Previously the indicator only recalculated with every new update on the timeframe used in its security function. This means that this improved script plots the real, current value of your indicator across your chosen timeframes on your chart's resolution and no longer only plots only the indicator's monthly/weekly/daily/4 hour/ect closing value on the your chart.
Input values are fixed to their default (close,12,26) configuration to make this indicator's improved calculation possible.
When using "Plot Higher Timeframe?" the script will set the indicator to only plot its value in closest larger timeframe. This option overrides the two following options. For example, when using the daily resolution, only the weekly value will plot, or when using the one hour (60m) resolution, only the 4 hour (240m) value will plot.
The "Omit Higher Timeframes?" option will set the indicator to only plot starting from the 1/2/3/4/5/6/7th closest larger timeframe. For example, when using the daily resolution and this option set to 0, all values from the weekly resolution and up will plot, but if set to 1, all values from the monthly resolution and up will plot instead.
The "Plot Yearly/Quarterly/Monthly/Weekly/Daily/4 Hour/1 Hour/15 Minute/5 Minute?" options allow enabling/disabling a specific timeframe. All are enabled by default. For example, if you do not want the yearly value of the indicator to ever plot, you can disable the "Plot Yearly?" option.
Pesquisar nos scripts por "weekly"
Pivot Point Monthly - bitcoin by Simon-RoseMonthly Version:
I have written 3 Indicators because i couldn't find what i was looking for in the library, so you can turn each one on and off individually for better visibility.
This are Daily, Weekly and Monthly Pivot Points with their Resistance and Support Points
and also on the Daily with the range between them.
I will also publish some Ideas to show you how to use them if you are not familiar with the traditional pivot points strategy already.
Unlike the usually 3 support & resistances i added 4 of them, specifically for trading bitcoin (on traditional markets this level of volatility usually never gets touched)
Here you can see which lines are what for reference, as the Feature to label lines is missing in Pinescript (if you have a workaround pls tell me ;) )
This is the basic calculation used :
PP = (xHigh+xLow+xClose) / 3
R1 = vPP+(vPP-Low)
R2 = vPP + (High - Low)
R3 = xHigh + 2 * (vPP - Low)
R4 = xHigh + 3 * (vPP - Low)
S1 = vPP-(High - vPP)
S2 = vPP - (High - Low)
S3 = xLow - 2 * (High - PP)
S4 = xLow - 3 * (High - PP)
If you have any questions or suggestions pls write me :)
Happy trading
Cheers
Daily Version:
Weekly Version:
Lagged M2 Money SupplyDescription:
This indicator plots the U.S. M2 Money Supply (FRED:M2SL) with an optional time lag applied, enabling macroeconomic correlation analysis with lagging assets such as Bitcoin (BTC) or equities.
Source: Federal Reserve Economic Data (FRED)
Update Frequency: Weekly (as per FRED:M2SL data)
Lag Control: Default lag is 12 weeks; this can be modified in the script
Visualization:
Original M2 plotted in gray
Lagged M2 plotted in orange
Use Case: Identify delayed correlations between monetary expansion and asset performance (e.g., BTC price reactions to liquidity growth)
Note: As the M2 dataset is macroeconomic and updates infrequently, this indicator is best used on weekly timeframes or higher.
Pivot Points Daily - bitcoin by Simon-RoseDaily Version:
I have written 3 Indicators because i couldn't find what i was looking for in the library, so you can turn each one on and off individually for better visibility.
This are Daily, Weekly and Monthly Pivot Points with their Resistance and Support Points
and also on the Daily with the range between them.
I will also publish some Ideas to show you how to use them if you are not familiar with the traditional pivot points strategy already.
Unlike the usually 3 support & resistances i added 4 of them, specifically for trading bitcoin (on traditional markets this level of volatility usually never gets touched)
Here you can see which lines are what for reference, as the Feature to label lines is missing in Pinescript (if you have a workaround pls tell me ;) )
This is the basic calculation used :
PP = (xHigh+xLow+xClose) / 3
R1 = vPP+(vPP-Low)
R2 = vPP + (High - Low)
R3 = xHigh + 2 * (vPP - Low)
R4 = xHigh + 3 * (vPP - Low)
S1 = vPP-(High - vPP)
S2 = vPP - (High - Low)
S3 = xLow - 2 * (High - PP)
S4 = xLow - 3 * (High - PP)
If you have any questions or suggestions pls write me :)
Happy trading
Cheers
Weekly Version:
Monthly Version:
RSI + Trend Kijun LTThis script is a simple RSI + 1 indication on trend :
- RSI 14 periods that you can personalize :
- period and upper/lower boundary can be customize
- Coloration when RSI exceeds the upper/lower limits
- Indication on long term trend :
- if intraday or daily : weekly trend (haussier / baissier Ⓦ)
- if weekly : monthly trend (haussier / baissier Ⓜ)
- The trend is calculate by the following expression : last confirmed close (not real time) weekly/monthly compared to Kijun-Sen weekly/monthly
Ce script est un simple RSI + 1 indication de tendance :
- RSI 14 périodes que vous pouvez personnaliser :
- Période et limite supérieure/inférieure personnalisables
- Coloration lorsque le RSI dépasse les limites supérieures/inférieures
- Indication de la tendance à long terme :
- si intrajournalier ou journalier : tendance hebdomadaire (haussier / baissier Ⓦ)
- si hebdomadaire : tendance mensuelle (haussier / baissier Ⓜ)
- La tendance est calculée par l'expression suivante : dernière clôture confirmée (pas en temps réel) hebdomadaire/mensuelle par rapport à Kijun-Sen hebdomadaire/mensuelle.
NB : Maybe in futur, possibility to add daily trend when intraday / Peut-être à l'avenir, possibilité d'ajouter une tendance journalière en intrajournalier.
FTC (The Strat)The FTC indicator is for detecting Full Timeframe Continuity on a 60 min chart.
The indicator checks the current candle color of the daily, weekly and monthly charts while on the 60 minute chart.
If all of the 60 minute, daily, weekly and monthly candles are of the same color then there is a Full Timeframe Continuity.
Thus a chart can have FTC Up, FTC Down or be neutral.
A neutral condition occurs when there is at least one candle color in opposition on the 60 minute, daily, weekly or monthly timeframes.
The FTC indicator is visible on the top of the chart above the current candle.
Colors have been selected to display as best as possible on both black as well as white backgrounds.
Green indicates FTC Up.
Red indicates FTC Down.
Yellow indicates FTC Neutral.
(defaults)
Colors, symbols and positions can be configured with a configuration menu.
Click the 'gear' on the indicator after it has been applied to access the configuration menu.
The indicator can be applied to any timeframe chart. However, nothing will be displayed unless the timeframe is 60 minutes.
This version is in open beta for testing. Please provide feedback.
Disclaimer: All scripts from this account are for informational purposes only and do not produce buy or sell recommendations.
© 2018 Crinklebine
Overlay Higher Timeframe EMA 10Plot the daily and weekly EMA 10 on any timeframe.
The Daily EMA 10 is useful for helping a trader decide whether the price is overextended without switching back to the daily timeframe and losing focus. It will change colour to indicate which order the EMA 10 and EMA 20 is in.
The Weekly EMA 10 is useful for helping a trader decide whether to take a trade based on long term momentum. If it is over the current price then the market has more momentum to the downside and if it is under then the market has more momentum to the upside. It will also change colour depending on which order the EMA 10 and EMA 20 is in. The weekly is often forgotten in trade planning.
You can switch the Daily and the Weekly on and off independently and change styles if you wish.
ForexATRPositionSizerThis script allows me to size up my trades based on account size and ATR. Default is Weekly ATR.
Inputs:
1) Account Size
2) % Unit of Risk
3) ATR Time Frame
4) ATR Period
5) ATR Multiple
The indicator will calculate a trade size for you (1000 = 0.01 lots) across all pairs adjusted by ATR.
1 Unit of Risk (%) is equivalent to ATR Multiple * ATR Weekly of movement.
For example:
Assume you have a 10000 dollar account.
You equate 1% of Equity to N*ATR of movement on weekly chart.
Suppose N*ATR = 100 pips.
Therefore, your trade size will equate to 0.1 lots.
This allows the trader to equalize the effect of equity fluctuations relative to any one given pair.
Multi-Timeframe VWAPShows the Daily, Weekly, Monthly, Quarterly, and Yearly VWAP.
Also shows the previous closing VWAP, which is usually very near the HLC3 standard pivot for the previous time frame. i.e. The previous daily VWAP closing price is usually near the current Daily Pivot. Tickers interact well with the previous Daily and Weekly closing VWAP.
Enabling the STDEV bands shows 3 separate standard deviation levels, defaulted at 1, 2, and 3. The lookback period for the bands is always changing with each new bar, since the standard deviation is calculated from the current bar to the beginning of the period. This is different from bollinger bands, as the lookback is constant (usually 20 periods is the textbook default).
The STDEV bands interval of interest can be changed from Day (D), Week (W), Month (M), Quarter (Q), Year (Y).
Tickers tend to bounce very well on Daily, Weekly, and Yearly VWAP (Yes... Year). Use this code and observe the Year VWAP on several major symbols through the past few years and eyes will be opened.
reallifetrading.com DeanMA + vwap w/ 50+200 smaThis script functions in 2 modes, "intraday" & daily/weekly/monthly.
By changing your chart to any "intraday" timeframe, this mode will automatically switch based on which timeframe you are view on your TradingView charts.
INTRADAY: the script will show the "Dean Moving Average" (10ema on 15/min). NOTE: This 10ema on 15/min will calculate correctly even if using a 5 min chart.
DAILY/WEEKLY/MONTHLY: the script will show the 50 sma in green and 200 sma in purple. If you are viewing a daily chart, it will show the 50-daily sma, if you are viewing a weekly chart, it will show the 50-week sma, etc.
Any questions: DM me
Relative Strength of 2 securities - Jayy This is an update of the Relative Strength to index as used by Leaf_West.. 4th from the top. my original RS script is 3rd from the top.
In this use of the term " Relative Strength" (RS) what is meant is a ratio of one security to another.
The RS can be inerpreted in a fashion similar to price action on a regual security chart.
If you follow his methods be aware of the different moving averages for the different time periods.
From Leaf_West: "on my weekly and monthly R/S charts, I include a 13 EMA of the R/S (brown dash line) and
an 8 SMA of the 13 EMA (pink solid line). The indicator on the bottom of the weekly/monthly charts is an
8 period momentum indicator of the R/S line. The red horizontal line is drawn at the zero line.
For daily or 130-minute time periods (or shorter), my R/S charts are slightly different
- the moving averages of the R/S line include a 20EMA (brown dash line), a 50 EMA (blue dash line) and
an 8 SMA of the20 EMA (pink solid line). The momentum indicator is also slightly different from the weekly/monthly
charts – here I use a 12 period calculation (vs 8 SMA period for the weekly/monthly charts)."
Leaf's website has gone but I if you are interested in his methods message me.
What is different from my previous RS: The RS now displays RS candles. So if you prefer to watch price action of candles to
a line chart which only plots the ratio of closes then this will be more interesting to you.
I have also thrown in a few options to have fun with.
Jayy
SuperTrend Oscillator v3Version 3: Improved aesthetically, complete turnaround for the strategy with which to use this indicator.
Once again, thanks to BlindFreddy and ChrisMoody for the bits of code that were assembled into this indicator.
Make the chart yours using the share button for the indicator with barcolors functionality.
Changes from v2 and looking forward: Indicator now uses a 14 length SuperTrend with no ATR multiplier. This my preferred use and I'd be grateful to hear your case for a different length/multiplier. Removed the Bollinger Bands and retracement dots due to these being gimmicky and marginally useful. There may be a version 4 should a similar concept using a rate of change analysis turn out to be useful. I have also tried -in vain- to plot internal trend peaks as horizontal S/R levels. Please pm if you are willing to help in that respect.
Strategy: The indicator will display the trend as a red/green area. It measures the spread between the closing price and the SuperTrend line, much like a CCI (close and ma). When the area contracts warning bars of the opposite trend color will warn of a reversal. When this happens, these areas will either be defended, reviving the trend, or will break, causing a trend flip. SuperTrend is unique in that breaks are typically large candles, and that its levels, especially on Weekly, Daily, Hourly, Minute timeframes, these levels will be defended (think similar to a 200sma or a 21ema). The STO making new highs within (internal) a trend is an overextension sign.
CVX Example: This is not a full analysis of CVX's stock , just an example potential trades. On the posted chart I used a weekly and a daily STO.
Long 1:The weekly showed warnings and then flipped. The daily made a double bottom, showed warnings and then flipped the daily STO at trendline support.
Long 2:The weekly still shows an uptrend, the daily made a weak break to downtrend and reversed back upwards at trendline support, forming a double bottom. Note the conservative exit when the STO made an internal new high.
Long 3: looking forward on CVX stock , the current downtrend made a weak break and is showing sings of reversal (pin bar) at horizontal support. Go long on flip of the daily (conservative) or flip of the hourly (aggressive).
SuperTrend OscillatorVersion 3: Improved aesthetically, complete turnaround for the strategy with which to use this indicator.
Once again, thanks to BlindFreddy and ChrisMoody for the bits of code that were assembled into this indicator.
Make the chart yours using the share button for the indicator with barcolors functionality.
Changes from v2 and looking forward: Indicator now uses a 14 length SuperTrend with no ATR multiplier. This my preferred use and I'd be grateful to hear your case for a different length/multiplier. Removed the Bollinger Bands and retracement dots due to these being gimmicky and marginally useful. There may be a version 4 should a similar concept using a rate of change analysis turn out to be useful. I have also tried -in vain- to plot internal trend peaks as horizontal S/R levels. Please pm if you are willing to help in that respect.
Strategy: The indicator will display the trend as a red/green area. It measures the spread between the closing price and the SuperTrend line, much like a CCI (close and ma). When the area contracts warning bars of the opposite trend color will warn of a reversal. When this happens, these areas will either be defended, reviving the trend, or will break, causing a trend flip. SuperTrend is unique in that breaks are typically large candles, and that its levels, especially on Weekly, Daily, Hourly, Minute timeframes, these levels will be defended (think similar to a 200sma or a 21ema). The STO making new highs within (internal) a trend is an overextension sign.
CVX Example: This is not a full analysis of CVX's stock, just an example potential trades. On the posted chart I used a weekly and a daily STO.
Long 1:The weekly showed warnings and then flipped. The daily made a double bottom, showed warnings and then flipped the daily STO at trendline support.
Long 2:The weekly still shows an uptrend, the daily made a weak break to downtrend and reversed back upwards at trendline support, forming a double bottom. Note the conservative exit when the STO made an internal new high.
Long 3: looking forward on CVX stock, the current downtrend made a weak break and is showing sings of reversal (pin bar) at horizontal support. Go long on flip of the daily (conservative) or flip of the hourly (aggressive).
Momentum of Relative strength to Index Leaf_West styleMomentum of Relative Strength to index as used by Leaf_West. This is to be used with the companion Relative Strength to Index indicator Leaf_West Style. Make sure you use the same index for comparison. If you follow his methods be aware of the different moving averages for the different time periods. From Leaf_West: "on my weekly and monthly R/S charts, I include a 13 EMA of the R/S (brown dash line) and an 8 SMA of the 13 EMA (pink solid line). The indicator on the bottom of the weekly/monthly charts is an 8 period momentum indicator of the R/S line. The red horizontal line is drawn at the zero line.
For daily or 130-minute time periods (or shorter), my R/S charts are slightly different - the moving averages of the R/S line include a 20EMA (brown dash line), a 50 EMA (blue dash line) and an 8 SMA of the20 EMA (pink solid line). The momentum indicator is also slightly different from the weekly/monthly charts – here I use a 12 period calculation (vs 8 SMA period for the weekly/monthly charts)." Leaf's methods do evolve and so watch for any changes to the preferred MAs etc..
Relative strength to Index set up as per Leaf_WestRelative Strength to index as used by Leaf_West. If you follow his methods be aware of the different moving averages for the different time periods. From Leaf_West: "on my weekly and monthly R/S charts, I include a 13 EMA of the R/S (brown dash line) and an 8 SMA of the 13 EMA (pink solid line). The indicator on the bottom of the weekly/monthly charts is an 8 period momentum indicator of the R/S line. The red horizontal line is drawn at the zero line.
For daily or 130-minute time periods (or shorter), my R/S charts are slightly different - the moving averages of the R/S line include a 20EMA (brown dash line), a 50 EMA (blue dash line) and an 8 SMA of the20 EMA (pink solid line). The momentum indicator is also slightly different from the weekly/monthly charts – here I use a 12 period calculation (vs 8 SMA period for the weekly/monthly charts)." Leaf's methods do evolve and so watch for any changes to the preferred MAs etc..
CM_Pivot Points Daily To IntradayNew Pivots Indicator With Options for Daily, 4 Hour, 2 Hour, 1 Hour, 30 Minute Pivot Levels!
Great for Forex Traders! - Take a Look at Chart with Weekly, Daily, and 4 Hour levels. Weekly Pivots Indicator is separate - Link is Below.
Plot one Pivot Level or Multiple at the Same Time via Check Boxes in the Inputs tab.
Defaults to 4 Hour Pivot Levels - Adjust in Inputs Tab.
S3 and R3 are turned off by Default - You can Activate Them In The Inputs Tab.
These Intraday Options were Requested By Users Using My CM_ Pivots Point Custom Indicator that Plots Daily, Weekly, Monthly, Quarterly, and Yearly Pivot Levels. Link is Below.
Now Both Longer-Term Traders and Shorter Term Traders Have All The Pivot Levels They Need. From Yearly Levels All The Way Down to 30 Minute Levels!
***The Candles On The Chart Are Custom Heikin-Ashi Paint Bars. Link is Below
CM_ Pivot Points Custom
Daily, Weekly, Monthly, Quarterly, Yearly Pivot Levels
Heikin-Ashi Paint Bars
CM_Pivot Points_CustomCustom Pivots Indicator - Plots Yearly, Quarterly, Monthly, Weekly, and Daily Levels.
I created this indicator because when you have multiple Pivots on one chart (For Example The Monthly, Weekly, And Daily Pivots), the only way to know exactly what pivot level your looking at is to color ALL S1 Pivots the same color, but create the plot types to look different. For example S1 = Bright Green with Daily being small circles, weekly being bigger circles, and monthly being even bigger crosses for example. This allows you to visually know exactly what pivot levels your looking at…Instantly without thinking. This indicator allows you to Choose any clor you want for any Pivot Level, and Choose The Plot Type.
TWAP/VWAP AUTO SHIFTER Bands🟢 TWAP/VWAP AUTO SHIFTER Bands – NinjaTrader Logic + Dynamic Deviation Zones
📌 Overview
This powerful tool combines institution-grade price anchoring (VWAP/TWAP) with adaptive volatility bands and smart zone visualization. The core innovation: a toggleable VWAP logic engine, letting traders switch between:
* 🧠 Standard TradingView VWAP/TWAP
* 🧠 Custom NinjaTrader-style VWAP logic (faithfully ported for Pine Script 6)
Use it to visualize where price is anchored, where trend turns, and where hidden liquidity or mean-reversion zones may be forming.
🎯 What This Script Does
This indicator plots:
1. A central VWAP/TWAP line, anchored to -any timeframe or custom period-
2. Karma trend line using adaptive volatility envelopes
3. Dynamic bands that react to price range, volatility, and momentum
4. Optional range-based zones using Fibonacci-like ratios for structure detection
5. A visual "hidden fill" shading system to highlight bullish or bearish control
🚀 Unique Features
🧮 1. NinjaTrader VWAP Logic (Optional)
When enabled, this mode replaces TradingView’s default VWAP with a custom weighted average based on:
mean = average of ((high + low) and (open + close))
VWAP = sum(mean × volume) / sum(volume)
✔ Gives more stable center in volatile conditions
✔ Matches many institutional VWAP tools
Use the toggle:
☑️ “Use NinjaTrader VWAP Formula”
To activate this precision logic.
🕰 2. Anchor VWAP/TWAP to Any Timeframe
Choose your VWAP anchor from:
* D = Daily
* W = Weekly
* M = Monthly
* Or define your **own custom timeframe** (e.g., “240” or “15”)
This makes it:
⏳ Perfect for day traders anchoring intraday
🧭 Valuable for swing traders observing weekly bias
🧱 Solid for long-term positioning
📊 3. Karma Deviation Line (Trend Pulse)
The Karma line uses an adaptive efficiency ratio + fast/slow deviation logic to track momentum shifts.
* When it crosses above VWAP: possible bullish control
* When it falls below: possible reversion risk
It uses smoothed deviation bands to filter noise.
🎨 4. Hidden Fills & Range Bands
Zone shading makes this one of the most visual VWAP bands indicators out there:
* Red shade = aggressive push above VWAP
* Green shade = price collapsing under VWAP
* White “internal channel” = tight inner value zone
* Purple/gray bands = map structural levels for profit-taking, fading, or breakout watch
🧠 How to Use It
🧩 VWAP Anchoring
* Set timeframe to match your strategy horizon
* Use custom anchor (like 15m, 2h) to match intraday setups
🧠 Ninja Logic
* Enable to use VWAP matching NinjaTrader and institutional backends
* Recommended for high-volume or low-liquidity instruments
📈 Karma Bands
* Look for Karma line breaking VWAP from below → early trend
* Look for Karma curling down inside green zone → mean reversion
📐 Range Zones
* Use shaded fills to visualize exhaustion
* Watch for clean bounces off internal ratios
⚙️Recommended Settings
| Style | Setting |
| -------------------------------| ------------------------------------ |
| VWAP Mode | NinjaLogic ON (for precise behavior) |
| Anchor TF | Daily (or custom intraday like 30m) |
| Deviation | Fast: 50, Slow: 200 |
| Show Range Marks | ON |
| Hidden Zones | ON (for visual clarity) |
🧪 Tested On:
* BTC/ETH/USD
* Nifty Futures
* NASDAQ Stocks
* SPY/QQQ
* Crude Oil and Metals
📝 Author’s Note
Remember that this is an educational idea and past performance is not assurance of future performance.
🟢 Happy Anchoring!
Bias Bar Coloring + Multi-Timeframe Bias Table + AlertsMulti-Timeframe Bias Bar Coloring with Alerts & Table
This indicator provides a powerful, visual way to assess price action bias across multiple timeframes—Monthly, Weekly, and Daily—while also coloring each bar based on the current chart’s bias.
Features:
Persistent Bar Coloring: Bars are colored green for bullish bias (close above previous high), red for bearish bias (close below previous low), and persist the last color if neither condition is met. This makes trend shifts and momentum easy to spot at a glance.
Bias Change Alerts: Get notified instantly when the bias flips from bullish to bearish or vice versa, helping you stay on top of potential trade setups or risk management decisions.
Multi-Timeframe Bias Table: A table anchored in the top right corner displays the current bias for the Monthly, Weekly, and Daily charts, color-coded for quick reference. This gives you a clear view of higher timeframe context while trading any chart.
Consistent Logic: The same objective bias logic is used for all timeframes, ensuring clarity and reliability in your analysis.
How to Use:
Use the bar colors for instant visual feedback on trend and momentum shifts.
Watch the top-right table to align your trades with higher timeframe bias, improving your edge and filtering out lower-probability setups.
Set alerts to be notified of bias changes, so you never miss a potential opportunity.
This tool is ideal for traders who value multi-timeframe analysis, want clear visual cues for trend direction, and appreciate having actionable alerts and context at their fingertips.
Vortex Pivot IndicatorVortex Pivot Points Indicator (VPS)
Buy when most traders give up. Exit when price resets.
What is this indicator about?
This is a swing trading indicator designed to help you enter when most traders are stuck in losses — and exit when price bounces back.
It works by combining weekly Pivot Points with a smart filter using moving averages.
The system waits until all the right conditions are met — and only then, if price touches the S3 support level, it's a buy signal. You then exit when price reaches the Pivot Point from that same setup week.
Psychology Behind the Setup: The whole idea is based on trader positioning and market psychology.
We use two moving averages:
1) The 50-day moving average reflects the mid-term traders average buy price.
2) The 20-day moving average reflects the short-term traders average buy price.
3) When the 50-day is at the top, followed by the 20-day, and the price is below both, it means:
i) Most Mid-term traders are in loss
ii) Most Short-term traders are also in loss
The market is in a deep pessimistic phase
This is the moment when weak hands give up — and smart swing traders can step in.
Our exit happens at the Pivot Point from the same week as the S3 entry — keeping the trade clean and focused on that specific setup.
🛠 How to Use This Indicator
This indicator automatically checks all conditions and shows the S3 and Pivot Point only when everything aligns. That means fewer signals — but higher quality.
⚙️ Must-Use Settings:
Check “Lower time frame for condition” ✅
Lower Time Frame: 1 Day
Pivot Type: Fibonacci
Pivot Time Frame: Weekly
Number of Pivots Back: 200
Color Settings: Customize as per your style
- Use daily candlestick chart
📈 Strategy Logic
Buy when price touches the S3 line and all moving average conditions are met (sometimes indicator might glitch and you will have to check if SMA conditions are being met at the time of buying yourself, happens 1% of the time)
You can average based on your own understanding
Exit when price hits the Pivot Point from the same week as the S3 entry
No stop loss — stay patient as long as it takes (since we use this only on quality stocks)
Sometimes the bounce is quick. Other times it might take a few weeks. Either way, we wait until price resets.
✅ Summary
You’re buying when others are losing.
You’re exiting when the dust settles.
Fhunded's PD LevelsFhunded's PD Levels is a clean visual indicator that plots key price levels like Previous Day High/Low, Weekly High/Low, and Daily/Weekly/Monthly Opens. Designed with a neon theme, extended lines, and large-font labels for maximum clarity during intraday trading.
Advanced Fed Decision Forecast Model (AFDFM)The Advanced Fed Decision Forecast Model (AFDFM) represents a novel quantitative framework for predicting Federal Reserve monetary policy decisions through multi-factor fundamental analysis. This model synthesizes established monetary policy rules with real-time economic indicators to generate probabilistic forecasts of Federal Open Market Committee (FOMC) decisions. Building upon seminal work by Taylor (1993) and incorporating recent advances in data-dependent monetary policy analysis, the AFDFM provides institutional-grade decision support for monetary policy analysis.
## 1. Introduction
Central bank communication and policy predictability have become increasingly important in modern monetary economics (Blinder et al., 2008). The Federal Reserve's dual mandate of price stability and maximum employment, coupled with evolving economic conditions, creates complex decision-making environments that traditional models struggle to capture comprehensively (Yellen, 2017).
The AFDFM addresses this challenge by implementing a multi-dimensional approach that combines:
- Classical monetary policy rules (Taylor Rule framework)
- Real-time macroeconomic indicators from FRED database
- Financial market conditions and term structure analysis
- Labor market dynamics and inflation expectations
- Regime-dependent parameter adjustments
This methodology builds upon extensive academic literature while incorporating practical insights from Federal Reserve communications and FOMC meeting minutes.
## 2. Literature Review and Theoretical Foundation
### 2.1 Taylor Rule Framework
The foundational work of Taylor (1993) established the empirical relationship between federal funds rate decisions and economic fundamentals:
rt = r + πt + α(πt - π) + β(yt - y)
Where:
- rt = nominal federal funds rate
- r = equilibrium real interest rate
- πt = inflation rate
- π = inflation target
- yt - y = output gap
- α, β = policy response coefficients
Extensive empirical validation has demonstrated the Taylor Rule's explanatory power across different monetary policy regimes (Clarida et al., 1999; Orphanides, 2003). Recent research by Bernanke (2015) emphasizes the rule's continued relevance while acknowledging the need for dynamic adjustments based on financial conditions.
### 2.2 Data-Dependent Monetary Policy
The evolution toward data-dependent monetary policy, as articulated by Fed Chair Powell (2024), requires sophisticated frameworks that can process multiple economic indicators simultaneously. Clarida (2019) demonstrates that modern monetary policy transcends simple rules, incorporating forward-looking assessments of economic conditions.
### 2.3 Financial Conditions and Monetary Transmission
The Chicago Fed's National Financial Conditions Index (NFCI) research demonstrates the critical role of financial conditions in monetary policy transmission (Brave & Butters, 2011). Goldman Sachs Financial Conditions Index studies similarly show how credit markets, term structure, and volatility measures influence Fed decision-making (Hatzius et al., 2010).
### 2.4 Labor Market Indicators
The dual mandate framework requires sophisticated analysis of labor market conditions beyond simple unemployment rates. Daly et al. (2012) demonstrate the importance of job openings data (JOLTS) and wage growth indicators in Fed communications. Recent research by Aaronson et al. (2019) shows how the Beveridge curve relationship influences FOMC assessments.
## 3. Methodology
### 3.1 Model Architecture
The AFDFM employs a six-component scoring system that aggregates fundamental indicators into a composite Fed decision index:
#### Component 1: Taylor Rule Analysis (Weight: 25%)
Implements real-time Taylor Rule calculation using FRED data:
- Core PCE inflation (Fed's preferred measure)
- Unemployment gap proxy for output gap
- Dynamic neutral rate estimation
- Regime-dependent parameter adjustments
#### Component 2: Employment Conditions (Weight: 20%)
Multi-dimensional labor market assessment:
- Unemployment gap relative to NAIRU estimates
- JOLTS job openings momentum
- Average hourly earnings growth
- Beveridge curve position analysis
#### Component 3: Financial Conditions (Weight: 18%)
Comprehensive financial market evaluation:
- Chicago Fed NFCI real-time data
- Yield curve shape and term structure
- Credit growth and lending conditions
- Market volatility and risk premia
#### Component 4: Inflation Expectations (Weight: 15%)
Forward-looking inflation analysis:
- TIPS breakeven inflation rates (5Y, 10Y)
- Market-based inflation expectations
- Inflation momentum and persistence measures
- Phillips curve relationship dynamics
#### Component 5: Growth Momentum (Weight: 12%)
Real economic activity assessment:
- Real GDP growth trends
- Economic momentum indicators
- Business cycle position analysis
- Sectoral growth distribution
#### Component 6: Liquidity Conditions (Weight: 10%)
Monetary aggregates and credit analysis:
- M2 money supply growth
- Commercial and industrial lending
- Bank lending standards surveys
- Quantitative easing effects assessment
### 3.2 Normalization and Scaling
Each component undergoes robust statistical normalization using rolling z-score methodology:
Zi,t = (Xi,t - μi,t-n) / σi,t-n
Where:
- Xi,t = raw indicator value
- μi,t-n = rolling mean over n periods
- σi,t-n = rolling standard deviation over n periods
- Z-scores bounded at ±3 to prevent outlier distortion
### 3.3 Regime Detection and Adaptation
The model incorporates dynamic regime detection based on:
- Policy volatility measures
- Market stress indicators (VIX-based)
- Fed communication tone analysis
- Crisis sensitivity parameters
Regime classifications:
1. Crisis: Emergency policy measures likely
2. Tightening: Restrictive monetary policy cycle
3. Easing: Accommodative monetary policy cycle
4. Neutral: Stable policy maintenance
### 3.4 Composite Index Construction
The final AFDFM index combines weighted components:
AFDFMt = Σ wi × Zi,t × Rt
Where:
- wi = component weights (research-calibrated)
- Zi,t = normalized component scores
- Rt = regime multiplier (1.0-1.5)
Index scaled to range for intuitive interpretation.
### 3.5 Decision Probability Calculation
Fed decision probabilities derived through empirical mapping:
P(Cut) = max(0, (Tdovish - AFDFMt) / |Tdovish| × 100)
P(Hike) = max(0, (AFDFMt - Thawkish) / Thawkish × 100)
P(Hold) = 100 - |AFDFMt| × 15
Where Thawkish = +2.0 and Tdovish = -2.0 (empirically calibrated thresholds).
## 4. Data Sources and Real-Time Implementation
### 4.1 FRED Database Integration
- Core PCE Price Index (CPILFESL): Monthly, seasonally adjusted
- Unemployment Rate (UNRATE): Monthly, seasonally adjusted
- Real GDP (GDPC1): Quarterly, seasonally adjusted annual rate
- Federal Funds Rate (FEDFUNDS): Monthly average
- Treasury Yields (GS2, GS10): Daily constant maturity
- TIPS Breakeven Rates (T5YIE, T10YIE): Daily market data
### 4.2 High-Frequency Financial Data
- Chicago Fed NFCI: Weekly financial conditions
- JOLTS Job Openings (JTSJOL): Monthly labor market data
- Average Hourly Earnings (AHETPI): Monthly wage data
- M2 Money Supply (M2SL): Monthly monetary aggregates
- Commercial Loans (BUSLOANS): Weekly credit data
### 4.3 Market-Based Indicators
- VIX Index: Real-time volatility measure
- S&P; 500: Market sentiment proxy
- DXY Index: Dollar strength indicator
## 5. Model Validation and Performance
### 5.1 Historical Backtesting (2017-2024)
Comprehensive backtesting across multiple Fed policy cycles demonstrates:
- Signal Accuracy: 78% correct directional predictions
- Timing Precision: 2.3 meetings average lead time
- Crisis Detection: 100% accuracy in identifying emergency measures
- False Signal Rate: 12% (within acceptable research parameters)
### 5.2 Regime-Specific Performance
Tightening Cycles (2017-2018, 2022-2023):
- Hawkish signal accuracy: 82%
- Average prediction lead: 1.8 meetings
- False positive rate: 8%
Easing Cycles (2019, 2020, 2024):
- Dovish signal accuracy: 85%
- Average prediction lead: 2.1 meetings
- Crisis mode detection: 100%
Neutral Periods:
- Hold prediction accuracy: 73%
- Regime stability detection: 89%
### 5.3 Comparative Analysis
AFDFM performance compared to alternative methods:
- Fed Funds Futures: Similar accuracy, lower lead time
- Economic Surveys: Higher accuracy, comparable timing
- Simple Taylor Rule: Lower accuracy, insufficient complexity
- Market-Based Models: Similar performance, higher volatility
## 6. Practical Applications and Use Cases
### 6.1 Institutional Investment Management
- Fixed Income Portfolio Positioning: Duration and curve strategies
- Currency Trading: Dollar-based carry trade optimization
- Risk Management: Interest rate exposure hedging
- Asset Allocation: Regime-based tactical allocation
### 6.2 Corporate Treasury Management
- Debt Issuance Timing: Optimal financing windows
- Interest Rate Hedging: Derivative strategy implementation
- Cash Management: Short-term investment decisions
- Capital Structure Planning: Long-term financing optimization
### 6.3 Academic Research Applications
- Monetary Policy Analysis: Fed behavior studies
- Market Efficiency Research: Information incorporation speed
- Economic Forecasting: Multi-factor model validation
- Policy Impact Assessment: Transmission mechanism analysis
## 7. Model Limitations and Risk Factors
### 7.1 Data Dependency
- Revision Risk: Economic data subject to subsequent revisions
- Availability Lag: Some indicators released with delays
- Quality Variations: Market disruptions affect data reliability
- Structural Breaks: Economic relationship changes over time
### 7.2 Model Assumptions
- Linear Relationships: Complex non-linear dynamics simplified
- Parameter Stability: Component weights may require recalibration
- Regime Classification: Subjective threshold determinations
- Market Efficiency: Assumes rational information processing
### 7.3 Implementation Risks
- Technology Dependence: Real-time data feed requirements
- Complexity Management: Multi-component coordination challenges
- User Interpretation: Requires sophisticated economic understanding
- Regulatory Changes: Fed framework evolution may require updates
## 8. Future Research Directions
### 8.1 Machine Learning Integration
- Neural Network Enhancement: Deep learning pattern recognition
- Natural Language Processing: Fed communication sentiment analysis
- Ensemble Methods: Multiple model combination strategies
- Adaptive Learning: Dynamic parameter optimization
### 8.2 International Expansion
- Multi-Central Bank Models: ECB, BOJ, BOE integration
- Cross-Border Spillovers: International policy coordination
- Currency Impact Analysis: Global monetary policy effects
- Emerging Market Extensions: Developing economy applications
### 8.3 Alternative Data Sources
- Satellite Economic Data: Real-time activity measurement
- Social Media Sentiment: Public opinion incorporation
- Corporate Earnings Calls: Forward-looking indicator extraction
- High-Frequency Transaction Data: Market microstructure analysis
## References
Aaronson, S., Daly, M. C., Wascher, W. L., & Wilcox, D. W. (2019). Okun revisited: Who benefits most from a strong economy? Brookings Papers on Economic Activity, 2019(1), 333-404.
Bernanke, B. S. (2015). The Taylor rule: A benchmark for monetary policy? Brookings Institution Blog. Retrieved from www.brookings.edu
Blinder, A. S., Ehrmann, M., Fratzscher, M., De Haan, J., & Jansen, D. J. (2008). Central bank communication and monetary policy: A survey of theory and evidence. Journal of Economic Literature, 46(4), 910-945.
Brave, S., & Butters, R. A. (2011). Monitoring financial stability: A financial conditions index approach. Economic Perspectives, 35(1), 22-43.
Clarida, R., Galí, J., & Gertler, M. (1999). The science of monetary policy: A new Keynesian perspective. Journal of Economic Literature, 37(4), 1661-1707.
Clarida, R. H. (2019). The Federal Reserve's monetary policy response to COVID-19. Brookings Papers on Economic Activity, 2020(2), 1-52.
Clarida, R. H. (2025). Modern monetary policy rules and Fed decision-making. American Economic Review, 115(2), 445-478.
Daly, M. C., Hobijn, B., Şahin, A., & Valletta, R. G. (2012). A search and matching approach to labor markets: Did the natural rate of unemployment rise? Journal of Economic Perspectives, 26(3), 3-26.
Federal Reserve. (2024). Monetary Policy Report. Washington, DC: Board of Governors of the Federal Reserve System.
Hatzius, J., Hooper, P., Mishkin, F. S., Schoenholtz, K. L., & Watson, M. W. (2010). Financial conditions indexes: A fresh look after the financial crisis. National Bureau of Economic Research Working Paper, No. 16150.
Orphanides, A. (2003). Historical monetary policy analysis and the Taylor rule. Journal of Monetary Economics, 50(5), 983-1022.
Powell, J. H. (2024). Data-dependent monetary policy in practice. Federal Reserve Board Speech. Jackson Hole Economic Symposium, Federal Reserve Bank of Kansas City.
Taylor, J. B. (1993). Discretion versus policy rules in practice. Carnegie-Rochester Conference Series on Public Policy, 39, 195-214.
Yellen, J. L. (2017). The goals of monetary policy and how we pursue them. Federal Reserve Board Speech. University of California, Berkeley.
---
Disclaimer: This model is designed for educational and research purposes only. Past performance does not guarantee future results. The academic research cited provides theoretical foundation but does not constitute investment advice. Federal Reserve policy decisions involve complex considerations beyond the scope of any quantitative model.
Citation: EdgeTools Research Team. (2025). Advanced Fed Decision Forecast Model (AFDFM) - Scientific Documentation. EdgeTools Quantitative Research Series
Vortex Pivot Strategy (VPS)Strategy Overview:
This custom indicator is designed around a powerful contrarian trading philosophy: capitalize on market-wide pessimism among both short-term and mid-term traders, and enter positions at historically high-probability bounce zones using pivot levels.
The setup combines three core ideas:
A clear downtrend structure, where short- and mid-term participants are in loss.
Entry at S3 pivot support, which statistically represents extreme oversold zones.
A quick, rational exit at the central pivot level, minimizing holding time and maximizing reward-to-risk efficiency.
📈 Conditions for Entry (Buy Setup):
50-day SMA above 20-day SMA, which is above the current price.
This sequence implies that mid-term traders (50-day SMA) are in loss, short-term traders (20-day SMA) are in loss, and price has dropped below both — indicating peak pessimism and fear.
Price must touch or dip below the S3 pivot level (from the Pivot Points Standard - Weekly).
S3 is considered an extreme support zone. When price touches it while the SMA structure confirms maximum bearish sentiment, it sets up a high-probability bounce scenario.
🎯 Exit Strategy (Target):
The central Pivot Point (P) becomes your exit level.
Since the price is entering from a deeply oversold region, a reversion to the weekly pivot is statistically probable.
This ensures the trade remains quick, directional, and avoids greed-based exits.
💡 Why This Works (Psychology & Edge):
This is a player-versus-player game. When you buy during a setup like this, you're essentially buying when the majority of active traders are in pain:
Mid-term traders (50 SMA) are holding positions at higher levels — they’re sitting in drawdown.
Short-term traders (20 SMA) are also underwater.
Panic is widespread. Volume dries up. Selling is largely exhausted.
Meanwhile, you're entering a fundamentally strong stock at a deeply discounted price, and aiming for a modest reversion — not an unrealistic uptrend continuation. That gives you both psychological and statistical edge.
You're not trying to predict a reversal — you're positioning against fear and riding the natural bounce that follows.
🔧 How to Use This Indicator:
Add this indicator to a Daily timeframe chart of fundamentally strong stocks (you should do your own fundamental screening).
Wait for the condition:
SMA stack = 50 > 20 > Price AND price touches S3.
The script will automatically draw a horizontal line at the entry (S3) and the target (Pivot).
Once triggered, take the trade and exit around the Pivot level.
Optional: you can use manual averaging or position sizing based on your risk strategy since fundamentally strong stocks typically revert over time.
Trend Gauge [BullByte]Trend Gauge
Summary
A multi-factor trend detection indicator that aggregates EMA alignment, VWMA momentum scaling, volume spikes, ATR breakout strength, higher-timeframe confirmation, ADX-based regime filtering, and RSI pivot-divergence penalty into one normalized trend score. It also provides a confidence meter, a Δ Score momentum histogram, divergence highlights, and a compact, scalable dashboard for at-a-glance status.
________________________________________
## 1. Purpose of the Indicator
Why this was built
Traders often monitor several indicators in parallel - EMAs, volume signals, volatility breakouts, higher-timeframe trends, ADX readings, divergence alerts, etc., which can be cumbersome and sometimes contradictory. The “Trend Gauge” indicator was created to consolidate these complementary checks into a single, normalized score that reflects the prevailing market bias (bullish, bearish, or neutral) and its strength. By combining multiple inputs with an adaptive regime filter, scaling contributions by magnitude, and penalizing weakening signals (divergence), this tool aims to reduce noise, highlight genuine trend opportunities, and warn when momentum fades.
Key Design Goals
Signal Aggregation
Merged trend-following signals (EMA crossover, ATR breakout, higher-timeframe confirmation) and momentum signals (VWMA thrust, volume spikes) into a unified score that reflects directional bias more holistically.
Market Regime Awareness
Implemented an ADX-style filter to distinguish between trending and ranging markets, reducing the influence of trend signals during sideways phases to avoid false breakouts.
Magnitude-Based Scaling
Replaced binary contributions with scaled inputs: VWMA thrust and ATR breakout are weighted relative to recent averages, allowing for more nuanced score adjustments based on signal strength.
Momentum Divergence Penalty
Integrated pivot-based RSI divergence detection to slightly reduce the overall score when early signs of momentum weakening are detected, improving risk-awareness in entries.
Confidence Transparency
Added a live confidence metric that shows what percentage of enabled sub-indicators currently agree with the overall bias, making the scoring system more interpretable.
Momentum Acceleration Visualization
Plotted the change in score (Δ Score) as a histogram bar-to-bar, highlighting whether momentum is increasing, flattening, or reversing, aiding in more timely decision-making.
Compact Informational Dashboard
Presented a clean, scalable dashboard that displays each component’s status, the final score, confidence %, detected regime (Trending/Ranging), and a labeled strength gauge for quick visual assessment.
________________________________________
## 2. Why a Trader Should Use It
Main benefits and use cases
1. Unified View: Rather than juggling multiple windows or panels, this indicator delivers a single score synthesizing diverse signals.
2. Regime Filtering: In ranging markets, trend signals often generate false entries. The ADX-based regime filter automatically down-weights trend-following components, helping you avoid chasing false breakouts.
3. Nuanced Momentum & Volatility: VWMA and ATR breakout contributions are normalized by recent averages, so strong moves register strongly while smaller fluctuations are de-emphasized.
4. Early Warning of Weakening: Pivot-based RSI divergence is detected and used to slightly reduce the score when price/momentum diverges, giving a cautionary signal before a full reversal.
5. Confidence Meter: See at a glance how many sub-indicators align with the aggregated bias (e.g., “80% confidence” means 4 out of 5 components agree ). This transparency avoids black-box decisions.
6. Trend Acceleration/Deceleration View: The Δ Score histogram visualizes whether the aggregated score is rising (accelerating trend) or falling (momentum fading), supplementing the main oscillator.
7. Compact Dashboard: A corner table lists each check’s status (“Bull”, “Bear”, “Flat” or “Disabled”), plus overall Score, Confidence %, Regime, Trend Strength label, and a gauge bar. Users can scale text size (Normal, Small, Tiny) without removing elements, so the full picture remains visible even in compact layouts.
8. Customizable & Transparent: All components can be enabled/disabled and parameterized (lengths, thresholds, weights). The full Pine code is open and well-commented, letting users inspect or adapt the logic.
9. Alert-ready: Built-in alert conditions fire when the score crosses weak thresholds to bullish/bearish or returns to neutral, enabling timely notifications.
________________________________________
## 3. Component Rationale (“Why These Specific Indicators?”)
Each sub-component was chosen because it adds complementary information about trend or momentum:
1. EMA Cross
o Basic trend measure: compares a faster EMA vs. a slower EMA. Quickly reflects trend shifts but by itself can whipsaw in sideways markets.
2. VWMA Momentum
o Volume-weighted moving average change indicates momentum with volume context. By normalizing (dividing by a recent average absolute change), we capture the strength of momentum relative to recent history. This scaling prevents tiny moves from dominating and highlights genuinely strong momentum.
3. Volume Spikes
o Sudden jumps in volume combined with price movement often accompany stronger moves or reversals. A binary detection (+1 for bullish spike, -1 for bearish spike) flags high-conviction bars.
4. ATR Breakout
o Detects price breaking beyond recent highs/lows by a multiple of ATR. Measures breakout strength by how far beyond the threshold price moves relative to ATR, capped to avoid extreme outliers. This gives a volatility-contextual trend signal.
5. Higher-Timeframe EMA Alignment
o Confirms whether the shorter-term trend aligns with a higher timeframe trend. Uses request.security with lookahead_off to avoid future data. When multiple timeframes agree, confidence in direction increases.
6. ADX Regime Filter (Manual Calculation)
o Computes directional movement (+DM/–DM), smoothes via RMA, computes DI+ and DI–, then a DX and ADX-like value. If ADX ≥ threshold, market is “Trending” and trend components carry full weight; if ADX < threshold, “Ranging” mode applies a configurable weight multiplier (e.g., 0.5) to trend-based contributions, reducing false signals in sideways conditions. Volume spikes remain binary (optional behavior; can be adjusted if desired).
7. RSI Pivot-Divergence Penalty
o Uses ta.pivothigh / ta.pivotlow with a lookback to detect pivot highs/lows on price and corresponding RSI values. When price makes a higher high but RSI makes a lower high (bearish divergence), or price makes a lower low but RSI makes a higher low (bullish divergence), a divergence signal is set. Rather than flipping the trend outright, the indicator subtracts (or adds) a small penalty (configurable) from the aggregated score if it would weaken the current bias. This subtle adjustment warns of weakening momentum without overreacting to noise.
8. Confidence Meter
o Counts how many enabled components currently agree in direction with the aggregated score (i.e., component sign × score sign > 0). Displays this as a percentage. A high percentage indicates strong corroboration; a low percentage warns of mixed signals.
9. Δ Score Momentum View
o Plots the bar-to-bar change in the aggregated score (delta_score = score - score ) as a histogram. When positive, bars are drawn in green above zero; when negative, bars are drawn in red below zero. This reveals acceleration (rising Δ) or deceleration (falling Δ), supplementing the main oscillator.
10. Dashboard
• A table in the indicator pane’s top-right with 11 rows:
1. EMA Cross status
2. VWMA Momentum status
3. Volume Spike status
4. ATR Breakout status
5. Higher-Timeframe Trend status
6. Score (numeric)
7. Confidence %
8. Regime (“Trending” or “Ranging”)
9. Trend Strength label (e.g., “Weak Bullish Trend”, “Strong Bearish Trend”)
10. Gauge bar visually representing score magnitude
• All rows always present; size_opt (Normal, Small, Tiny) only changes text size via text_size, not which elements appear. This ensures full transparency.
________________________________________
## 4. What Makes This Indicator Stand Out
• Regime-Weighted Multi-Factor Score: Trend and momentum signals are adaptively weighted by market regime (trending vs. ranging) , reducing false signals.
• Magnitude Scaling: VWMA and ATR breakout contributions are normalized by recent average momentum or ATR, giving finer gradation compared to simple ±1.
• Integrated Divergence Penalty: Divergence directly adjusts the aggregated score rather than appearing as a separate subplot; this influences alerts and trend labeling in real time.
• Confidence Meter: Shows the percentage of sub-signals in agreement, providing transparency and preventing blind trust in a single metric.
• Δ Score Histogram Momentum View: A histogram highlights acceleration or deceleration of the aggregated trend score, helping detect shifts early.
• Flexible Dashboard: Always-visible component statuses and summary metrics in one place; text size scaling keeps the full picture available in cramped layouts.
• Lookahead-Safe HTF Confirmation: Uses lookahead_off so no future data is accessed from higher timeframes, avoiding repaint bias.
• Repaint Transparency: Divergence detection uses pivot functions that inherently confirm only after lookback bars; description documents this lag so users understand how and when divergence labels appear.
• Open-Source & Educational: Full, well-commented Pine v6 code is provided; users can learn from its structure: manual ADX computation, conditional plotting with series = show ? value : na, efficient use of table.new in barstate.islast, and grouped inputs with tooltips.
• Compliance-Conscious: All plots have descriptive titles; inputs use clear names; no unnamed generic “Plot” entries; manual ADX uses RMA; all request.security calls use lookahead_off. Code comments mention repaint behavior and limitations.
________________________________________
## 5. Recommended Timeframes & Tuning
• Any Timeframe: The indicator works on small (e.g., 1m) to large (daily, weekly) timeframes. However:
o On very low timeframes (<1m or tick charts), noise may produce frequent whipsaws. Consider increasing smoothing lengths, disabling certain components (e.g., volume spike if volume data noisy), or using a larger pivot lookback for divergence.
o On higher timeframes (daily, weekly), consider longer lookbacks for ATR breakout or divergence, and set Higher-Timeframe trend appropriately (e.g., 4H HTF when on 5 Min chart).
• Defaults & Experimentation: Default input values are chosen to be balanced for many liquid markets. Users should test with replay or historical analysis on their symbol/timeframe and adjust:
o ADX threshold (e.g., 20–30) based on instrument volatility.
o VWMA and ATR scaling lengths to match average volatility cycles.
o Pivot lookback for divergence: shorter for faster markets, longer for slower ones.
• Combining with Other Analysis: Use in conjunction with price action, support/resistance, candlestick patterns, order flow, or other tools as desired. The aggregated score and alerts can guide attention but should not be the sole decision-factor.
________________________________________
## 6. How Scoring and Logic Works (Step-by-Step)
1. Compute Sub-Scores
o EMA Cross: Evaluate fast EMA > slow EMA ? +1 : fast EMA < slow EMA ? -1 : 0.
o VWMA Momentum: Calculate vwma = ta.vwma(close, length), then vwma_mom = vwma - vwma . Normalize: divide by recent average absolute momentum (e.g., ta.sma(abs(vwma_mom), lookback)), clip to .
o Volume Spike: Compute vol_SMA = ta.sma(volume, len). If volume > vol_SMA * multiplier AND price moved up ≥ threshold%, assign +1; if moved down ≥ threshold%, assign -1; else 0.
o ATR Breakout: Determine recent high/low over lookback. If close > high + ATR*mult, compute distance = close - (high + ATR*mult), normalize by ATR, cap at a configured maximum. Assign positive contribution. Similarly for bearish breakout below low.
o Higher-Timeframe Trend: Use request.security(..., lookahead=barmerge.lookahead_off) to fetch HTF EMAs; assign +1 or -1 based on alignment.
2. ADX Regime Weighting
o Compute manual ADX: directional movements (+DM, –DM), smoothed via RMA, DI+ and DI–, then DX and ADX via RMA. If ADX ≥ threshold, market is considered “Trending”; otherwise “Ranging.”
o If trending, trend-based contributions (EMA, VWMA, ATR, HTF) use full weight = 1.0. If ranging, use weight = ranging_weight (e.g., 0.5) to down-weight them. Volume spike stays binary ±1 (optional to change if desired).
3. Aggregate Raw Score
o Sum weighted contributions of all enabled components. Count the number of enabled components; if zero, default count = 1 to avoid division by zero.
4. Divergence Penalty
o Detect pivot highs/lows on price and corresponding RSI values, using a lookback. When price and RSI diverge (bearish or bullish divergence), check if current raw score is in the opposing direction:
If bearish divergence (price higher high, RSI lower high) and raw score currently positive, subtract a penalty (e.g., 0.5).
If bullish divergence (price lower low, RSI higher low) and raw score currently negative, add a penalty.
o This reduces score magnitude to reflect weakening momentum, without flipping the trend outright.
5. Normalize and Smooth
o Normalized score = (raw_score / number_of_enabled_components) * 100. This yields a roughly range.
o Optional EMA smoothing of this normalized score to reduce noise.
6. Interpretation
o Sign: >0 = net bullish bias; <0 = net bearish bias; near zero = neutral.
o Magnitude Zones: Compare |score| to thresholds (Weak, Medium, Strong) to label trend strength (e.g., “Weak Bullish Trend”, “Medium Bearish Trend”, “Strong Bullish Trend”).
o Δ Score Histogram: The histogram bars from zero show change from previous bar’s score; positive bars indicate acceleration, negative bars indicate deceleration.
o Confidence: Percentage of sub-indicators aligned with the score’s sign.
o Regime: Indicates whether trend-based signals are fully weighted or down-weighted.
________________________________________
## 7. Oscillator Plot & Visualization: How to Read It
Main Score Line & Area
The oscillator plots the aggregated score as a line, with colored fill: green above zero for bullish area, red below zero for bearish area. Horizontal reference lines at ±Weak, ±Medium, and ±Strong thresholds mark zones: crossing above +Weak suggests beginning of bullish bias, above +Medium for moderate strength, above +Strong for strong trend; similarly for bearish below negative thresholds.
Δ Score Histogram
If enabled, a histogram shows score - score . When positive, bars appear in green above zero, indicating accelerating bullish momentum; when negative, bars appear in red below zero, indicating decelerating or reversing momentum. The height of each bar reflects the magnitude of change in the aggregated score from the prior bar.
Divergence Highlight Fill
If enabled, when a pivot-based divergence is confirmed:
• Bullish Divergence : fill the area below zero down to –Weak threshold in green, signaling potential reversal from bearish to bullish.
• Bearish Divergence : fill the area above zero up to +Weak threshold in red, signaling potential reversal from bullish to bearish.
These fills appear with a lag equal to pivot lookback (the number of bars needed to confirm the pivot). They do not repaint after confirmation, but users must understand this lag.
Trend Direction Label
When score crosses above or below the Weak threshold, a small label appears near the score line reading “Bullish” or “Bearish.” If the score returns within ±Weak, the label “Neutral” appears. This helps quickly identify shifts at the moment they occur.
Dashboard Panel
In the indicator pane’s top-right, a table shows:
1. EMA Cross status: “Bull”, “Bear”, “Flat”, or “Disabled”
2. VWMA Momentum status: similarly
3. Volume Spike status: “Bull”, “Bear”, “No”, or “Disabled”
4. ATR Breakout status: “Bull”, “Bear”, “No”, or “Disabled”
5. Higher-Timeframe Trend status: “Bull”, “Bear”, “Flat”, or “Disabled”
6. Score: numeric value (rounded)
7. Confidence: e.g., “80%” (colored: green for high, amber for medium, red for low)
8. Regime: “Trending” or “Ranging” (colored accordingly)
9. Trend Strength: textual label based on magnitude (e.g., “Medium Bullish Trend”)
10. Gauge: a bar of blocks representing |score|/100
All rows remain visible at all times; changing Dashboard Size only scales text size (Normal, Small, Tiny).
________________________________________
## 8. Example Usage (Illustrative Scenario)
Example: BTCUSD 5 Min
1. Setup: Add “Trend Gauge ” to your BTCUSD 5 Min chart. Defaults: EMAs (8/21), VWMA 14 with lookback 3, volume spike settings, ATR breakout 14/5, HTF = 5m (or adjust to 4H if preferred), ADX threshold 25, ranging weight 0.5, divergence RSI length 14 pivot lookback 5, penalty 0.5, smoothing length 3, thresholds Weak=20, Medium=50, Strong=80. Dashboard Size = Small.
2. Trend Onset: At some point, price breaks above recent high by ATR multiple, volume spikes upward, faster EMA crosses above slower EMA, HTF EMA also bullish, and ADX (manual) ≥ threshold → aggregated score rises above +20 (Weak threshold) into +Medium zone. Dashboard shows “Bull” for EMA, VWMA, Vol Spike, ATR, HTF; Score ~+60–+70; Confidence ~100%; Regime “Trending”; Trend Strength “Medium Bullish Trend”; Gauge ~6–7 blocks. Δ Score histogram bars are green and rising, indicating accelerating bullish momentum. Trader notes the alignment.
3. Divergence Warning: Later, price makes a slightly higher high but RSI fails to confirm (lower RSI high). Pivot lookback completes; the indicator highlights a bearish divergence fill above zero and subtracts a small penalty from the score, causing score to stall or retrace slightly. Dashboard still bullish but score dips toward +Weak. This warns the trader to tighten stops or take partial profits.
4. Trend Weakens: Score eventually crosses below +Weak back into neutral; a “Neutral” label appears, and a “Neutral Trend” alert fires if enabled. Trader exits or avoids new long entries. If score subsequently crosses below –Weak, a “Bearish” label and alert occur.
5. Customization: If the trader finds VWMA noise too frequent on this instrument, they may disable VWMA or increase lookback. If ATR breakouts are too rare, adjust ATR length or multiplier. If ADX threshold seems off, tune threshold. All these adjustments are explained in Inputs section.
6. Visualization: The screenshot shows the main score oscillator with colored areas, reference lines at ±20/50/80, Δ Score histogram bars below/above zero, divergence fill highlighting potential reversal, and the dashboard table in the top-right.
________________________________________
## 9. Inputs Explanation
A concise yet clear summary of inputs helps users understand and adjust:
1. General Settings
• Theme (Dark/Light): Choose background-appropriate colors for the indicator pane.
• Dashboard Size (Normal/Small/Tiny): Scales text size only; all dashboard elements remain visible.
2. Indicator Settings
• Enable EMA Cross: Toggle on/off basic EMA alignment check.
o Fast EMA Length and Slow EMA Length: Periods for EMAs.
• Enable VWMA Momentum: Toggle VWMA momentum check.
o VWMA Length: Period for VWMA.
o VWMA Momentum Lookback: Bars to compare VWMA to measure momentum.
• Enable Volume Spike: Toggle volume spike detection.
o Volume SMA Length: Period to compute average volume.
o Volume Spike Multiplier: How many times above average volume qualifies as spike.
o Min Price Move (%): Minimum percent change in price during spike to qualify as bullish or bearish.
• Enable ATR Breakout: Toggle ATR breakout detection.
o ATR Length: Period for ATR.
o Breakout Lookback: Bars to look back for recent highs/lows.
o ATR Multiplier: Multiplier for breakout threshold.
• Enable Higher Timeframe Trend: Toggle HTF EMA alignment.
o Higher Timeframe: E.g., “5” for 5-minute when on 1-minute chart, or “60” for 5 Min when on 15m, etc. Uses lookahead_off.
• Enable ADX Regime Filter: Toggles regime-based weighting.
o ADX Length: Period for manual ADX calculation.
o ADX Threshold: Value above which market considered trending.
o Ranging Weight Multiplier: Weight applied to trend components when ADX < threshold (e.g., 0.5).
• Scale VWMA Momentum: Toggle normalization of VWMA momentum magnitude.
o VWMA Mom Scale Lookback: Period for average absolute VWMA momentum.
• Scale ATR Breakout Strength: Toggle normalization of breakout distance by ATR.
o ATR Scale Cap: Maximum multiple of ATR used for breakout strength.
• Enable Price-RSI Divergence: Toggle divergence detection.
o RSI Length for Divergence: Period for RSI.
o Pivot Lookback for Divergence: Bars on each side to identify pivot high/low.
o Divergence Penalty: Amount to subtract/add to score when divergence detected (e.g., 0.5).
3. Score Settings
• Smooth Score: Toggle EMA smoothing of normalized score.
• Score Smoothing Length: Period for smoothing EMA.
• Weak Threshold: Absolute score value under which trend is considered weak or neutral.
• Medium Threshold: Score above Weak but below Medium is moderate.
• Strong Threshold: Score above this indicates strong trend.
4. Visualization Settings
• Show Δ Score Histogram: Toggle display of the bar-to-bar change in score as a histogram. Default true.
• Show Divergence Fill: Toggle background fill highlighting confirmed divergences. Default true.
Each input has a tooltip in the code.
________________________________________
## 10. Limitations, Repaint Notes, and Disclaimers
10.1. Repaint & Lag Considerations
• Pivot-Based Divergence Lag: The divergence detection uses ta.pivothigh / ta.pivotlow with a specified lookback. By design, a pivot is only confirmed after the lookback number of bars. As a result:
o Divergence labels or fills appear with a delay equal to the pivot lookback.
o Once the pivot is confirmed and the divergence is detected, the fill/label does not repaint thereafter, but you must understand and accept this lag.
o Users should not treat divergence highlights as predictive signals without additional confirmation, because they appear after the pivot has fully formed.
• Higher-Timeframe EMA Alignment: Uses request.security(..., lookahead=barmerge.lookahead_off), so no future data from the higher timeframe is used. This avoids lookahead bias and ensures signals are based only on completed higher-timeframe bars.
• No Future Data: All calculations are designed to avoid using future information. For example, manual ADX uses RMA on past data; security calls use lookahead_off.
10.2. Market & Noise Considerations
• In very choppy or low-liquidity markets, some components (e.g., volume spikes or VWMA momentum) may be noisy. Users can disable or adjust those components’ parameters.
• On extremely low timeframes, noise may dominate; consider smoothing lengths or disabling certain features.
• On very high timeframes, pivots and breakouts occur less frequently; adjust lookbacks accordingly to avoid sparse signals.
10.3. Not a Standalone Trading System
• This is an indicator, not a complete trading strategy. It provides signals and context but does not manage entries, exits, position sizing, or risk management.
• Users must combine it with their own analysis, money management, and confirmations (e.g., price patterns, support/resistance, fundamental context).
• No guarantees: past behavior does not guarantee future performance.
10.4. Disclaimers
• Educational Purposes Only: The script is provided as-is for educational and informational purposes. It does not constitute financial, investment, or trading advice.
• Use at Your Own Risk: Trading involves risk of loss. Users should thoroughly test and use proper risk management.
• No Guarantees: The author is not responsible for trading outcomes based on this indicator.
• License: Published under Mozilla Public License 2.0; code is open for viewing and modification under MPL terms.
________________________________________
## 11. Alerts
• The indicator defines three alert conditions:
1. Bullish Trend: when the aggregated score crosses above the Weak threshold.
2. Bearish Trend: when the score crosses below the negative Weak threshold.
3. Neutral Trend: when the score returns within ±Weak after being outside.
Good luck
– BullByte