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

[amibroker] Re: AFL decimal values



PureBytes Links

Trading Reference Links

Hello Donald,


>WRITEVAL() always uses three decimal places (which affects how ROUND()
>works), and both need the ability to set the number of decimals.


Although AFL docs doesn't mention this, WriteVal() function has additional
parameter which defines number formating.

WriteVal( DataArray, Format)

Format parameter is a float in the form x.y where x specifies total number
of characters printed and y specifies number of decimal places. Default
value is 8.3 which means print numbers with 3 decimal places using max 8
characters (including dot and leading spaces).
Example
WriteVal(Close, 5.0) - print close value WITHOUT decimal part
WriteVal(Close, 8.5) - print close with 5 digits after decimal point

You can also check MACD commentary for more examples on WriteVal() function.

Best regards,
Tomasz Janeczko


------------------------------------------------------------------------
eGroup home: http://www.eGroups.com/list/amibroker
Free Web-based e-mail groups by eGroups.com