Triple eMA cross trackerTracks 3 emas, colorizing background:
Green - 1 on top of 2 on top of 3;
Blue - 1 on top of 3, but 2 below 3;
Red - 1 below 2 below 3;
Orange - 1 below 3, 2 above 3.
Nutshell: allows a quick and always apparent check for strategies like the old 8e, 13e, 21e strategy you see online, customizeable by any emas of your choosing.
חפש סקריפטים עבור "top"
BTC 1D Alerts V1This script contains a variety of key indicator for bitcoin all-in-one and they can be activated individually in the menu. These are meant to be used on the 1D chart for Bitcoin.
1457 Day Moving Average: the bottom of the bitcoin price and arguably the rock bottom price target.
Ichimoku Cloud: a common useful indicator for bitcoin support and resistance.
350ma fibs (21 8 5 3 2 and 1.6) : Signify the tops of each logarthmic rise in bitcoin price. They are generally curving higher over the long term. For halvening #3, the predicted market crash would be after hitting the 350ma x3 fib. Also the 350 ma / 111 ma cross signifies bull market top within about 3 days as well. Using the combination of the 350ma fibs and the 350/111 crosses, reasonably identify when market top is about to occur.
50,120,200 ma: Common moving averages that bitcoin retests during bull market runs. Also, the 50/200 golden and death crosses.
1D EMA Superguppy Ribbons: green = bull market, gray is indeterminate, red = bear market. Very high specificity indicator of bull runs, especially for bitcoin. You can change to 3D candle for even more specificity for a bull market start. Use the 1W for even more specificity. 1D Superguppy is recommended for decisionmaking.
1W EMA21: a very good moving average programmed to be shown on both the daily and weekly candle time. Bitcoin commonly corrects to this repeatedly during past bull runs. Acts as support during bull run and resistance during a bear market.
Steps to identifying a bull market:
1. 50/200 golden cross
2. 1D EMA superguppy green
3. 3D EMA superguppy green (if you prefer more certainty than step 2).
4. Hitting the 1W EMA21 and bouncing off during the bull run signifies corrections.
Once a bull market is identified,
Additional recommended buying and selling techniques:
Indicators:
- Fiblines - to determine retracements from peaks (such as all time high or recent highs)
- Stochastic RSI - 1d, 3d, and 1W SRSI are great time to buy, especially the 1W SRSI which comes much less frequently.
- volumen consolidado - for multi exchange volumes compiled into a single line. I prefer buying on the lowest volume days which generally coincide with dips.
- MACD - somewhat dubious utility but many algorithms are programmed to buy or sell based on this.
Check out the Alerts for golden crosses and 350ma Fib crosses which are invaluable for long term buying planning.
I left this open source so that all the formulas can be understood and verified. Much of it hacked together from other sources but all indicators that are fundamental to bitcoin. I apologize in advance for not attributing all the articles and references... but then again I am making no money off of this anyway.
OSC_SpecialK Beta_Pine3A multiple signals|oscillators indicator based on custom stochrsi, custom BB% , CoG, Standard ChandeMoM,Standard overload RSI.
Work with all symbols. Requiert a correct volume source for SpK_Shadow and Fastsignal. (Some index have bad volume)
Legend :
Black Line : Standard ChandeMoM
Blue/Red Line : 14|9|3 StochRSI with sma called SpK
Black Squares : A fast and reactive signal (often a faster retracement, can be relativly horizontal or continuity trend with acceleration ) Really reactive with low interval. (!!Volume dependance!!) called FastSignal.
Red/Green Squares : Need other signal for confirmation. Can be slow to trigger, especially with low interval.(It is important to be in the right trend) Called Signal T1|T2 (!!Volume dependance!!)
Tiny diamond (top/bottom of both section) : Standard RSI saturation
Tiny diamond (middle line of top section) : Center of Gravity signal (standard value I think). Can help to confirm an other signal.
Histogram|area : Work as a difference because it is. Called SpK_Shadow (It's like Peter Pan shadow's ) Can help to see the FastSignal end (when hist arrives near the middle). || In combination with SignalT1/T2 : When shadow is on the middle and you have T1|T2 signals a strong impulsion is possible. (Keep in mind the trend with the LargeTimeFrame ) (!!Volume dependance!!)
Bottom Section is a Large TimeFrame of the top section, with a ratio. I use it to see the level of risk on the interval, according to the targets displayed by my overlay indicator. (OVL_Kikoocycle Beta_Pine3 )
By combining signals and oscillators, it is relatively easy to deduce good opportunities or avoid certain pitfalls. (Keep in mind this script was designed to be used with an overlay indicator, particulary my other script called OVL_Kikoocycle Beta_Pine3 (soon published ) )
Sorry if I do not use traders' common vocabulary...And for my dirty english.
S73 RSI & Stoch RSIRSI and Stoch RSI combined into 1.
Get 2 for the price of 1.
Stoch RSI has two extra h lines, 10 an 90, as well as the traditional 20 and 80.
Remember, High Stoch RSI can mark the strength of a trend, doesn't necessarily mean there will be a change in trend once top and bottom levels are hit.
Click here to see how BTC has been topped out between levels of 90-100 for 14 weeks on the weekly chart.
EASY SYSTEM v1So here I try to make the easy system better using different scripts
I keep the donchian % channel from easy first version --this good for setting your take profit or your stop loss use it wisely
I add the top and bottom finder - here I advise to use also another indicator to verify the spots , the last one always be the bottom but in dump it will show few bottom until it find the true bottom
I add bullish area zone and bearish area zone with colors which is optional if you want to see the trend that you are now
add pivot system with MTF for also helping to see the tops and the bottom
I suggest you to add linear channel of 200 length on top it so it will be more easy to see where the asset is going
Also see the volumes (I have many volumes indicators or any volume indicator of your choice
your Aim is to buy the lowest - and sell the highest so patience sometime can save you allot of money
most of mistakes is because we want to win and we enter either too early or too late .
Colored Klinger Volume Oscillator (CKVO)This is a color enhanced version of Klinger Volume Oscillator. I specially designed this to get maximum profit from highly volatile coins. This indicator is based on volume.
xTrigger (the line) shows if trend is bullish or bearish. It is the average of the area. You can clearly see the trend.
xKVO (the area) shows how buy and sell orders change. It rises while buys are increasing against sells, decreases while sells are increasing against buys.
The color or the area provides buy and sell signals. Green: buy. Red: sell. Gray: Undecided.
Of course there are false signals. You should use other indicators to confirm them.
I like to use RSI and Bollinger Bands along with it to eliminate false signals. Also check for double bottom and top, etc.
Its wise to check the general direction of coin using a bigger time frame using Heikin Aishi. For example 1W Heikin Ashi if you are trading on 1D.
In addition to buy signals the most important indication is divergence with the price. Before a trend change 2 kinds of divergences happen
- Trend line moves reverse to the price line
- Are a tops moves revers to the price tops. For example while there is a higher price top, there is a lower area top. Then its time to escape.
Motivation
It is common to suffer from failures while trading highly profitable but volatile coins like NULLS, REP, DLT, LRC, MFT, HOT, OAX, KEY, etc.
- Traders sell too early to ensure a profit. Sell at 10% and it goes 200%
- Traders buy too early. Traders buy and it drops yet another 50%
- Wrong patience. The trader keeps the faith and waits for days for the glorious days. And nothing happens.
I believe with this indicator I am able to solve those problems most of the time.
Aggregated Volume BTCAggregates the Bitcoin volume from multiple exchanges into a single indicator.
# Exchanges and Pairs
Included are only exchanges supported by TradingView:
* Binance
* Bitstamp
* Bittrex
* Coinbase
* Gemini
* itBit
* Bitfinex
* Kraken
* Poloniex
* HitBTC
* OKCoin
* BitMEX
Excluded low volume exchanges (not in CMC Top):
* CEX.IO
* Coinfloor
Excluded low volume pairs (not in CMC Top):
* KRAKEN:XBTCAD, COINBASE:BTCUSDC, ITBIT:BTCEUR, ITBIT:BTCSGD, BITFINEX:BTCJPY, BITFINEX:BTCGBP, POLONIEX:BTCUSDC, OKCOIN:BTCUSD, OKCOIN:BTCCNY
Many other top exchanges are not included, because they are not supported by TradingView.
# Inputs
By default the spot exchanges are selected. You can select also the other margin trading and derivatives exchanges.
# Contribute
Feel free to share any ideas and issues you have.
# Open Source
The code is open source @ github.com and uses the commonpine library github.com
RSI / Stoch / SRSI / MFI / Aroon Overlay [SigmaDraconis]Combines 4 popular indicators (RSI, Stoch, SRSI, MFI) and 1 peculiar one (Aroon) in 1 for those who want to save indicators but not only.
This is an evolution of my (simpler) "RSI / Stoch / Stoch RSI (SRSI) Overlay " that you can find on my scripts.
Added bands for oversold/overbought areas (70/30 common for RSI and 80/20 for SRSI and MFI), as well as a middle 50 horizontal line.
Neutral bands around 55-45 added as well that can be hidden for less clutter. I also recommend a more transparent coloring for these since Pine script doesn't allow default transparency for horizontal lines.
By default only RSI and Stoch are activated, you can activate Aroon, MFI and SRSI on the inputs window.
Some extra notes:
* RSI, Stoch and MFI can help to strengthen one's decision as well as Aroon to predict a possible trend reversal, SRSI can show when RSI has high probability of being topped or bottomed when oversold/overbought but don't forget to look at volume and how the trend progresses that can keep SRSI above 80 or below 20 while RSI and price continues to trend, divergences are most helpful here to find possible reversal areas.
* This chart depicts some interesting divergences, as well as Stoch tops and bottoms and confluences between RSI/MFI and Stoch on some over-extended tops and bottoms that shown being good reversal zones.
RSI resistances are shown as well, failing to break above 60 or the neutral zone (this is a bearish BTC trend chart after all) or failing to gain support to break up certain levels (RSI notes a more bullish trend when consistently above 60 and more bearish below 40).
If you like it and use it to profit, please tip me below :)
Tip jars:
BTC: 15nMBiEGVrdGcu9C1h6QRcTNRvugHkqrMQ
ETH: 0xC33845946c48B61fBCbEA0367ec2238CaF2b73bc
BTS: sigma-draconis
CMYK RYTHM ◊ Introduction
This script makes use of a sliding matrix, to search the highest/lowest point in the slider, it then counts the amount of times it was high/low, giving the distance from a previous high/low.
Every High/low are granted values, being a lower value for shorted periods, and a larger value for Longer periods.
This reveals the different period lengths of active frequencies.
Doing this with different slider lenghts would result in measuring with different mean period lenghts.
◊ Origin
From my dream last night.
This is a part of Project XIAM.
◊ Theoretical Approach
Philosophy β :: Rythmic
Searching for the period lenght of several frequencys at once.
◊ Usage
This is an alalythical tool, to be used for Automatically adjusting settings on Indicators that presume a period length for calculation.
Calculations are based on Past values, and no reversal measures or fail-safes are applied, so it will only be useful during a continuation of trend.
◊ Features
Matrix Calculation of Lowest/Highest points in a sliding series with Steady Length.
In the future Several slider lenghts will be applied to search for Frequencies of different magnitudes.
Lenght between TOPS, DIPS , and an SMA that smoothens this.
BIAS Is TOP to DIP Minus DIP to TOP, to uncover Bullish/Bearish index of market movements.
◊ Community
CMYK :: discord.gg
AUTOVIEW :: discordapp.com
TRADINGVIEW UNOFFICIAL :: discord.gg
Topfinder Bottomfinder pivot matcher Midas- jayyMidas Technical Analysis: A VWAP Approach to Trading and Investing in Today’s Markets by
Andrew Coles, David G. Hawkins Copyright © 2011 by Andrew Coles and David G. Hawkins.
Appendix C: TradeStation Code for the MIDAS Topfinder/Bottomfinder Curves ported to tradingview
This code is used to assist in adjusting D volume to intersect pivot candle at a pivot candle when using this script: Top Bottom Finder Public version- Jayy found here:
The "n" number entered into the TB-F script is the topfinder/bottomfinder starting point or anchor
Be sure to enter the correct number in the "Topfinder bottomfinder initiation/anchor candle: 1 for CANDLE low - top finder, 2 for CANDLE high - bottom finder, 3 for CANDLE MIDPOINT (hl2) dialogue box
The location of the match point of the pivot candle is extremely important in the: "Match to PIVOT CANDLE: use 1 for CANDLE low, 2 for midtail of the candle below the BODY, 3 for candle BODY low, 4 for CANDLE HIGH, 5 for midpoint of candletail above body, 6 for candle BODY high". Do not
confuse body high with candle high. The body low will either be the candle open or close. The body high will be either the open or close.
If you expect a trend up the pivot candle is likely the low of the pivot candle ie 1 (2 and 3 are alternatives).
In a trend down the high of the pivot candle is often selected ie 4 (5 or 6 are alternatives)
If the candle body is aqua increase D volume if it is orange reduce D volume. Adjust iteratively until the candle body turns yellow. That will mean that the TB-F line passes through the pivot candle at the selected point.
Jayy
ElectroVanga v2.0The new free indicator "ElectroVanga 2.0" is better than my old indicator "ElectroVanga 1.0". Buy and sell signals.
Plots:
Red plot = hightrend
Lime plot = lowtrend
Blue plot = centertrend = (hightrend + lowtrend) / 2
Arrows:
Red arrow (down only) = market top = short entry (long exit)
Lime arrow (up only) = market bottom = long entry (short exit)
Blue arrow (up or down) = long or short entry (long or short exit) *
* If the blue arrow is against you, it is better to liquidate the position
Background:
Red background = more likely downtrend
Lime background = more likely uptrend
NA color background = 50/50
TimeFrames:
- 1D
- 1W
- 1MN
Hints:
A down arrow on a red background is a more reliable prediction than an down arrow on a lime background.
A up arrow on a lime background is a more reliable prediction than an up arrow on a red background.
The logic of this system
The price usually moves either in the upper zone (between the red plot and blue plot) or in the lower zone (between the lime plot and blue plot).
If the price is in the upper zone, then this is the uptrend. If the price is in the lower zone, then this is the downtrend.
If now the uptrend, then the red plot is the top of the market, and the blue plot is the bottom of the market.
If now the downtrend, then the blue plot is the top of the market, and the lime plot is the bottom of the market.
The Always Winning Holy Grail Strategy - Not (by ChartArt)How to win all the time if 1+1 = 2
The most upvoted strategies on Tradingview are those which seemingly work 100%, but they actually don't at all because they are repainting and would not work in live trading reality. They are using the multi-time-frame strategy testing bug and thereby trade during the backtest on close prices before the bar has closed in reality.
Top list of these cheating repainting strategies:
1569 upvotes ANN Strategy
877 upvotes Vdub FX SniperVX3 Strategy
481 upvotes Get Trend Strategy
I guess there are much more strategies among the top upvoted strategies on Tradingview which cheat with a multi-time-frame close price, but three examples are enough. The ANN Strategy uses the daily close price as multi-time-frame and cheats with that. The Vdub FX SniperVX3 Strategy uses the half-day (720 minute) close price to cheat and the Get Trend Strategy uses the 160 minute bar close for repaint cheating (at least here the author of this strategy explains that his strategy is only demo and would not work, which might be the reason why it has 1000 less upvotes than the ANN Strategy. I already wrote months ago a comment underneat these strategies to explain this issue but it hasn't stopped these strategies from getting more and more upvotes and staying in the top list.
I thought this way of cheating is lame, so I invented a new way to cheat my way to seemingly reach 100% profitable trades all the time by going long if 1+1 is equal to 2. Welcome to super wide stop losses. Simply use a extreme unrealistic large stop loss and take profit after a realistic amount of pips and according to Tradingview's current backtest module you win 100% all the time. Yay! :)
My recommendation for the Tradingview team is to add a function to let the user define a stop out and margin call level and maybe set a realistic setting as default, like 100%.
Please don't trade with this strategy!
true trendEasy way to look at the Trend , but still accurate. Top bar is DI +, DI - , bars change in yellow when a swing happen, histogram show the increase/decrease of Min and Max and Open-Close; 2 lines moving between +1 and - 1 folloiwng 3 Ema crossing ; a Dot (diamond shape) appear on the botton when volatility increase and finally a " + " show when volume are much bigger the usually. Yellow line on top is Willams % and help us to find top and bottom of the market.
MACD MultiTimeFrame 1h4h1D [Fantastic Fox]Please insert the indicator into 1h time-frame, otherwise you need to change the lengths' inputs.
When there are tops for two of the MACDs and they are near and close* to each other, there is a big opportunity of a "Major Top" for the security, and vice versa for "Major Bottom".
This indicator can be used for tracing multi time-frame divergence. Also, it could help traders to identify the waves of Elliott Wave, and as a signal for confirmation of an impulse after a correction or retracement.
* They should be on top of each others head, not crossing each other. not necessarily touching, but not so far from each other.
EMA_ConvergenceFirst I have to give kudos to my son who I asked to take a shot at creating this little indicator. Nice work son!
While trading, one of the things I look for is when price or certain EMA's approach another EMA. The example that I use on this 1 minute SPY chart is an 8 EMA and 20 EMA. I am looking for when the 8 and 20 are within' 3 cents of each other. Many times when they are getting close, price is approaching a top or bottom. I am looking for a candlestick reversal around that area. You may want to know when PRICE is near the 50 EMA: Use EMA 1 and 50 for that. Having it light up on top of the page, or elsewhere, makes it easier to look for the convergence when it occurs. If it lights up for a long period, price may be going sideways. I don't enter into a trade until the EMA starts separating, usually with another candlestick formation.
You are able to change the distance for convergence and two EMA's. Unfortunately you will have to adjust the convergence number up as you increase in time frames. This is designed to see when they are close, not when they cross.
The bars on top of this example are lit up purple due to the 8 and 20 EMA are within' 3 cents of each other.
If you want to overlay the price bars, instead of having it separate, just change overlay to "true"
Enjoy.
TSLA Cycle Timing - 122-Day Reversal Map (Adaptive Framework)This indicator is a timing map built specifically for Tesla (TSLA) on the Daily chart. It plots a repeating set of vertical, color-coded timing markers inside a 122-bar cycle (commonly treated as ~122 trading days on the Daily timeframe). These markers highlight reversal “zones”—areas where TSLA has historically shown a tendency to pivot from high-to-low and low-to-high within the cycle.
The script includes:
23 TSLA-derived set points (Points 1–23): the core timing map used to mark the most repeatable reversal areas.
Two optional “Inversion Points” (INV A / INV B): manual markers you can enable when TSLA’s high/low sequence appears to flip due to a structural deviation.
One additional optional marker (OPT C) for user customization.
This is not an auto-buy/sell system. It is a cycle-structure framework designed to help you anticipate when a reversal is more likely to occur, so you can combine it with your own confirmation tools (price action, trend context, support/resistance, volume, etc.).
Definitions (How this script interprets highs/lows)
In the context of cycle mapping:
A High Point is the highest price reached between two neighboring high pivots.
A Low Point is the lowest price reached between two neighboring low pivots.
The vertical lines are timing markers, not “guaranteed pivot candles.” Price may top/bottom slightly before or after a line. That’s why the script includes an optional ± window (in bars) to visualize a small tolerance zone around each marker.
How it works (Conceptually)
The script defines a repeating cycle length (default 122 bars).
Inside each cycle, each point has an offset measured in bars from the cycle start.
For every cycle instance (past, current, and optional future cycles), the script draws:
a vertical dotted line at each enabled point offset
optional ± window bands around the line
optional labels (numbers for set points and “INV” labels for inversion points)
Because this is a Tesla-specific map, the default offsets for Points 1–23 are preconfigured based on TSLA’s observed structure, and the remaining optional points are user-controlled.
How to Use (Important)
1) Use the Daily chart first
This model is designed around TSLA’s Daily cycle behavior. Start with:
Symbol: TSLA
Timeframe: 1D
If you use other timeframes, the cycle “tempo” can change and may require different offsets.
2) Identify the cycle start (anchor)
Cycle mapping depends on where the current cycle is anchored.
Use “Bars Back to Current Cycle Start” to shift the cycle start so that the script’s point sequence aligns with your most recent known cycle beginning. Once aligned, the points should repeat near each 122-bar interval.
3) Read the vertical markers as reversal zones
The colored vertical lines represent areas where reversals have historically occurred, not a promise that price must reverse exactly on the line.
A practical approach:
Use the marker as a “heads-up” zone
Wait for confirmation (trend break, candle structure, momentum shift, key level reaction, etc.)
4) Understand “set points” vs “Inversion Points”
Set Points (1–23)
These are the primary TSLA reversal zones that tend to recur within the 122-bar structure. Specific numbered points often appear near the same relative position inside each cycle.
Inversion Points (INV A / INV B)
Occasionally, TSLA’s cycle behavior can flip—meaning the expected high-to-low (or low-to-high) progression temporarily swaps order. This is what I refer to as an inversion.
When you see a cycle behaving “backwards” relative to the usual sequence:
Enable INV A and/or INV B
Place their offsets at the bar locations where the flip becomes obvious
Use these markers as manual annotations so your cycle notes stay consistent even when TSLA deviates from its typical rhythm
These inversion markers do not force the script to predict a flip—they allow you to document it cleanly.
5) Use the ± Window Bands to manage real-world variance
Markets don’t pivot on perfect timestamps. If a reversal tends to happen “around” a point:
Enable ± Window Bands
Set Window ± Bars (commonly 1–3 bars on 1D)
This gives a realistic visual tolerance zone around each timing marker.
Settings Guide (Practical)
Cycle Length (bars): 122 (TSLA Daily baseline)
Lookback Bars: increase to study more history, decrease for performance
Future Cycles: use sparingly; future markers are guidance zones, not guarantees
Past Cycles: Lines Only: recommended ON for stable performance
Labels at Top: helps keep the chart clean and readable
Final Notes / Limitations
This is a historical timing framework designed to map TSLA’s repeating reversal structure. It helps estimate when reversal pressure tends to appear, but it does not replace risk management or confirmation. Cycle behavior can stretch, compress, or invert during unusual volatility regimes—hence the inclusion of optional inversion markers.
XAUUSD: Ultimate Sniper🔥 Stop Gambling, Start Trading with Logic!
Gold (XAUUSD) is not just a chart; it is a global asset driven by the Dollar (DXY) and US Yields (US10Y). Standard indicators (RSI, MACD) often fail because they ignore these macro factors. XAUUSD Ultimate Sniper is designed to solve this problem by combining Macro Economics with Statistical Math.
This script is not just a signal generator; it is a complete trading system.
🚀 KEY FEATURES:
1. Macro Correlation Filter:
The script analyzes DXY (Dollar Index) and US10Y (10-Year Yields) in the background.
Logic: If the Dollar and Yields are rising, Gold is under pressure (Bearish). If they are falling, Gold has room to fly (Bullish).
Dashboard: A live panel on the top-right shows the trend of these assets instantly.
2. Linear Regression Channel (The Tunnel):
Instead of guessing support/resistance, we use a statistical Linear Regression Channel.
The channel shows the "Fair Value" of price. Deviations outside the channel indicate "Overbought" or "Oversold" zones mathematically.
3. Smart "Re-Entry" Logic (No Repainting):
Most indicators signal too early while the price is still crashing/rallying.
Our Solution: This script waits for the price to close back inside the channel. It captures the confirmed reversal, not the falling knife.
4. ATR Based Dynamic Risk Management:
Stop Loss (SL) and Take Profit (TP) levels are automatically calculated using ATR (Average True Range).
Live Labels: When a signal appears, you will see exact price levels for your SL and TP on the chart.
🛠️ HOW TO USE:
Timeframe: Optimized for 15 Minutes (15m).
The Panel: Check the top-right table. If DXY and US10Y are GREEN, look for BUY signals. If RED, look for SELL signals.
The Signals: Wait for the "AL" (Buy) or "SAT" (Sell) labels.
Execution: Enter the trade and set your Stop Loss / Take Profit exactly where the label tells you.
Risk Warning: Past performance is not indicative of future results. This tool is for educational purposes. Always manage your risk.
BBMA By K1M4K-ID- Final Validated Re-Entry//@version=6
indicator("BBMA By K1M4K-ID- Final Validated Re-Entry", overlay=true, max_labels_count=500)
// === INPUT BB ===
lengthBB = input.int(20, title="BB Period")
devBB = input.float(2.0, title="Deviation")
src = input.source(close, title="Source")
bbColorMid = input.color(color.purple, title="Mid BB Color")
bbColorTop = input.color(color.purple, title="Top BB Color")
bbColorLow = input.color(color.purple, title="Low BB Color")
showFill = input.bool(true, title="Show BB Fill")
showReEntrySignals = input.bool(true, "Show Re-Entry Signals (✅)")
showSignalTable = input.bool(true, "Show Signal Table")
// === BB CALCULATION ===
basis = ta.sma(src, lengthBB)
dev = devBB * ta.stdev(src, lengthBB)
topBB = basis + dev
lowBB = basis - dev
// === PLOT BB ===
pMid = plot(basis, title="Mid BB", color=bbColorMid, linewidth=2)
pTop = plot(topBB, title="Top BB", color=bbColorTop, linewidth=2)
pLow = plot(lowBB, title="Low BB", color=bbColorLow, linewidth=2)
fill(pTop, pLow, color=showFill ? color.new(color.purple, 85) : na, title="BB Fill")
// === INPUT MA SETTING ===
ma_func(source, length) => ta.wma(source, length)
// === MA HIGH/LOW ===
ma5_high = ma_func(high, 5)
ma10_high = ma_func(high, 10)
ma5_low = ma_func(low, 5)
ma10_low = ma_func(low, 10)
// === PLOT MA ===
p_ma5_high = plot(ma5_high, title="MA 5 High", color=color.green, linewidth=2)
p_ma10_high = plot(ma10_high, title="MA 10 High", color=color.green, linewidth=2)
fill(p_ma5_high, p_ma10_high, color=color.new(color.green, 85), title="MA High Fill")
p_ma5_low = plot(ma5_low, title="MA 5 Low", color=color.red, linewidth=2)
p_ma10_low = plot(ma10_low, title="MA 10 Low", color=color.red, linewidth=2)
fill(p_ma5_low, p_ma10_low, color=color.new(color.red, 85), title="MA Low Fill")
// === EMA 50 ===
ema50 = ta.ema(close, 50)
plot(ema50, title="EMA 50", color=color.blue, linewidth=3)
// === CSA KUKUH (LOGIKA ASLI LU - TIDAK DIUBAH) ===
var bool hasCsaBuy = false
var bool hasCsaSell = false
isCsaKukuhBuy = close > ma5_high and close > ma10_high and close > basis
isCsaKukuhSell = close < ma5_low and close < ma10_low and close < basis
if isCsaKukuhBuy and not hasCsaBuy
hasCsaBuy := true
hasCsaSell := false
else if isCsaKukuhSell and not hasCsaSell
hasCsaSell := true
hasCsaBuy := false
showCsaBuy = isCsaKukuhBuy and not hasCsaBuy
showCsaSell = isCsaKukuhSell and not hasCsaSell
plotshape(showCsaBuy, title="CSA Kukuh Buy First", location=location.belowbar, color=color.green, style=shape.labelup, text="CSAK", textcolor=color.white, size=size.small)
plotshape(showCsaSell, title="CSA Kukuh Sell First", location=location.abovebar, color=color.red, style=shape.labeldown, text="CSAK", textcolor=color.white, size=size.small)
// === CSM (HANYA SAAT KELUAR DARI DALAM BB) ===
wasInsideBB = (close >= lowBB and close <= topBB )
csmBuySignal = wasInsideBB and close > topBB
csmSellSignal = wasInsideBB and close < lowBB
plotshape(csmBuySignal, title="CSM Buy", location=location.abovebar, color=color.green, style=shape.triangleup, text="CSM", size=size.tiny)
plotshape(csmSellSignal, title="CSM Sell", location=location.belowbar, color=color.red, style=shape.triangledown, text="CSM", size=size.tiny)
// === CSA (BREAKOUT TANPA MELEWATI MID BB) ===
isCsaBuy = close > ma5_high and close > ma10_high and close <= basis
isCsaSell = close < ma5_low and close < ma10_low and close >= basis
plotshape(isCsaBuy, title="CSA Buy", location=location.belowbar, color=color.new(color.green, 60), style=shape.circle, text="CSA", size=size.tiny)
plotshape(isCsaSell, title="CSA Sell", location=location.abovebar, color=color.new(color.red, 60), style=shape.circle, text="CSA", size=size.tiny)
// === EXTREME ===
basis_ext = ta.sma(close, 20)
dev_ext = 2 * ta.stdev(close, 20)
isExtremeBuy() => ta.wma(low, 5) < basis_ext - dev_ext
isExtremeSell() => ta.wma(high, 5) > basis_ext + dev_ext
plotshape(isExtremeBuy(), title="Extreme Buy", location=location.belowbar, color=color.green, style=shape.labelup, text="E", size=size.tiny, textcolor=color.white)
plotshape(isExtremeSell(), title="Extreme Sell", location=location.abovebar, color=color.red, style=shape.labeldown, text="E", size=size.tiny, textcolor=color.white)
// === ZZL MA ===
isZzlBuy = (ma5_high > basis and ma10_high > basis and ma5_low > basis and ma10_low > basis and
(ma5_high <= basis or ma10_high <= basis or ma5_low <= basis or ma10_low <= basis))
isZzlSell = (ma5_high < basis and ma10_high < basis and ma5_low < basis and ma10_low < basis and
(ma5_high >= basis or ma10_high >= basis or ma5_low >= basis or ma10_low >= basis))
var bool zzlBuyShown = false
var bool zzlSellShown = false
if isZzlBuy and not zzlBuyShown
label.new(bar_index, low, "Z", style=label.style_label_up, color=color.green, textcolor=color.white)
zzlBuyShown := true
if not isZzlBuy
zzlBuyShown := false
if isZzlSell and not zzlSellShown
label.new(bar_index, high, "Z", style=label.style_label_down, color=color.red, textcolor=color.white)
zzlSellShown := true
if not isZzlSell
zzlSellShown := false
// ===========================================
// === VALIDASI + RE-ENTRY (H4 & H1) ===
// ===========================================
// --- Ambil data ---
= request.security(syminfo.tickerid, "240", )
wasInside_h4 = request.security(syminfo.tickerid, "240", (close >= (ta.sma(close, lengthBB) - devBB * ta.stdev(close, lengthBB) ) and close <= (ta.sma(close, lengthBB) + devBB * ta.stdev(close, lengthBB) )))
csmBuy_h4 = wasInside_h4 and request.security(syminfo.tickerid, "240", close > (ta.sma(close, lengthBB) + devBB * ta.stdev(close, lengthBB)))
csmSell_h4 = wasInside_h4 and request.security(syminfo.tickerid, "240", close < (ta.sma(close, lengthBB) - devBB * ta.stdev(close, lengthBB)))
csakBuy_h4 = close_h4 > ma5h_h4 and close_h4 > ma10h_h4 and close_h4 > basis_h4
csakSell_h4 = close_h4 < ma5l_h4 and close_h4 < ma10l_h4 and close_h4 < basis_h4
csaBuy_h4 = close_h4 > ma5h_h4 and close_h4 > ma10h_h4 and close_h4 <= basis_h4
csaSell_h4 = close_h4 < ma5l_h4 and close_h4 < ma10l_h4 and close_h4 >= basis_h4
csmBuy_h1 = request.security(syminfo.tickerid, "60", (close >= (ta.sma(close, lengthBB) - devBB * ta.stdev(close, lengthBB) ) and close <= (ta.sma(close, lengthBB) + devBB * ta.stdev(close, lengthBB) )) and close > (ta.sma(close, lengthBB) + devBB * ta.stdev(close, lengthBB)))
csmSell_h1 = request.security(syminfo.tickerid, "60", (close >= (ta.sma(close, lengthBB) - devBB * ta.stdev(close, lengthBB) ) and close <= (ta.sma(close, lengthBB) + devBB * ta.stdev(close, lengthBB) )) and close < (ta.sma(close, lengthBB) - devBB * ta.stdev(close, lengthBB)))
csakBuy_h1 = request.security(syminfo.tickerid, "60", close > ta.wma(high,5) and close > ta.wma(high,10) and close > ta.sma(close, lengthBB))
csakSell_h1 = request.security(syminfo.tickerid, "60", close < ta.wma(low,5) and close < ta.wma(low,10) and close < ta.sma(close, lengthBB))
csaBuy_h1 = request.security(syminfo.tickerid, "60", close > ta.wma(high,5) and close > ta.wma(high,10) and close <= ta.sma(close, lengthBB))
csaSell_h1 = request.security(syminfo.tickerid, "60", close < ta.wma(low,5) and close < ta.wma(low,10) and close >= ta.sma(close, lengthBB))
csmBuy_m15 = request.security(syminfo.tickerid, "15", close > (ta.sma(close, lengthBB) + devBB * ta.stdev(close, lengthBB)))
csmSell_m15 = request.security(syminfo.tickerid, "15", close < (ta.sma(close, lengthBB) - devBB * ta.stdev(close, lengthBB)))
csakBuy_d = request.security(syminfo.tickerid, "D", close > ta.wma(high,5) and close > ta.wma(high,10) and close > ta.sma(close, lengthBB))
csakSell_d = request.security(syminfo.tickerid, "D", close < ta.wma(low,5) and close < ta.wma(low,10) and close < ta.sma(close, lengthBB))
csaBuy_d = request.security(syminfo.tickerid, "D", close > ta.wma(high,5) and close > ta.wma(high,10) and close <= ta.sma(close, lengthBB))
csaSell_d = request.security(syminfo.tickerid, "D", close < ta.wma(low,5) and close < ta.wma(low,10) and close >= ta.sma(close, lengthBB))
// --- Validasi ---
validCsakH4Buy = csakBuy_h4 and ta.highest(csmBuy_h1 ? 1 : 0, 4) == 1
validCsakH4Sell = csakSell_h4 and ta.highest(csmSell_h1 ? 1 : 0, 4) == 1
validCsakH1Buy = csakBuy_h1 and ta.highest(csmBuy_m15 ? 1 : 0, 4) == 1
validCsakH1Sell = csakSell_h1 and ta.highest(csmSell_m15 ? 1 : 0, 4) == 1
validCsmH1Buy = csmBuy_h1 and (csaBuy_h4 or csakBuy_h4) and ta.highest(csmBuy_m15 ? 1 : 0, 4) == 1
validCsmH1Sell = csmSell_h1 and (csaSell_h4 or csakSell_h4) and ta.highest(csmSell_m15 ? 1 : 0, 4) == 1
validCsmH4Buy = csmBuy_h4 and (csaBuy_d or csakBuy_d) and ta.highest(csmBuy_h1 or csmSell_h1 ? 1 : 0, 4) == 1
validCsmH4Sell = csmSell_h4 and (csaSell_d or csakSell_d) and ta.highest(csmBuy_h1 or csmSell_h1 ? 1 : 0, 4) == 1
// --- Re-Entry Area ---
inReEntryBuy = low <= math.max(ma5_low, ma10_low)
inReEntrySell = high >= math.min(ma5_high, ma10_high)
// --- Flag Valid + Hit Detection ---
var bool vCsakH4B = false, vCsakH4S = false
var bool vCsakH1B = false, vCsakH1S = false
var bool vCsmH4B = false, vCsmH4S = false
var bool vCsmH1B = false, vCsmH1S = false
var bool hitCsakH4B = false, hitCsakH4S = false
var bool hitCsakH1B = false, hitCsakH1S = false
var bool hitCsmH4B = false, hitCsmH4S = false
var bool hitCsmH1B = false, hitCsmH1S = false
// Reset hit setiap candle
hitCsakH4B := false
hitCsakH4S := false
hitCsakH1B := false
hitCsakH1S := false
hitCsmH4B := false
hitCsmH4S := false
hitCsmH1B := false
hitCsmH1S := false
// Aktifkan flag saat valid
vCsakH4B := validCsakH4Buy ? true : vCsakH4B
vCsakH4S := validCsakH4Sell ? true : vCsakH4S
vCsakH1B := validCsakH1Buy ? true : vCsakH1B
vCsakH1S := validCsakH1Sell ? true : vCsakH1S
vCsmH4B := validCsmH4Buy ? true : vCsmH4B
vCsmH4S := validCsmH4Sell ? true : vCsmH4S
vCsmH1B := validCsmH1Buy ? true : vCsmH1B
vCsmH1S := validCsmH1Sell ? true : vCsmH1S
// Deteksi & reset saat re-entry
if vCsakH4B and inReEntryBuy
hitCsakH4B := true
vCsakH4B := false
if vCsakH4S and inReEntrySell
hitCsakH4S := true
vCsakH4S := false
if vCsakH1B and inReEntryBuy
hitCsakH1B := true
vCsakH1B := false
if vCsakH1S and inReEntrySell
hitCsakH1S := true
vCsakH1S := false
if vCsmH4B and inReEntryBuy
hitCsmH4B := true
vCsmH4B := false
if vCsmH4S and inReEntrySell
hitCsmH4S := true
vCsmH4S := false
if vCsmH1B and inReEntryBuy
hitCsmH1B := true
vCsmH1B := false
if vCsmH1S and inReEntrySell
hitCsmH1S := true
vCsmH1S := false
// --- Plot Re-Entry ---
//plotshape(showReEntrySignals and hitCsakH4B, location=location.belowbar, color=color.teal, style=shape.labelup, text="✅", size=size.normal)
//plotshape(showReEntrySignals and hitCsakH4S, location=location.abovebar, color=color.orange, style=shape.labeldown, text="✅", size=size.normal)
//plotshape(showReEntrySignals and hitCsakH1B, location=location.belowbar, color=color.green, style=shape.labelup, text="✅", size=size.small)
//plotshape(showReEntrySignals and hitCsakH1S, location=location.abovebar, color=color.red, style=shape.labeldown, text="✅", size=size.small)
//plotshape(showReEntrySignals and hitCsmH1B, location=location.belowbar, color=color.green, style=shape.labelup, text="✅ CSM", size=size.tiny)
//plotshape(showReEntrySignals and hitCsmH1S, location=location.abovebar, color=color.red, style=shape.labeldown, text="✅ CSM", size=size.tiny)
//plotshape(showReEntrySignals and hitCsmH4B, location=location.belowbar, color=color.teal, style=shape.labelup, text="✅ CSM", size=size.tiny)
//plotshape(showReEntrySignals and hitCsmH4S, location=location.abovebar, color=color.orange, style=shape.labeldown, text="✅ CSM", size=size.tiny)
// ===========================================
// === TABEL SIGNAL H1 & H4 (FINAL) ===
// ===========================================
var table sigTable = table.new(position.top_right, 4, 5, border_width=1)
if barstate.islast and showSignalTable
table.cell(sigTable, 0, 0, "TF", text_color=color.white, bgcolor=color.black)
table.cell(sigTable, 1, 0, "Signal", text_color=color.white, bgcolor=color.black)
table.cell(sigTable, 2, 0, "Status", text_color=color.white, bgcolor=color.black)
table.cell(sigTable, 3, 0, "Re-Entry", text_color=color.white, bgcolor=color.black)
table.cell(sigTable, 0, 1, "H4", text_color=color.white, bgcolor=color.black)
table.cell(sigTable, 1, 1, "CSAK Buy", text_color=color.green, bgcolor=color.new(color.green, 90))
table.cell(sigTable, 2, 1, vCsakH4B ? "✅ Valid" : "-", text_color=vCsakH4B ? color.green : color.gray, bgcolor=color.new(vCsakH4B ? color.green : color.gray, 90))
table.cell(sigTable, 3, 1, hitCsakH4B ? "✅ Hit" : "-", text_color=hitCsakH4B ? color.teal : color.gray, bgcolor=color.new(hitCsakH4B ? color.teal : color.gray, 90))
table.cell(sigTable, 0, 2, "H4", text_color=color.white, bgcolor=color.black)
table.cell(sigTable, 1, 2, "CSAK Sell", text_color=color.red, bgcolor=color.new(color.red, 90))
table.cell(sigTable, 2, 2, vCsakH4S ? "✅ Valid" : "-", text_color=vCsakH4S ? color.red : color.gray, bgcolor=color.new(vCsakH4S ? color.red : color.gray, 90))
table.cell(sigTable, 3, 2, hitCsakH4S ? "✅ Hit" : "-", text_color=hitCsakH4S ? color.orange : color.gray, bgcolor=color.new(hitCsakH4S ? color.orange : color.gray, 90))
table.cell(sigTable, 0, 3, "H1", text_color=color.white, bgcolor=color.black)
table.cell(sigTable, 1, 3, "CSM Buy", text_color=color.green, bgcolor=color.new(color.green, 90))
table.cell(sigTable, 2, 3, vCsmH1B ? "✅ Valid" : "-", text_color=vCsmH1B ? color.green : color.gray, bgcolor=color.new(vCsmH1B ? color.green : color.gray, 90))
table.cell(sigTable, 3, 3, hitCsmH1B ? "✅ Hit" : "-", text_color=hitCsmH1B ? color.teal : color.gray, bgcolor=color.new(hitCsmH1B ? color.teal : color.gray, 90))
table.cell(sigTable, 0, 4, "H1", text_color=color.white, bgcolor=color.black)
table.cell(sigTable, 1, 4, "CSM Sell", text_color=color.red, bgcolor=color.new(color.red, 90))
table.cell(sigTable, 2, 4, vCsmH1S ? "✅ Valid" : "-", text_color=vCsmH1S ? color.red : color.gray, bgcolor=color.new(vCsmH1S ? color.red : color.gray, 90))
table.cell(sigTable, 3, 4, hitCsmH1S ? "✅ Hit" : "-", text_color=hitCsmH1S ? color.orange : color.gray, bgcolor=color.new(hitCsmH1S ? color.orange : color.gray, 90))
Auto Fibonacci Lines Depending on ZigZag %In the world of technical analysis, few tools are as powerful—or as misused—as Fibonacci Retracements. The Auto Fibonacci Lines Depending on ZigZag % is not just an indicator; it is a complete, automated trading system designed to eliminate subjectivity and bring institutional-grade precision to your charts.
This script automates the identification of significant market structures using a ZigZag algorithm. Once a market swing is mathematically confirmed (based on your deviation settings), it instantly projects a complete suite of Retracement and Extension levels. This allows you to stop guessing where to draw your lines and start focusing on price action.
🧠 The Logic Behind the Indicator
Understanding how your tools work is the first step to trusting them. This script operates on a three-step logic loop:
ZigZag Identification:
The script continuously monitors price action relative to the last known pivot point. It uses a user-defined Deviation % to filter out market noise. A new "Leg" is only confirmed when price reverses by this specific percentage. This ensures that the Fibonacci lines are only drawn on significant market moves, not random chop.
Automated Anchor Points:
Once a downward trend is confirmed (e.g., price drops 30% from the top), the script automatically anchors the Fibonacci tool to the Swing High (Start) and the Swing Low (End). It does this without you needing to click or drag anything.
Dynamic Cleanup:
Markets evolve. A key feature of this script is its self-cleaning mechanism. As soon as a new trend leg is confirmed, the script automatically deletes the old, invalidated Fibonacci lines and draws a fresh set for the new structure. This keeps your chart clean and focused on the now.
🎓 How to Trade This System
This indicator is color-coded to simplify your decision-making process. It moves beyond standard "rainbow" charts by categorizing price levels into three distinct actionable zones.
1. The "Reload Zone" (White Lines: 0.618 - 0.786) ⚪
Role: High-Probability Support / Entry
In institutional trading, the 0.618 (Golden Ratio) to 0.786 region is often where algorithms step in to defend a trend.
Why it works : This is the "discount" area where smart money re-accumulates positions before the next leg up.
2. The "Decision Wall" (Blue Lines: 1.382 - 1.5) 🔵
Role: Strong Resistance / Trend Check
This is a unique feature of this suite. The 1.382 and 1.5 levels often act as a "ceiling" for weak breakouts.
Strategy : If you entered in the White Zone, the Blue Zone is your first major hurdle. If price stalls here, consider securing partial profits.
Warning : A rejection from the Blue Lines often leads to a double-top formation. However, a clean break above the Blue Lines usually signals a parabolic move is beginning.
3. The "Extension Zone" (Yellow, Red, Purple > 1.618) 🟡🔴
Role : Take Profit / Exhaustion
Levels above 1.5 (starting with the 1.618 Golden Extension) are statistical extremes.
Strategy : These are Strict Take Profit levels. Do not FOMO (Fear Of Missing Out) into new long positions here. The probability of a reversal increases drastically as price climbs through these levels (2.618, 3.618, 4.618).
📐 The Mathematical Edge: Logarithmic vs. Linear
One of the most critical features of this script is the ability to toggle between Logarithmic and Linear calculations.
Why use Logarithmic?
If you are trading Crypto (Bitcoin, Altcoins) or high-growth Tech Stocks, linear Fibonacci levels are mathematically incorrect over large moves. A 50% drop from $100 is different than a 50% drop from $10.
This script calculates the percentage difference (Log Scale), ensuring your targets are accurate even during 100%+ parabolic runs.
Why use Linear?
For mature markets like Forex (EURUSD) or Indices (SPX500) where volatility is lower, Linear scaling is the industry standard.
🛠️ Configuration & Best Practices
Deviation % : This is the heartbeat of the indicator.
Swing Trading : Set to 20-30%. This filters out noise and only draws Fibs on major macro moves.
Scalping : Set to 3-5%. This will catch smaller intraday waves.
Text Place : Keeps your chart clean by pushing labels to the right, ensuring they don't overlap with the current price action.
👤 Who Is This Indicator For?
The Disciplined Trader : Who wants to remove emotional bias from their charting.
The Crypto Investor : Who needs accurate Logarithmic targets for long-term holding.
The Confluence Trader : Who combines these automated levels with Order Blocks, RSI, or Volume to find the perfect entry.
⚠️ RISK DISCLAIMER & TERMS OF USE
For Educational Purposes Only:
This script and the strategies described herein are provided strictly for educational and informational purposes. They do not constitute financial, investment, or trading advice. The "Auto Fibonacci Lines" indicator is a tool for technical analysis and should not be used as the sole basis for any trading decision.
No Guarantees:
Past performance of any trading system or methodology is not necessarily indicative of future results. Financial markets are inherently volatile, and trading involves a high level of risk. You could lose some or all of your capital.
User Responsibility:
By using this script, you acknowledge that you are solely responsible for your own trading decisions and risk management. The author assumes no liability for any losses or damages resulting from the use of this tool or the information provided. Always consult with a qualified financial advisor before making investment decisions.
Alert 2d 2Alert 2 Tops/bottoms in a Strong mommentum for other symbols
1. There is a strong wave including many same color bars.
2. There are 2 Tops/bottoms pattern inside that wave with the same dirrection.
Alert 2dAlert 2 Tops/bottoms in a Strong mommentum.
1. There is a strong wave including many same color bars.
2. There are 2 Tops/bottoms pattern inside that wave with the same dirrection.
Script Title: FX Exchange Simulator: Two Investors (Gain vs. LosDescriptionOverviewThis educational tool is designed to help traders and beginners understand the mechanics of currency exchange rates in the EUR/USD pair. It simulates two distinct investor scenarios based on the highest and lowest prices over a user-defined period (default: 100 bars).The Two ScenariosThe script compares how the direction of exchange and the timing of the trade impact final purchasing power:Investor 1 (Starting with USD - The Strategic Entry):At the Low: Converts $1,000 USD into EUR by dividing the amount by the exchange rate.At the High: Converts those EUR back into USD by multiplying.Result: Demonstrates how buying a currency when it is "cheap" (at the low) increases your total capital in dollars.Investor 2 (Starting with EUR - The Timing Error):At the Low: Panics and converts 1,000€ into USD by multiplying.At the High: Tries to recover the 1,000€ by dividing the USD back at a higher rate.Result: Demonstrates how selling a currency when it is "cheap" and buying it back when it is "expensive" leads to a significant loss of purchasing power.FeaturesDynamic Historical Analysis: Automatically finds the highest and lowest points within the selected lookback period.Step-by-Step Calculation Table: A clean, top-centered table showing the initial amount, the exchange process, the final total, and the ROI (Return on Investment) percentage.Visual Annotations: Labels on the chart pinpoint exactly where the "Minimum" and "Maximum" occurred to provide visual context for the trade simulation.Fully Customizable: Users can adjust the initial capital amount and the lookback period via the settings menu.Mathematics Behind the ScriptThe script uses the following formulas for the calculations:Profit Scenario (USD to EUR):$$\text{Total USD} = \left( \frac{\text{Initial USD}}{\text{Price}_{min}} \right) \times \text{Price}_{max}$$Loss Scenario (EUR to USD):$$\text{Total EUR} = \left( \text{Initial EUR} \times \text{Price}_{min} \right) / \text{Price}_{max}$$InstructionsAdd the script to your chart (best used on EUR/USD).Look at the labels to see where the period extremes are.Check the table at the top to see the financial outcome of both investors.Use the "Settings" to change the initial amount or the bar period to test different market cycles.DisclaimerThis script is for educational purposes only. It is intended to illustrate currency exchange mechanics and does not constitute financial advice.
Accumulation/Distribution Oscillator [MarkitTick]💡 This script presents a statistically normalized evolution of the classic Accumulation/Distribution (A/D) indicator, designed to transform unbounded volume flow into a bounded, actionable oscillator. By integrating Relative Volume (RVOL) weighting and Z-Score standardization, this tool isolates genuine institutional buying and selling pressure from market noise, offering a clear view of volume momentum regimes.
✨ Originality and Utility
The standard Accumulation/Distribution line is a cumulative total of volume flow, which often results in an unbounded line that drifts indefinitely with price trends. This makes it difficult for traders to identify overextended conditions or specific turning points.
This script solves that problem through a three-stage quantitative process:
Smart Volume Weighting: Instead of treating all volume equally, this indicator amplifies the impact of high-volume nodes using a Relative Volume (RVOL) filter. This ensures that significant institutional activity carries more weight than low-liquidity chopping.
Detrending: It subtracts a smoothed average (using ALMA, EMA, or others) from the raw A/D line to create a raw oscillator.
Normalization: Finally, it applies a Z-Score calculation to normalize the data. This bounds the oscillator around a zero mean, allowing for the application of Bollinger Bands to detect statistical extremes (2 or 3 standard deviations).
🔬 Methodology and Concepts
The calculation logic follows a strict quantitative pipeline:
● Money Flow Multiplier (MFM)
The core engine is the classic MFM calculation, which determines the location of the Close relative to the High-Low range. A Close near the High results in +1, while a Close near the Low results in -1.
● Advanced Volume Filtering
Before accumulation, the volume is processed through two filters:
RVOL Multiplier: If the current bar's volume exceeds its simple moving average (`rvol_len`), the volume is multiplied by a user-defined factor (`rvol_mult`). This emphasizes breakout candles.
Candle Strength (Optional): If enabled, weight is increased based on how close the price closes to the absolute high or low, rewarding decisive candle shapes.
● Z-Score Standardization
The script calculates the "Raw Oscillator" by subtracting a moving average (Signal Line) from the cumulative A/D Line. It then calculates the Z-Score of this raw value over a lookback period (`z_len`).
Formula: Z = (Value - Mean) / Standard Deviation
🎨 Visual Guide
The indicator renders a complex data set into an easy-to-read interface:
• The Oscillator (Line & Histogram)
The primary output is the Z-Score value.
Teal Histogram/Line: Represents Bullish momentum (Accumulation). Darker Teal indicates accelerating momentum (`osc > previous`), while lighter Teal indicates decaying momentum.
Red Histogram/Line: Represents Bearish momentum (Distribution). Darker Red indicates accelerating selling pressure, while lighter Red indicates exhaustion.
Gray: If the Trend Filter (200 EMA) or VWAP Filter is enabled and the signal opposes the trend, the histogram turns Gray to indicate a low-probability counter-trend signal.
• Bollinger Bands (Blue Bands)
These bands wrap around the oscillator line.
Upper Band: Usually set to +2 Standard Deviations. When the oscillator pierces this band, accumulation is statistically extreme (potential mean reversion or strong breakout).
Lower Band: Usually set to -2 Standard Deviations. Indicates statistically extreme distribution.
• Divergences
The script automatically detects and plots structural divergences:
Green Lines/Labels: Bullish Divergence. Price makes a Lower Low while the Oscillator makes a Higher Low.
Red Lines/Labels: Bearish Divergence. Price makes a Higher High while the Oscillator makes a Lower High.
• Multi-Timeframe (MTF) Dashboard
Located in the top right, this table displays the momentum status (BULL/BEAR) of the oscillator across three user-defined timeframes (default: 60min, 240min, Daily), allowing for fractal trend analysis.
📖 How to Use
This tool is best used for identifying trend exhaustion and hidden volume strength.
1. Trend Continuation
In a strong uptrend, look for the Histogram to remain Teal and above the Zero line. A pullback to the Zero line that bounces back up suggests buyers are stepping in to defend the trend.
2. Statistical Extremes
When the oscillator line breaks outside the Bollinger Bands, volume flow is significantly deviated from the norm.
If price is ranging, this often signals a reversal (Reversion to Mean).
If price is breaking out, this confirms strong impulse participation.
3. Divergence Reversals
A divergence is a leading signal. If price is pushing new highs but the A/D Oscillator fails to make a new high (Red Divergence Line), it indicates that the volume supporting the move is drying up, often preceding a correction.
⚙️ Inputs and Settings
● Oscillator Settings
Smoothing Type/Length: Choose between ALMA, EMA, SMA, etc., to smooth the A/D line. ALMA is default for its zero-lag properties.
ALMA Offset/Sigma: Fine-tune the responsiveness of the Arnaud Legoux Moving Average.
● Quant Filters
RVOL Lookback & Multiplier: Determines the threshold for "High Volume." Default is 1.5x average volume.
Z-Score Lookback: The period used to establish statistical significance (Default: 100).
Use VWAP/Trend Filter: Logical switches to gray out signals that contradict the macro trend (200 EMA) or the intraday mean (VWAP).
● Dashboard
Customize the three timeframes displayed in the MTF table to match your trading horizon (e.g., Scalpers might use 5m, 15m, 1h).
🔍 Deconstruction of the Underlying Scientific and Academic Framework
This indicator relies on the Law of Supply and Demand quantified through Standard Score (Z-Score) Statistics .
Standard Accumulation/Distribution is derived from the work of Marc Chaikin, positing that the proximity of the close to the high/low on high volume indicates the "smart money" flow. However, raw cumulative data suffers from heteroscedasticity (varying variance).
By applying Z-Score normalization:
Z = (x - μ) / σ
We transform the data into a standard normal distribution. This allows us to apply probability theory to volume analysis. A value of +2.0 is not merely "high"; it represents a volume flow intensity that falls within the top 2.2% of the data set (assuming normal distribution), providing a mathematically robust definition of "Overbought" or "Oversold" volume conditions.
⚠️ Disclaimer
All provided scripts and indicators are strictly for educational exploration and must not be interpreted as financial advice or a recommendation to execute trades. I expressly disclaim all liability for any financial losses or damages that may result, directly or indirectly, from the reliance on or application of these tools. Market participation carries inherent risk where past performance never guarantees future returns, leaving all investment decisions and due diligence solely at your own discretion.






















