Futures Session TWAP + Bands - CFD ChartsAn anchored TWAP (time-weighted average price) with 1/2/3-sigma bands that
knows when the real market is actually open — built for CFD and cash-index
charts whose 24h quotes distort classic session averages.
What makes it original: a TWAP weighs every bar equally, so on a 24h CFD chart
the thin overnight bars count as much as the liquid session and drag the line
away from the number execution desks reference. This indicator pulls the
volume of the auto-detected futures contract and uses it as a SESSION GATE:
only bars where the future actually traded are counted. It also plots an
optional futures-volume VWAP on the same anchor, so the TWAP-vs-VWAP spread
becomes readable at a glance — that spread is the point of the pair.
How it works:
- TWAP = equal-weight average of the chart's price (hlc3 by default) over the
anchor period (session/week/month); bands from the time-weighted variance.
- Session gate (optional, on by default): bars without futures volume are
skipped, so the TWAP covers the real trading session. Only session/volume
information is borrowed from the future — the price stays this chart's
price, so the futures-vs-cash basis cannot distort the level.
- The futures contract is auto-detected from the chart symbol (DAX/GER40 ->
FDAX, NAS100 -> NQ, US30 -> YM, UK100 -> Z, US500 -> ES), or set manually.
- Optional "Daily anchor = futures trading day" resets at the futures day
change instead of CFD broker midnight, matching the sibling VWAP tool.
- A status label shows the active source, the gate state and the current
VWAP-minus-TWAP spread.
How to use it: the TWAP is the fair time-average of the session — the line an
evenly-sliced execution would achieve. Compare it with the futures-volume
VWAP: VWAP above TWAP means volume was concentrated above the time average
(participants paid up), VWAP below TWAP means volume traded below it. The two
lines glued together signals balanced rotation; a widening spread marks
one-sided participation. The 2/3-sigma bands frame statistically stretched
zones relative to the session mean. Check the status label once after loading
to confirm the futures feed is active.
*This script is part of a consistent set of open-source session, range and
volume tools — the companions are on my profile.* Indikator

Equilibrium Deviation Engine [LB]
Concept
The Equilibrium Deviation Engine is a session-resetting, volume-weighted equilibrium model that builds a dynamic fair value basis from accumulated price and volume since the last anchor point (daily by default). Around this basis, it constructs multiple deviation bands and an independent extreme contrarian channel whose width varies inversely with short-term volatility — expanding during quiet markets and contracting during turbulent ones.
Mathematical Foundation
At each new session (e.g., daily open), the engine resets three accumulators and recalculates them bar by bar :
PV = SUM(Price * Volume)
V = SUM(Volume)
P2V = SUM(Price^2 * Volume)
The equilibrium basis is the volume-weighted average price since reset :
Basis = PV / V
The standard deviation of price around this basis is derived from the variance :
Var = max( (P2V / V) - Basis^2 , 0 )
Dev = sqrt(Var)
Three main bands are then computed by applying adaptive multipliers to this deviation. The adaptation uses two independent weights :
TWAP Weight — compares the basis to a hidden TWAP. The larger the gap relative to the deviation, the more the bands widen, capturing potential mean-reversion targets.
HV Weight — compares current historical volatility (HV) to its own smoothed baseline. When HV expands, bands widen ; when HV contracts, bands narrow.
The final band width for level k is :
D_k = Dev * Mult_k * TWAP_Weight * HV_Weight
The Extreme Contrarian Channel
A separate channel is built using an inverse volatility weight. Instead of expanding with rising HV, it contracts :
InvWeight = clamp( 1 / (HV_contrarian / HV_contrarian_baseline) , min, max )
This creates a structural envelope that is widest during low-volatility regimes (where price tends to range) and tightens during high-volatility regimes (where price breaks through normal boundaries). The inner and outer levels use user-defined sigma multipliers.
What Problem Does It Solve ?
Traditional deviation bands (Bollinger, Keltner, VWAP bands) use fixed lookback windows and a single volatility metric. They do not reset at session boundaries, nor do they distinguish between different volatility regimes for mean-reversion versus breakout scenarios. The Equilibrium Deviation Engine solves this by :
- Resetting accumulators at each session (e.g., daily), producing a true volume-weighted equilibrium for the current period.
- Adapting band width to both the TWAP gap (directional drift) and HV regime (market excitement).
- Adding a separate contrarian channel using inverse volatility, specifically designed to identify exhaustion zones where low volatility precedes expansion, or where extreme HV signals climax conditions.
How To Interpret
Basis line (white) — the real-time volume-weighted fair value for the current session. Price above basis signals session bullishness ; price below signals session bearishness.
Deviation bands 1, 2, 3 — graduated zones of overextension from the basis. Price reaching Band 3 represents an extreme statistical deviation from the session's equilibrium, often preceding reversion.
Extreme contrarian channel — a separate envelope that behaves inversely to short-term HV. When this channel is wide (low HV, quiet market), price tends to oscillate within it, making the boundaries attractive mean-reversion levels. When the channel narrows sharply (high HV, excited market), it signals compression before a potential breakout.
Band expansion vs contraction — widening bands indicate increasing dispersion and adaptive uncertainty ; narrowing bands indicate consolidation and equilibrium tightening.
Parameters
LB Engine
Source — price field used for calculations (default HLC3).
Reset TF — timeframe at which accumulators reset (default Daily).
Hidden TWAP Length — period for the TWAP used in the TWAP gap weight.
Historical Volatility Length — period for HV calculation (main bands).
HV Smoothing — smoothing period for the HV baseline.
LB Bands
Deviation 1, 2, 3 — base multipliers for the three main deviation levels.
LB Contrarian Channel
Extreme Channel Inner/Outer — sigma multipliers for the contrarian channel.
Use Main HV Weight — applies the main HV weight to the contrarian channel.
Use Hidden TWAP Weight — applies the TWAP gap weight to the contrarian channel.
Contrarian Inverse HV Length — period for the HV used in the inverse weighting.
Contrarian Inverse HV Smooth — smoothing period for the contrarian HV baseline.
Contrarian Inverse HV Min/Max — clamping limits for the inverse weight.
LB Style
Show Basis, Show Main Fills, Color Bars — visual toggles.
Basis Width, Band Width, Extreme Channel Width — line thickness controls.
Reference
This indicator is a proprietary design by Luis Barlier. It synthesises concepts from session volume-weighted average price (VWAP), adaptive volatility bands, and inverse volatility regime detection. It does not correspond to a single academic publication. Indikator

