[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [amibroker] AmiBroker 5.09.0 BETA released [. New fields in Status() function: pxchart* Chart coordinates! ]


  • To: <amibroker@xxxxxxxxxxxxxxx>
  • Subject: RE: [amibroker] AmiBroker 5.09.0 BETA released [. New fields in Status() function: pxchart* Chart coordinates! ]
  • From: "J. Biran" <jbiran@xxxxxxxxxxx>
  • Date: Wed, 30 Apr 2008 15:58:29 -0700

PureBytes Links

Trading Reference Links

Hi,

 

This is REAL NEAT addition!.

 

Two questions:

 

1)

in the samples below there is multiple usage of the command GfxSetOverlayMode();

 

Can several of these be interleaved within the code and as a result the Gfx() following these will be plotted some on op others underneath (transparent) for individual sections? (I don’t seem to get it to work)

 

2)

If you select text pointsize X, how do you compensate its vertical position to line up its center height with a value Y, independent of chart size?

 

Joseph Biran
____________________________________________

 

From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of Tomasz Janeczko
Sent: Wednesday, April 30, 2008 8:32 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] AmiBroker 5.09.0 BETA released [• New fields in Status() function: pxchart* Chart coordinates! ]

 

Hello,

 

AmiBroker 5.09.0 BETA released

 

CHANGES FOR VERSION 5.09.0 (as compared to 5.08.0)

  • MDI Tab order is now saved in the layout
  • Added interface to BugsLayerUtil.dll for optional call stack / symbol dump report in crash recovery window
    Now there is a detailed call stack and CPU register state in the bottom of the crash report. This should allow quicker/easier fixes of any crashes
  • New fields in Status() function: pxchart*

    Status("pxchartleft") - returns x-coordinate of top-left corner of chart area
    Status("pxcharttop") - returns y-coordinate of top-left corner of chart area
    Status("pxchartright") - returns x-coordinate of bottom-right corner of chart area
    Status("pxchartbottom") - returns y-coordinate of bottom-right corner of chart area
    Status("pxchartwidth") - returns width chart area (right-left)
    Status("pxchartheight") - returns width chart area (bottom-top)
    Chart co-ordinates are useful because they automatically take into account selected axis font size,
    whether date axis is on or off
    and other settings (New Look chart style)
    All co-ordinates are in screen pixels. Note that top, left coordinates may not be zero as chart rectangle is smaller than underlying window because there is an extra space (padding) around chart.


// Test code:
Title = StrFormat("left=%g, top=%g, right=%g, bottom=%g, width=%g, height=%g",
left=
Status("pxchartleft"),
top=
Status("pxcharttop"),
right=
Status("pxchartright"),
bottom=
Status("pxchartbottom"),
Status("pxchartwidth"),
Status("pxchartheight") );
GfxSetOverlayMode(1);
GfxRectangle(Left,top, right, bottom);

============ Overlay sample ================
_SECTION_BEGIN("GfxOverlaySampleNew");

function GetVisibleBarCount()
{
 lvb =
Status("lastvisiblebar");
 fvb =
Status("firstvisiblebar");

 return Min( Lvb - fvb, BarCount - fvb );
}

function GfxConvertBarToPixelX( bar )
{
 lvb =
Status("lastvisiblebar");
 fvb =
Status("firstvisiblebar");
 pxchartleft =
Status("pxchartleft");
 pxchartwidth =
Status("pxchartwidth");

 return pxchartleft + bar  * pxchartwidth / ( Lvb - fvb + 1 );
}

function GfxConvertValueToPixelY( Value )
{
 local Miny, Maxy, pxchartbottom, pxchartheight;

 Miny =
Status("axisminy");
 Maxy =
Status("axismaxy");

 pxchartbottom =
Status("pxchartbottom");
 pxchartheight =
Status("pxchartheight");

 return pxchartbottom - floor( 0.5 + ( Value - Miny ) * pxchartheight/ ( Maxy - Miny ) );
}



Plot(C, "Price", colorBlack, styleHistogram );

GfxSetOverlayMode(0);
GfxSelectSolidBrush( colorRed );
GfxSelectPen( colorRed );

AllVisibleBars = GetVisibleBarCount();
fvb =
Status("firstvisiblebar");

for( i = 0; i < AllVisibleBars ; i++ )
{
   x = GfxConvertBarToPixelX( i );
   y = GfxConvertValueToPixelY( C[ i + fvb ] );

  
GfxRectangle( x-1, y-1, x + 2, y+1 );
}

//SetChartBkGradientFill( ColorRGB(200,200,200), ColorRGB( 255,255,255) );
_SECTION_END();

 

  • OLE: Name property is now writable, allowing switchin currently selected symbol for the document

    Example (JScript):
    AB = new ActiveXObject("Broker.Application");
    AB.ActiveDocument.Name = "MSFT"; // change the symbol for current document to "MSFT"


Best regards,
Tomasz Janeczko
amibroker.com

__._,_.___

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

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

For other support material please check also:
http://www.amibroker.com/support.html




Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___