Files
catalyst/live-trading.html
T
2018-02-08 01:17:12 -05:00

535 lines
28 KiB
HTML

<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Live Trading &mdash; Catalyst 0.4 documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="top" title="Catalyst 0.4 documentation" href="index.html"/>
<link rel="next" title="Features" href="features.html"/>
<link rel="prev" title="Catalyst Beginner Tutorial" href="beginner-tutorial.html"/>
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-nav-search">
<a href="index.html" class="icon icon-home"> Catalyst
</a>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="install.html">Install</a><ul>
<li class="toctree-l2"><a class="reference internal" href="install.html#installing-with-conda">Installing with <code class="docutils literal"><span class="pre">conda</span></code></a><ul>
<li class="toctree-l3"><a class="reference internal" href="install.html#troubleshooting-conda-install">Troubleshooting <code class="docutils literal"><span class="pre">conda</span></code> Install</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="install.html#installing-with-pip">Installing with <code class="docutils literal"><span class="pre">pip</span></code></a><ul>
<li class="toctree-l3"><a class="reference internal" href="install.html#troubleshooting-pip-install">Troubleshooting <code class="docutils literal"><span class="pre">pip</span></code> Install</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="install.html#installing-with-pipenv">Installing with <code class="docutils literal"><span class="pre">pipenv</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="install.html#gnu-linux-requirements">GNU/Linux Requirements</a><ul>
<li class="toctree-l3"><a class="reference internal" href="install.html#amazon-linux-ami-notes">Amazon Linux AMI Notes</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="install.html#macos-requirements">MacOS Requirements</a><ul>
<li class="toctree-l3"><a class="reference internal" href="install.html#macos-virtualenv-conda-matplotlib">MacOS + virtualenv/conda + matplotlib</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="install.html#windows-requirements">Windows Requirements</a></li>
<li class="toctree-l2"><a class="reference internal" href="install.html#updating-catalyst">Updating Catalyst</a></li>
<li class="toctree-l2"><a class="reference internal" href="install.html#getting-help">Getting Help</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="beginner-tutorial.html">Catalyst Beginner Tutorial</a><ul>
<li class="toctree-l2"><a class="reference internal" href="beginner-tutorial.html#basics">Basics</a></li>
<li class="toctree-l2"><a class="reference internal" href="beginner-tutorial.html#my-first-algorithm">My first algorithm</a></li>
<li class="toctree-l2"><a class="reference internal" href="beginner-tutorial.html#ingesting-data">Ingesting data</a></li>
<li class="toctree-l2"><a class="reference internal" href="beginner-tutorial.html#running-the-algorithm">Running the algorithm</a><ul>
<li class="toctree-l3"><a class="reference internal" href="beginner-tutorial.html#command-line-interface">Command line interface</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="beginner-tutorial.html#access-to-previous-prices-using-history">Access to previous prices using <code class="docutils literal"><span class="pre">history</span></code></a><ul>
<li class="toctree-l3"><a class="reference internal" href="beginner-tutorial.html#working-example-dual-moving-average-cross-over">Working example: Dual Moving Average Cross-Over</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="beginner-tutorial.html#jupyter-notebook">Jupyter Notebook</a><ul>
<li class="toctree-l3"><a class="reference internal" href="beginner-tutorial.html#install">Install</a></li>
<li class="toctree-l3"><a class="reference internal" href="beginner-tutorial.html#running-algorithms">Running Algorithms</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="beginner-tutorial.html#next-steps">Next steps</a></li>
</ul>
</li>
<li class="toctree-l1 current"><a class="current reference internal" href="">Live Trading</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#supported-exchanges">Supported Exchanges</a></li>
<li class="toctree-l2"><a class="reference internal" href="#paper-trading-vs-live-trading-modes">Paper Trading vs Live Trading modes</a></li>
<li class="toctree-l2"><a class="reference internal" href="#authentication">Authentication</a></li>
<li class="toctree-l2"><a class="reference internal" href="#currency-symbols">Currency Symbols</a></li>
<li class="toctree-l2"><a class="reference internal" href="#trading-an-algorithm">Trading an Algorithm</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="features.html">Features</a><ul>
<li class="toctree-l2"><a class="reference internal" href="features.html#current-functionality">Current Functionality</a></li>
<li class="toctree-l2"><a class="reference internal" href="features.html#upcoming-features">Upcoming features</a></li>
<li class="toctree-l2"><a class="reference internal" href="features.html#naming-convention">Naming Convention</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="example-algos.html">Example Algorithms</a><ul>
<li class="toctree-l2"><a class="reference internal" href="example-algos.html#overview">Overview</a></li>
<li class="toctree-l2"><a class="reference internal" href="example-algos.html#buy-btc-simple-algorithm">Buy BTC Simple Algorithm</a></li>
<li class="toctree-l2"><a class="reference internal" href="example-algos.html#buy-and-hodl-algorithm">Buy and Hodl Algorithm</a></li>
<li class="toctree-l2"><a class="reference internal" href="example-algos.html#dual-moving-average-crossover">Dual Moving Average Crossover</a></li>
<li class="toctree-l2"><a class="reference internal" href="example-algos.html#mean-reversion-algorithm">Mean Reversion Algorithm</a></li>
<li class="toctree-l2"><a class="reference internal" href="example-algos.html#simple-universe">Simple Universe</a></li>
<li class="toctree-l2"><a class="reference internal" href="example-algos.html#portfolio-optimization">Portfolio Optimization</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="utilities.html">Utilities</a><ul>
<li class="toctree-l2"><a class="reference internal" href="utilities.html#output-to-csv-file">Output to CSV file</a></li>
<li class="toctree-l2"><a class="reference internal" href="utilities.html#extracting-market-data">Extracting market data</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="videos.html">Videos</a><ul>
<li class="toctree-l2"><a class="reference internal" href="videos.html#installation-macos">Installation: MacOS</a></li>
<li class="toctree-l2"><a class="reference internal" href="videos.html#installation-windows">Installation: Windows</a></li>
<li class="toctree-l2"><a class="reference internal" href="videos.html#backtesting-a-strategy">Backtesting a Strategy</a></li>
<li class="toctree-l2"><a class="reference internal" href="videos.html#live-trading-a-strategy">Live Trading a Strategy</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="resources.html">Resources</a><ul>
<li class="toctree-l2"><a class="reference internal" href="resources.html#related-3rd-party-apis">Related 3rd Party APIs</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="development-guidelines.html">Development Guidelines</a><ul>
<li class="toctree-l2"><a class="reference internal" href="development-guidelines.html#creating-a-development-environment">Creating a Development Environment</a></li>
<li class="toctree-l2"><a class="reference internal" href="development-guidelines.html#git-branching-structure">Git Branching Structure</a></li>
<li class="toctree-l2"><a class="reference internal" href="development-guidelines.html#contributing-to-the-docs">Contributing to the Docs</a></li>
<li class="toctree-l2"><a class="reference internal" href="development-guidelines.html#commit-messages">Commit messages</a></li>
<li class="toctree-l2"><a class="reference internal" href="development-guidelines.html#formatting-docstrings">Formatting Docstrings</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="releases.html">Release Notes</a><ul>
<li class="toctree-l2"><a class="reference internal" href="releases.html#version-0-5-1">Version 0.5.1</a><ul>
<li class="toctree-l3"><a class="reference internal" href="releases.html#bug-fixes">Bug Fixes</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#build">Build</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="releases.html#version-0-4-7">Version 0.4.7</a><ul>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id1">Bug Fixes</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id2">Build</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="releases.html#version-0-4-6">Version 0.4.6</a><ul>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id3">Bug Fixes</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id4">Build</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="releases.html#version-0-4-5">Version 0.4.5</a><ul>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id5">Bug Fixes</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="releases.html#version-0-4-4">Version 0.4.4</a><ul>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id6">Bug Fixes</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="releases.html#version-0-4-3">Version 0.4.3</a><ul>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id7">Bug Fixes</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="releases.html#version-0-4-2">Version 0.4.2</a><ul>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id8">Bug Fixes</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id9">Build</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="releases.html#version-0-4-0">Version 0.4.0</a><ul>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id10">Bug Fixes</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id11">Build</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#version-0-3-10">Version 0.3.10</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id12">Bug Fixes</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="releases.html#version-0-3-9">Version 0.3.9</a><ul>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id13">Bug Fixes</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id14">Build</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="releases.html#version-0-3-8">Version 0.3.8</a><ul>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id15">Bug Fixes</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="releases.html#version-0-3-7">Version 0.3.7</a><ul>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id16">Bug Fixes</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id17">Build</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="releases.html#version-0-3-6">Version 0.3.6</a><ul>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id18">Bug Fixes</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="releases.html#version-0-3-5">Version 0.3.5</a><ul>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id19">Bug Fixes</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="releases.html#version-0-3-4">Version 0.3.4</a><ul>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id20">Bug Fixes</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id21">Build</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#documentation">Documentation</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="releases.html#version-0-3-3">Version 0.3.3</a><ul>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id23">Bug Fixes</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id24">Build</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="releases.html#version-0-3-2">Version 0.3.2</a><ul>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id25">Bug Fixes</a></li>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id26">Build</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="releases.html#version-0-3-1">Version 0.3.1</a><ul>
<li class="toctree-l3"><a class="reference internal" href="releases.html#id27">Bug Fixes</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="releases.html#version-0-3">Version 0.3</a></li>
<li class="toctree-l2"><a class="reference internal" href="releases.html#version-0-2-dev5">Version 0.2.dev5</a></li>
<li class="toctree-l2"><a class="reference internal" href="releases.html#version-0-2-dev4">Version 0.2.dev4</a></li>
<li class="toctree-l2"><a class="reference internal" href="releases.html#version-0-2-dev3">Version 0.2.dev3</a></li>
<li class="toctree-l2"><a class="reference internal" href="releases.html#version-0-2-dev2">Version 0.2.dev2</a></li>
<li class="toctree-l2"><a class="reference internal" href="releases.html#version-0-2-dev1">Version 0.2.dev1</a></li>
<li class="toctree-l2"><a class="reference internal" href="releases.html#version-0-1-dev9">Version 0.1.dev9</a></li>
<li class="toctree-l2"><a class="reference internal" href="releases.html#version-0-1-dev8">Version 0.1.dev8</a></li>
<li class="toctree-l2"><a class="reference internal" href="releases.html#version-0-1-dev7">Version 0.1.dev7</a></li>
<li class="toctree-l2"><a class="reference internal" href="releases.html#version-0-1-dev6">Version 0.1.dev6</a></li>
</ul>
</li>
</ul>
</div>
&nbsp;
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">Catalyst</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html">Docs</a> &raquo;</li>
<li>Live Trading</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/live-trading.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document">
<div class="section" id="live-trading">
<h1>Live Trading<a class="headerlink" href="#live-trading" title="Permalink to this headline"></a></h1>
<p>This document explains how to get started with live trading.</p>
<div class="section" id="supported-exchanges">
<h2>Supported Exchanges<a class="headerlink" href="#supported-exchanges" title="Permalink to this headline"></a></h2>
<p>Since version 0.4, Catalyst integrated with <a class="reference external" href="https://github.com/ccxt/ccxt">CCXT</a>,
a cryptocurrency trading library with support for more than 90 exchanges. The
range of CCXT and Catalyst support for each of those exchanges varies greatly.
The most supported exchanges are as follows:</p>
<p>The exchanges available for backtesting are fully supported in live mode:</p>
<ul class="simple">
<li>Bitfinex, id = <code class="docutils literal"><span class="pre">bitfinex</span></code></li>
<li>Bittrex, id = <code class="docutils literal"><span class="pre">bittrex</span></code></li>
<li>Poloniex, id = <code class="docutils literal"><span class="pre">poloniex</span></code></li>
</ul>
<p>Additionally, we have successfully tested the following exchanges:</p>
<ul class="simple">
<li>Binance, id = <code class="docutils literal"><span class="pre">binance</span></code></li>
<li>Bitmex, id = <code class="docutils literal"><span class="pre">bitmex</span></code></li>
<li>GDAX, id = <code class="docutils literal"><span class="pre">gdax</span></code></li>
</ul>
<p>As Catalyst is currently in Alpha and in under active development, you are
encouraged to throughly test any exchange in <em>paper trading</em> mode before trading
<em>live</em> with it.</p>
</div>
<div class="section" id="paper-trading-vs-live-trading-modes">
<h2>Paper Trading vs Live Trading modes<a class="headerlink" href="#paper-trading-vs-live-trading-modes" title="Permalink to this headline"></a></h2>
<p>Catalyst currently supports three different modes in which you can execute your
trading algorithm. The first is backtesting, which is covered extensively in the
tutorial, and uses historical data to run your algorithm. There is no
interaction with the exchange in backtesting mode, and this is the first mode
that you should test any new algorithm.</p>
<p>Once you are confident with the simulations that you have obtained with your
algorithm in backtesting, you may switch to live trading, where you have two
different modes:
* <em>Paper Trading</em>: The simulated algorithm runs in real time, and fetches
pricing data in real time from the exchange, but the orders never reach the
exchange, and are instead kept within Catalyst and simulated. No real currency
is bought or sold. Think of it as a <cite>backtesting happening in real time</cite>.
* <em>Live Trading</em>: This is the proper live trading mode in which an algorithm
runs in real time, fetching pricing data from live exchanges and placing orders
against the exchange. Real currency is transacted on the exchange driven by the
algorithm.</p>
<p>These three modes are controlled by the following variables:</p>
<table border="1" class="docutils">
<colgroup>
<col width="38%" />
<col width="18%" />
<col width="44%" />
</colgroup>
<tbody valign="top">
<tr class="row-odd"><td rowspan="2">Mode</td>
<td colspan="2">Parameters</td>
</tr>
<tr class="row-even"><td>live</td>
<td>simulate_orders</td>
</tr>
<tr class="row-odd"><td>backtesting</td>
<td>False</td>
<td>True (default)</td>
</tr>
<tr class="row-even"><td>paper trading</td>
<td>True</td>
<td>True</td>
</tr>
<tr class="row-odd"><td>live trading</td>
<td>True</td>
<td>False</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="authentication">
<h2>Authentication<a class="headerlink" href="#authentication" title="Permalink to this headline"></a></h2>
<p>Most exchanges require token key/secret combination for authentication. By
convention, Catalyst uses an <code class="docutils literal"><span class="pre">auth.json</span></code> file to hold this data.</p>
<p>This example illustrates the convention using the <em>Bitfinex</em> exchange.
Here is how to generate key and secret values for the Bitfinex exchange:
<a class="reference external" href="https://docs.bitfinex.com/v1/docs/api-access">https://docs.bitfinex.com/v1/docs/api-access</a>. Most exchanges follow
a similar process.</p>
<p>The auth.json file:</p>
<div class="highlight-json"><div class="highlight"><pre><span class="p">{</span>
<span class="nt">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;bitfinex&quot;</span><span class="p">,</span>
<span class="nt">&quot;key&quot;</span><span class="p">:</span> <span class="s2">&quot;my-key&quot;</span><span class="p">,</span>
<span class="nt">&quot;secret&quot;</span><span class="p">:</span> <span class="s2">&quot;my-secret&quot;</span>
<span class="p">}</span>
</pre></div>
</div>
<p>The file goes here: <code class="docutils literal"><span class="pre">~/.catalyst/data/exchanges/bitfinex/auth.json</span></code></p>
<p>Note that the <cite>bitfinex</cite> part in the directory above corresponds to the id of the Bitfinex
exchange as defined in the &#8220;Supported Exchanges&#8221; section above.
Attempting to run an algorithm where the targeted exchange is missing
its <code class="docutils literal"><span class="pre">auth.json</span></code> file will create the directory structure and create an empty
auth.json file, but will result in an error.</p>
</div>
<div class="section" id="currency-symbols">
<h2>Currency Symbols<a class="headerlink" href="#currency-symbols" title="Permalink to this headline"></a></h2>
<p>Catalyst introduces a universal convention to reference
trading pairs and individual currencies. This
is required to ensure that the <code class="docutils literal"><span class="pre">symbol()</span></code> api predictably
returns the correct asset regardless of the targeted exchange.</p>
<p>Exchanges tend to use their own convention to represent currencies
(e.g. XBT and BTC both represent Bitcoin on different exchanges).
Trading pairs are also inconsistent. For example, Bitfinex
puts the market currency before the base currency without a
separator, Bittrex puts the base currency first and uses a dash
seperator.</p>
<p>Here is the Catalyst convention:</p>
<p><em>[Market Currency]_[Base Currency]</em> all lowercase.</p>
<p>Currency symbols (e.g. btc, eth, ltc) follow the Bittrex convention.</p>
<p>Here are some examples:</p>
<div class="highlight-json"><div class="highlight"><pre># With Bitfinex
bitcoin_usd_asset = symbol(&#39;btc_usd&#39;)
ethereum_bitcoin_asset = symbol(&#39;eth_btc&#39;)
# With Bittrex
ethereum_bitcoin_asset = symbol(&#39;eth_btc&#39;)
neo_ethereum_asset = symbol(&#39;neo_eth)
</pre></div>
</div>
<p>Note that the trading pairs are always referenced in the same manner.
However, not all trading pairs are available on all exchanges. An
error will occur if the specified trading pair is not trading
on the exchange. To check which currency pairs are available on each
of the supported exchanges, see
<a class="reference external" href="https://www.enigma.co/catalyst/status">Catalyst Market Coverage</a>.</p>
</div>
<div class="section" id="trading-an-algorithm">
<h2>Trading an Algorithm<a class="headerlink" href="#trading-an-algorithm" title="Permalink to this headline"></a></h2>
<p>There is no special convention to follow when writing an
algorithm for live trading. The same algorithm should work in
backtest and live execution mode without modification.</p>
<p>What differs are the arguments provided to the catalyst client or
<cite>run_algorithm()</cite> interface. Here is the same example in both interfaces:</p>
<div class="highlight-bash"><div class="highlight"><pre>catalyst live -f my_algo_code -x bitfinex -c btc -n my_algo_name
</pre></div>
</div>
<div class="highlight-python"><div class="highlight"><pre><span class="n">run_algorithm</span><span class="p">(</span>
<span class="n">initialize</span><span class="o">=</span><span class="n">initialize</span><span class="p">,</span>
<span class="n">handle_data</span><span class="o">=</span><span class="n">handle_data</span><span class="p">,</span>
<span class="n">analyze</span><span class="o">=</span><span class="n">analyze</span><span class="p">,</span>
<span class="n">exchange_name</span><span class="o">=</span><span class="s">&#39;bitfinex&#39;</span><span class="p">,</span>
<span class="n">live</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span>
<span class="n">algo_namespace</span><span class="o">=</span><span class="s">&#39;my_algo_name&#39;</span><span class="p">,</span>
<span class="n">base_currency</span><span class="o">=</span><span class="s">&#39;btc&#39;</span>
<span class="p">)</span>
</pre></div>
</div>
<p>Here is the breakdown of the new arguments:</p>
<ul class="simple">
<li><code class="docutils literal"><span class="pre">live</span></code>: Boolean flag which enables live trading. It defaults to <code class="docutils literal"><span class="pre">False</span></code>.</li>
<li><code class="docutils literal"><span class="pre">capital_base</span></code>: The amount of base_currency assigned to the strategy.
It has to be lower or equal to the amount of base currency available for
trading on the exchange. For illustration, order_target_percent(asset, 1)
will order the capital_base amount specified here of the specified asset.</li>
<li><code class="docutils literal"><span class="pre">exchange_name</span></code>: The name of the targeted exchange. See the
<a class="reference external" href="https://github.com/ccxt/ccxt/wiki/Exchange-Markets">CCXT Supported Exchanges</a>
for the full list.</li>
<li><code class="docutils literal"><span class="pre">algo_namespace</span></code>: A arbitrary label assigned to your algorithm for
data storage purposes.</li>
<li><code class="docutils literal"><span class="pre">base_currency</span></code>: The base currency used to calculate the
statistics of your algorithm. Currently, the base currency of all
trading pairs of your algorithm must match this value.</li>
<li><code class="docutils literal"><span class="pre">simulate_orders</span></code>: Enables the paper trading mode, in which orders are
simulated in Catalyst instead of processed on the exchange. It defaults to
<code class="docutils literal"><span class="pre">True</span></code>.</li>
</ul>
<p>Here is a complete algorithm for reference:
<a class="reference external" href="https://github.com/enigmampc/catalyst/blob/master/catalyst/examples/buy_low_sell_high_live.py">Buy Low and Sell High</a></p>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="features.html" class="btn btn-neutral float-right" title="Features" accesskey="n">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="beginner-tutorial.html" class="btn btn-neutral" title="Catalyst Beginner Tutorial" accesskey="p"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2018, Enigma MPC, Inc..
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'0.4',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>