Terry.
I have the preferences set to 2 decimal places but the below
plot gives 4 decimal places. I’m not sure what you mean with your remarks
about Title. How do you use Title and or printf to
format decimal places in the PlotText function?
Thanks
Peter
// Calculates Standard Deviation
Period = EndValue( BarIndex() ) - BeginValue( BarIndex() );
StandardDeviationInTheRange = EndValue( StDev( Close, Period ) );
PlotText( "Standard
Deviation is " + StandardDeviationInTheRange, PlotTextxCoordinate , PlotTextyCoordinate , PlotColour , colorWhite );
-----Original Message-----
From: amibroker@xxxxxxxxxxxxxxx
[mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf
Of Terry
Sent: Tuesday, 2 May 2006 2:37
a.m.
To: amibroker@xxxxxxxxxxxxxxx
Subject: RE: [amibroker] PlotText
& Formatting Decimals?
Right.
You either change the default number of decimal places in Tools->Preferences
OR you use the Title = statement and then your printf formatting will work.
-----Original Message-----
From: amibroker@xxxxxxxxxxxxxxx
[mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf
Of Peter
Sent: Monday, May 01, 2006 03:30
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] PlotText
& Formatting Decimals?
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
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 other support material please check also:
http://www.amibroker.com/support.html
SPONSORED LINKS
YAHOO! GROUPS LINKS