Indicator · Pine Script v5 · On the chart

Nubia - Auto Midas Anchored VWAP [xdecow]

by g-moe· code credited to goodgains

This overlay indicator plots automatic Midas-style anchored VWAPs on the price chart.

View on GitHub

GitHub stars3on the repository
Pine versionv5runs as is
Lines of code62
Settings2inputs
LicenceNone statedfile: MPL-2.0
Last update5 months ago27 May 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

62 lines of Pine Script v5 from Tradingview/nubia-auto-midas-anchored-vwap-xdecow.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.

nubia-auto-midas-anchored-vwap-xdecow.pine
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © goodgains


//@version=5
indicator('Nubia - Auto Midas Anchored VWAP [xdecow]', shorttitle='Nubia [xdecow]', overlay=true, max_bars_back=2584)

// @keywords: anchored-vwap, midas-curve, auto-pivot-anchor, highest-lowest-avwap, volume-weighted-path, hlc3-source, pivot-length-scan, dynamic-anchor, always-show-toggle, overlay-vwap-lines, swing-high-anchor, swing-low-anchor, cumulative-volume, price-path-average, xdecow-variant, liquidity-anchor, trend-path, avwap-comparison, intraday-anchoring, pivot-driven-vwap

md_show = input(false, 'Always show')

getVwap(src, length, vol) =>
    uvol = vol
    uwgt = vol * src

    if length < 1
        na
    else
        for i = 1 to length - 1 by 1
            uvol += vol[i]
            uwgt += vol[i] * src[i]
            uwgt
        uwgt / uvol

getMidas(len, isHighest) =>
    if na(len)
        [na, na]
    else
        mid = getVwap(hlc3, len, volume)
        value = if isHighest
            getVwap(high, len, volume)
        else
            getVwap(low, len, volume)

        [mid, value]

getMidasTrend(vtop, vbot) =>
    (na(vtop) or close > vtop) and close > vbot ? 1 : (na(vbot) or close < vbot) and close < vtop ? -1 : 0


ma1_len = input.int(17, '#1 Length', minval=2)

ma1_highbars = ta.highestbars(ma1_len) * -1
ma1_lowbars = ta.lowestbars(ma1_len) * -1

[ma1_top_mid, ma1_top_high] = getMidas(ma1_highbars, true)
[ma1_bot_mid, ma1_bot_low] = getMidas(ma1_lowbars, false)

ma1_top_visible = ma1_top_high > low
ma1_bot_visible = ma1_bot_low < high
ma1_top_color = ma1_top_visible ? color.red : md_show ? #926966 : na
ma1_bot_color = ma1_bot_visible ? color.green : md_show ? #527552 : na

ma1_top_p1 = plot(ma1_top_visible or md_show ? ma1_top_high : na, color=ma1_top_color, linewidth=1, style=plot.style_linebr, title='#1 Highest AVWAP')
ma1_top_p2 = plot(ma1_top_visible or md_show ? ma1_top_mid : na, color=na, editable=false)
fill(ma1_top_p1, ma1_top_p2, ma1_top_color, title='#1 Highest background', transp=90)

ma1_bot_p1 = plot(ma1_bot_visible or md_show ? ma1_bot_low : na, color=ma1_bot_color, linewidth=1, style=plot.style_linebr, title='#1 Lowest AVWAP')
ma1_bot_p2 = plot(ma1_bot_visible or md_show ? ma1_bot_mid : na, color=na, editable=false)
fill(ma1_bot_p1, ma1_bot_p2, ma1_bot_color, title='#1 Lowest background', transp=90)

ma1_trend = getMidasTrend(ma1_top_high, ma1_bot_low)

Overview

Nubia - Auto Midas Anchored VWAP [xdecow] finds the bars of the highest high and lowest low inside a user-set length, then builds volume-weighted averages of high or low and of the HLC3 midpoint back to those bars. Red and green broken lines mark the high and low paths, with faint fills toward the midpoint. The Always show input keeps dim lines visible when price no longer intersects them. A trend comparison of the close against those paths is calculated but not plotted. There are no trade entries or exits.

Details

Published by

g-moe on GitHub

Code credit

goodgains, as written in the script's header

Type

Indicator, Pine Script v5

Draws

On the price chart

Category

Volume, Trend

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Always showboolfalsemd_show
#1 Lengthint17ma1_len
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

The Momentum Setup is a multi-indicator visual tool designed for trend and momentum analysis directly on the price chart. It combines Relative Strength Index (RSI), Money Flow Index (MFI), Commodity Channel Index (CCI), Supertrend, and a 250-bar percentage cha

Indicator v5 Oscillators & momentumTrend
Updated 1 year ago · MPL-2.0 GitHub repository of Momentum Setup - Ankush Bajaj Momentum Investing Setup

Adaptive MA Slope

by capissimo
114 stars

This indicator calculates Kaufman's Adaptive Moving Average (KAMA) on a chosen price source and determines trend direction based on the slope across a configurable lookback window. Signals can be filtered by short-term volatility expansion using ATR comparison

Indicator v4 Moving averagesTrend
Updated 1 year ago · None stated GitHub repository of Adaptive MA Slope
92 stars

This indicator plots a volume-weighted average price of the typical price on the chart and colors that line by ADX strength. It draws a standard-deviation envelope around VWAP and tints the fill green when plus DI leads and red when minus DI leads. Triangle ma

Indicator v5 TrendOscillators & momentum
Updated 8 weeks ago · Custom licence GitHub repository of Moon Dev VWAP x ADX Explosion

Signal Strategy 15m

by tripolskypetr
72 stars

This indicator generates trend-following trade signals on the price chart by combining moving average crossovers with multi-factor filters. It triggers entry alerts when fast and slow EMAs cross in the direction of a baseline trend EMA, confirmed by non-extrem

Indicator v5 TrendMoving averages
Updated 3 days ago · MIT GitHub repository of Signal Strategy 15m

Copilot

by milocaetano
48 stars

Copilot is an order flow range-reversal indicator designed to overlay trading setups directly on the price chart. It evaluates four criteria: market context (sideways vs trending regime based on ATR height), structure (double top or double bottom retests), abs

Indicator v5 SMC / ICT / price actionSupport & resistance
Updated yesterday · MIT GitHub repository of Copilot
46 stars

This overlay indicator plots a SuperTrend using a 10-period ATR with a multiplier of 3, drawing up and down stop lines and a faint trend fill on the price chart. It compares a 9-period EMA with an 18-period EMA and a 12/26/9 MACD against its signal, and it req

Indicator v5 TrendOscillators & momentum
Updated 3 years ago · None stated GitHub repository of SuperTrend + MACD + EMA

More indicators

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers