<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [Stock](./bitburner.stock.md) &gt; [getPosition](./bitburner.stock.getposition.md)

## Stock.getPosition() method

Returns the player’s position in a stock.

**Signature:**

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

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

sym


</td><td>

string


</td><td>

Stock symbol.


</td></tr>
</tbody></table>

**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 in 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


```js
const [sharesLong, avgLongPrice, sharesShort, avgShortPrice] = ns.stock.getPosition("ECP");
```

