<h1>Netscript Trade Information eXchange (TIX) API<aclass="headerlink"href="#netscript-trade-information-exchange-tix-api"title="Permalink to this headline">¶</a></h1>
<p>The Trade Information eXchange (TIX) is the communications protocol supported by the World Stock Exchange (WSE).
The WESE provides an API that allows you to automatically communicate with the
<aclass="reference external"href="http://bitburner.wikia.com/wiki/Stock_Market">Stock Market</a>. This API lets you write code using Netscript
to build automated trading systems and create your own algorithmic trading strategies. Access to this
TIX API can be purchased by visiting the World Stock Exchange in-game.</p>
<p>Access to the TIX API currently costs $5 billion. After you purchase it, you will retain this
access even after you 'reset' by installing Augmentations</p>
<divclass="section"id="getstockprice">
<h2>getStockPrice<aclass="headerlink"href="#getstockprice"title="Permalink to this headline">¶</a></h2>
<dlclass="function">
<dtid="getStockPrice">
<codeclass="descname">getStockPrice</code><spanclass="sig-paren">(</span><em>sym</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#getStockPrice"title="Permalink to this definition">¶</a></dt>
<h2>getStockPosition<aclass="headerlink"href="#getstockposition"title="Permalink to this headline">¶</a></h2>
<dlclass="function">
<dtid="getStockPosition">
<codeclass="descname">getStockPosition</code><spanclass="sig-paren">(</span><em>sym</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#getStockPosition"title="Permalink to this definition">¶</a></dt>
<h2>buyStock<aclass="headerlink"href="#buystock"title="Permalink to this headline">¶</a></h2>
<dlclass="function">
<dtid="buyStock">
<codeclass="descname">buyStock</code><spanclass="sig-paren">(</span><em>sym</em>, <em>shares</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#buyStock"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>sym</strong> (<em>string</em>) -- Symbol of stock to purchase</li>
<li><strong>shares</strong> (<em>number</em>) -- Number of shares to purchased. Must be positive. Will be rounded to nearest integer</li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Attempts to purchase shares of a stock using a <aclass="reference external"href="http://bitburner.wikia.com/wiki/Stock_Market#Order_Types">Market Order</a>.</p>
<p>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.</p>
<p>If this function successfully purchases the shares, it will return the stock price at which each share was purchased. Otherwise,
it will return 0.</p>
</dd></dl>
</div>
<divclass="section"id="sellstock">
<h2>sellStock<aclass="headerlink"href="#sellstock"title="Permalink to this headline">¶</a></h2>
<dlclass="function">
<dtid="sellStock">
<codeclass="descname">sellStock</code><spanclass="sig-paren">(</span><em>sym</em>, <em>shares</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#sellStock"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>sym</strong> (<em>string</em>) -- Symbol of stock to sell</li>
<li><strong>shares</strong> (<em>number</em>) -- Number of shares to sell. Must be positive. Will be rounded to nearest integer</li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Attempts to sell shares of a stock using a <aclass="reference external"href="http://bitburner.wikia.com/wiki/Stock_Market#Order_Types">Market Order</a>.</p>
<p>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.</p>
<p>The net profit made from selling stocks with this function is reflected in the script's statistics.
<p>If the sale is successful, this function will return the stock price at which each share was sold. Otherwise, it will return 0.</p>
</dd></dl>
</div>
<divclass="section"id="shortstock">
<h2>shortStock<aclass="headerlink"href="#shortstock"title="Permalink to this headline">¶</a></h2>
<dlclass="function">
<dtid="shortStock">
<codeclass="descname">shortStock</code><spanclass="sig-paren">(</span><em>sym</em>, <em>shares</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#shortStock"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>sym</strong> (<em>string</em>) -- Symbol of stock to short</li>
<li><strong>shares</strong> (<em>number</em>) -- Number of shares to short. Must be positive. Will be rounded to nearest integer</li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Attempts to purchase a <aclass="reference external"href="http://bitburner.wikia.com/wiki/Stock_Market#Positions:_Long_vs_Short">short</a> position of a stock
using a <aclass="reference external"href="http://bitburner.wikia.com/wiki/Stock_Market#Order_Types">Market Order</a>.</p>
<p>The ability to short a stock is <strong>not</strong> immediately available to the player and must be unlocked later on in the game.</p>
<p>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.</p>
<p>If the purchase is successful, this function will return the stock price at which each share was purchased. Otherwise, it will return 0.</p>
</dd></dl>
</div>
<divclass="section"id="sellshort">
<h2>sellShort<aclass="headerlink"href="#sellshort"title="Permalink to this headline">¶</a></h2>
<dlclass="function">
<dtid="sellShort">
<codeclass="descname">sellShort</code><spanclass="sig-paren">(</span><em>sym</em>, <em>shares</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#sellShort"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>sym</strong> (<em>string</em>) -- Symbol of stock to sell</li>
<li><strong>shares</strong> (<em>number</em>) -- Number of shares to sell. Must be positive. Will be rounded to nearest integer</li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Attempts to sell a <aclass="reference external"href="http://bitburner.wikia.com/wiki/Stock_Market#Positions:_Long_vs_Short">short</a> position of a stock
using a <aclass="reference external"href="http://bitburner.wikia.com/wiki/Stock_Market#Order_Types">Market Order</a>.</p>
<p>The ability to short a stock is <strong>not</strong> immediately available to the player and must be unlocked later on in the game.</p>
<p>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.</p>
<p>If the sale is successful, this function will return the stock price at which each share was sold. Otherwise it will return 0.</p>
</dd></dl>
</div>
<divclass="section"id="placeorder">
<h2>placeOrder<aclass="headerlink"href="#placeorder"title="Permalink to this headline">¶</a></h2>
<dlclass="function">
<dtid="placeOrder">
<codeclass="descname">placeOrder</code><spanclass="sig-paren">(</span><em>sym</em>, <em>shares</em>, <em>price</em>, <em>type</em>, <em>pos</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#placeOrder"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>sym</strong> (<em>string</em>) -- Symbol of stock to player order for</li>
<li><strong>shares</strong> (<em>number</em>) -- Number of shares for order. Must be positive. Will be rounded to nearest integer</li>
<li><strong>price</strong> (<em>number</em>) -- Execution price for the order</li>
<li><strong>type</strong> (<em>string</em>) -- <p>Type of order. It must specify "limit" or "stop", and must also specify "buy" or "sell". This is NOT
case-sensitive. Here are four examples that will work:</p>
<ul>
<li>limitbuy</li>
<li>limitsell</li>
<li>stopbuy</li>
<li>stopsell</li>
</ul>
</li>
<li><strong>pos</strong> (<em>string</em>) -- Specifies whether the order is a "Long" or "Short" position. The Values "L" or "S" can also be used. This is
NOT case-sensitive.</li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Places an order on the stock market. This function only works for <aclass="reference external"href="http://bitburner.wikia.com/wiki/Stock_Market#Order_Types">Limit and Stop Orders</a>.</p>
<p>The ability to place limit and stop orders is <strong>not</strong> immediately available to the player and must be unlocked later on in the game.</p>
<p>Returns true if the order is successfully placed, and false otherwise.</p>
</dd></dl>
</div>
<divclass="section"id="cancelorder">
<h2>cancelOrder<aclass="headerlink"href="#cancelorder"title="Permalink to this headline">¶</a></h2>
<dlclass="function">
<dtid="cancelOrder">
<codeclass="descname">cancelOrder</code><spanclass="sig-paren">(</span><em>sym</em>, <em>shares</em>, <em>price</em>, <em>type</em>, <em>pos</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#cancelOrder"title="Permalink to this definition">¶</a></dt>
<trclass="field-odd field"><thclass="field-name">Arguments:</th><tdclass="field-body"><ulclass="first last simple">
<li><strong>sym</strong> (<em>string</em>) -- Symbol of stock to player order for</li>
<li><strong>shares</strong> (<em>number</em>) -- Number of shares for order. Must be positive. Will be rounded to nearest integer</li>
<li><strong>price</strong> (<em>number</em>) -- Execution price for the order</li>
<li><strong>type</strong> (<em>string</em>) -- <p>Type of order. It must specify "limit" or "stop", and must also specify "buy" or "sell". This is NOT
case-sensitive. Here are four examples that will work:</p>
<ul>
<li>limitbuy</li>
<li>limitsell</li>
<li>stopbuy</li>
<li>stopsell</li>
</ul>
</li>
<li><strong>pos</strong> (<em>string</em>) -- Specifies whether the order is a "Long" or "Short" position. The Values "L" or "S" can also be used. This is
NOT case-sensitive.</li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Cancels an oustanding Limit or Stop order on the stock market.</p>
<p>The ability to use limit and stop orders is <strong>not</strong> immediately available to the player and must be unlocked later on in the game.</p>