Re: [amibroker] @Tomasz - VAP using variables other than Volumes

 

Hello,

Thank you very much for your e-mail.

IN 6.13 you have universal function
PriceVolDistribution
that allows to create distributions of any array vs any other array (not only price vs volume)

It also provides access to underlying data so people who wanted to access data from PlotVAPOverlay
can now use PriceVolDistribution instead.

AFL:

PriceVolDistribution( priceH, priceL, vol, bins, absolute = False, startbar = 0, endbar = -1 )

priceH - normally it is "high" array (but can be any other data array to create distribution)
priceL - normally it is "low" array (but can be any other data array to create distribution)

If you want distribution from single array, pass same array as priceH and priceL.

vol - normally "volume" array but it can be any array holding "frequency" or "volume" of data

bins - number of price levels / distribution bins to use

absolute - if True  - returned distribution is in absolute volume values (sum of volume occurring at given price level)
                 if False - returned distribution is in relative volume values 0...1 ( with 1 being the maximum volume from the distribution)

startbar/endbar - start and end bar numbers from which to take data for the distribution.

PriceVolDistribution returns a matrix of [ bins, 2 ] (number of rows = bins, number of columns = 2)

In the first column we have price levels for the distribution
In the second column we have cumulative volume at given price level.

// a demo showing
// re-implementation of VAP overlay using
// PriceVolDistribution and low-level graphics
bi = BarIndex();
fvb = FirstVisibleValue( bi );
lvb = LastVisibleValue( bi );

mx = PriceVolDistribution( H, L, V, 100, False, fvb, lvb );

GfxSetCoordsMode( 1 );

GfxSelectPen( colorRed );

bins = MxGetSize( mx, 0 );
for( i = 0; i < bins; i++ )
{
   price = mx[ i ][ 0 ];     // price level
   relvolume = mx[ i ][ 1 ]; // relative volume 0..1
   relbar = relvolume * (lvb-fvb+1);
   GfxMoveTo( fvb, price );
   GfxLineTo( fvb + relbar, price );
}

Plot( C, "Price", colorDefault, styleBar );

if( ParamToggle("BuildinVAP", "No|Yes") ) PlotVAPOverlay( 100, 100, colorGreen, 2 );
Best regards,
Tomasz Janeczko
amibroker.com

On 2016-03-30 11:25, meanomalist@yahoo.com [amibroker] wrote:

Hi Tomasz,


Is it just not possible to use other than Volumes as Input in VAP function?


If not, can you please make this function flexible to accept user defined Input?


Purpose: It will open a big door of opportunities for a user to Analyse the Market Profile at various Price points from multiple Dimensions.


So, can we have it please?


__._,_.___

Posted by: Tomasz Janeczko <groups@amibroker.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (3)

Upgrade your account with the latest Yahoo Mail app
Get organized with the fast and easy-to-use Yahoo Mail app. Upgrade today!

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/


.

__,_._,___


EmoticonEmoticon