Indikator

Indikator

WAP Maverick - (Dual EMA Smoothed VWAP) - [mutantdog]Short Version:
This here is my take on the popular VWAP indicator with several novel features including:
Dual EMA smoothing.
Arithmetic and Harmonic Mean plots.
Custom Anchor feat. Intraday Session Sizes.
2 Pairs of Bands.
Side Input for Connection to other Indicator.
This can be used 'out of the box' as a replacement VWAP, benefitting from smoother transitions and easy-to-use custom alerts.
By design however, this is intended to be a highly customisable alternative with many adjustable parameters and a pseudo-modular input system to connect with another indicator. Well suited for the tweakers around here and those who like to get a little more creative.
I made this primarily for crypto although it should work for other markets. Default settings are best suited to 15m timeframe - the anchor of 1 week is ideal for crypto which often follows a cyclical nature from Monday through Sunday. In 15m, the default ema length of 21 means that the wap comes to match a standard vwap towards the end of Monday. If using higher chart timeframes, i recommend decreasing the ema length to closely match this principle (suggested: for 1h chart, try length = 8; for 4h chart, length = 2 or 3 should suffice).
Note: the use of harmonic mean calculations will cause problems on any data source incorporating both positive and negative values, it may also return unusable results on extremely low-value charts (eg: low-sat coins in /btc pairs).
Long version:
The development of this project was one driven more by experimentation than a specific end-goal, however i have tried to fine-tune everything into a coherent usable end-product. With that in mind then, this walkthrough will follow something of a development chronology as i dissect the various functions.
DUAL-EMA SMOOTHING
At its core this is based upon / adapted from the standard vwap indicator provided by TradingView although I have modified and changed most of it. The first mod is the dual ema smoothing. Rather than simply applying an ema to the output of the standard vwap function, instead i have incorporated the ema in a manner analogous to the way smas are used within a standard vwma. Sticking for now with the arithmetic mean, the basic vwap calculation is simply sum(source * volume) / sum(volume) across the anchored period. In this case i have simply applied an ema to each of the numerator and denominator values resulting in ema(sum(source * volume)) / ema(sum(volume)) with the ema length independent of the anchor. This results in smoother (albeit slower) transitions than the aforementioned post-vwap method. Furthermore in the case when anchor period is equal to current timeframe, the result is a basic volume-weighted ema.
The example below shows a standard vwap (1week anchor) in blue, a 21-ema applied to the vwap in purple and a dual-21-ema smoothed wap in gold. Notably both ema types come to effectively resemble the standard vwap after around 24 hours into the new anchor session but how they behave in the meantime is very different. The dual-ema transitions quite gradually while the post-vwap ema immediately sets about trying to catch up. Incidentally. a similar and slower variation of the dual-ema can be achieved with dual-rma although i have not included it in this indicator, attempted analogues using sma or wma were far less useful however.
STANDARD DEVIATION AND BANDS
With this updated calculation, a corresponding update to the standard deviation is also required. The vwap has its own anchored volume-weighted st.dev but this cannot be used in combination with the ema smoothing so instead it has been recalculated appropriately. There are two pairs of bands with separate multipliers (stepped to 0.1x) and in both cases high and low bands can be activated or deactivated individually. An example usage for this would be to create different upper and lower bands for profit and stoploss targets. Alerts can be set easily for different crossing conditions, more on this later.
Alongside the bands, i have also added the option to shift ('Deviate') the entire indicator up or down according to a multiple of the corrected st.dev value. This has many potential uses, for example if we want to bias our analysis in one direction it may be useful to move the wap in the opposite. Or if the asset is trading within a narrow range and we are waiting on a breakout, we could shift to the desired level and set alerts accordingly. The 'Deviate' parameter applies to the entire indicator including the bands which will remain centred on the main WAP.
CUSTOM (W)ANCHOR
Ever thought about using a vwap with anchor periods smaller than a day? Here you can do just that. I've removed the Earnings/Dividends/Splits options from the basic vwap and added an 'Intraday' option instead. When selected, a custom anchor length can be created as a multiple of minutes (default steps of 60 mins but can input any value from 0 - 1440). While this may not seem at first like a useful feature for anyone except hi-speed scalpers, this actually offers more interesting potential than it appears.
When set to 0 minutes the current timeframe is always used, turning this into the basic volume-weighted ema mentioned earlier. When using other low time frames the anchor can act as a pre-ema filter creating a stepped effect akin to an adaptive MA. Used in combination with the bands, the result is a kind of volume-weighted adaptive exponential bollinger band; if such a thing does not already exist then this is where you create it. Alternatively, by combining two instances you may find potential interesting crosses between an intraday wap and a standard timeframe wap. Below is an example set to intraday with 480 mins, 2x st.dev bands and ema length 21. Included for comparison in purple is a standard 21 ema.
I'm sure there are many potential uses to be found here, so be creative and please share anything you come up with in the comments.
ARITHMETIC AND HARMONIC MEAN CALCULATIONS
The standard vwap uses the arithmetic mean in its calculation. Indeed, most mean calculations tend to be arithmetic: sma being the most widely used example. When volume weighting is involved though this can lead to a slight bias in favour of upward moves over downward. While the effect of this is minor, over longer anchor periods it can become increasingly significant. The harmonic mean, on the other hand, has the opposite effect which results in a value that is always lower than the arithmetic mean. By viewing both arithmetic and harmonic waps together, the extent to which they diverge from each other can be used as a visual reference of how much price has changed during the anchored period.
Furthermore, the harmonic mean may actually be the more appropriate one to use during downtrends or bearish periods, in principle at least. Consider that a short trade is functionally the same as a long trade on the inverse of the pair (eg: selling BTC/USD is the same as buying USD/BTC). With the harmonic mean being an inverse of the arithmetic then, it makes sense to use it instead. To illustrate this below is a snapshot of LUNA/USDT on the left with its inverse 1/(LUNA/USDT) = USDT/LUNA on the right. On both charts is a wap with identical settings, note the resistance on the left and its corresponding support on the right. It should be easy from this to see that the lower harmonic wap on the left corresponds to the upper arithmetic wap on the right. Thus, it would appear that the harmonic mean should be used in a downtrend. In principle, at least...
In reality though, it is not quite so black and white. Rarely are these values exact in their predictions and the sort of range one should allow for inaccuracies will likely be greater than the difference between these two means. Furthermore, the ema smoothing has already introduced some lag and thus additional inaccuracies. Nevertheless, the symmetry warrants its inclusion.
SIDE INPUT & ALERTS
Finally we move on to the pseudo-modular component here. While TradingView allows some interoperability between indicators, it is limited to just one connection. Any attempt to use multiple source inputs will remove this functionality completely. The workaround here is to instead use custom 'string' input menus for additional sources, preserving this function in the sole 'source' input. In this case, since the wap itself is dependant only price and volume, i have repurposed the full 'source' into the second 'side' input. This allows for a separate indicator to interact with this one that can be used for triggering alerts. You could even use another instance of this one (there is a hidden wap:mid plot intended for this use which is the midpoint between both means). Note that deleting a connected indicator may result in the deletion of those connected to it.
Preset alertconditions are available for crossings of the side input above and below the main wap, alongside several customisable alerts with corresponding visual markers based upon selectable conditions. Alerts for band crossings apply only to those that are active and only crossings of the type specified within the 'crosses' subsection of the indicator settings. The included options make it easy to create buy alerts specific to certain bands with sell alerts specific to other bands. The chart below shows two instances with differing anchor periods, both are connected with buy and sell alerts enabled for visible bands.
Okay... So that just about covers it here, i think. As mentioned earlier this is the product of various experiments while i have been learning my way around PineScript. Some of those experiments have been branched off from this in order to not over-clutter it with functions. The pseudo-modular design and the 'side' input are the result of an attempt to create a connective framework across various projects. Even on its own though, this should offer plenty of tweaking potential for anyone who likes to venture away from the usual standards, all the while still retaining its core purpose as a traders tool.
Thanks for checking this out. I look forward to any feedback below.
Indikator

