# close()

ICE Data Services -

 close() Series Functions

The close() function is used to create a Series Object of the close prices or to retrieve individual close price values.

Syntax
close( [ nBarIndex][, sym() | inv()] )

Parameters
Parameter: Description:Default:
nBarIndex [Optional]  Number of bar index of series to retrieve

n/asym() or        inv() [Optional]  Function of sym() or inv() to determine source for close values.

n/a
Return Value(s)
Returns a Series Object when
nBarIndex is not specified.

Returns a single price value when nBarIndexis specified.

Notes
N/A

Code Examples
 ``function main() { //retrieve the value for the current price bar myVar = ``close``(``0``)``;```` //retrieve the value for the previous price bar myVar = ``close``(``-1``)``;```` //retrieve the current value for a specific symbol myVar = ``close``(``0``, ``sym("IBM") ``)``;```` //retrieve the current value for a specific symbol/interval myVar = ``close``(``0``, ``sym("IBM,5") ``)``;```` //retrieve the current value for a specific bar interval myVar = ``close``(``0``, ``inv(15)`` ``)``;```` //create a Series Object of the close prices. xClose = ``close``()``;```` //create a Series Object of the close prices for a specific symbol. xClose = ``close``(`` ``sym("IBM")`` ``)``;```` //create a Series Object of the close prices for a specific symbol/interval. xClose = ``close``(`` ``sym("IBM,5")`` ``)``;```` //create a Series Object of the close prices for a specific interval. xClose = ``close``(`` ``inv(15)`` ``)``; }``