Help Needed for GfxTextOut()

Hello I need some Help.

I want to get Text(" PDH" on left side of chart indication Prev Day High
I am testing with only PDH with below code, but it is not showing anything, Can anyone help ?

_SECTION_BEGIN("PrevDay HL");
pxHeight = Status( "pxchartheight" ) ;
pyWidth = Status( "pxchartwidth");
Show_PDHL = ParamToggle("PrevDayHL","Hide|Show",0);
PDH =  TimeFrameGetPrice("H", inDaily, -1);    
PDL =  TimeFrameGetPrice("L", inDaily, -1);
YPos = LastValue(C);

GfxSelectFont( "Tahoma", 13, 100 );
GfxSetBkMode( 1 );
GfxSetOverlayMode( mode = 0 );
GfxSetTextColor( colorWhite );

//GfxTextOut("Close - " +LastValue(C),100,100); // Testing
GfxTextOut("PDH - " +LastValue(PDH),5,LastValue(PDH));

_SECTION_END();

First problem: you are using PIXEL co-ordinate mode (the default), yet you are passing values in DOLLARS.
This won't work. You need to set co-ordinate mode to different mode (2) to use pixels for X and price for Y co-ordinate.

http://www.amibroker.com/guide/afl/gfxsetcoordsmode.html

// you must set co-ordinate mode correctly
GfxSetCoordsMode( 2 ); // x in pixels, y in prices (dollars)

Second problem: You are using WHITE color, which you won't see on white background (if you are using such background).

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.