mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-15 11:22:18 +08:00
DOC: typo - #158
This commit is contained in:
@@ -483,7 +483,7 @@ bitcoin price.
|
||||
|
||||
Now we will run the simulation again, but this time we extend our original
|
||||
algorithm with the addition of the ``analyze()`` function. Somewhat analogously
|
||||
as how ``initialize()`` gets called once before the start of the algorith,
|
||||
as how ``initialize()`` gets called once before the start of the algorithm,
|
||||
``analyze()`` gets called once at the end of the algorithm, and receives two
|
||||
variables: ``context``, which we discussed at the very beginning, and ``perf``,
|
||||
which is the pandas dataframe containing the performance data for our algorithm
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
==========
|
||||
Unit Tests
|
||||
==========
|
||||
|
||||
Exchanges
|
||||
~~~~~~~~~
|
||||
|
||||
Markets
|
||||
-------
|
||||
Sample:
|
||||
All markets in 3 random exchanges
|
||||
Test:
|
||||
Fetch all TradingPair instances
|
||||
Assert:
|
||||
No error
|
||||
|
||||
Current Ticker
|
||||
------------------
|
||||
Sample:
|
||||
3 random markets in each of the 3 random exchanges
|
||||
Test:
|
||||
Fetch current price and volume
|
||||
Assert:
|
||||
Not null and no error
|
||||
|
||||
Historical Price Data
|
||||
---------------------
|
||||
Sample:
|
||||
- 3 random markets for each of the 3 random exchanges supporting historical data
|
||||
- For each market, randomly select one supported frequency
|
||||
Test:
|
||||
Fetch historical data for each market using the selected frequency
|
||||
Assert:
|
||||
- No error and not blank
|
||||
- Date of each candle is consistent with the Catalyst desired pattern,
|
||||
- All candle start at fix intervals
|
||||
- Last candle partial and forward looking from the end date
|
||||
|
||||
Authentication and Orders
|
||||
-------------------------
|
||||
Sample:
|
||||
1 random market for each of 3 random authenticated exchanges
|
||||
Test:
|
||||
- Create one limit order randomly buying or selling at least 10% out from the current price
|
||||
- Retrieve the open order from the exchange
|
||||
- Cancel the open order
|
||||
Assert:
|
||||
No error
|
||||
|
||||
|
||||
Bundles
|
||||
~~~~~~~
|
||||
|
||||
Validate Bundle Data
|
||||
--------------------
|
||||
Sample:
|
||||
- 3 random market in bundles for exchanges supporting historical data
|
||||
- For each market, randomly selected data range available in the exchange historical data
|
||||
Test:
|
||||
- Clean the target exchange bundle
|
||||
- Ingest the selected market data for the selected data range
|
||||
- Retrieve the bundle data into a dataframe
|
||||
- Retrieve the equivalent OHLCV data from the exchange into a dataframe
|
||||
Assert:
|
||||
Matching data for the bundle and exchange
|
||||
|
||||
|
||||
Algo Stats
|
||||
----------
|
||||
Sample:
|
||||
- 2 sample algorithms with built-in stats calculator
|
||||
- 2 KPIs both calculated by each algo and by Catalyst
|
||||
Test:
|
||||
- Run each algorithm
|
||||
- Compare the results of the two methods or calculating stats
|
||||
Assert:
|
||||
- Matching stats
|
||||
|
||||
CSV Ingestion
|
||||
-------------
|
||||
Sample:
|
||||
3 random CSV files containing price data
|
||||
Test:
|
||||
- Ingest each CSV files
|
||||
- Validate with the exchange like in the 'Validate Bundle Data' test
|
||||
Assert:
|
||||
Matching data between the bundle and the exchange
|
||||
|
||||
@@ -697,7 +697,7 @@ examine now how our portfolio value changed over time compared to the
|
||||
bitcoin price.</p>
|
||||
<p>Now we will run the simulation again, but this time we extend our original
|
||||
algorithm with the addition of the <code class="docutils literal"><span class="pre">analyze()</span></code> function. Somewhat analogously
|
||||
as how <code class="docutils literal"><span class="pre">initialize()</span></code> gets called once before the start of the algorith,
|
||||
as how <code class="docutils literal"><span class="pre">initialize()</span></code> gets called once before the start of the algorithm,
|
||||
<code class="docutils literal"><span class="pre">analyze()</span></code> gets called once at the end of the algorithm, and receives two
|
||||
variables: <code class="docutils literal"><span class="pre">context</span></code>, which we discussed at the very beginning, and <code class="docutils literal"><span class="pre">perf</span></code>,
|
||||
which is the pandas dataframe containing the performance data for our algorithm
|
||||
|
||||
+1
-1
@@ -259,7 +259,7 @@
|
||||
<ul class="wy-breadcrumbs">
|
||||
<li><a href="index.html">Docs</a> »</li>
|
||||
|
||||
<li></li>
|
||||
<li>Index</li>
|
||||
<li class="wy-breadcrumbs-aside">
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -258,7 +258,7 @@
|
||||
<ul class="wy-breadcrumbs">
|
||||
<li><a href="index.html">Docs</a> »</li>
|
||||
|
||||
<li></li>
|
||||
<li>Search</li>
|
||||
<li class="wy-breadcrumbs-aside">
|
||||
|
||||
</li>
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user