fxshrat
Private Group
Posts: 566
Received Likes: 211
|
Post by fxshrat on May 3, 2016 18:06:19 GMT
By "weird plot" been talked about in this post amibrokerforum.proboards.com/thread/159/volume-price-buying-selling-volumes?page=2&scrollTo=639I'm referring to plots like in the example picture below. Those long horizontal bars you see there disappear if i.e. a basic printf like printf( "%g", 1 ); is placed after PriceVolDistribution or if it is removed. If being placed before PriceVolDistribution then I get those long bars at several zoom/scroll stages. Not sure what's causing it. This also can happen if using Tomasz Janeczko's demo code of the ReadMe of AB 6.13 www.amibroker.com/devlog/wp-content/uploads/2016/04/readme6130.htmlIf you place i.e. printf( "%g", 1 ); before PriceVolDistribution then plot behaves differently (i.e. if zooming scrolling) compared to not placing it. Anyone able to confirm this or facing similar observations?
|
|
fxshrat
Private Group
Posts: 566
Received Likes: 211
|
Post by fxshrat on May 3, 2016 18:15:10 GMT
Test code.
Uncomment printf line and compare plot. You should see a plot change
// a demo showing // re-implementation of VAP overlay using // PriceVolDistribution and low-level graphics RequestTimedRefresh( 1 );
bi = BarIndex(); fvb = Max( 0, FirstVisibleValue( bi ) ); lvb = Max( 0, LastVisibleValue( bi ) );
//printf( "%g", 1 );
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 );
|
|
andwilson
Private Group
Posts: 43
Received Likes: 13
|
Post by andwilson on May 3, 2016 18:17:59 GMT
Confirmed!
printf placed before PriceVolDistribution interferes with display;
|
|
fxshrat
Private Group
Posts: 566
Received Likes: 211
|
Post by fxshrat on Jun 9, 2016 18:28:37 GMT
It seems that at least all string functions that offer some formating seem to cause side effects on PriceVolDistribution.
So far I have figured: printf(), _TraceF(), StrFormat().
That means that while _TraceF() seems to cause effects i.e. _TRACEF( "%g", 1 ); On the other _Trace() does not seem to cause effects i.e. _TRACE( "" + 1 );
So it seems that those functions with format specifiers cause the effects only.
|
|
fxshrat
Private Group
Posts: 566
Received Likes: 211
|
Post by fxshrat on Jun 15, 2016 15:46:50 GMT
FYI, for people using this function I've got informed by AB that this issue has been confirmed and it has already been fixed in AB 6.14 development version. So the fix will be available in the next public beta release.
So you don't need to send further support mails in regards to this issue regarding AB 6.13.
Thank you to the people participating in this matter and thanks to AB for fixing the issue!
|
|