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

Re: [amibroker] Re: How to you use the low-level graphics to plot text?



PureBytes Links

Trading Reference Links

Hello,

Below is  a positioning sample code. Note that if scale changes (pxheight changes) due to new data,
it needs additional refresh to read new scale and adjust positions properly

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

GfxSetOverlayMode(0); 

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

lvb = Status("lastvisiblebar"); 
fvb = Status("firstvisiblebar"); 

pxwidth = Status("pxwidth"); 
pxheight = Status("pxheight"); 

TotalBars = Lvb - fvb; 

axisarea = 56; // may need adjustment if you are using non-default font for axis 

GfxSelectSolidBrush( colorRed ); 
GfxSelectPen( colorRed ); 
for( i = 0; i < TotalBars AND i < ( BarCount - fvb ); i++ ) 
{ 
  x = 5 + i * (pxwidth - axisarea - 10) / ( TotalBars + 1 ); 

  y = 5 + ( C[ i + fvb ] - Miny ) * ( pxheight - 10 )/ ( Maxy - Miny ); 

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

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message ----- 
From: "J. Biran" <jbiran@xxxxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Tuesday, August 07, 2007 3:01 AM
Subject: RE: [amibroker] Re: How to you use the low-level graphics to plot text?


> 
> That's good information! 
> 
> What about the x axis positioning?
> 
> 
> Joseph Biran
> ____________________________________________
> 
> -----Original Message-----
> From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf
> Of Tomasz Janeczko
> Sent: Monday, August 06, 2007 4:14 PM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: Re: [amibroker] Re: How to you use the low-level graphics to plot
> text?
> 
> WHAT?????????????????????????
> I did NOT say that  !!!
> 
> What I did say was that PlotText is SIMPLER.
> 
> It does not mean that you can use Gfx functions. And I actually described
> what you should do !
> 
> === COPY OF MY SUPPORT RESPONSE BELOW ===
> 
> 
> Using low-level graphics you need to:
> 
> 1. get the "height" of the pane - Status("pxheight")
> 
> 2. get the "miny" and "maxy" Status("axisminy"), Status("axismaxy")
> 
> 3. calculate value->pixel position and then plot at specified X/Y
> 
> BUT..... to plot text on CHART at specified PRICE point, you should
> really use much simpler PlotText() function that uses PRICE and DATE
> as coordintes so you don't need to calculate yourself:
> 
> http://www.amibroker.com/f?plottext
> 
> 
> Best regards,
> Tomasz Janeczko
> amibroker.com
> ----- Original Message ----- 
> From: "Jerry Gress" <pleasenospamplease@xxxxxxxxxxx>
> To: <amibroker@xxxxxxxxxxxxxxx>
> Sent: Tuesday, August 07, 2007 12:42 AM
> Subject: RE: [amibroker] Re: How to you use the low-level graphics to plot
> text?
> 
> 
>> Thanks Graham,
>> 
>> Hope your doing well, yeah received e-mail from support and it Looks like
> we
>> can't use the great graphics for simple plottext. Too bad!!!!!!
>> 
>> Jerry Gress
>> Stockton, Ca.
>> 
>> 
>> -----Original Message-----
>> From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On
> Behalf
>> Of Graham
>> Sent: Monday, August 06, 2007 2:59 PM
>> To: amibroker@xxxxxxxxxxxxxxx
>> Subject: Re: [amibroker] Re: How to you use the low-level graphics to plot
>> text?
>> 
>> to write text at bars use plottext function, to plot shapes at bars
>> use plotshapes function
>> 
>> -- 
>> Cheers
>> Graham Kav
>> AFL Writing Service
>> http://www.aflwriting.com
>> 
>> 
>> 
>> On 06/08/07, kar_avi <kar_avi@xxxxxxxxx> wrote:
>>> --- In amibroker@xxxxxxxxxxxxxxx, "Jerry Gress"
>>> <pleasenospamplease@xxx> wrote:
>>> >
>>>
>>> > So the question is how do I put some fancy text on a 2 minute chart at
>>> > specified price points? The best this lowly programmer can tell all
> this
>>> > graphic stuff is to the pixel not price. Example:
>>> >
>>> >
>>> > SYNTAX  GfxTextOut( "text", x, y )
>>> > RETURNS NOTHING
>>> > FUNCTION  Writes a character string at the specified location using the
>>> > currently selected font.
>>> >
>>> > Parameters:
>>> >
>>> > "text" - Specifies the character string to be drawn
>>> > x - Specifies the x-coordinate of the starting point of the text
>>> > y - Specifies the y-coordinate of the starting point of the text
>>> >
>>> >
>>> > Any help will be greatly appreciated.
>>> >
>>> > Jerry Gress
>>> > Stockton, Ca.
>>> >
>>>
>>> exactly my problem also. I want to plot lot of texts, arrows, shapes
>>> etc near range bar breakouts. but the coordinates are in pixels, and I
>>> do not know any way to get the pixels of the High of a bar identified,
>>> unless its built from scratch as the code posted here previously. so
>>> the low level functions may not be useful to traders who write their
>>> own systems with some amount of coding, but more to developers who can
>>> enhance features for Amibroker.
>>>
>> 
>> 
>> 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
>> 
>> Yahoo! Groups Links
>> 
>> 
>> 
>> 
>> 
>> 
>> 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
>> 
>> Yahoo! Groups Links
>> 
>> 
>> 
>> 
>>
> 
> 
> 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
> 
> Yahoo! Groups Links
> 
> 
> 
> 
> 
> 
> 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
> 
> Yahoo! Groups Links
> 
> 
> 
> 
>


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
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/