mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-17 06:48:42 +02:00
v0.44.1 Minor Update - Added Augs to Duplicate Sleeves and updated documentation
This commit is contained in:
16
doc/source/netscript/tixapi/buyStock.rst
Normal file
16
doc/source/netscript/tixapi/buyStock.rst
Normal file
@@ -0,0 +1,16 @@
|
||||
buyStock() Netscript Function
|
||||
=============================
|
||||
|
||||
.. js:function:: buyStock(sym, shares)
|
||||
|
||||
:param string sym: Symbol of stock to purchase
|
||||
:param number shares: Number of shares to purchased. Must be positive. Will be rounded to nearest integer
|
||||
:RAM cost: 2.5 GB
|
||||
|
||||
Attempts to purchase shares of a stock using a `Market Order <http://bitburner.wikia.com/wiki/Stock_Market#Order_Types>`_.
|
||||
|
||||
If the player does not have enough money to purchase the specified number of shares, then no shares will be purchased. Remember
|
||||
that every transaction on the stock exchange costs a certain commission fee.
|
||||
|
||||
If this function successfully purchases the shares, it will return the stock price at which each share was purchased. Otherwise,
|
||||
it will return 0.
|
||||
24
doc/source/netscript/tixapi/cancelOrder.rst
Normal file
24
doc/source/netscript/tixapi/cancelOrder.rst
Normal file
@@ -0,0 +1,24 @@
|
||||
cancelOrder() Netscript Function
|
||||
================================
|
||||
|
||||
.. js:function:: cancelOrder(sym, shares, price, type, pos)
|
||||
|
||||
:param string sym: Symbol of stock to player order for
|
||||
:param number shares: Number of shares for order. Must be positive. Will be rounded to nearest integer
|
||||
:param number price: Execution price for the order
|
||||
:param string type: Type of order. It must specify "limit" or "stop", and must also specify "buy" or "sell". This is NOT
|
||||
case-sensitive. Here are four examples that will work:
|
||||
|
||||
* limitbuy
|
||||
* limitsell
|
||||
* stopbuy
|
||||
* stopsell
|
||||
|
||||
:param string pos:
|
||||
Specifies whether the order is a "Long" or "Short" position. The Values "L" or "S" can also be used. This is
|
||||
NOT case-sensitive.
|
||||
:RAM cost: 2.5 GB
|
||||
|
||||
Cancels an oustanding Limit or Stop order on the stock market.
|
||||
|
||||
The ability to use limit and stop orders is **not** immediately available to the player and must be unlocked later on in the game.
|
||||
68
doc/source/netscript/tixapi/getOrders.rst
Normal file
68
doc/source/netscript/tixapi/getOrders.rst
Normal file
@@ -0,0 +1,68 @@
|
||||
getOrders() Netscript Function
|
||||
==============================
|
||||
|
||||
.. js:function:: getOrders()
|
||||
|
||||
:RAM cost: 2.5 GB
|
||||
|
||||
Returns your order book for the stock market. This is an object containing information
|
||||
for all the Limit and Stop Orders you have in the stock market.
|
||||
|
||||
The object has the following structure::
|
||||
|
||||
{
|
||||
StockSymbol1: [ // Array of orders for this stock
|
||||
{
|
||||
shares: Order quantity
|
||||
price: Order price
|
||||
type: Order type
|
||||
position: Either "L" or "S" for Long or Short position
|
||||
},
|
||||
{
|
||||
...
|
||||
},
|
||||
...
|
||||
],
|
||||
StockSymbol2: [ // Array of orders for this stock
|
||||
...
|
||||
],
|
||||
...
|
||||
}
|
||||
|
||||
The "Order type" property can have one of the following four values:
|
||||
|
||||
* "Limit Buy Order"
|
||||
* "Limit Sell Order"
|
||||
* "Stop Buy Order"
|
||||
* "Stop Sell Order"
|
||||
|
||||
**Note that the order book will only contain information for stocks that you actually
|
||||
have orders in**. For example, if you do not have orders in Nova Medical (NVMD), then the returned
|
||||
object will not have a "NVMD" property.
|
||||
|
||||
Example::
|
||||
|
||||
{
|
||||
ECP: [
|
||||
{
|
||||
shares: 5,
|
||||
price: 100,000
|
||||
type: "Stop Buy Order",
|
||||
position: "S",
|
||||
},
|
||||
{
|
||||
shares: 25,
|
||||
price: 125,000
|
||||
type: "Limit Sell Order",
|
||||
position: "L",
|
||||
},
|
||||
],
|
||||
SYSC: [
|
||||
{
|
||||
shares: 100,
|
||||
price: 10,000
|
||||
type: "Limit Buy Order",
|
||||
position: "L",
|
||||
},
|
||||
],
|
||||
}
|
||||
21
doc/source/netscript/tixapi/getStockForecast.rst
Normal file
21
doc/source/netscript/tixapi/getStockForecast.rst
Normal file
@@ -0,0 +1,21 @@
|
||||
getStockForecast() Netscript Function
|
||||
=====================================
|
||||
|
||||
.. js:function:: getStockForecast(sym)
|
||||
|
||||
:param string sym: Symbol of stock
|
||||
:RAM cost: 2.5 GB
|
||||
|
||||
Returns the probability that the specified stock's price will increase
|
||||
(as opposed to decrease) during the next tick.
|
||||
|
||||
The probability is returned as a decimal value, NOT a percentage (e.g. if a
|
||||
stock has a 60% chance of increasing, then this function will return 0.6,
|
||||
NOT 60).
|
||||
|
||||
In other words, if this function returned 0.30 for a stock, then this means
|
||||
that the stock's price has a 30% chance of increasing and a 70% chance of
|
||||
decreasing during the next tick.
|
||||
|
||||
In order to use this function, you must first purchase access to the Four Sigma (4S)
|
||||
Market Data TIX API.
|
||||
11
doc/source/netscript/tixapi/getStockMaxShares.rst
Normal file
11
doc/source/netscript/tixapi/getStockMaxShares.rst
Normal file
@@ -0,0 +1,11 @@
|
||||
getStockMaxShares() Netscript Function
|
||||
======================================
|
||||
|
||||
.. js:function:: getStockMaxShares(sym)
|
||||
|
||||
:param string sym: Stock symbol
|
||||
:RAM cost: 2 GB
|
||||
|
||||
Returns the maximum number of shares that the stock has. This is the maximum
|
||||
amount of the stock that can be purchased in both the Long and Short
|
||||
positions combined
|
||||
27
doc/source/netscript/tixapi/getStockPosition.rst
Normal file
27
doc/source/netscript/tixapi/getStockPosition.rst
Normal file
@@ -0,0 +1,27 @@
|
||||
getStockPosition() Netscript Function
|
||||
=====================================
|
||||
|
||||
.. js:function:: getStockPosition(sym)
|
||||
|
||||
:param string sym: Stock symbol
|
||||
: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 <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::
|
||||
|
||||
pos = getStockPosition("ECP");
|
||||
shares = pos[0];
|
||||
avgPx = pos[1];
|
||||
sharesShort = pos[2];
|
||||
avgPxShort = pos[3];
|
||||
14
doc/source/netscript/tixapi/getStockPrice.rst
Normal file
14
doc/source/netscript/tixapi/getStockPrice.rst
Normal file
@@ -0,0 +1,14 @@
|
||||
getStockPrice() Netscript Function
|
||||
==================================
|
||||
|
||||
.. js:function:: getStockPrice(sym)
|
||||
|
||||
:param string sym: Stock symbol
|
||||
:RAM cost: 2 GB
|
||||
|
||||
Returns the price of a stock, given its symbol (NOT the company name). The symbol is a sequence
|
||||
of two to four capital letters.
|
||||
|
||||
Example::
|
||||
|
||||
getStockPrice("FISG");
|
||||
8
doc/source/netscript/tixapi/getStockSymbols.rst
Normal file
8
doc/source/netscript/tixapi/getStockSymbols.rst
Normal file
@@ -0,0 +1,8 @@
|
||||
getStockSymbols() Netscript Function()
|
||||
======================================
|
||||
|
||||
.. js:function:: getStockSymbols()
|
||||
|
||||
:RAM cost: 2 GB
|
||||
|
||||
Returns an array of the symbols of the tradable stocks
|
||||
17
doc/source/netscript/tixapi/getStockVolatility.rst
Normal file
17
doc/source/netscript/tixapi/getStockVolatility.rst
Normal file
@@ -0,0 +1,17 @@
|
||||
getStockVolatility() Netscript Function
|
||||
=======================================
|
||||
|
||||
.. js:function:: getStockVolatility(sym)
|
||||
|
||||
:param string sym: Symbol of stock
|
||||
:RAM cost: 2.5 GB
|
||||
|
||||
Returns the volatility of the specified stock.
|
||||
|
||||
Volatility represents the maximum percentage by which a stock's price can
|
||||
change every tick. The volatility is returned as a decimal value, NOT
|
||||
a percentage (e.g. if a stock has a volatility of 3%, then this function will
|
||||
return 0.03, NOT 3).
|
||||
|
||||
In order to use this function, you must first purchase access to the Four Sigma (4S)
|
||||
Market Data TIX API.
|
||||
26
doc/source/netscript/tixapi/placeOrder.rst
Normal file
26
doc/source/netscript/tixapi/placeOrder.rst
Normal file
@@ -0,0 +1,26 @@
|
||||
placeOrder() Netscript Function
|
||||
===============================
|
||||
|
||||
.. js:function:: placeOrder(sym, shares, price, type, pos)
|
||||
|
||||
:param string sym: Symbol of stock to player order for
|
||||
:param number shares: Number of shares for order. Must be positive. Will be rounded to nearest integer
|
||||
:param number price: Execution price for the order
|
||||
:param string type: Type of order. It must specify "limit" or "stop", and must also specify "buy" or "sell". This is NOT
|
||||
case-sensitive. Here are four examples that will work:
|
||||
|
||||
* limitbuy
|
||||
* limitsell
|
||||
* stopbuy
|
||||
* stopsell
|
||||
|
||||
:param string pos:
|
||||
Specifies whether the order is a "Long" or "Short" position. The Values "L" or "S" can also be used. This is
|
||||
NOT case-sensitive.
|
||||
:RAM cost: 2.5 GB
|
||||
|
||||
Places an order on the stock market. This function only works for `Limit and Stop Orders <http://bitburner.wikia.com/wiki/Stock_Market#Order_Types>`_.
|
||||
|
||||
The ability to place limit and stop orders is **not** immediately available to the player and must be unlocked later on in the game.
|
||||
|
||||
Returns true if the order is successfully placed, and false otherwise.
|
||||
11
doc/source/netscript/tixapi/purchase4SMarketData.rst
Normal file
11
doc/source/netscript/tixapi/purchase4SMarketData.rst
Normal file
@@ -0,0 +1,11 @@
|
||||
purchase4SMarketData() Netscript Function
|
||||
=========================================
|
||||
|
||||
.. js:function:: purchase4SMarketData()
|
||||
|
||||
:RAM cost: 2.5 GB
|
||||
|
||||
Purchase 4S Market Data Access.
|
||||
|
||||
Returns true if you successfully purchased it or if you already have access.
|
||||
Returns false otherwise.
|
||||
11
doc/source/netscript/tixapi/purchase4SMarketDataTixApi.rst
Normal file
11
doc/source/netscript/tixapi/purchase4SMarketDataTixApi.rst
Normal file
@@ -0,0 +1,11 @@
|
||||
purchase4SMarketDataTixApi() Netscript Function
|
||||
===============================================
|
||||
|
||||
.. js:function:: purchase4SMarketDataTixApi()
|
||||
|
||||
:RAM cost: 2.5 GB
|
||||
|
||||
Purchase 4S Market Data TIX API Access.
|
||||
|
||||
Returns true if you successfully purchased it or if you already have access.
|
||||
Returns false otherwise.
|
||||
18
doc/source/netscript/tixapi/sellShort.rst
Normal file
18
doc/source/netscript/tixapi/sellShort.rst
Normal file
@@ -0,0 +1,18 @@
|
||||
sellShort() Netscript Function
|
||||
==============================
|
||||
|
||||
.. js:function:: sellShort(sym, shares)
|
||||
|
||||
:param string sym: Symbol of stock to sell
|
||||
:param number shares: Number of shares to sell. Must be positive. Will be rounded to nearest integer
|
||||
:RAM cost: 2.5 GB
|
||||
|
||||
Attempts to sell a `short <http://bitburner.wikia.com/wiki/Stock_Market#Positions:_Long_vs_Short>`_ position of a stock
|
||||
using a `Market Order <http://bitburner.wikia.com/wiki/Stock_Market#Order_Types>`_.
|
||||
|
||||
The ability to short a stock is **not** immediately available to the player and must be unlocked later on in the game.
|
||||
|
||||
If the specified number of shares exceeds the amount that the player actually owns, then this function will sell all owned
|
||||
shares. Remember that every transaction on the stock exchange costs a certain commission fee.
|
||||
|
||||
If the sale is successful, this function will return the stock price at which each share was sold. Otherwise it will return 0.
|
||||
20
doc/source/netscript/tixapi/sellStock.rst
Normal file
20
doc/source/netscript/tixapi/sellStock.rst
Normal file
@@ -0,0 +1,20 @@
|
||||
sellStock() Netscript Function
|
||||
==============================
|
||||
|
||||
.. js:function:: sellStock(sym, shares)
|
||||
|
||||
:param string sym: Symbol of stock to sell
|
||||
:param number shares: Number of shares to sell. Must be positive. Will be rounded to nearest integer
|
||||
:RAM cost: 2.5 GB
|
||||
|
||||
Attempts to sell shares of a stock using a `Market Order <http://bitburner.wikia.com/wiki/Stock_Market#Order_Types>`_.
|
||||
|
||||
If the specified number of shares in the function exceeds the amount that the player actually owns, then this function will
|
||||
sell all owned shares. Remember that every transaction on the stock exchange costs a certain commission fee.
|
||||
|
||||
The net profit made from selling stocks with this function is reflected in the script's statistics.
|
||||
This net profit is calculated as::
|
||||
|
||||
shares * (sell price - average price of purchased shares)
|
||||
|
||||
If the sale is successful, this function will return the stock price at which each share was sold. Otherwise, it will return 0.
|
||||
18
doc/source/netscript/tixapi/shortStock.rst
Normal file
18
doc/source/netscript/tixapi/shortStock.rst
Normal file
@@ -0,0 +1,18 @@
|
||||
shortStock() Netscript Function
|
||||
===============================
|
||||
|
||||
.. js:function:: shortStock(sym, shares)
|
||||
|
||||
:param string sym: Symbol of stock to short
|
||||
:param number shares: Number of shares to short. Must be positive. Will be rounded to nearest integer
|
||||
:RAM cost: 2.5 GB
|
||||
|
||||
Attempts to purchase a `short <http://bitburner.wikia.com/wiki/Stock_Market#Positions:_Long_vs_Short>`_ position of a stock
|
||||
using a `Market Order <http://bitburner.wikia.com/wiki/Stock_Market#Order_Types>`_.
|
||||
|
||||
The ability to short a stock is **not** immediately available to the player and must be unlocked later on in the game.
|
||||
|
||||
If the player does not have enough money to purchase the specified number of shares, then no shares will be purchased.
|
||||
Remember that every transaction on the stock exchange costs a certain commission fee.
|
||||
|
||||
If the purchase is successful, this function will return the stock price at which each share was purchased. Otherwise, it will return 0.
|
||||
Reference in New Issue
Block a user