2021-10-27 21:16:16 +02:00
|
|
|
getPosition() Netscript Function
|
2019-03-03 04:08:54 +01:00
|
|
|
=====================================
|
|
|
|
|
2021-10-27 21:16:16 +02:00
|
|
|
.. js:function:: getPosition(sym)
|
2019-03-03 04:08:54 +01:00
|
|
|
|
|
|
|
:RAM cost: 2 GB
|
2021-03-12 08:51:56 +01:00
|
|
|
:param string sym: Stock symbol
|
|
|
|
|
2019-03-03 04:08:54 +01:00
|
|
|
|
|
|
|
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 <http://bitburner.wikia.com/wiki/Stock_Market#Positions:_Long_vs_Short>`_. 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 <http://bitburner.wikia.com/wiki/Stock_Market#Positions:_Long_vs_Short>`_. 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::
|
|
|
|
|
2021-10-27 21:16:16 +02:00
|
|
|
pos = getPosition("ECP");
|
2019-03-03 04:08:54 +01:00
|
|
|
shares = pos[0];
|
|
|
|
avgPx = pos[1];
|
|
|
|
sharesShort = pos[2];
|
|
|
|
avgPxShort = pos[3];
|