Hi Peter, Using the example of the PlotText
function in the AB Help files, I have wrapped the integer function around the
Buy Price. See the example below: Regards, Gordon Sutherland Plot(C,"Price", colorBlack,
styleLine ); Plot(MA(C,20),"MA20", colorRed ); Buy=Cross( C, MA(C,20 ) ); Sell= Cross( MA( C, 20 ), C ); dist = 1.5*ATR(10); for( i = 0; i < BarCount; i++
) { if( Buy[i] ) PlotText( "Buy\n@" + int(C[ i ]*100)/100, i, L[ i ]-dist[i], colorGreen
); if( Sell[i] ) PlotText( "Sell\n@" + int(C[ i ]*100)/100, i, H[ i ]+dist[i], colorRed,
colorYellow
); } -----Original
Message----- Hi Is there a way to format a number to a set number of decimal
places. E.g. In the below example round the number to 2 decimal places. PlotText( "Buy @ "+ 1234.5678, xCoordinate , yCoordinate , PlotColour , colorWhite ); It seems that formatting used in printf
e.g.
printf ("2 decimal = %0.2f", 1234.5678); doesn’t work in PlotText Thanks Peter
|
- [amibroker] PlotText & Formatting Decimals? Peter
- RE: [amibroker] PlotText & Formatting Decimals? Gordon Sutherland
- RE: [amibroker] PlotText & Formatting Decimals? Terry