Re: [amibroker] Vertical Line.

 

If all you need is a vertical line, there is no need to use GFX.

Example:

My_Date = ParamDate("My Date","01/01/2016", 0); // DD/MM/YYYY format
Thats_the_day = DateNum() == My_Date;
Plot( Thats_the_day, "", coloryellow, styleHistogram | styleOwnScale | styleLine | styleNoLabel ); 


2016-02-19 22:32 GMT-02:00 tavenui@googlemail.com [amibroker] <amibroker@yahoogroups.com>:
 

HI,

I want to draw a simple vertical line at a date, e.g Options Expiry Date. e.g. 25/2/2016.

I have searched though documentation and can not seem to find a suitable solution.

I have tried to splice some things together and got in a bit of a mess.

__________________________________________________________________________________
function DrawButton( Text, x1, y1, x2, y2, BackColor )
{
    GfxSetOverlayMode( 0 );
    GfxSelectFont( "Tahoma", 12, 800 );
    GfxSelectPen( colorBlack );
    GfxSetBkMode( 1 );
    GfxSelectSolidBrush( BackColor );
    GfxSetBkColor( BackColor );
    GfxSetTextColor( 1 );
    GfxRectangle( x1, y1, x2, y2 );
    GfxDrawText( Text, x1, y1, x2, y2, 32 | 1 | 4 );
}
 
Yoffset = Param( "Button Row Offset (px)", 0, 0, 2000, 5 );
Xoffset    = Param( "Button Column Offset (px)", 10, 0, 2000, 5 );
CellHeight = Param("Cell Height",1000,500,1000,5);  
CellWidth = Param("Cell Width",2,1,20,5); 
DrawButton( "TEST", Xoffset, yoffset, Xoffset + CellWidth, yOffset + CellHeight, colorBlue );

Expiry = ParamDate ("Expiry Dates","03-12-2015", 1 );

Plot( Expiry, "Expiry Dates", colorDarkRed, styleOwnScale | styleLine , 0, 0, 2 );

Plot( IIf(DayOfYear() > Ref(DayOfYear(), 1), C, Null ), "Expiry Date", colorDarkRed, styleOwnScale | styleHistogram | styleDashed, 0, 1 );





--
Agradeço antecipadamente,

----------------------------------------------------------
João Flávio Machado Derzi
+55 (31) 9731-4469

__._,_.___

Posted by: =?UTF-8?Q?Jo=C3=A3o_Fl=C3=A1vio_Machado_Derzi?= <joaoderzi@gmail.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)
**** 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/


.

__,_._,___

Related Posts


EmoticonEmoticon

:)
:(
=(
^_^
:D
=D
=)D
|o|
@@,
;)
:-bd
:-d
:p
:ng
:lv