Volume Profile (per swing)

I'm hoping someone has done this already and can show me how to plot a volume profile for each leg of a price swing (eg. zig zag).



If you are serious on it. First you will have to learn this masterpiece of @empottasch. TINA!

How to get the most traded area value of previous day intraday data

Techniques from this thread will help:

Multiple Anchored VWAP

And this thread also:

How to get the values of PriceVolDistribution() bins using gfxTextOut or exploration or in title


Thanks cougar. I have read those threads and made my best effort to modify available codes.

To clarify, I don't want multiple anchored profiles applied manually, but automatic plotting for every up swing. Just thought someone might have done it already.

Reading won't help. As of today, Human Brain is not evolved to read Codes, probably, we need to try and experiment with Codes to understand, then, possibly realize them! And after we realize a Code, its no longer a Code for you, rather, a skill that you acquired.

The purpose of this forum is not to provide AFL pasties, but, to help each other. If you work (with devotion) on the codes from those threads and spent some time with those, you yourself would be able to satisfy your own wants.

If you still get stuck, then, please share your attempts and you will surely get help!

All the Best!

P.S. Are you aware of "Help Vampire" Syndrome? Please read along.


Just trying to get the last swing plotted for starters...


Screenshot is okay if you are sharing errors but also use Code tags while sharing Codes.

The way you have used ValueWhen is incorrect. Suggesting you to thoroughly read: Understanding how AFL works.

Let alone, if you search this forum with the keyword "ValueWhen", you will get many links similar to counter what you are unable to accomplish. Especially this one:

Trend line between peaks

Now coming to the problem try this:

fvb = LastValue( ValueWhen( Low == tb, bi ) );
lvb = LastValue( ValueWhen( High == pb, bi ) );