mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-09 17:23:53 +01:00
documentation
This commit is contained in:
parent
01dcf3c64f
commit
9b0726ca9a
83
dist/bitburner.d.ts
vendored
83
dist/bitburner.d.ts
vendored
@ -4448,42 +4448,43 @@ export declare interface TIX {
|
||||
getSymbols(): StockSymbol[];
|
||||
|
||||
/**
|
||||
* Returns the price of a stock, given its symbol (NOT the company name).
|
||||
* The symbol is a sequence of two to four capital letters.
|
||||
* Returns the price of a stock
|
||||
*
|
||||
* The stock’s price is the average of its bid and ask price
|
||||
* @remarks
|
||||
* RAM cost: 2 GB
|
||||
* The stock’s price is the average of its bid and ask price.
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* getPrice("FISG");
|
||||
* ```
|
||||
* @remarks RAM cost: 2 GB
|
||||
* @param sym - Stock symbol.
|
||||
* @returns The price of a stock.
|
||||
*/
|
||||
getPrice(sym: StockSymbol): number;
|
||||
|
||||
/**
|
||||
* Given a stock’s symbol (NOT the company name), returns the ask price of that stock.
|
||||
* The symbol is a sequence of two to four capital letters.
|
||||
*
|
||||
* Returns the ask price of that stock.
|
||||
* @remarks RAM cost: 2 GB
|
||||
*
|
||||
* @param sym - Stock symbol.
|
||||
* @returns The ask price of a stock.
|
||||
*/
|
||||
getAskPrice(sym: StockSymbol): number;
|
||||
|
||||
/**
|
||||
* Given a stock’s symbol (NOT the company name), returns the bid price of that stock.
|
||||
* The symbol is a sequence of two to four capital letters.
|
||||
*
|
||||
* Returns the bid price of that stock.
|
||||
* @remarks RAM cost: 2 GB
|
||||
*
|
||||
* @param sym - Stock symbol.
|
||||
* @returns The bid price of a stock.
|
||||
*/
|
||||
getBidPrice(sym: StockSymbol): number;
|
||||
|
||||
/**
|
||||
* Returns 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 is the returned array is the number of shares the player owns of
|
||||
@ -4504,28 +4505,30 @@ export declare interface TIX {
|
||||
* sharesShort = pos[2];
|
||||
* avgPxShort = pos[3];
|
||||
* ```
|
||||
* @remarks RAM cost: 2 GB
|
||||
* @param sym - Stock symbol.
|
||||
* @returns Array of four elements that represents the player’s position in a stock.
|
||||
*/
|
||||
getPosition(sym: StockSymbol): [number, number, number, number];
|
||||
|
||||
/**
|
||||
* Returns the maximum number of shares that the stock has.
|
||||
* Returns the maximum number of shares of a stock.
|
||||
* @remarks
|
||||
* RAM cost: 2 GB
|
||||
* This is the maximum amount of the stock that can be purchased
|
||||
* in both the Long and Short positions combined.
|
||||
*
|
||||
* @remarks RAM cost: 2 GB
|
||||
* @param sym - Stock symbol.
|
||||
* @returns Maximum number of shares that the stock has.
|
||||
*/
|
||||
getMaxShares(sym: StockSymbol): number;
|
||||
|
||||
/**
|
||||
* Calculates cost of buying stocks.
|
||||
* @remarks
|
||||
* RAM cost: 2 GB
|
||||
* Calculates and returns how much it would cost to buy a given number of shares of a stock.
|
||||
* This takes into account spread, large transactions influencing the price of the stock and commission fees.
|
||||
*
|
||||
* @remarks RAM cost: 2 GB
|
||||
* @param sym - Stock symbol.
|
||||
* @param shares - Number of shares to purchase.
|
||||
* @param posType - Specifies whether the order is a “Long” or “Short” position.
|
||||
@ -4534,10 +4537,12 @@ export declare interface TIX {
|
||||
getPurchaseCost(sym: StockSymbol, shares: number, posType: OrderPosition): number;
|
||||
|
||||
/**
|
||||
* Calculate profit of setting stocks.
|
||||
* @remarks
|
||||
* RAM cost: 2 GB
|
||||
* Calculates and returns how much you would gain from selling a given number of shares of a stock.
|
||||
* This takes into account spread, large transactions influencing the price of the stock and commission fees.
|
||||
*
|
||||
* @remarks RAM cost: 2 GB
|
||||
* @param sym - Stock symbol.
|
||||
* @param shares - Number of shares to sell.
|
||||
* @param posType - Specifies whether the order is a “Long” or “Short” position.
|
||||
@ -4546,6 +4551,9 @@ export declare interface TIX {
|
||||
getSaleGain(sym: StockSymbol, shares: number, posType: OrderPosition): number;
|
||||
|
||||
/**
|
||||
* Buy stocks.
|
||||
* @remarks
|
||||
* RAM cost: 2.5 GB
|
||||
* Attempts to purchase shares of a stock using a Market Order.
|
||||
*
|
||||
* If the player does not have enough money to purchase the specified number of shares,
|
||||
@ -4555,7 +4563,6 @@ export declare interface TIX {
|
||||
* If this function successfully purchases the shares, it will return the stock price at which
|
||||
* each share was purchased. Otherwise, it will return 0.
|
||||
*
|
||||
* @remarks RAM cost: 2.5 GB
|
||||
* @param sym - Stock symbol.
|
||||
* @param shares - Number of shares to purchased. Must be positive. Will be rounded to nearest integer.
|
||||
* @returns The stock price at which each share was purchased, otherwise 0 if the shares weren't purchased.
|
||||
@ -4563,6 +4570,9 @@ export declare interface TIX {
|
||||
buy(sym: StockSymbol, shares: number): number;
|
||||
|
||||
/**
|
||||
* Sell stocks.
|
||||
* @remarks
|
||||
* RAM cost: 2.5 GB
|
||||
* Attempts to sell shares of a stock using a Market Order.
|
||||
*
|
||||
* If the specified number of shares in the function exceeds the amount that the player
|
||||
@ -4577,7 +4587,6 @@ export declare interface TIX {
|
||||
* If the sale is successful, this function will return the stock price at
|
||||
* which each share was sold. Otherwise, it will return 0.
|
||||
*
|
||||
* @remarks RAM cost: 2.5 GB
|
||||
* @param sym - Stock symbol.
|
||||
* @param shares - Number of shares to sell. Must be positive. Will be rounded to nearest integer.
|
||||
* @returns The stock price at which each share was sold, otherwise 0 if the shares weren't sold.
|
||||
@ -4585,6 +4594,9 @@ export declare interface TIX {
|
||||
sell(sym: StockSymbol, shares: number): number;
|
||||
|
||||
/**
|
||||
* Short stocks.
|
||||
* @remarks
|
||||
* RAM cost: 2.5 GB
|
||||
* Attempts to purchase a short position of a stock using a Market Order.
|
||||
*
|
||||
* The ability to short a stock is **not** immediately available to the player and
|
||||
@ -4597,7 +4609,6 @@ export declare interface TIX {
|
||||
* If the purchase is successful, this function will return the stock price at which each
|
||||
* share was purchased. Otherwise, it will return 0.
|
||||
*
|
||||
* @remarks RAM cost: 2.5 GB
|
||||
* @param sym - Stock symbol.
|
||||
* @param shares - Number of shares to short. Must be positive. Will be rounded to nearest integer.
|
||||
* @returns The stock price at which each share was purchased, otherwise 0 if the shares weren't purchased.
|
||||
@ -4605,6 +4616,9 @@ export declare interface TIX {
|
||||
short(sym: StockSymbol, shares: number): number;
|
||||
|
||||
/**
|
||||
* Sell short stock.
|
||||
* @remarks
|
||||
* RAM cost: 2.5 GB
|
||||
* Attempts to sell a short position of a stock using a Market Order.
|
||||
*
|
||||
* The ability to short a stock is **not** immediately available to the player and
|
||||
@ -4617,7 +4631,6 @@ export declare interface TIX {
|
||||
* If the sale is successful, this function will return the stock price at which each
|
||||
* share was sold. Otherwise it will return 0.
|
||||
*
|
||||
* @remarks RAM cost: 2.5 GB
|
||||
* @param sym - Stock symbol.
|
||||
* @param shares - Number of shares to sell. Must be positive. Will be rounded to nearest integer.
|
||||
* @returns The stock price at which each share was sold, otherwise 0 if the shares weren't sold.
|
||||
@ -4625,6 +4638,9 @@ export declare interface TIX {
|
||||
sellShort(sym: StockSymbol, shares: number): number;
|
||||
|
||||
/**
|
||||
* Place order for stocks.
|
||||
* @remarks
|
||||
* RAM cost: 2.5 GB
|
||||
* Places an order on the stock market. This function only works for Limit and Stop Orders.
|
||||
*
|
||||
* The ability to place limit and stop orders is **not** immediately available to the player and
|
||||
@ -4632,7 +4648,6 @@ export declare interface TIX {
|
||||
*
|
||||
* Returns true if the order is successfully placed, and false otherwise.
|
||||
*
|
||||
* @remarks RAM cost: 2.5 GB
|
||||
* @param sym - Stock symbol.
|
||||
* @param shares - Number of shares for order. Must be positive. Will be rounded to nearest integer.
|
||||
* @param price - Execution price for the order.
|
||||
@ -4643,12 +4658,14 @@ export declare interface TIX {
|
||||
placeOrder(sym: StockSymbol, shares: number, price: number, type: OrderType, pos: OrderPosition): boolean;
|
||||
|
||||
/**
|
||||
* Cancel order for stocks.
|
||||
* @remarks
|
||||
* 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.
|
||||
*
|
||||
* @remarks RAM cost: 2.5 GB
|
||||
* @param sym - Stock symbol.
|
||||
* @param shares - Number of shares for order. Must be positive. Will be rounded to nearest integer.
|
||||
* @param price - Execution price for the order.
|
||||
@ -4659,7 +4676,8 @@ export declare interface TIX {
|
||||
|
||||
/**
|
||||
* Returns your order book for the stock market.
|
||||
*
|
||||
* @remarks
|
||||
* RAM cost: 2.5 GB
|
||||
* 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:
|
||||
*
|
||||
@ -4683,11 +4701,7 @@ export declare interface TIX {
|
||||
* ...
|
||||
* }
|
||||
* ```
|
||||
* The “Order type” property can have one of the following four values:
|
||||
* * “Limit Buy Order”
|
||||
* * “Limit Sell Order”
|
||||
* * “Stop Buy Order”
|
||||
* * “Stop Sell Order”
|
||||
* 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.
|
||||
*
|
||||
* @example
|
||||
@ -4718,21 +4732,20 @@ export declare interface TIX {
|
||||
* ],
|
||||
* }
|
||||
* ```
|
||||
* @remarks RAM cost: 2.5 GB
|
||||
* @returns Object containing information for all the Limit and Stop Orders you have in the stock market.
|
||||
*/
|
||||
getOrders(): StockOrder;
|
||||
|
||||
/**
|
||||
* Returns the volatility of the specified stock.
|
||||
*
|
||||
* @remarks
|
||||
* RAM cost: 2.5 GB
|
||||
* 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.
|
||||
*
|
||||
* @remarks RAM cost: 2.5 GB
|
||||
* @param sym - Stock symbol.
|
||||
* @returns Volatility of the specified stock.
|
||||
*/
|
||||
@ -4740,7 +4753,8 @@ export declare interface TIX {
|
||||
|
||||
/**
|
||||
* Returns the probability that the specified stock’s price will increase (as opposed to decrease) during the next tick.
|
||||
*
|
||||
* @remarks
|
||||
* RAM cost: 2.5 GB
|
||||
* 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).
|
||||
*
|
||||
@ -4749,7 +4763,6 @@ export declare interface TIX {
|
||||
*
|
||||
* In order to use this function, you must first purchase access to the Four Sigma (4S) Market Data TIX API.
|
||||
*
|
||||
* @remarks RAM cost: 2.5 GB
|
||||
* @param sym - Stock symbol.
|
||||
* @returns Probability that the specified stock’s price will increase (as opposed to decrease) during the next tick.
|
||||
*/
|
||||
@ -4757,9 +4770,6 @@ export declare interface TIX {
|
||||
|
||||
/**
|
||||
* Purchase 4S Market Data Access.
|
||||
*
|
||||
* Returns true if you successfully purchased it or if you already have access. Returns false otherwise.
|
||||
*
|
||||
* @remarks RAM cost: 2.5 GB
|
||||
* @returns True if you successfully purchased it or if you already have access, false otherwise.
|
||||
*/
|
||||
@ -4767,9 +4777,6 @@ export declare interface TIX {
|
||||
|
||||
/**
|
||||
* Purchase 4S Market Data TIX API Access.
|
||||
*
|
||||
* Returns true if you successfully purchased it or if you already have access. Returns false otherwise.
|
||||
*
|
||||
* @remarks RAM cost: 2.5 GB
|
||||
* @returns True if you successfully purchased it or if you already have access, false otherwise.
|
||||
*/
|
||||
|
@ -19462,7 +19462,7 @@
|
||||
"excerptTokens": [
|
||||
{
|
||||
"kind": "Content",
|
||||
"text": "interface TIX "
|
||||
"text": "export interface TIX "
|
||||
}
|
||||
],
|
||||
"releaseTag": "Public",
|
||||
@ -19471,7 +19471,7 @@
|
||||
{
|
||||
"kind": "MethodSignature",
|
||||
"canonicalReference": "bitburner!TIX#buy:member(1)",
|
||||
"docComment": "/**\n * Attempts to purchase shares of a stock using a Market Order.\n *\n * 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.\n *\n * If this function successfully purchases the shares, it will return the stock price at which each share was purchased. Otherwise, it will return 0.\n *\n * @remarks\n *\n * RAM cost: 2.5 GB\n *\n * @param sym - Stock symbol.\n *\n * @param shares - Number of shares to purchased. Must be positive. Will be rounded to nearest integer.\n *\n * @returns The stock price at which each share was purchased, otherwise 0 if the shares weren't purchased.\n */\n",
|
||||
"docComment": "/**\n * Buy stocks.\n *\n * @remarks\n *\n * RAM cost: 2.5 GB Attempts to purchase shares of a stock using a Market Order.\n *\n * 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.\n *\n * If this function successfully purchases the shares, it will return the stock price at which each share was purchased. Otherwise, it will return 0.\n *\n * @param sym - Stock symbol.\n *\n * @param shares - Number of shares to purchased. Must be positive. Will be rounded to nearest integer.\n *\n * @returns The stock price at which each share was purchased, otherwise 0 if the shares weren't purchased.\n */\n",
|
||||
"excerptTokens": [
|
||||
{
|
||||
"kind": "Content",
|
||||
@ -19531,7 +19531,7 @@
|
||||
{
|
||||
"kind": "MethodSignature",
|
||||
"canonicalReference": "bitburner!TIX#cancelOrder:member(1)",
|
||||
"docComment": "/**\n * Cancels an oustanding Limit or Stop order on the stock market.\n *\n * The ability to use limit and stop orders is **not** immediately available to the player and must be unlocked later on in the game.\n *\n * @remarks\n *\n * RAM cost: 2.5 GB\n *\n * @param sym - Stock symbol.\n *\n * @param shares - Number of shares for order. Must be positive. Will be rounded to nearest integer.\n *\n * @param price - Execution price for the order.\n *\n * @param type - Type of order.\n *\n * @param pos - Specifies whether the order is a “Long” or “Short” position.\n */\n",
|
||||
"docComment": "/**\n * Cancel order for stocks.\n *\n * @remarks\n *\n * RAM cost: 2.5 GB Cancels an oustanding Limit or Stop order on the stock market.\n *\n * The ability to use limit and stop orders is **not** immediately available to the player and must be unlocked later on in the game.\n *\n * @param sym - Stock symbol.\n *\n * @param shares - Number of shares for order. Must be positive. Will be rounded to nearest integer.\n *\n * @param price - Execution price for the order.\n *\n * @param type - Type of order.\n *\n * @param pos - Specifies whether the order is a “Long” or “Short” position.\n */\n",
|
||||
"excerptTokens": [
|
||||
{
|
||||
"kind": "Content",
|
||||
@ -19638,7 +19638,7 @@
|
||||
{
|
||||
"kind": "MethodSignature",
|
||||
"canonicalReference": "bitburner!TIX#getAskPrice:member(1)",
|
||||
"docComment": "/**\n * Given a stock’s symbol (NOT the company name), returns the ask price of that stock. The symbol is a sequence of two to four capital letters.\n *\n * @remarks\n *\n * RAM cost: 2 GB\n *\n * @param sym - Stock symbol.\n *\n * @returns The ask price of a stock.\n */\n",
|
||||
"docComment": "/**\n * Returns the ask price of that stock.\n *\n * @remarks\n *\n * RAM cost: 2 GB\n *\n * @param sym - Stock symbol.\n *\n * @returns The ask price of a stock.\n */\n",
|
||||
"excerptTokens": [
|
||||
{
|
||||
"kind": "Content",
|
||||
@ -19683,7 +19683,7 @@
|
||||
{
|
||||
"kind": "MethodSignature",
|
||||
"canonicalReference": "bitburner!TIX#getBidPrice:member(1)",
|
||||
"docComment": "/**\n * Given a stock’s symbol (NOT the company name), returns the bid price of that stock. The symbol is a sequence of two to four capital letters.\n *\n * @remarks\n *\n * RAM cost: 2 GB\n *\n * @param sym - Stock symbol.\n *\n * @returns The bid price of a stock.\n */\n",
|
||||
"docComment": "/**\n * Returns the bid price of that stock.\n *\n * @remarks\n *\n * RAM cost: 2 GB\n *\n * @param sym - Stock symbol.\n *\n * @returns The bid price of a stock.\n */\n",
|
||||
"excerptTokens": [
|
||||
{
|
||||
"kind": "Content",
|
||||
@ -19728,7 +19728,7 @@
|
||||
{
|
||||
"kind": "MethodSignature",
|
||||
"canonicalReference": "bitburner!TIX#getForecast:member(1)",
|
||||
"docComment": "/**\n * Returns the probability that the specified stock’s price will increase (as opposed to decrease) during the next tick.\n *\n * 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).\n *\n * 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.\n *\n * In order to use this function, you must first purchase access to the Four Sigma (4S) Market Data TIX API.\n *\n * @remarks\n *\n * RAM cost: 2.5 GB\n *\n * @param sym - Stock symbol.\n *\n * @returns Probability that the specified stock’s price will increase (as opposed to decrease) during the next tick.\n */\n",
|
||||
"docComment": "/**\n * Returns the probability that the specified stock’s price will increase (as opposed to decrease) during the next tick.\n *\n * @remarks\n *\n * RAM cost: 2.5 GB 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).\n *\n * 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.\n *\n * In order to use this function, you must first purchase access to the Four Sigma (4S) Market Data TIX API.\n *\n * @param sym - Stock symbol.\n *\n * @returns Probability that the specified stock’s price will increase (as opposed to decrease) during the next tick.\n */\n",
|
||||
"excerptTokens": [
|
||||
{
|
||||
"kind": "Content",
|
||||
@ -19773,7 +19773,7 @@
|
||||
{
|
||||
"kind": "MethodSignature",
|
||||
"canonicalReference": "bitburner!TIX#getMaxShares:member(1)",
|
||||
"docComment": "/**\n * 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.\n *\n * @remarks\n *\n * RAM cost: 2 GB\n *\n * @param sym - Stock symbol.\n *\n * @returns Maximum number of shares that the stock has.\n */\n",
|
||||
"docComment": "/**\n * Returns the maximum number of shares of a stock.\n *\n * @remarks\n *\n * RAM cost: 2 GB This is the maximum amount of the stock that can be purchased in both the Long and Short positions combined.\n *\n * @param sym - Stock symbol.\n *\n * @returns Maximum number of shares that the stock has.\n */\n",
|
||||
"excerptTokens": [
|
||||
{
|
||||
"kind": "Content",
|
||||
@ -19818,7 +19818,7 @@
|
||||
{
|
||||
"kind": "MethodSignature",
|
||||
"canonicalReference": "bitburner!TIX#getOrders:member(1)",
|
||||
"docComment": "/**\n * Returns your order book for the stock market.\n *\n * 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:\n * ```ts\n * {\n * StockSymbol1: [ // Array of orders for this stock\n * {\n * shares: Order quantity\n * price: Order price\n * type: Order type\n * position: Either \"L\" or \"S\" for Long or Short position\n * },\n * {\n * ...\n * },\n * ...\n * ],\n * StockSymbol2: [ // Array of orders for this stock\n * ...\n * ],\n * ...\n * }\n * ```\n *\n * 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.\n *\n * @remarks\n *\n * RAM cost: 2.5 GB\n *\n * @returns Object containing information for all the Limit and Stop Orders you have in the stock market.\n *\n * @example\n * ```ts\n * \"If you do not have orders in Nova Medical (NVMD), then the returned object will not have a “NVMD” property.\"\n * {\n * ECP: [\n * {\n * shares: 5,\n * price: 100,000\n * type: \"Stop Buy Order\",\n * position: \"S\",\n * },\n * {\n * shares: 25,\n * price: 125,000\n * type: \"Limit Sell Order\",\n * position: \"L\",\n * },\n * ],\n * SYSC: [\n * {\n * shares: 100,\n * price: 10,000\n * type: \"Limit Buy Order\",\n * position: \"L\",\n * },\n * ],\n * }\n * ```\n *\n */\n",
|
||||
"docComment": "/**\n * Returns your order book for the stock market.\n *\n * @remarks\n *\n * RAM cost: 2.5 GB 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:\n * ```ts\n * {\n * StockSymbol1: [ // Array of orders for this stock\n * {\n * shares: Order quantity\n * price: Order price\n * type: Order type\n * position: Either \"L\" or \"S\" for Long or Short position\n * },\n * {\n * ...\n * },\n * ...\n * ],\n * StockSymbol2: [ // Array of orders for this stock\n * ...\n * ],\n * ...\n * }\n * ```\n *\n * 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.\n *\n * @returns Object containing information for all the Limit and Stop Orders you have in the stock market.\n *\n * @example\n * ```ts\n * \"If you do not have orders in Nova Medical (NVMD), then the returned object will not have a “NVMD” property.\"\n * {\n * ECP: [\n * {\n * shares: 5,\n * price: 100,000\n * type: \"Stop Buy Order\",\n * position: \"S\",\n * },\n * {\n * shares: 25,\n * price: 125,000\n * type: \"Limit Sell Order\",\n * position: \"L\",\n * },\n * ],\n * SYSC: [\n * {\n * shares: 100,\n * price: 10,000\n * type: \"Limit Buy Order\",\n * position: \"L\",\n * },\n * ],\n * }\n * ```\n *\n */\n",
|
||||
"excerptTokens": [
|
||||
{
|
||||
"kind": "Content",
|
||||
@ -19847,7 +19847,7 @@
|
||||
{
|
||||
"kind": "MethodSignature",
|
||||
"canonicalReference": "bitburner!TIX#getPosition:member(1)",
|
||||
"docComment": "/**\n * Returns an array of four elements that represents the player’s position in a stock.\n *\n * 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 player’s shares in the Long position.\n *\n * 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.\n *\n * All elements in the returned array are numeric.\n *\n * @remarks\n *\n * RAM cost: 2 GB\n *\n * @param sym - Stock symbol.\n *\n * @returns Array of four elements that represents the player’s position in a stock.\n *\n * @example\n * ```ts\n * pos = getPosition(\"ECP\");\n * shares = pos[0];\n * avgPx = pos[1];\n * sharesShort = pos[2];\n * avgPxShort = pos[3];\n * ```\n *\n */\n",
|
||||
"docComment": "/**\n * Returns the player’s position in a stock.\n *\n * @remarks\n *\n * RAM cost: 2 GB Returns an array of four elements that represents the player’s position in a stock.\n *\n * 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 player’s shares in the Long position.\n *\n * 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.\n *\n * All elements in the returned array are numeric.\n *\n * @param sym - Stock symbol.\n *\n * @returns Array of four elements that represents the player’s position in a stock.\n *\n * @example\n * ```ts\n * pos = getPosition(\"ECP\");\n * shares = pos[0];\n * avgPx = pos[1];\n * sharesShort = pos[2];\n * avgPxShort = pos[3];\n * ```\n *\n */\n",
|
||||
"excerptTokens": [
|
||||
{
|
||||
"kind": "Content",
|
||||
@ -19892,7 +19892,7 @@
|
||||
{
|
||||
"kind": "MethodSignature",
|
||||
"canonicalReference": "bitburner!TIX#getPrice:member(1)",
|
||||
"docComment": "/**\n * Returns the price of a stock, given its symbol (NOT the company name). The symbol is a sequence of two to four capital letters.\n *\n * The stock’s price is the average of its bid and ask price\n *\n * @remarks\n *\n * RAM cost: 2 GB\n *\n * @param sym - Stock symbol.\n *\n * @returns The price of a stock.\n *\n * @example\n * ```ts\n * getPrice(\"FISG\");\n * ```\n *\n */\n",
|
||||
"docComment": "/**\n * Returns the price of a stock\n *\n * @remarks\n *\n * RAM cost: 2 GB The stock’s price is the average of its bid and ask price.\n *\n * @param sym - Stock symbol.\n *\n * @returns The price of a stock.\n *\n * @example\n * ```ts\n * getPrice(\"FISG\");\n * ```\n *\n */\n",
|
||||
"excerptTokens": [
|
||||
{
|
||||
"kind": "Content",
|
||||
@ -19937,7 +19937,7 @@
|
||||
{
|
||||
"kind": "MethodSignature",
|
||||
"canonicalReference": "bitburner!TIX#getPurchaseCost:member(1)",
|
||||
"docComment": "/**\n * Calculates and returns how much it would cost to buy a given number of shares of a stock. This takes into account spread, large transactions influencing the price of the stock and commission fees.\n *\n * @remarks\n *\n * RAM cost: 2 GB\n *\n * @param sym - Stock symbol.\n *\n * @param shares - Number of shares to purchase.\n *\n * @param posType - Specifies whether the order is a “Long” or “Short” position.\n *\n * @returns Cost to buy a given number of shares of a stock.\n */\n",
|
||||
"docComment": "/**\n * Calculates cost of buying stocks.\n *\n * @remarks\n *\n * RAM cost: 2 GB Calculates and returns how much it would cost to buy a given number of shares of a stock. This takes into account spread, large transactions influencing the price of the stock and commission fees.\n *\n * @param sym - Stock symbol.\n *\n * @param shares - Number of shares to purchase.\n *\n * @param posType - Specifies whether the order is a “Long” or “Short” position.\n *\n * @returns Cost to buy a given number of shares of a stock.\n */\n",
|
||||
"excerptTokens": [
|
||||
{
|
||||
"kind": "Content",
|
||||
@ -20013,7 +20013,7 @@
|
||||
{
|
||||
"kind": "MethodSignature",
|
||||
"canonicalReference": "bitburner!TIX#getSaleGain:member(1)",
|
||||
"docComment": "/**\n * Calculates and returns how much you would gain from selling a given number of shares of a stock. This takes into account spread, large transactions influencing the price of the stock and commission fees.\n *\n * @remarks\n *\n * RAM cost: 2 GB\n *\n * @param sym - Stock symbol.\n *\n * @param shares - Number of shares to sell.\n *\n * @param posType - Specifies whether the order is a “Long” or “Short” position.\n *\n * @returns Gain from selling a given number of shares of a stock.\n */\n",
|
||||
"docComment": "/**\n * Calculate profit of setting stocks.\n *\n * @remarks\n *\n * RAM cost: 2 GB Calculates and returns how much you would gain from selling a given number of shares of a stock. This takes into account spread, large transactions influencing the price of the stock and commission fees.\n *\n * @param sym - Stock symbol.\n *\n * @param shares - Number of shares to sell.\n *\n * @param posType - Specifies whether the order is a “Long” or “Short” position.\n *\n * @returns Gain from selling a given number of shares of a stock.\n */\n",
|
||||
"excerptTokens": [
|
||||
{
|
||||
"kind": "Content",
|
||||
@ -20122,7 +20122,7 @@
|
||||
{
|
||||
"kind": "MethodSignature",
|
||||
"canonicalReference": "bitburner!TIX#getVolatility:member(1)",
|
||||
"docComment": "/**\n * Returns the volatility of the specified stock.\n *\n * 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).\n *\n * In order to use this function, you must first purchase access to the Four Sigma (4S) Market Data TIX API.\n *\n * @remarks\n *\n * RAM cost: 2.5 GB\n *\n * @param sym - Stock symbol.\n *\n * @returns Volatility of the specified stock.\n */\n",
|
||||
"docComment": "/**\n * Returns the volatility of the specified stock.\n *\n * @remarks\n *\n * RAM cost: 2.5 GB 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).\n *\n * In order to use this function, you must first purchase access to the Four Sigma (4S) Market Data TIX API.\n *\n * @param sym - Stock symbol.\n *\n * @returns Volatility of the specified stock.\n */\n",
|
||||
"excerptTokens": [
|
||||
{
|
||||
"kind": "Content",
|
||||
@ -20167,7 +20167,7 @@
|
||||
{
|
||||
"kind": "MethodSignature",
|
||||
"canonicalReference": "bitburner!TIX#placeOrder:member(1)",
|
||||
"docComment": "/**\n * Places an order on the stock market. This function only works for Limit and Stop Orders.\n *\n * The ability to place limit and stop orders is **not** immediately available to the player and must be unlocked later on in the game.\n *\n * Returns true if the order is successfully placed, and false otherwise.\n *\n * @remarks\n *\n * RAM cost: 2.5 GB\n *\n * @param sym - Stock symbol.\n *\n * @param shares - Number of shares for order. Must be positive. Will be rounded to nearest integer.\n *\n * @param price - Execution price for the order.\n *\n * @param type - Type of order.\n *\n * @param pos - Specifies whether the order is a “Long” or “Short” position.\n *\n * @returns True if the order is successfully placed, and false otherwise.\n */\n",
|
||||
"docComment": "/**\n * Place order for stocks.\n *\n * @remarks\n *\n * RAM cost: 2.5 GB Places an order on the stock market. This function only works for Limit and Stop Orders.\n *\n * The ability to place limit and stop orders is **not** immediately available to the player and must be unlocked later on in the game.\n *\n * Returns true if the order is successfully placed, and false otherwise.\n *\n * @param sym - Stock symbol.\n *\n * @param shares - Number of shares for order. Must be positive. Will be rounded to nearest integer.\n *\n * @param price - Execution price for the order.\n *\n * @param type - Type of order.\n *\n * @param pos - Specifies whether the order is a “Long” or “Short” position.\n *\n * @returns True if the order is successfully placed, and false otherwise.\n */\n",
|
||||
"excerptTokens": [
|
||||
{
|
||||
"kind": "Content",
|
||||
@ -20274,7 +20274,7 @@
|
||||
{
|
||||
"kind": "MethodSignature",
|
||||
"canonicalReference": "bitburner!TIX#purchase4SMarketData:member(1)",
|
||||
"docComment": "/**\n * Purchase 4S Market Data Access.\n *\n * Returns true if you successfully purchased it or if you already have access. Returns false otherwise.\n *\n * @remarks\n *\n * RAM cost: 2.5 GB\n *\n * @returns True if you successfully purchased it or if you already have access, false otherwise.\n */\n",
|
||||
"docComment": "/**\n * Purchase 4S Market Data Access.\n *\n * @remarks\n *\n * RAM cost: 2.5 GB\n *\n * @returns True if you successfully purchased it or if you already have access, false otherwise.\n */\n",
|
||||
"excerptTokens": [
|
||||
{
|
||||
"kind": "Content",
|
||||
@ -20302,7 +20302,7 @@
|
||||
{
|
||||
"kind": "MethodSignature",
|
||||
"canonicalReference": "bitburner!TIX#purchase4SMarketDataTixApi:member(1)",
|
||||
"docComment": "/**\n * Purchase 4S Market Data TIX API Access.\n *\n * Returns true if you successfully purchased it or if you already have access. Returns false otherwise.\n *\n * @remarks\n *\n * RAM cost: 2.5 GB\n *\n * @returns True if you successfully purchased it or if you already have access, false otherwise.\n */\n",
|
||||
"docComment": "/**\n * Purchase 4S Market Data TIX API Access.\n *\n * @remarks\n *\n * RAM cost: 2.5 GB\n *\n * @returns True if you successfully purchased it or if you already have access, false otherwise.\n */\n",
|
||||
"excerptTokens": [
|
||||
{
|
||||
"kind": "Content",
|
||||
@ -20330,7 +20330,7 @@
|
||||
{
|
||||
"kind": "MethodSignature",
|
||||
"canonicalReference": "bitburner!TIX#sell:member(1)",
|
||||
"docComment": "/**\n * Attempts to sell shares of a stock using a Market Order.\n *\n * 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.\n *\n * The net profit made from selling stocks with this function is reflected in the script’s statistics. This net profit is calculated as:\n *\n * shares * (sell_price - average_price_of_purchased_shares)\n *\n * If the sale is successful, this function will return the stock price at which each share was sold. Otherwise, it will return 0.\n *\n * @remarks\n *\n * RAM cost: 2.5 GB\n *\n * @param sym - Stock symbol.\n *\n * @param shares - Number of shares to sell. Must be positive. Will be rounded to nearest integer.\n *\n * @returns The stock price at which each share was sold, otherwise 0 if the shares weren't sold.\n */\n",
|
||||
"docComment": "/**\n * Sell stocks.\n *\n * @remarks\n *\n * RAM cost: 2.5 GB Attempts to sell shares of a stock using a Market Order.\n *\n * 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.\n *\n * The net profit made from selling stocks with this function is reflected in the script’s statistics. This net profit is calculated as:\n *\n * shares * (sell_price - average_price_of_purchased_shares)\n *\n * If the sale is successful, this function will return the stock price at which each share was sold. Otherwise, it will return 0.\n *\n * @param sym - Stock symbol.\n *\n * @param shares - Number of shares to sell. Must be positive. Will be rounded to nearest integer.\n *\n * @returns The stock price at which each share was sold, otherwise 0 if the shares weren't sold.\n */\n",
|
||||
"excerptTokens": [
|
||||
{
|
||||
"kind": "Content",
|
||||
@ -20390,7 +20390,7 @@
|
||||
{
|
||||
"kind": "MethodSignature",
|
||||
"canonicalReference": "bitburner!TIX#sellShort:member(1)",
|
||||
"docComment": "/**\n * Attempts to sell a short position of a stock using a Market Order.\n *\n * The ability to short a stock is **not** immediately available to the player and must be unlocked later on in the game.\n *\n * 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.\n *\n * If the sale is successful, this function will return the stock price at which each share was sold. Otherwise it will return 0.\n *\n * @remarks\n *\n * RAM cost: 2.5 GB\n *\n * @param sym - Stock symbol.\n *\n * @param shares - Number of shares to sell. Must be positive. Will be rounded to nearest integer.\n *\n * @returns The stock price at which each share was sold, otherwise 0 if the shares weren't sold.\n */\n",
|
||||
"docComment": "/**\n * Sell short stock.\n *\n * @remarks\n *\n * RAM cost: 2.5 GB Attempts to sell a short position of a stock using a Market Order.\n *\n * The ability to short a stock is **not** immediately available to the player and must be unlocked later on in the game.\n *\n * 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.\n *\n * If the sale is successful, this function will return the stock price at which each share was sold. Otherwise it will return 0.\n *\n * @param sym - Stock symbol.\n *\n * @param shares - Number of shares to sell. Must be positive. Will be rounded to nearest integer.\n *\n * @returns The stock price at which each share was sold, otherwise 0 if the shares weren't sold.\n */\n",
|
||||
"excerptTokens": [
|
||||
{
|
||||
"kind": "Content",
|
||||
@ -20450,7 +20450,7 @@
|
||||
{
|
||||
"kind": "MethodSignature",
|
||||
"canonicalReference": "bitburner!TIX#short:member(1)",
|
||||
"docComment": "/**\n * Attempts to purchase a short position of a stock using a Market Order.\n *\n * The ability to short a stock is **not** immediately available to the player and must be unlocked later on in the game.\n *\n * 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.\n *\n * If the purchase is successful, this function will return the stock price at which each share was purchased. Otherwise, it will return 0.\n *\n * @remarks\n *\n * RAM cost: 2.5 GB\n *\n * @param sym - Stock symbol.\n *\n * @param shares - Number of shares to short. Must be positive. Will be rounded to nearest integer.\n *\n * @returns The stock price at which each share was purchased, otherwise 0 if the shares weren't purchased.\n */\n",
|
||||
"docComment": "/**\n * Short stocks.\n *\n * @remarks\n *\n * RAM cost: 2.5 GB Attempts to purchase a short position of a stock using a Market Order.\n *\n * The ability to short a stock is **not** immediately available to the player and must be unlocked later on in the game.\n *\n * 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.\n *\n * If the purchase is successful, this function will return the stock price at which each share was purchased. Otherwise, it will return 0.\n *\n * @param sym - Stock symbol.\n *\n * @param shares - Number of shares to short. Must be positive. Will be rounded to nearest integer.\n *\n * @returns The stock price at which each share was purchased, otherwise 0 if the shares weren't purchased.\n */\n",
|
||||
"excerptTokens": [
|
||||
{
|
||||
"kind": "Content",
|
||||
|
@ -4,11 +4,7 @@
|
||||
|
||||
## TIX.buy() method
|
||||
|
||||
Attempts to purchase shares of a stock using a Market Order.
|
||||
|
||||
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.
|
||||
Buy stocks.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
@ -31,5 +27,9 @@ The stock price at which each share was purchased, otherwise 0 if the shares wer
|
||||
|
||||
## Remarks
|
||||
|
||||
RAM cost: 2.5 GB
|
||||
RAM cost: 2.5 GB Attempts to purchase shares of a stock using a Market Order.
|
||||
|
||||
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.
|
||||
|
||||
|
@ -4,9 +4,7 @@
|
||||
|
||||
## TIX.cancelOrder() method
|
||||
|
||||
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.
|
||||
Cancel order for stocks.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
@ -30,5 +28,7 @@ void
|
||||
|
||||
## Remarks
|
||||
|
||||
RAM cost: 2.5 GB
|
||||
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.
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
## TIX.getAskPrice() method
|
||||
|
||||
Given a stock’s symbol (NOT the company name), returns the ask price of that stock. The symbol is a sequence of two to four capital letters.
|
||||
Returns the ask price of that stock.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
## TIX.getBidPrice() method
|
||||
|
||||
Given a stock’s symbol (NOT the company name), returns the bid price of that stock. The symbol is a sequence of two to four capital letters.
|
||||
Returns the bid price of that stock.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
|
@ -6,12 +6,6 @@
|
||||
|
||||
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.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
@ -32,5 +26,9 @@ Probability that the specified stock’s price will increase (as opposed to decr
|
||||
|
||||
## Remarks
|
||||
|
||||
RAM cost: 2.5 GB
|
||||
RAM cost: 2.5 GB 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.
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
## TIX.getMaxShares() method
|
||||
|
||||
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.
|
||||
Returns the maximum number of shares of a stock.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
@ -26,5 +26,5 @@ Maximum number of shares that the stock has.
|
||||
|
||||
## Remarks
|
||||
|
||||
RAM cost: 2 GB
|
||||
RAM cost: 2 GB This is the maximum amount of the stock that can be purchased in both the Long and Short positions combined.
|
||||
|
||||
|
@ -6,7 +6,20 @@
|
||||
|
||||
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:
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
getOrders(): StockOrder;
|
||||
```
|
||||
<b>Returns:</b>
|
||||
|
||||
[StockOrder](./bitburner.stockorder.md)
|
||||
|
||||
Object containing information for all the Limit and Stop Orders you have in the stock market.
|
||||
|
||||
## Remarks
|
||||
|
||||
RAM cost: 2.5 GB 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:
|
||||
|
||||
```ts
|
||||
{
|
||||
@ -28,22 +41,7 @@ This is an object containing information for all the Limit and Stop Orders you h
|
||||
...
|
||||
}
|
||||
```
|
||||
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.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
getOrders(): StockOrder;
|
||||
```
|
||||
<b>Returns:</b>
|
||||
|
||||
[StockOrder](./bitburner.stockorder.md)
|
||||
|
||||
Object containing information for all the Limit and Stop Orders you have in the stock market.
|
||||
|
||||
## Remarks
|
||||
|
||||
RAM cost: 2.5 GB
|
||||
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.
|
||||
|
||||
## Example
|
||||
|
||||
|
@ -4,13 +4,7 @@
|
||||
|
||||
## TIX.getPosition() method
|
||||
|
||||
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. 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.
|
||||
Returns the player’s position in a stock.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
@ -32,7 +26,13 @@ Array of four elements that represents the player’s position in a stock.
|
||||
|
||||
## Remarks
|
||||
|
||||
RAM cost: 2 GB
|
||||
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. 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
|
||||
|
||||
|
@ -4,9 +4,7 @@
|
||||
|
||||
## TIX.getPrice() method
|
||||
|
||||
Returns the price of a stock, given its symbol (NOT the company name). The symbol is a sequence of two to four capital letters.
|
||||
|
||||
The stock’s price is the average of its bid and ask price
|
||||
Returns the price of a stock
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
@ -28,7 +26,7 @@ The price of a stock.
|
||||
|
||||
## Remarks
|
||||
|
||||
RAM cost: 2 GB
|
||||
RAM cost: 2 GB The stock’s price is the average of its bid and ask price.
|
||||
|
||||
## Example
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
## TIX.getPurchaseCost() method
|
||||
|
||||
Calculates and returns how much it would cost to buy a given number of shares of a stock. This takes into account spread, large transactions influencing the price of the stock and commission fees.
|
||||
Calculates cost of buying stocks.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
@ -28,5 +28,5 @@ Cost to buy a given number of shares of a stock.
|
||||
|
||||
## Remarks
|
||||
|
||||
RAM cost: 2 GB
|
||||
RAM cost: 2 GB Calculates and returns how much it would cost to buy a given number of shares of a stock. This takes into account spread, large transactions influencing the price of the stock and commission fees.
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
## TIX.getSaleGain() method
|
||||
|
||||
Calculates and returns how much you would gain from selling a given number of shares of a stock. This takes into account spread, large transactions influencing the price of the stock and commission fees.
|
||||
Calculate profit of setting stocks.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
@ -28,5 +28,5 @@ Gain from selling a given number of shares of a stock.
|
||||
|
||||
## Remarks
|
||||
|
||||
RAM cost: 2 GB
|
||||
RAM cost: 2 GB Calculates and returns how much you would gain from selling a given number of shares of a stock. This takes into account spread, large transactions influencing the price of the stock and commission fees.
|
||||
|
||||
|
@ -6,10 +6,6 @@
|
||||
|
||||
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.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
@ -30,5 +26,7 @@ Volatility of the specified stock.
|
||||
|
||||
## Remarks
|
||||
|
||||
RAM cost: 2.5 GB
|
||||
RAM cost: 2.5 GB 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.
|
||||
|
||||
|
@ -9,51 +9,30 @@ Stock market API
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
interface TIX
|
||||
export interface TIX
|
||||
```
|
||||
|
||||
## Methods
|
||||
|
||||
| Method | Description |
|
||||
| --- | --- |
|
||||
| [buy(sym, shares)](./bitburner.tix.buy.md) | Attempts to purchase shares of a stock using a Market Order.<!-- -->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. |
|
||||
| [cancelOrder(sym, shares, price, type, pos)](./bitburner.tix.cancelorder.md) | 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. |
|
||||
| [getAskPrice(sym)](./bitburner.tix.getaskprice.md) | Given a stock’s symbol (NOT the company name), returns the ask price of that stock. The symbol is a sequence of two to four capital letters. |
|
||||
| [getBidPrice(sym)](./bitburner.tix.getbidprice.md) | Given a stock’s symbol (NOT the company name), returns the bid price of that stock. The symbol is a sequence of two to four capital letters. |
|
||||
| [getForecast(sym)](./bitburner.tix.getforecast.md) | 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. |
|
||||
| [getMaxShares(sym)](./bitburner.tix.getmaxshares.md) | 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. |
|
||||
| [getOrders()](./bitburner.tix.getorders.md) | 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:
|
||||
```ts
|
||||
{
|
||||
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. |
|
||||
| [getPosition(sym)](./bitburner.tix.getposition.md) | 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. 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. |
|
||||
| [getPrice(sym)](./bitburner.tix.getprice.md) | Returns the price of a stock, given its symbol (NOT the company name). The symbol is a sequence of two to four capital letters.<!-- -->The stock’s price is the average of its bid and ask price |
|
||||
| [getPurchaseCost(sym, shares, posType)](./bitburner.tix.getpurchasecost.md) | Calculates and returns how much it would cost to buy a given number of shares of a stock. This takes into account spread, large transactions influencing the price of the stock and commission fees. |
|
||||
| [getSaleGain(sym, shares, posType)](./bitburner.tix.getsalegain.md) | Calculates and returns how much you would gain from selling a given number of shares of a stock. This takes into account spread, large transactions influencing the price of the stock and commission fees. |
|
||||
| [buy(sym, shares)](./bitburner.tix.buy.md) | Buy stocks. |
|
||||
| [cancelOrder(sym, shares, price, type, pos)](./bitburner.tix.cancelorder.md) | Cancel order for stocks. |
|
||||
| [getAskPrice(sym)](./bitburner.tix.getaskprice.md) | Returns the ask price of that stock. |
|
||||
| [getBidPrice(sym)](./bitburner.tix.getbidprice.md) | Returns the bid price of that stock. |
|
||||
| [getForecast(sym)](./bitburner.tix.getforecast.md) | Returns the probability that the specified stock’s price will increase (as opposed to decrease) during the next tick. |
|
||||
| [getMaxShares(sym)](./bitburner.tix.getmaxshares.md) | Returns the maximum number of shares of a stock. |
|
||||
| [getOrders()](./bitburner.tix.getorders.md) | Returns your order book for the stock market. |
|
||||
| [getPosition(sym)](./bitburner.tix.getposition.md) | Returns the player’s position in a stock. |
|
||||
| [getPrice(sym)](./bitburner.tix.getprice.md) | Returns the price of a stock |
|
||||
| [getPurchaseCost(sym, shares, posType)](./bitburner.tix.getpurchasecost.md) | Calculates cost of buying stocks. |
|
||||
| [getSaleGain(sym, shares, posType)](./bitburner.tix.getsalegain.md) | Calculate profit of setting stocks. |
|
||||
| [getSymbols()](./bitburner.tix.getsymbols.md) | Returns an array of the symbols of the tradable stocks |
|
||||
| [getVolatility(sym)](./bitburner.tix.getvolatility.md) | 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. |
|
||||
| [placeOrder(sym, shares, price, type, pos)](./bitburner.tix.placeorder.md) | Places an order on the stock market. This function only works for Limit and Stop Orders.<!-- -->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. |
|
||||
| [purchase4SMarketData()](./bitburner.tix.purchase4smarketdata.md) | Purchase 4S Market Data Access.<!-- -->Returns true if you successfully purchased it or if you already have access. Returns false otherwise. |
|
||||
| [purchase4SMarketDataTixApi()](./bitburner.tix.purchase4smarketdatatixapi.md) | Purchase 4S Market Data TIX API Access.<!-- -->Returns true if you successfully purchased it or if you already have access. Returns false otherwise. |
|
||||
| [sell(sym, shares)](./bitburner.tix.sell.md) | Attempts to sell shares of a stock using a Market Order.<!-- -->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. |
|
||||
| [sellShort(sym, shares)](./bitburner.tix.sellshort.md) | Attempts to sell a short position of a stock using a Market Order.<!-- -->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. |
|
||||
| [short(sym, shares)](./bitburner.tix.short.md) | Attempts to purchase a short position of a stock using a Market Order.<!-- -->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. |
|
||||
| [getVolatility(sym)](./bitburner.tix.getvolatility.md) | Returns the volatility of the specified stock. |
|
||||
| [placeOrder(sym, shares, price, type, pos)](./bitburner.tix.placeorder.md) | Place order for stocks. |
|
||||
| [purchase4SMarketData()](./bitburner.tix.purchase4smarketdata.md) | Purchase 4S Market Data Access. |
|
||||
| [purchase4SMarketDataTixApi()](./bitburner.tix.purchase4smarketdatatixapi.md) | Purchase 4S Market Data TIX API Access. |
|
||||
| [sell(sym, shares)](./bitburner.tix.sell.md) | Sell stocks. |
|
||||
| [sellShort(sym, shares)](./bitburner.tix.sellshort.md) | Sell short stock. |
|
||||
| [short(sym, shares)](./bitburner.tix.short.md) | Short stocks. |
|
||||
|
||||
|
@ -4,11 +4,7 @@
|
||||
|
||||
## TIX.placeOrder() method
|
||||
|
||||
Places an order on the stock market. This function only works for Limit and Stop Orders.
|
||||
|
||||
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.
|
||||
Place order for stocks.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
@ -34,5 +30,9 @@ True if the order is successfully placed, and false otherwise.
|
||||
|
||||
## Remarks
|
||||
|
||||
RAM cost: 2.5 GB
|
||||
RAM cost: 2.5 GB Places an order on the stock market. This function only works for Limit and Stop Orders.
|
||||
|
||||
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.
|
||||
|
||||
|
@ -6,8 +6,6 @@
|
||||
|
||||
Purchase 4S Market Data Access.
|
||||
|
||||
Returns true if you successfully purchased it or if you already have access. Returns false otherwise.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
|
@ -6,8 +6,6 @@
|
||||
|
||||
Purchase 4S Market Data TIX API Access.
|
||||
|
||||
Returns true if you successfully purchased it or if you already have access. Returns false otherwise.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
```typescript
|
||||
|
@ -4,15 +4,7 @@
|
||||
|
||||
## TIX.sell() method
|
||||
|
||||
Attempts to sell shares of a stock using a Market Order.
|
||||
|
||||
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.
|
||||
Sell stocks.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
@ -35,5 +27,13 @@ The stock price at which each share was sold, otherwise 0 if the shares weren't
|
||||
|
||||
## Remarks
|
||||
|
||||
RAM cost: 2.5 GB
|
||||
RAM cost: 2.5 GB Attempts to sell shares of a stock using a Market Order.
|
||||
|
||||
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.
|
||||
|
||||
|
@ -4,13 +4,7 @@
|
||||
|
||||
## TIX.sellShort() method
|
||||
|
||||
Attempts to sell a short position of a stock using a Market Order.
|
||||
|
||||
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.
|
||||
Sell short stock.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
@ -33,5 +27,11 @@ The stock price at which each share was sold, otherwise 0 if the shares weren't
|
||||
|
||||
## Remarks
|
||||
|
||||
RAM cost: 2.5 GB
|
||||
RAM cost: 2.5 GB Attempts to sell a short position of a stock using a Market Order.
|
||||
|
||||
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.
|
||||
|
||||
|
@ -4,13 +4,7 @@
|
||||
|
||||
## TIX.short() method
|
||||
|
||||
Attempts to purchase a short position of a stock using a Market Order.
|
||||
|
||||
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.
|
||||
Short stocks.
|
||||
|
||||
<b>Signature:</b>
|
||||
|
||||
@ -33,5 +27,11 @@ The stock price at which each share was purchased, otherwise 0 if the shares wer
|
||||
|
||||
## Remarks
|
||||
|
||||
RAM cost: 2.5 GB
|
||||
RAM cost: 2.5 GB Attempts to purchase a short position of a stock using a Market Order.
|
||||
|
||||
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.
|
||||
|
||||
|
@ -75,13 +75,13 @@ import { INetscriptGang, NetscriptGang } from "./NetscriptFunctions/Gang";
|
||||
import { INetscriptSleeve, NetscriptSleeve } from "./NetscriptFunctions/Sleeve";
|
||||
import { INetscriptExtra, NetscriptExtra } from "./NetscriptFunctions/Extra";
|
||||
import { INetscriptHacknet, NetscriptHacknet } from "./NetscriptFunctions/Hacknet";
|
||||
import { Bladeburner as INetscriptBladeburner } from "./ScriptEditor/NetscriptDefinitions";
|
||||
import { Bladeburner as INetscriptBladeburner, TIX } from "./ScriptEditor/NetscriptDefinitions";
|
||||
import { NetscriptBladeburner } from "./NetscriptFunctions/Bladeburner";
|
||||
import { INetscriptCodingContract, NetscriptCodingContract } from "./NetscriptFunctions/CodingContract";
|
||||
import { INetscriptCorporation, NetscriptCorporation } from "./NetscriptFunctions/Corporation";
|
||||
import { INetscriptFormulas, NetscriptFormulas } from "./NetscriptFunctions/Formulas";
|
||||
import { INetscriptAugmentations, NetscriptAugmentations } from "./NetscriptFunctions/Augmentations";
|
||||
import { INetscriptStockMarket, NetscriptStockMarket } from "./NetscriptFunctions/StockMarket";
|
||||
import { NetscriptStockMarket } from "./NetscriptFunctions/StockMarket";
|
||||
|
||||
import { toNative } from "./NetscriptFunctions/toNative";
|
||||
|
||||
@ -99,7 +99,7 @@ interface NS extends INetscriptExtra, INetscriptAugmentations {
|
||||
codingcontract: INetscriptCodingContract;
|
||||
corporation: INetscriptCorporation;
|
||||
formulas: INetscriptFormulas;
|
||||
stock: INetscriptStockMarket;
|
||||
stock: TIX;
|
||||
}
|
||||
|
||||
function NetscriptFunctions(workerScript: WorkerScript): NS {
|
||||
|
@ -10,34 +10,9 @@ import { PositionTypes } from "../StockMarket/data/PositionTypes";
|
||||
import { StockSymbols } from "../StockMarket/data/StockSymbols";
|
||||
import { getStockMarket4SDataCost, getStockMarket4STixApiCost } from "../StockMarket/StockMarketCosts";
|
||||
import { Stock } from "../StockMarket/Stock";
|
||||
import { TIX } from "../ScriptEditor/NetscriptDefinitions";
|
||||
|
||||
export interface INetscriptStockMarket {
|
||||
getSymbols(): any;
|
||||
getPrice(symbol: any): any;
|
||||
getAskPrice(symbol: any): any;
|
||||
getBidPrice(symbol: any): any;
|
||||
getPosition(symbol: any): any;
|
||||
getMaxShares(symbol: any): any;
|
||||
getPurchaseCost(symbol: any, shares: any, posType: any): any;
|
||||
getSaleGain(symbol: any, shares: any, posType: any): any;
|
||||
buy(symbol: any, shares: any): any;
|
||||
sell(symbol: any, shares: any): any;
|
||||
short(symbol: any, shares: any): any;
|
||||
sellShort(symbol: any, shares: any): any;
|
||||
placeOrder(symbol: any, shares: any, price: any, type: any, pos: any): any;
|
||||
cancelOrder(symbol: any, shares: any, price: any, type: any, pos: any): any;
|
||||
getOrders(): any;
|
||||
getVolatility(symbol: any): any;
|
||||
getForecast(symbol: any): any;
|
||||
purchase4SMarketData(): void;
|
||||
purchase4SMarketDataTixApi(): void;
|
||||
}
|
||||
|
||||
export function NetscriptStockMarket(
|
||||
player: IPlayer,
|
||||
workerScript: WorkerScript,
|
||||
helper: INetscriptHelper,
|
||||
): INetscriptStockMarket {
|
||||
export function NetscriptStockMarket(player: IPlayer, workerScript: WorkerScript, helper: INetscriptHelper): TIX {
|
||||
/**
|
||||
* Checks if the player has TIX API access. Throws an error if the player does not
|
||||
*/
|
||||
|
85
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
85
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
@ -1348,7 +1348,7 @@ interface SleeveTask {
|
||||
* Stock market API
|
||||
* @public
|
||||
*/
|
||||
interface TIX {
|
||||
export interface TIX {
|
||||
/**
|
||||
* Returns an array of the symbols of the tradable stocks
|
||||
*
|
||||
@ -1358,42 +1358,43 @@ interface TIX {
|
||||
getSymbols(): StockSymbol[];
|
||||
|
||||
/**
|
||||
* Returns the price of a stock, given its symbol (NOT the company name).
|
||||
* The symbol is a sequence of two to four capital letters.
|
||||
* Returns the price of a stock
|
||||
*
|
||||
* The stock’s price is the average of its bid and ask price
|
||||
* @remarks
|
||||
* RAM cost: 2 GB
|
||||
* The stock’s price is the average of its bid and ask price.
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* getPrice("FISG");
|
||||
* ```
|
||||
* @remarks RAM cost: 2 GB
|
||||
* @param sym - Stock symbol.
|
||||
* @returns The price of a stock.
|
||||
*/
|
||||
getPrice(sym: StockSymbol): number;
|
||||
|
||||
/**
|
||||
* Given a stock’s symbol (NOT the company name), returns the ask price of that stock.
|
||||
* The symbol is a sequence of two to four capital letters.
|
||||
*
|
||||
* Returns the ask price of that stock.
|
||||
* @remarks RAM cost: 2 GB
|
||||
*
|
||||
* @param sym - Stock symbol.
|
||||
* @returns The ask price of a stock.
|
||||
*/
|
||||
getAskPrice(sym: StockSymbol): number;
|
||||
|
||||
/**
|
||||
* Given a stock’s symbol (NOT the company name), returns the bid price of that stock.
|
||||
* The symbol is a sequence of two to four capital letters.
|
||||
*
|
||||
* Returns the bid price of that stock.
|
||||
* @remarks RAM cost: 2 GB
|
||||
*
|
||||
* @param sym - Stock symbol.
|
||||
* @returns The bid price of a stock.
|
||||
*/
|
||||
getBidPrice(sym: StockSymbol): number;
|
||||
|
||||
/**
|
||||
* Returns 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 is the returned array is the number of shares the player owns of
|
||||
@ -1414,28 +1415,30 @@ interface TIX {
|
||||
* sharesShort = pos[2];
|
||||
* avgPxShort = pos[3];
|
||||
* ```
|
||||
* @remarks RAM cost: 2 GB
|
||||
* @param sym - Stock symbol.
|
||||
* @returns Array of four elements that represents the player’s position in a stock.
|
||||
*/
|
||||
getPosition(sym: StockSymbol): [number, number, number, number];
|
||||
|
||||
/**
|
||||
* Returns the maximum number of shares that the stock has.
|
||||
* Returns the maximum number of shares of a stock.
|
||||
* @remarks
|
||||
* RAM cost: 2 GB
|
||||
* This is the maximum amount of the stock that can be purchased
|
||||
* in both the Long and Short positions combined.
|
||||
*
|
||||
* @remarks RAM cost: 2 GB
|
||||
* @param sym - Stock symbol.
|
||||
* @returns Maximum number of shares that the stock has.
|
||||
*/
|
||||
getMaxShares(sym: StockSymbol): number;
|
||||
|
||||
/**
|
||||
* Calculates cost of buying stocks.
|
||||
* @remarks
|
||||
* RAM cost: 2 GB
|
||||
* Calculates and returns how much it would cost to buy a given number of shares of a stock.
|
||||
* This takes into account spread, large transactions influencing the price of the stock and commission fees.
|
||||
*
|
||||
* @remarks RAM cost: 2 GB
|
||||
* @param sym - Stock symbol.
|
||||
* @param shares - Number of shares to purchase.
|
||||
* @param posType - Specifies whether the order is a “Long” or “Short” position.
|
||||
@ -1444,10 +1447,12 @@ interface TIX {
|
||||
getPurchaseCost(sym: StockSymbol, shares: number, posType: OrderPosition): number;
|
||||
|
||||
/**
|
||||
* Calculate profit of setting stocks.
|
||||
* @remarks
|
||||
* RAM cost: 2 GB
|
||||
* Calculates and returns how much you would gain from selling a given number of shares of a stock.
|
||||
* This takes into account spread, large transactions influencing the price of the stock and commission fees.
|
||||
*
|
||||
* @remarks RAM cost: 2 GB
|
||||
* @param sym - Stock symbol.
|
||||
* @param shares - Number of shares to sell.
|
||||
* @param posType - Specifies whether the order is a “Long” or “Short” position.
|
||||
@ -1456,6 +1461,9 @@ interface TIX {
|
||||
getSaleGain(sym: StockSymbol, shares: number, posType: OrderPosition): number;
|
||||
|
||||
/**
|
||||
* Buy stocks.
|
||||
* @remarks
|
||||
* RAM cost: 2.5 GB
|
||||
* Attempts to purchase shares of a stock using a Market Order.
|
||||
*
|
||||
* If the player does not have enough money to purchase the specified number of shares,
|
||||
@ -1465,7 +1473,6 @@ interface TIX {
|
||||
* If this function successfully purchases the shares, it will return the stock price at which
|
||||
* each share was purchased. Otherwise, it will return 0.
|
||||
*
|
||||
* @remarks RAM cost: 2.5 GB
|
||||
* @param sym - Stock symbol.
|
||||
* @param shares - Number of shares to purchased. Must be positive. Will be rounded to nearest integer.
|
||||
* @returns The stock price at which each share was purchased, otherwise 0 if the shares weren't purchased.
|
||||
@ -1473,6 +1480,9 @@ interface TIX {
|
||||
buy(sym: StockSymbol, shares: number): number;
|
||||
|
||||
/**
|
||||
* Sell stocks.
|
||||
* @remarks
|
||||
* RAM cost: 2.5 GB
|
||||
* Attempts to sell shares of a stock using a Market Order.
|
||||
*
|
||||
* If the specified number of shares in the function exceeds the amount that the player
|
||||
@ -1487,7 +1497,6 @@ interface TIX {
|
||||
* If the sale is successful, this function will return the stock price at
|
||||
* which each share was sold. Otherwise, it will return 0.
|
||||
*
|
||||
* @remarks RAM cost: 2.5 GB
|
||||
* @param sym - Stock symbol.
|
||||
* @param shares - Number of shares to sell. Must be positive. Will be rounded to nearest integer.
|
||||
* @returns The stock price at which each share was sold, otherwise 0 if the shares weren't sold.
|
||||
@ -1495,6 +1504,9 @@ interface TIX {
|
||||
sell(sym: StockSymbol, shares: number): number;
|
||||
|
||||
/**
|
||||
* Short stocks.
|
||||
* @remarks
|
||||
* RAM cost: 2.5 GB
|
||||
* Attempts to purchase a short position of a stock using a Market Order.
|
||||
*
|
||||
* The ability to short a stock is **not** immediately available to the player and
|
||||
@ -1507,7 +1519,6 @@ interface TIX {
|
||||
* If the purchase is successful, this function will return the stock price at which each
|
||||
* share was purchased. Otherwise, it will return 0.
|
||||
*
|
||||
* @remarks RAM cost: 2.5 GB
|
||||
* @param sym - Stock symbol.
|
||||
* @param shares - Number of shares to short. Must be positive. Will be rounded to nearest integer.
|
||||
* @returns The stock price at which each share was purchased, otherwise 0 if the shares weren't purchased.
|
||||
@ -1515,6 +1526,9 @@ interface TIX {
|
||||
short(sym: StockSymbol, shares: number): number;
|
||||
|
||||
/**
|
||||
* Sell short stock.
|
||||
* @remarks
|
||||
* RAM cost: 2.5 GB
|
||||
* Attempts to sell a short position of a stock using a Market Order.
|
||||
*
|
||||
* The ability to short a stock is **not** immediately available to the player and
|
||||
@ -1527,7 +1541,6 @@ interface TIX {
|
||||
* If the sale is successful, this function will return the stock price at which each
|
||||
* share was sold. Otherwise it will return 0.
|
||||
*
|
||||
* @remarks RAM cost: 2.5 GB
|
||||
* @param sym - Stock symbol.
|
||||
* @param shares - Number of shares to sell. Must be positive. Will be rounded to nearest integer.
|
||||
* @returns The stock price at which each share was sold, otherwise 0 if the shares weren't sold.
|
||||
@ -1535,6 +1548,9 @@ interface TIX {
|
||||
sellShort(sym: StockSymbol, shares: number): number;
|
||||
|
||||
/**
|
||||
* Place order for stocks.
|
||||
* @remarks
|
||||
* RAM cost: 2.5 GB
|
||||
* Places an order on the stock market. This function only works for Limit and Stop Orders.
|
||||
*
|
||||
* The ability to place limit and stop orders is **not** immediately available to the player and
|
||||
@ -1542,7 +1558,6 @@ interface TIX {
|
||||
*
|
||||
* Returns true if the order is successfully placed, and false otherwise.
|
||||
*
|
||||
* @remarks RAM cost: 2.5 GB
|
||||
* @param sym - Stock symbol.
|
||||
* @param shares - Number of shares for order. Must be positive. Will be rounded to nearest integer.
|
||||
* @param price - Execution price for the order.
|
||||
@ -1553,12 +1568,14 @@ interface TIX {
|
||||
placeOrder(sym: StockSymbol, shares: number, price: number, type: OrderType, pos: OrderPosition): boolean;
|
||||
|
||||
/**
|
||||
* Cancel order for stocks.
|
||||
* @remarks
|
||||
* 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.
|
||||
*
|
||||
* @remarks RAM cost: 2.5 GB
|
||||
* @param sym - Stock symbol.
|
||||
* @param shares - Number of shares for order. Must be positive. Will be rounded to nearest integer.
|
||||
* @param price - Execution price for the order.
|
||||
@ -1569,7 +1586,8 @@ interface TIX {
|
||||
|
||||
/**
|
||||
* Returns your order book for the stock market.
|
||||
*
|
||||
* @remarks
|
||||
* RAM cost: 2.5 GB
|
||||
* 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:
|
||||
*
|
||||
@ -1593,11 +1611,7 @@ interface TIX {
|
||||
* ...
|
||||
* }
|
||||
* ```
|
||||
* The “Order type” property can have one of the following four values:
|
||||
* * “Limit Buy Order”
|
||||
* * “Limit Sell Order”
|
||||
* * “Stop Buy Order”
|
||||
* * “Stop Sell Order”
|
||||
* 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.
|
||||
*
|
||||
* @example
|
||||
@ -1628,21 +1642,20 @@ interface TIX {
|
||||
* ],
|
||||
* }
|
||||
* ```
|
||||
* @remarks RAM cost: 2.5 GB
|
||||
* @returns Object containing information for all the Limit and Stop Orders you have in the stock market.
|
||||
*/
|
||||
getOrders(): StockOrder;
|
||||
|
||||
/**
|
||||
* Returns the volatility of the specified stock.
|
||||
*
|
||||
* @remarks
|
||||
* RAM cost: 2.5 GB
|
||||
* 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.
|
||||
*
|
||||
* @remarks RAM cost: 2.5 GB
|
||||
* @param sym - Stock symbol.
|
||||
* @returns Volatility of the specified stock.
|
||||
*/
|
||||
@ -1650,7 +1663,8 @@ interface TIX {
|
||||
|
||||
/**
|
||||
* Returns the probability that the specified stock’s price will increase (as opposed to decrease) during the next tick.
|
||||
*
|
||||
* @remarks
|
||||
* RAM cost: 2.5 GB
|
||||
* 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).
|
||||
*
|
||||
@ -1659,7 +1673,6 @@ interface TIX {
|
||||
*
|
||||
* In order to use this function, you must first purchase access to the Four Sigma (4S) Market Data TIX API.
|
||||
*
|
||||
* @remarks RAM cost: 2.5 GB
|
||||
* @param sym - Stock symbol.
|
||||
* @returns Probability that the specified stock’s price will increase (as opposed to decrease) during the next tick.
|
||||
*/
|
||||
@ -1667,9 +1680,6 @@ interface TIX {
|
||||
|
||||
/**
|
||||
* Purchase 4S Market Data Access.
|
||||
*
|
||||
* Returns true if you successfully purchased it or if you already have access. Returns false otherwise.
|
||||
*
|
||||
* @remarks RAM cost: 2.5 GB
|
||||
* @returns True if you successfully purchased it or if you already have access, false otherwise.
|
||||
*/
|
||||
@ -1677,9 +1687,6 @@ interface TIX {
|
||||
|
||||
/**
|
||||
* Purchase 4S Market Data TIX API Access.
|
||||
*
|
||||
* Returns true if you successfully purchased it or if you already have access. Returns false otherwise.
|
||||
*
|
||||
* @remarks RAM cost: 2.5 GB
|
||||
* @returns True if you successfully purchased it or if you already have access, false otherwise.
|
||||
*/
|
||||
|
@ -19462,7 +19462,7 @@
|
||||
"excerptTokens": [
|
||||
{
|
||||
"kind": "Content",
|
||||
"text": "interface TIX "
|
||||
"text": "export interface TIX "
|
||||
}
|
||||
],
|
||||
"releaseTag": "Public",
|
||||
@ -19471,7 +19471,7 @@
|
||||
{
|
||||
"kind": "MethodSignature",
|
||||
"canonicalReference": "bitburner!TIX#buy:member(1)",
|
||||
"docComment": "/**\n * Attempts to purchase shares of a stock using a Market Order.\n *\n * 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.\n *\n * If this function successfully purchases the shares, it will return the stock price at which each share was purchased. Otherwise, it will return 0.\n *\n * @remarks\n *\n * RAM cost: 2.5 GB\n *\n * @param sym - Stock symbol.\n *\n * @param shares - Number of shares to purchased. Must be positive. Will be rounded to nearest integer.\n *\n * @returns The stock price at which each share was purchased, otherwise 0 if the shares weren't purchased.\n */\n",
|
||||
"docComment": "/**\n * Buy stocks.\n *\n * @remarks\n *\n * RAM cost: 2.5 GB Attempts to purchase shares of a stock using a Market Order.\n *\n * 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.\n *\n * If this function successfully purchases the shares, it will return the stock price at which each share was purchased. Otherwise, it will return 0.\n *\n * @param sym - Stock symbol.\n *\n * @param shares - Number of shares to purchased. Must be positive. Will be rounded to nearest integer.\n *\n * @returns The stock price at which each share was purchased, otherwise 0 if the shares weren't purchased.\n */\n",
|
||||
"excerptTokens": [
|
||||
{
|
||||
"kind": "Content",
|
||||
@ -19531,7 +19531,7 @@
|
||||
{
|
||||
"kind": "MethodSignature",
|
||||
"canonicalReference": "bitburner!TIX#cancelOrder:member(1)",
|
||||
"docComment": "/**\n * Cancels an oustanding Limit or Stop order on the stock market.\n *\n * The ability to use limit and stop orders is **not** immediately available to the player and must be unlocked later on in the game.\n *\n * @remarks\n *\n * RAM cost: 2.5 GB\n *\n * @param sym - Stock symbol.\n *\n * @param shares - Number of shares for order. Must be positive. Will be rounded to nearest integer.\n *\n * @param price - Execution price for the order.\n *\n * @param type - Type of order.\n *\n * @param pos - Specifies whether the order is a “Long” or “Short” position.\n */\n",
|
||||
"docComment": "/**\n * Cancel order for stocks.\n *\n * @remarks\n *\n * RAM cost: 2.5 GB Cancels an oustanding Limit or Stop order on the stock market.\n *\n * The ability to use limit and stop orders is **not** immediately available to the player and must be unlocked later on in the game.\n *\n * @param sym - Stock symbol.\n *\n * @param shares - Number of shares for order. Must be positive. Will be rounded to nearest integer.\n *\n * @param price - Execution price for the order.\n *\n * @param type - Type of order.\n *\n * @param pos - Specifies whether the order is a “Long” or “Short” position.\n */\n",
|
||||
"excerptTokens": [
|
||||
{
|
||||
"kind": "Content",
|
||||
@ -19638,7 +19638,7 @@
|
||||
{
|
||||
"kind": "MethodSignature",
|
||||
"canonicalReference": "bitburner!TIX#getAskPrice:member(1)",
|
||||
"docComment": "/**\n * Given a stock’s symbol (NOT the company name), returns the ask price of that stock. The symbol is a sequence of two to four capital letters.\n *\n * @remarks\n *\n * RAM cost: 2 GB\n *\n * @param sym - Stock symbol.\n *\n * @returns The ask price of a stock.\n */\n",
|
||||
"docComment": "/**\n * Returns the ask price of that stock.\n *\n * @remarks\n *\n * RAM cost: 2 GB\n *\n * @param sym - Stock symbol.\n *\n * @returns The ask price of a stock.\n */\n",
|
||||
"excerptTokens": [
|
||||
{
|
||||
"kind": "Content",
|
||||
@ -19683,7 +19683,7 @@
|
||||
{
|
||||
"kind": "MethodSignature",
|
||||
"canonicalReference": "bitburner!TIX#getBidPrice:member(1)",
|
||||
"docComment": "/**\n * Given a stock’s symbol (NOT the company name), returns the bid price of that stock. The symbol is a sequence of two to four capital letters.\n *\n * @remarks\n *\n * RAM cost: 2 GB\n *\n * @param sym - Stock symbol.\n *\n * @returns The bid price of a stock.\n */\n",
|
||||
"docComment": "/**\n * Returns the bid price of that stock.\n *\n * @remarks\n *\n * RAM cost: 2 GB\n *\n * @param sym - Stock symbol.\n *\n * @returns The bid price of a stock.\n */\n",
|
||||
"excerptTokens": [
|
||||
{
|
||||
"kind": "Content",
|
||||
@ -19728,7 +19728,7 @@
|
||||
{
|
||||
"kind": "MethodSignature",
|
||||
"canonicalReference": "bitburner!TIX#getForecast:member(1)",
|
||||
"docComment": "/**\n * Returns the probability that the specified stock’s price will increase (as opposed to decrease) during the next tick.\n *\n * 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).\n *\n * 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.\n *\n * In order to use this function, you must first purchase access to the Four Sigma (4S) Market Data TIX API.\n *\n * @remarks\n *\n * RAM cost: 2.5 GB\n *\n * @param sym - Stock symbol.\n *\n * @returns Probability that the specified stock’s price will increase (as opposed to decrease) during the next tick.\n */\n",
|
||||
"docComment": "/**\n * Returns the probability that the specified stock’s price will increase (as opposed to decrease) during the next tick.\n *\n * @remarks\n *\n * RAM cost: 2.5 GB 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).\n *\n * 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.\n *\n * In order to use this function, you must first purchase access to the Four Sigma (4S) Market Data TIX API.\n *\n * @param sym - Stock symbol.\n *\n * @returns Probability that the specified stock’s price will increase (as opposed to decrease) during the next tick.\n */\n",
|
||||
"excerptTokens": [
|
||||
{
|
||||
"kind": "Content",
|
||||
@ -19773,7 +19773,7 @@
|
||||
{
|
||||
"kind": "MethodSignature",
|
||||
"canonicalReference": "bitburner!TIX#getMaxShares:member(1)",
|
||||
"docComment": "/**\n * 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.\n *\n * @remarks\n *\n * RAM cost: 2 GB\n *\n * @param sym - Stock symbol.\n *\n * @returns Maximum number of shares that the stock has.\n */\n",
|
||||
"docComment": "/**\n * Returns the maximum number of shares of a stock.\n *\n * @remarks\n *\n * RAM cost: 2 GB This is the maximum amount of the stock that can be purchased in both the Long and Short positions combined.\n *\n * @param sym - Stock symbol.\n *\n * @returns Maximum number of shares that the stock has.\n */\n",
|
||||
"excerptTokens": [
|
||||
{
|
||||
"kind": "Content",
|
||||
@ -19818,7 +19818,7 @@
|
||||
{
|
||||
"kind": "MethodSignature",
|
||||
"canonicalReference": "bitburner!TIX#getOrders:member(1)",
|
||||
"docComment": "/**\n * Returns your order book for the stock market.\n *\n * 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:\n * ```ts\n * {\n * StockSymbol1: [ // Array of orders for this stock\n * {\n * shares: Order quantity\n * price: Order price\n * type: Order type\n * position: Either \"L\" or \"S\" for Long or Short position\n * },\n * {\n * ...\n * },\n * ...\n * ],\n * StockSymbol2: [ // Array of orders for this stock\n * ...\n * ],\n * ...\n * }\n * ```\n *\n * 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.\n *\n * @remarks\n *\n * RAM cost: 2.5 GB\n *\n * @returns Object containing information for all the Limit and Stop Orders you have in the stock market.\n *\n * @example\n * ```ts\n * \"If you do not have orders in Nova Medical (NVMD), then the returned object will not have a “NVMD” property.\"\n * {\n * ECP: [\n * {\n * shares: 5,\n * price: 100,000\n * type: \"Stop Buy Order\",\n * position: \"S\",\n * },\n * {\n * shares: 25,\n * price: 125,000\n * type: \"Limit Sell Order\",\n * position: \"L\",\n * },\n * ],\n * SYSC: [\n * {\n * shares: 100,\n * price: 10,000\n * type: \"Limit Buy Order\",\n * position: \"L\",\n * },\n * ],\n * }\n * ```\n *\n */\n",
|
||||
"docComment": "/**\n * Returns your order book for the stock market.\n *\n * @remarks\n *\n * RAM cost: 2.5 GB 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:\n * ```ts\n * {\n * StockSymbol1: [ // Array of orders for this stock\n * {\n * shares: Order quantity\n * price: Order price\n * type: Order type\n * position: Either \"L\" or \"S\" for Long or Short position\n * },\n * {\n * ...\n * },\n * ...\n * ],\n * StockSymbol2: [ // Array of orders for this stock\n * ...\n * ],\n * ...\n * }\n * ```\n *\n * 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.\n *\n * @returns Object containing information for all the Limit and Stop Orders you have in the stock market.\n *\n * @example\n * ```ts\n * \"If you do not have orders in Nova Medical (NVMD), then the returned object will not have a “NVMD” property.\"\n * {\n * ECP: [\n * {\n * shares: 5,\n * price: 100,000\n * type: \"Stop Buy Order\",\n * position: \"S\",\n * },\n * {\n * shares: 25,\n * price: 125,000\n * type: \"Limit Sell Order\",\n * position: \"L\",\n * },\n * ],\n * SYSC: [\n * {\n * shares: 100,\n * price: 10,000\n * type: \"Limit Buy Order\",\n * position: \"L\",\n * },\n * ],\n * }\n * ```\n *\n */\n",
|
||||
"excerptTokens": [
|
||||
{
|
||||
"kind": "Content",
|
||||
@ -19847,7 +19847,7 @@
|
||||
{
|
||||
"kind": "MethodSignature",
|
||||
"canonicalReference": "bitburner!TIX#getPosition:member(1)",
|
||||
"docComment": "/**\n * Returns an array of four elements that represents the player’s position in a stock.\n *\n * 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 player’s shares in the Long position.\n *\n * 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.\n *\n * All elements in the returned array are numeric.\n *\n * @remarks\n *\n * RAM cost: 2 GB\n *\n * @param sym - Stock symbol.\n *\n * @returns Array of four elements that represents the player’s position in a stock.\n *\n * @example\n * ```ts\n * pos = getPosition(\"ECP\");\n * shares = pos[0];\n * avgPx = pos[1];\n * sharesShort = pos[2];\n * avgPxShort = pos[3];\n * ```\n *\n */\n",
|
||||
"docComment": "/**\n * Returns the player’s position in a stock.\n *\n * @remarks\n *\n * RAM cost: 2 GB Returns an array of four elements that represents the player’s position in a stock.\n *\n * 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 player’s shares in the Long position.\n *\n * 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.\n *\n * All elements in the returned array are numeric.\n *\n * @param sym - Stock symbol.\n *\n * @returns Array of four elements that represents the player’s position in a stock.\n *\n * @example\n * ```ts\n * pos = getPosition(\"ECP\");\n * shares = pos[0];\n * avgPx = pos[1];\n * sharesShort = pos[2];\n * avgPxShort = pos[3];\n * ```\n *\n */\n",
|
||||
"excerptTokens": [
|
||||
{
|
||||
"kind": "Content",
|
||||
@ -19892,7 +19892,7 @@
|
||||
{
|
||||
"kind": "MethodSignature",
|
||||
"canonicalReference": "bitburner!TIX#getPrice:member(1)",
|
||||
"docComment": "/**\n * Returns the price of a stock, given its symbol (NOT the company name). The symbol is a sequence of two to four capital letters.\n *\n * The stock’s price is the average of its bid and ask price\n *\n * @remarks\n *\n * RAM cost: 2 GB\n *\n * @param sym - Stock symbol.\n *\n * @returns The price of a stock.\n *\n * @example\n * ```ts\n * getPrice(\"FISG\");\n * ```\n *\n */\n",
|
||||
"docComment": "/**\n * Returns the price of a stock\n *\n * @remarks\n *\n * RAM cost: 2 GB The stock’s price is the average of its bid and ask price.\n *\n * @param sym - Stock symbol.\n *\n * @returns The price of a stock.\n *\n * @example\n * ```ts\n * getPrice(\"FISG\");\n * ```\n *\n */\n",
|
||||
"excerptTokens": [
|
||||
{
|
||||
"kind": "Content",
|
||||
@ -19937,7 +19937,7 @@
|
||||
{
|
||||
"kind": "MethodSignature",
|
||||
"canonicalReference": "bitburner!TIX#getPurchaseCost:member(1)",
|
||||
"docComment": "/**\n * Calculates and returns how much it would cost to buy a given number of shares of a stock. This takes into account spread, large transactions influencing the price of the stock and commission fees.\n *\n * @remarks\n *\n * RAM cost: 2 GB\n *\n * @param sym - Stock symbol.\n *\n * @param shares - Number of shares to purchase.\n *\n * @param posType - Specifies whether the order is a “Long” or “Short” position.\n *\n * @returns Cost to buy a given number of shares of a stock.\n */\n",
|
||||
"docComment": "/**\n * Calculates cost of buying stocks.\n *\n * @remarks\n *\n * RAM cost: 2 GB Calculates and returns how much it would cost to buy a given number of shares of a stock. This takes into account spread, large transactions influencing the price of the stock and commission fees.\n *\n * @param sym - Stock symbol.\n *\n * @param shares - Number of shares to purchase.\n *\n * @param posType - Specifies whether the order is a “Long” or “Short” position.\n *\n * @returns Cost to buy a given number of shares of a stock.\n */\n",
|
||||
"excerptTokens": [
|
||||
{
|
||||
"kind": "Content",
|
||||
@ -20013,7 +20013,7 @@
|
||||
{
|
||||
"kind": "MethodSignature",
|
||||
"canonicalReference": "bitburner!TIX#getSaleGain:member(1)",
|
||||
"docComment": "/**\n * Calculates and returns how much you would gain from selling a given number of shares of a stock. This takes into account spread, large transactions influencing the price of the stock and commission fees.\n *\n * @remarks\n *\n * RAM cost: 2 GB\n *\n * @param sym - Stock symbol.\n *\n * @param shares - Number of shares to sell.\n *\n * @param posType - Specifies whether the order is a “Long” or “Short” position.\n *\n * @returns Gain from selling a given number of shares of a stock.\n */\n",
|
||||
"docComment": "/**\n * Calculate profit of setting stocks.\n *\n * @remarks\n *\n * RAM cost: 2 GB Calculates and returns how much you would gain from selling a given number of shares of a stock. This takes into account spread, large transactions influencing the price of the stock and commission fees.\n *\n * @param sym - Stock symbol.\n *\n * @param shares - Number of shares to sell.\n *\n * @param posType - Specifies whether the order is a “Long” or “Short” position.\n *\n * @returns Gain from selling a given number of shares of a stock.\n */\n",
|
||||
"excerptTokens": [
|
||||
{
|
||||
"kind": "Content",
|
||||
@ -20122,7 +20122,7 @@
|
||||
{
|
||||
"kind": "MethodSignature",
|
||||
"canonicalReference": "bitburner!TIX#getVolatility:member(1)",
|
||||
"docComment": "/**\n * Returns the volatility of the specified stock.\n *\n * 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).\n *\n * In order to use this function, you must first purchase access to the Four Sigma (4S) Market Data TIX API.\n *\n * @remarks\n *\n * RAM cost: 2.5 GB\n *\n * @param sym - Stock symbol.\n *\n * @returns Volatility of the specified stock.\n */\n",
|
||||
"docComment": "/**\n * Returns the volatility of the specified stock.\n *\n * @remarks\n *\n * RAM cost: 2.5 GB 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).\n *\n * In order to use this function, you must first purchase access to the Four Sigma (4S) Market Data TIX API.\n *\n * @param sym - Stock symbol.\n *\n * @returns Volatility of the specified stock.\n */\n",
|
||||
"excerptTokens": [
|
||||
{
|
||||
"kind": "Content",
|
||||
@ -20167,7 +20167,7 @@
|
||||
{
|
||||
"kind": "MethodSignature",
|
||||
"canonicalReference": "bitburner!TIX#placeOrder:member(1)",
|
||||
"docComment": "/**\n * Places an order on the stock market. This function only works for Limit and Stop Orders.\n *\n * The ability to place limit and stop orders is **not** immediately available to the player and must be unlocked later on in the game.\n *\n * Returns true if the order is successfully placed, and false otherwise.\n *\n * @remarks\n *\n * RAM cost: 2.5 GB\n *\n * @param sym - Stock symbol.\n *\n * @param shares - Number of shares for order. Must be positive. Will be rounded to nearest integer.\n *\n * @param price - Execution price for the order.\n *\n * @param type - Type of order.\n *\n * @param pos - Specifies whether the order is a “Long” or “Short” position.\n *\n * @returns True if the order is successfully placed, and false otherwise.\n */\n",
|
||||
"docComment": "/**\n * Place order for stocks.\n *\n * @remarks\n *\n * RAM cost: 2.5 GB Places an order on the stock market. This function only works for Limit and Stop Orders.\n *\n * The ability to place limit and stop orders is **not** immediately available to the player and must be unlocked later on in the game.\n *\n * Returns true if the order is successfully placed, and false otherwise.\n *\n * @param sym - Stock symbol.\n *\n * @param shares - Number of shares for order. Must be positive. Will be rounded to nearest integer.\n *\n * @param price - Execution price for the order.\n *\n * @param type - Type of order.\n *\n * @param pos - Specifies whether the order is a “Long” or “Short” position.\n *\n * @returns True if the order is successfully placed, and false otherwise.\n */\n",
|
||||
"excerptTokens": [
|
||||
{
|
||||
"kind": "Content",
|
||||
@ -20274,7 +20274,7 @@
|
||||
{
|
||||
"kind": "MethodSignature",
|
||||
"canonicalReference": "bitburner!TIX#purchase4SMarketData:member(1)",
|
||||
"docComment": "/**\n * Purchase 4S Market Data Access.\n *\n * Returns true if you successfully purchased it or if you already have access. Returns false otherwise.\n *\n * @remarks\n *\n * RAM cost: 2.5 GB\n *\n * @returns True if you successfully purchased it or if you already have access, false otherwise.\n */\n",
|
||||
"docComment": "/**\n * Purchase 4S Market Data Access.\n *\n * @remarks\n *\n * RAM cost: 2.5 GB\n *\n * @returns True if you successfully purchased it or if you already have access, false otherwise.\n */\n",
|
||||
"excerptTokens": [
|
||||
{
|
||||
"kind": "Content",
|
||||
@ -20302,7 +20302,7 @@
|
||||
{
|
||||
"kind": "MethodSignature",
|
||||
"canonicalReference": "bitburner!TIX#purchase4SMarketDataTixApi:member(1)",
|
||||
"docComment": "/**\n * Purchase 4S Market Data TIX API Access.\n *\n * Returns true if you successfully purchased it or if you already have access. Returns false otherwise.\n *\n * @remarks\n *\n * RAM cost: 2.5 GB\n *\n * @returns True if you successfully purchased it or if you already have access, false otherwise.\n */\n",
|
||||
"docComment": "/**\n * Purchase 4S Market Data TIX API Access.\n *\n * @remarks\n *\n * RAM cost: 2.5 GB\n *\n * @returns True if you successfully purchased it or if you already have access, false otherwise.\n */\n",
|
||||
"excerptTokens": [
|
||||
{
|
||||
"kind": "Content",
|
||||
@ -20330,7 +20330,7 @@
|
||||
{
|
||||
"kind": "MethodSignature",
|
||||
"canonicalReference": "bitburner!TIX#sell:member(1)",
|
||||
"docComment": "/**\n * Attempts to sell shares of a stock using a Market Order.\n *\n * 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.\n *\n * The net profit made from selling stocks with this function is reflected in the script’s statistics. This net profit is calculated as:\n *\n * shares * (sell_price - average_price_of_purchased_shares)\n *\n * If the sale is successful, this function will return the stock price at which each share was sold. Otherwise, it will return 0.\n *\n * @remarks\n *\n * RAM cost: 2.5 GB\n *\n * @param sym - Stock symbol.\n *\n * @param shares - Number of shares to sell. Must be positive. Will be rounded to nearest integer.\n *\n * @returns The stock price at which each share was sold, otherwise 0 if the shares weren't sold.\n */\n",
|
||||
"docComment": "/**\n * Sell stocks.\n *\n * @remarks\n *\n * RAM cost: 2.5 GB Attempts to sell shares of a stock using a Market Order.\n *\n * 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.\n *\n * The net profit made from selling stocks with this function is reflected in the script’s statistics. This net profit is calculated as:\n *\n * shares * (sell_price - average_price_of_purchased_shares)\n *\n * If the sale is successful, this function will return the stock price at which each share was sold. Otherwise, it will return 0.\n *\n * @param sym - Stock symbol.\n *\n * @param shares - Number of shares to sell. Must be positive. Will be rounded to nearest integer.\n *\n * @returns The stock price at which each share was sold, otherwise 0 if the shares weren't sold.\n */\n",
|
||||
"excerptTokens": [
|
||||
{
|
||||
"kind": "Content",
|
||||
@ -20390,7 +20390,7 @@
|
||||
{
|
||||
"kind": "MethodSignature",
|
||||
"canonicalReference": "bitburner!TIX#sellShort:member(1)",
|
||||
"docComment": "/**\n * Attempts to sell a short position of a stock using a Market Order.\n *\n * The ability to short a stock is **not** immediately available to the player and must be unlocked later on in the game.\n *\n * 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.\n *\n * If the sale is successful, this function will return the stock price at which each share was sold. Otherwise it will return 0.\n *\n * @remarks\n *\n * RAM cost: 2.5 GB\n *\n * @param sym - Stock symbol.\n *\n * @param shares - Number of shares to sell. Must be positive. Will be rounded to nearest integer.\n *\n * @returns The stock price at which each share was sold, otherwise 0 if the shares weren't sold.\n */\n",
|
||||
"docComment": "/**\n * Sell short stock.\n *\n * @remarks\n *\n * RAM cost: 2.5 GB Attempts to sell a short position of a stock using a Market Order.\n *\n * The ability to short a stock is **not** immediately available to the player and must be unlocked later on in the game.\n *\n * 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.\n *\n * If the sale is successful, this function will return the stock price at which each share was sold. Otherwise it will return 0.\n *\n * @param sym - Stock symbol.\n *\n * @param shares - Number of shares to sell. Must be positive. Will be rounded to nearest integer.\n *\n * @returns The stock price at which each share was sold, otherwise 0 if the shares weren't sold.\n */\n",
|
||||
"excerptTokens": [
|
||||
{
|
||||
"kind": "Content",
|
||||
@ -20450,7 +20450,7 @@
|
||||
{
|
||||
"kind": "MethodSignature",
|
||||
"canonicalReference": "bitburner!TIX#short:member(1)",
|
||||
"docComment": "/**\n * Attempts to purchase a short position of a stock using a Market Order.\n *\n * The ability to short a stock is **not** immediately available to the player and must be unlocked later on in the game.\n *\n * 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.\n *\n * If the purchase is successful, this function will return the stock price at which each share was purchased. Otherwise, it will return 0.\n *\n * @remarks\n *\n * RAM cost: 2.5 GB\n *\n * @param sym - Stock symbol.\n *\n * @param shares - Number of shares to short. Must be positive. Will be rounded to nearest integer.\n *\n * @returns The stock price at which each share was purchased, otherwise 0 if the shares weren't purchased.\n */\n",
|
||||
"docComment": "/**\n * Short stocks.\n *\n * @remarks\n *\n * RAM cost: 2.5 GB Attempts to purchase a short position of a stock using a Market Order.\n *\n * The ability to short a stock is **not** immediately available to the player and must be unlocked later on in the game.\n *\n * 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.\n *\n * If the purchase is successful, this function will return the stock price at which each share was purchased. Otherwise, it will return 0.\n *\n * @param sym - Stock symbol.\n *\n * @param shares - Number of shares to short. Must be positive. Will be rounded to nearest integer.\n *\n * @returns The stock price at which each share was purchased, otherwise 0 if the shares weren't purchased.\n */\n",
|
||||
"excerptTokens": [
|
||||
{
|
||||
"kind": "Content",
|
||||
|
Loading…
Reference in New Issue
Block a user