+ Time Weighted Average PriceThis is basically NeoButane's script (which should be more popular than it is) with a few additions, those being primarily plotted lines of the closing price of the previous TWAP, however I've also added the optionality of plotting a second TWAP of say, maybe a different resolution if you are so inclined. Also, you may plot shapes across the top or bottom of your chart color based on if current price is above or below the previous closing price of the TWAP, in case you might want to clean the chart up a bit and not plot the actual closing price lines.
But what is TWAP, exactly, you might be saying to yourself. If you're familiar with VWAP then you've probably a pretty good idea of what this is and how it works. TWAP is a calculation that defines the weighted average price over a specific time period. Traders use TWAP as a trading strategy, or more specifically, an execution strategy, to place large orders without excessively impacting the market price. They break down the large orders into several sets of small orders priced near TWAP. Basically it's VWAP but without the volume element, and most traders will likely use it in a similar fashion as they might use VWAP, and that is like a moving average--dynamic support and resistance.
I like to think of it as displaying a price range over a specified time period (such as a month or a week). This is why I think the closes of the previous period or two are so important. Losing the previous closing price or regaining it can often give you an inclination as to whether at least some of the next period (the one you're currently in) may be bearish or bullish.
Above is a more zoomed out view of ADA/USD
And here's the same image with just the closing price for the time period plotted.
Enjoy! Indikator

Flunki T-WAP minus MA Oscillator
Yo,
Possible the last of these for now, and mostly for the sake of completeness..
This is..
Another simple oscillator that show the difference in price between a selectable timeframe TWAP and a Moving Average of that TWAP
This is shown as a histogram.
Use numeric TWAP values for minutes (30, 60 ,720 whatever) and D, 3D, W, M for higher values
There is also a global timeframe which will set the timeframe for a global alternate timeframe (instead of current chart resolution)
On top of that is a Moving Average of the histogram value, shown as a blue / red line with an option to highlight this MA crossing zero, and an option to colour bars to this line.
The major difference between this Oscillator, and the other script (Flunki VWAP minus MA Oscillator)
(I treid to insert a link but it's invisible so it would seem, anyway.. )
is that VWAP is usually calculated daily, so there is a sharp move upon the daily close, as VWAP starts a new day. Using TWAP this does not occur, so gives smoother transitions ; also the timeframe for TWAP is selectable for additional wap fun.
Simple idea : Code open
Enjoy ! Indikator

Indikator

Indikator

Interval Volatility Bands [DW]This is an experimental study that utilizes Volume Weighted Average Price or Time Weighted Average Price calculations, Bollinger Bands, and Fibonacci numbers to estimate volatility over a specified interval.
First, the basis is calculated by selecting:
-VWAP, which has the option to be calculated using real volume or tick volume
-TWAP, which has the option to be calculated using the standard method or exponential method
Next, standard deviation from the basis is calculated and multiplied by a specified expansion coefficient. The result is then added to and subtracted from the basis to calculate the high and low bands.
There are three band calculation methods to chosse from in this script:
-Standard, which uses the default calculations
-Average, which takes a cumulative average of standard deviation
-Hybrid, which takes the maximum of the standard and average standard deviation methods
Lastly, the high and low band ranges are multiplied by Fibonacci Percentages 23.6 - 78.6.
A custom color scheme with eight default presets to choose from is included. Indikator
