bitburner-src/markdown/bitburner.tix.getposition.md
2021-10-30 16:03:34 -04:00

48 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [TIX](./bitburner.tix.md) &gt; [getPosition](./bitburner.tix.getposition.md)
## TIX.getPosition() method
Returns the players position in a stock.
<b>Signature:</b>
```typescript
getPosition(sym: StockSymbol): [number, number, number, number];
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| sym | [StockSymbol](./bitburner.stocksymbol.md) | Stock symbol. |
<b>Returns:</b>
\[number, number, number, number\]
Array of four elements that represents the players position in a stock.
## Remarks
RAM cost: 2 GB Returns an array of four elements that represents the players 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 players 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 players Short position.
All elements in the returned array are numeric.
## Example
```ts
pos = getPosition("ECP");
shares = pos[0];
avgPx = pos[1];
sharesShort = pos[2];
avgPxShort = pos[3];
```