Anchored VWAP

Hi
Is there an Anchored (where i can click on a specific bar for the anchor) VWAP indicator available?

Thanks

Search in the forum or use this link.

Thanks for the reply . Could you paste the code for a simple anchored VWAP please. Surely this should be a standard feature in AB. Thanks

The way Anchored VWAP works is to anchor at an everyday point in time, like start of the day.
( also for intraday data, again Daily TF or higher would be pointless )

By anchoring at specific bar, what do you do with all previous data?
Just think about it, what you are asking is possible in AFL by masking previous data but is it logical?

maybe i didnt explain what i want to do with avwap. I want to anchor it to a specific bar of interest to me (might be volume spike etc)

bi 		= BarIndex();
CurBar 	= SelectedValue( bi );
ArrBI 	= CurBar == bi;
sVWAP 	= SumSince( ArrBI, Avg * V) / SumSince( ArrBI, V );

Plot( sVWAP, "sVWAP", colorBlue, styleLine );

See this

Thanks but i get 505 error - Division by zero?

Take time and try debugging.
Post your AB version etc
Check volume, test intra timeframe etc

If i were to reply, It is working fine in my system, would it be helpful?
I can't see your screen.

Thanks - im a trader not a programmer. Why its not a standard feature (as it is in Tradingvieww etc) i dont know. People buy AB to trade not spend hours learning to code what really should be a standard feature. I appreciate your help anyway - thanks

Let’s set the record straight: AmiBroker is in a completely different league than TV. AB is a high-performance, fully programmable system design, development, validation and trading platform designed for serious traders who demand speed, control, and precision. TV might be appear easier for beginners, but it’s limited, slow, and locked into whatever fixed tools they decide to give you.

"Why isn’t this built-in like TV? — that mindset misses the point. The truth is, building everything in leads to bloatware: slow, overloaded software packed with features 90% of users don’t even need. That’s exactly what AmiBroker avoids — and rightly so. AmiBroker avoids becoming bloated junk by not stuffing in every feature imaginable. Instead it allows YOU to decide what you want and achieve that with few lines of AFL. That’s how it stays blazing fast, lightweight, and rock-solid.

And now, with built-in AI assistant, you don’t even need to write AFL yourself — just describe what you want and let the AI generate it. You get full customization without being a coder.

So no, it’s not a flaw that AB doesn’t spoon-feed features. It’s a strength. You’re trading with a platform that adapts to you, not the other way around.

With AFL literally EVERYTHING is "built-in" because there is NO LIMIT of what you can do.

AmiBroker with all its power is just 5MB in size (executable files). Isn't that absolutely amazing? Who else nowadays produces such amazingly compact software?

Also 505 is NOT an error, it is warning. Please read Basics: Error, warning, notice

You will Warning 505 got this if divisor is zero. You can avoid it by just using SafeDivide

bi       = BarIndex();
CurBar    = SelectedValue( bi );
ArrBI    = CurBar == bi;
sVWAP    = SafeDivide( SumSince( ArrBI, Avg * V, True), SumSince( ArrBI, V, True ), Null );

Plot( sVWAP, "sVWAP", colorBlue, styleLine );
9 Likes

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.