Files
bitburner-src/markdown/bitburner.stock.md
2025-10-14 11:51:54 -07:00

357 lines
5.0 KiB
Markdown
Raw Permalink 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; [Stock](./bitburner.stock.md)
## Stock interface
Stock market API
**Signature:**
```typescript
export interface Stock
```
## Methods
<table><thead><tr><th>
Method
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
[buyShort(sym, shares)](./bitburner.stock.buyshort.md)
</td><td>
Short stocks.
</td></tr>
<tr><td>
[buyStock(sym, shares)](./bitburner.stock.buystock.md)
</td><td>
Buy stocks.
</td></tr>
<tr><td>
[cancelOrder(sym, shares, price, orderType, positionType)](./bitburner.stock.cancelorder.md)
</td><td>
Cancel order for stocks.
</td></tr>
<tr><td>
[getAskPrice(sym)](./bitburner.stock.getaskprice.md)
</td><td>
Returns the ask price of that stock.
</td></tr>
<tr><td>
[getBidPrice(sym)](./bitburner.stock.getbidprice.md)
</td><td>
Returns the bid price of that stock.
</td></tr>
<tr><td>
[getBonusTime()](./bitburner.stock.getbonustime.md)
</td><td>
Get Stock Market bonus time.
</td></tr>
<tr><td>
[getConstants()](./bitburner.stock.getconstants.md)
</td><td>
Get game constants for the stock market mechanic.
</td></tr>
<tr><td>
[getForecast(sym)](./bitburner.stock.getforecast.md)
</td><td>
Returns the probability that the specified stocks price will increase (as opposed to decrease) during the next tick.
</td></tr>
<tr><td>
[getMaxShares(sym)](./bitburner.stock.getmaxshares.md)
</td><td>
Returns the maximum number of shares of a stock.
</td></tr>
<tr><td>
[getOrders()](./bitburner.stock.getorders.md)
</td><td>
Returns your order book for the stock market.
</td></tr>
<tr><td>
[getOrganization(sym)](./bitburner.stock.getorganization.md)
</td><td>
Returns the organization associated with a stock symbol.
</td></tr>
<tr><td>
[getPosition(sym)](./bitburner.stock.getposition.md)
</td><td>
Returns the players position in a stock.
</td></tr>
<tr><td>
[getPrice(sym)](./bitburner.stock.getprice.md)
</td><td>
Returns the price of a stock.
</td></tr>
<tr><td>
[getPurchaseCost(sym, shares, positionType)](./bitburner.stock.getpurchasecost.md)
</td><td>
Calculates cost of buying stocks.
</td></tr>
<tr><td>
[getSaleGain(sym, shares, positionType)](./bitburner.stock.getsalegain.md)
</td><td>
Calculate profit of selling stocks.
</td></tr>
<tr><td>
[getSymbols()](./bitburner.stock.getsymbols.md)
</td><td>
Returns an array of the symbols of the tradable stocks
</td></tr>
<tr><td>
[getVolatility(sym)](./bitburner.stock.getvolatility.md)
</td><td>
Returns the volatility of the specified stock.
</td></tr>
<tr><td>
[has4SData()](./bitburner.stock.has4sdata.md)
</td><td>
Returns true if the player has access to the 4S Data
</td></tr>
<tr><td>
[has4SDataTixApi()](./bitburner.stock.has4sdatatixapi.md)
</td><td>
Returns true if the player has access to the 4SData TIX API
</td></tr>
<tr><td>
[hasTixApiAccess()](./bitburner.stock.hastixapiaccess.md)
</td><td>
Returns true if the player has access to the TIX API
</td></tr>
<tr><td>
[hasWseAccount()](./bitburner.stock.haswseaccount.md)
</td><td>
Returns true if the player has access to a WSE Account
</td></tr>
<tr><td>
[nextUpdate()](./bitburner.stock.nextupdate.md)
</td><td>
Sleep until the next Stock Market price update has happened.
</td></tr>
<tr><td>
[placeOrder(sym, shares, price, orderType, positionType)](./bitburner.stock.placeorder.md)
</td><td>
Place order for stocks.
</td></tr>
<tr><td>
[purchase4SMarketData()](./bitburner.stock.purchase4smarketdata.md)
</td><td>
Purchase 4S Market Data UI access (UI only).
You need to have a WSE account. Note that this feature only unlocks access to 4S Market Data in the Stock Market UI. If you want to access 4S Market Data via NS APIs, you have to unlock "4S Market Data TIX API access" via [purchase4SMarketDataTixApi](./bitburner.stock.purchase4smarketdatatixapi.md)<!-- -->, which is unrelated to this feature.
</td></tr>
<tr><td>
[purchase4SMarketDataTixApi()](./bitburner.stock.purchase4smarketdatatixapi.md)
</td><td>
Purchase 4S Market Data TIX API access (NS APIs only).
You need to have TIX API access. Note that this feature only unlocks access to 4S Market Data via NS APIs.
</td></tr>
<tr><td>
[purchaseTixApi()](./bitburner.stock.purchasetixapi.md)
</td><td>
Purchase TIX API access.
You need to have TIX API access to perform actions via NS APIs. Note that you can buy TIX API access without a WSE account.
</td></tr>
<tr><td>
[purchaseWseAccount()](./bitburner.stock.purchasewseaccount.md)
</td><td>
Purchase a WSE account.
You need to have this account to perform actions via the Stock Market UI. Note that if you want to perform actions via NS APIs, you need to have TIX API access, not this account.
</td></tr>
<tr><td>
[sellShort(sym, shares)](./bitburner.stock.sellshort.md)
</td><td>
Sell short stock.
</td></tr>
<tr><td>
[sellStock(sym, shares)](./bitburner.stock.sellstock.md)
</td><td>
Sell stocks.
</td></tr>
</tbody></table>