Welcome Features News Download Registration Support FAQ Wish list Links
Advanced stock charting and analysis program

A-Z Index | Category Index |

ADDCOLUMN
- add numeric exploration column

Exploration / Indicators
(AFL 1.8)


SYNTAX AddColumn( array, name, format = 1.2, textColor = colorDefault, bkgndColor = colorDefault, width = -1 )
RETURNS NOTHING
FUNCTION Adds a new column to the exploration result list. The column shows array values and has a caption of name. The values are formatted using format specification.
By default all variables are displayed with 2 decimal digits, but you can change this by assigning a different value to this variable: 1.5 gives 5 decimal digits, 1.0 gives no decimal digits. (Note for advanced users: the integer part of this number can be used to pad formatted number with spaces - 6.0 will give no decimal digits but a number space-padded upto 6 characters.)
Next two parameters allow to modify text and background color.

special format constants:

  • formatDateTime - produces date time formated according to your system settings
    AddColumn( DateTime(), "Date / Time", formatDateTime );

  • formatChar - allows outputting single ASCII character codes:
    Example (produces signal file accepted by various other programs):
    Buy=Cross(MACD(),Signal());
    Sell=Cross(Signal(), MACD());
    Filter=Buy OR Sell;
    SetOption("NoDefaultColumns", True );
    AddColumn( DateTime(), "Date", formatDateTime );
    AddColumn( IIf( Buy, 66, 83 ), "Signal", formatChar );
  • width parameter allows to control pixel width of the column
EXAMPLE 1. Simple column showing close price

addcolumn( Close, "Close price", 1.4 );

2. Colorful output

Filter =1;

AddColumn( Close, "Close", 1.2 );
AddColumn( MACD(), "MACD", 1.4 , IIf( MACD() > 0, colorGreen, colorRed ) );
AddTextColumn( FullName(), "Full name", 77 , colorDefault, IIf( Close < 10, colorLightBlue, colorDefault ) );

SEE ALSO ADDTEXTCOLUMN() function

References:

The AddColumn function is used in the following formulas in AFL on-line library:


 


About | Privacy | Terms of Use | Contact information
Copyright © 2003 AMIBROKER.COM