Skip to content

Latest commit

 

History

History
47 lines (28 loc) · 1.31 KB

bitburner.tix.getposition.md

File metadata and controls

47 lines (28 loc) · 1.31 KB

Home > bitburner > TIX > getPosition

TIX.getPosition() method

Returns the player’s position in a stock.

Signature:

getPosition(sym: string): [number, number, number, number];

Parameters

Parameter Type Description
sym string Stock symbol.

Returns:

[number, number, number, number]

Array of four elements that represents the player’s position in a stock.

Remarks

RAM cost: 2 GB Returns an array of four elements that represents the player’s position in a stock.

The first element is the returned array is the number of shares the player owns of the stock in the Long position. The second element in the array is the average price of the player’s shares in the Long position.

The third element in the array is the number of shares the player owns of the stock in the Short position. The fourth element in the array is the average price of the player’s Short position.

All elements in the returned array are numeric.

Example

pos = getPosition("ECP");
shares      = pos[0];
avgPx       = pos[1];
sharesShort = pos[2];
avgPxShort  = pos[3];