From 3fe550d354c5e702fa612e2977157355110b057e Mon Sep 17 00:00:00 2001 From: Victor Grau Serrat Date: Fri, 12 Jan 2018 08:38:07 -0700 Subject: [PATCH] DOC: typo - #158 --- _sources/beginner-tutorial.txt | 2 +- _sources/unit-tests.txt | 88 ++++++++++++++++++++++++++++++++++ beginner-tutorial.html | 2 +- genindex.html | 2 +- search.html | 2 +- searchindex.js | 2 +- 6 files changed, 93 insertions(+), 5 deletions(-) create mode 100644 _sources/unit-tests.txt diff --git a/_sources/beginner-tutorial.txt b/_sources/beginner-tutorial.txt index 12792ca4..ed6f56ff 100644 --- a/_sources/beginner-tutorial.txt +++ b/_sources/beginner-tutorial.txt @@ -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 diff --git a/_sources/unit-tests.txt b/_sources/unit-tests.txt new file mode 100644 index 00000000..1da822f1 --- /dev/null +++ b/_sources/unit-tests.txt @@ -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 + diff --git a/beginner-tutorial.html b/beginner-tutorial.html index d23987b1..a999e7d9 100644 --- a/beginner-tutorial.html +++ b/beginner-tutorial.html @@ -697,7 +697,7 @@ examine now how our portfolio value changed over time compared to the 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 diff --git a/genindex.html b/genindex.html index 14614d5d..fa75e11f 100644 --- a/genindex.html +++ b/genindex.html @@ -259,7 +259,7 @@