- get ASCII code of character

String manipulation
(AmiBroker 4.80)

SYNTAX Asc( string, pos = 0 )
FUNCTION Returns the ANSI character code corresponding to the first letter in a string (if position is not specified) or code of character at specified position. If you don't specify position (pos argument) then first character is used. Negative values of pos reference characters counting from the end of string.

Useful for creation of exploration that displays single letters for signals instead of numbers.

EXAMPLE Buy = Cross(MACD(),Signal());
Sell = Cross(Signal(),MACD());

Filter = Buy OR Sell;

AddColumn( IIf( Buy, Asc("B"), Asc("S")), "Signal", formatChar );
SEE ALSO AddColumn() function


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

More information:

See updated/extended version on-line.