mirror of
https://github.com/wassname/catalyst.git
synced 2026-10-29 13:00:42 +08:00
DOC: typo - #158
This commit is contained in:
1 parent
fa7711b21a
commit
3fe550d354
6 files changed
+93
-5
No files matched your search
@@ -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
@@ -1 +1 @@
|
||||
Search.setIndex({envversion:47,filenames:["appendix","beginner-tutorial","bundles","development-guidelines","example-algos","features","index","install","live-trading","release-process","releases","resources","unit-tests","utilities","videos"],objects:{"zipline.data.bundles":{bundles:[0,0,1,""]}},objnames:{"0":["py","data","Python data"]},objtypes:{"0":"py:data"},terms:{"000000e":1,"1000th":1,"15t":4,"1st":1,"30t":4,"328842e":1,"340mb":10,"380954e":1,"40mb":10,"460mb":10,"505275d6646a41f3856b22b16678d":1,"536708e":1,"5min":[1,4],"650729e":1,"7869f7828fa140328eb40477bb7d":1,"998236e":1,"998677e":1,"999120e":1,"999558e":1,"99mb":10,"__file__":[4,13],"__future__":4,"__main__":[1,4],"__name__":[1,4],"__wrapped__":9,"_tkinter":1,"boolean":[2,8],"case":[1,2,3,7,13],"class":[3,9],"default":1,"export":9,"final":[1,2,3],"float":[1,10],"import":[1,2,4,9,13],"int":2,"long":[1,2,4],"new":1,"null":12,"public":10,"return":[1,4,8,9,10,11],"short":[1,3,4],"static":9,"throw":10,"true":[1,4,8,10],"try":[4,7],"var":1,"while":[5,7,9,10],aapl:2,abil:2,abl:[1,2,7],abner:4,about:[1,2,6,7],abov:[1,3,4,5,7,8,9],accept:[2,7,9],accord:9,accordingli:[1,4],account:[1,2,4,6,10],acevedo:4,acquir:[2,7],across:[5,6,10],activ:[7,9],actual:1,add:[1,2,3,7,9,13],addit:[1,3,5,6,7,10],address:9,adjust:[2,4,10],administr:7,advantag:7,afford:[1,4],aforement:1,after:[1,2,4,7,9],again:1,against:[1,6,8,10,14],agre:4,ahead:1,aim:[4,11],algebra:[4,7],algo:[1,2,4,10],algo_namespac:[1,4,8],algo_volatil:1,algofil:[1,2],algorith:1,algorithm_period_return:[1,4],algotext:1,alia:4,alias:4,all:[0,1,2,3,4,5,6,7,8,9,10,12],allow:[1,2,5,6,7],almost:7,along:2,alongsid:1,alpha:[1,4,7],alreadi:[1,2,3,7],also:[1,2,3,4,6,7,8,9],altern:[1,5,7],although:1,alwai:[2,5,8,9],amount:[1,4,8,10],amp_btc:5,anaconda:[1,7,9],analog:1,analysi:[1,4,6,9,10,11],analyst:11,analyt:[6,7],analyz:[1,4,8,10,13],ani:[1,2,4,5,7,9,13],anonym:2,anoth:[1,2,4,5],anymor:1,anyth:[1,7,9],apach:4,appar:1,appear:[2,9],append:9,appli:[1,4],applic:[1,4],appropri:[1,3,4],approxim:[1,4],appveyor:9,apt:[1,7],arang:[1,4],arbitrag:5,arbitrari:8,arbitrarili:1,arch:7,architectur:1,ardr_btc:5,arg:[1,9],argument:[0,1,2,8,9],argv:13,around:[6,9],arrai:[4,7],art:6,articl:[3,4],ask:[1,3],asmatrix:4,assert:12,assess:1,asset_nam:[1,4],assetdbwrit:2,assign:[1,8],assimil:1,assist:7,assum:[1,3,4,7],astyp:4,atla:7,attempt:[2,8],attribut:[4,9],auth:[8,10],auto:10,automag:7,avail:1,avoid:[1,2,4],awar:9,ax1:[1,4],ax2:[1,4],ax3:[1,4],ax4:[1,4],ax5:[1,4],ax6:[1,4],axhlin:4,axi:4,ayala:4,back:[3,5,7],backbon:4,backend:7,bah:4,bar:[1,4,10],bar_count:[1,4],base:[1,2,4,5,6,7,8,14],base_curr:[1,4,5,8,13],base_pric:[1,4],basenam:[4,13],basi:[4,10],batch:7,batteri:1,bch_btc:5,bch_eth:5,bch_usdt:5,bcn_btc:5,bcn_xmr:5,bcolz:2,bcolzdailybarread:2,bcolzdailybarwrit:2,bcolzminutebarread:2,bcolzminutebarwrit:2,bcy_btc:5,be62ff77760c4599abaac43be9cc9:1,bear:[1,4],beautifi:1,becaus:[1,7,9,10],been:[0,1,2,7,9],befor:[1,2,4,7,8,10],before_trading_start:[0,4],beggin:4,begin:[1,4,7],behavior:0,bela_btc:5,believ:1,below:[1,4,7,13],benchmark:[1,4,5,6,10],benchmark_period_return:[1,4],benchmark_volatil:1,benefit:1,best:[3,6,7],beta:[1,4],better:1,between:[1,3,4,5,6,12],beyond:5,bfill:4,bia:1,big:7,bin:[4,7],binari:[7,9],bit:[3,7],bitcoin:[1,4,5,6,8,13],bitcoin_usd_asset:8,bitfinex:[1,4,5,6,8,10],bittrex:[1,4,5,6,8,10,14],blank:12,bld:3,blk_btc:5,blk_xmr:5,blockchain:5,blotter:13,blue:1,bodi:3,book:1,both:[1,3,5,8,9,12],bought:1,bound:1,breakdown:8,brew:7,brother:7,brows:7,browser:[1,3,9],btc:1,btc_usd:[1,4,5,8],btc_usdt:[4,5,6,13],btcd_btc:5,btcd_xmr:5,btm_btc:5,bts_btc:5,bug:[2,3],bui:1,build:[1,3,7,9],build_ext:3,burst_btc:5,button:[7,9],buy_and_hodl:[4,10],buy_btc_simpl:[1,4],buy_btc_simple_out:[1,4],buy_df:[1,4],buy_low_sell_high:10,calcul:[1,3,4,8,12],call:[1,2,3,4],can:[1,2,3,4,5,6,7,8,9,10,13],can_trad:[1,4,10],cancel_ord:[1,4],candl:[1,5,10,12],candle_s:4,candlestick:4,cannot:[1,4,7],canon:3,capabl:10,capit:[1,4],capital_bas:[1,4,8,10,13],capital_us:1,captur:1,cash:[1,2,3,4,10],catalyst_dev:[1,6,7],caus:[0,1,2,3],ccxt:10,cell:1,cert:10,certian:0,chanc:1,chang:[1,3,4,6,7,9,10],channel:[1,6,7],charact:3,charg:1,chart:[1,4,7],check:[1,2,3,4,5,7,8],checker:9,checkout:[3,9],choic:9,choos:[1,4,5,7,9,13],chosen:[1,13],chunk:[1,10],circumv:7,clam_btc:5,classic:[1,4],classifi:1,clean:[2,7,9,10,12],clear:2,cli:[1,4,10,13],click:[7,9],client:8,clone:3,close:[1,4,5,13],cmap:4,cmd:[1,7],code:[1,4,7,9,10,13],codebas:3,coin:[1,4,10],collect:[1,2,4],color:[1,4],colorbar:4,colour:4,column:[1,2,4],com:[1,2,3,8],combin:[7,8],come:[2,7],comment:1,common:1,commonli:1,commun:[5,7,11],comp:4,compar:[1,4,5,6,7,12],comparison:10,compat:[6,10],compil:[7,9,10],complement:4,complet:8,complex:[1,7],complianc:4,complimentari:13,comprehens:10,compress:[1,10],comput:[1,4,7,10,11],concept:1,conda:1,conda_build_matrix:9,condit:4,config:7,configur:[1,7,10],congratul:7,consid:[1,4],consist:[1,5,12],constant:1,constraint:2,consum:9,contain:[1,2,3,4,7,12],content:1,context:[Line truncated
|
||||
Search.setIndex({envversion:46,filenames:["appendix","beginner-tutorial","bundles","development-guidelines","example-algos","features","index","install","live-trading","release-process","releases","resources","unit-tests","utilities","videos"],objects:{"zipline.data.bundles":{bundles:[0,0,1,""]}},objnames:{"0":["py","data","Python data"]},objtypes:{"0":"py:data"},terms:{"000000e":1,"1000th":1,"15t":4,"1st":1,"30t":4,"328842e":1,"340mb":10,"380954e":1,"40mb":10,"460mb":10,"505275d6646a41f3856b22b16678d":1,"536708e":1,"5min":[1,4],"650729e":1,"7869f7828fa140328eb40477bb7d":1,"998236e":1,"998677e":1,"999120e":1,"999558e":1,"99mb":10,"__file__":[4,13],"__future__":4,"__main__":[1,4],"__name__":[1,4],"__wrapped__":9,"_tkinter":1,"boolean":[2,8],"case":[1,2,3,7,13],"class":[3,9],"default":1,"export":9,"final":[1,2,3],"float":[1,10],"import":[1,2,4,9,13],"int":2,"long":[1,2,4],"new":1,"null":12,"public":10,"return":[1,4,8,9,10,11],"short":[1,3,4],"static":9,"throw":10,"true":[1,4,8,10],"try":[4,7],"var":1,"while":[5,7,9,10],aapl:2,abil:2,abl:[1,2,7],abner:4,about:[1,2,6,7],abov:[1,3,4,5,7,8,9],accept:[2,7,9],accord:9,accordingli:[1,4],account:[1,2,4,6,10],acevedo:4,acquir:[2,7],across:[5,6,10],activ:[7,9],actual:1,add:[1,2,3,7,9,13],addit:[1,3,5,6,7,10],address:9,adjust:[2,4,10],administr:7,advantag:7,afford:[1,4],aforement:1,after:[1,2,4,7,9],again:1,against:[1,6,8,10,14],agre:4,ahead:1,aim:[4,11],algebra:[4,7],algo:[1,2,4,10],algo_namespac:[1,4,8],algo_volatil:1,algofil:[1,2],algorithm_period_return:[1,4],algotext:1,alia:4,alias:4,all:[0,1,2,3,4,5,6,7,8,9,10,12],allow:[1,2,5,6,7],almost:7,along:2,alongsid:1,alpha:[1,4,7],alreadi:[1,2,3,7],also:[1,2,3,4,6,7,8,9],altern:[1,5,7],although:1,alwai:[2,5,8,9],amount:[1,4,8,10],amp_btc:5,anaconda:[1,7,9],analog:1,analysi:[1,4,6,9,10,11],analyst:11,analyt:[6,7],analyz:[1,4,8,10,13],ani:[1,2,4,5,7,9,13],anonym:2,anoth:[1,2,4,5],anymor:1,anyth:[1,7,9],apach:4,appar:1,appear:[2,9],append:9,appli:[1,4],applic:[1,4],appropri:[1,3,4],approxim:[1,4],appveyor:9,apt:[1,7],arang:[1,4],arbitrag:5,arbitrari:8,arbitrarili:1,arch:7,architectur:1,ardr_btc:5,arg:[1,9],argument:[0,1,2,8,9],argv:13,around:[6,9],arrai:[4,7],art:6,articl:[3,4],ask:[1,3],asmatrix:4,assert:12,assess:1,asset_nam:[1,4],assetdbwrit:2,assign:[1,8],assimil:1,assist:7,assum:[1,3,4,7],astyp:4,atla:7,attempt:[2,8],attribut:[4,9],auth:[8,10],auto:10,automag:7,avail:[0,1],avoid:[1,2,4],awar:9,ax1:[1,4],ax2:[1,4],ax3:[1,4],ax4:[1,4],ax5:[1,4],ax6:[1,4],axhlin:4,axi:4,ayala:4,back:[3,5,7],backbon:4,backend:7,bah:4,bar:[1,4,10],bar_count:[1,4],base:[1,2,4,5,6,7,8,14],base_curr:[1,4,5,8,13],base_pric:[1,4],basenam:[4,13],basi:[4,10],batch:7,batteri:1,bch_btc:5,bch_eth:5,bch_usdt:5,bcn_btc:5,bcn_xmr:5,bcolz:2,bcolzdailybarread:2,bcolzdailybarwrit:2,bcolzminutebarread:2,bcolzminutebarwrit:2,bcy_btc:5,be62ff77760c4599abaac43be9cc9:1,bear:[1,4],beautifi:1,becaus:[1,7,9,10],been:[0,1,2,7,9],befor:[1,2,4,7,8,10],before_trading_start:[0,4],beggin:4,begin:[1,4,7],behavior:0,bela_btc:5,believ:1,below:[1,4,7,13],benchmark:[1,4,5,6,10],benchmark_period_return:[1,4],benchmark_volatil:1,benefit:1,best:[3,6,7],beta:[1,4],better:1,between:[1,3,4,5,6,12],beyond:5,bfill:4,bia:1,big:7,bin:[4,7],binari:[7,9],bit:[3,7],bitcoin:[1,4,5,6,8,13],bitcoin_usd_asset:8,bitfinex:[1,4,5,6,8,10],bittrex:[1,4,5,6,8,10,14],blank:12,bld:3,blk_btc:5,blk_xmr:5,blockchain:5,blotter:13,blue:1,bodi:3,book:1,both:[1,3,5,8,9,12],bought:1,bound:1,breakdown:8,brew:7,brother:7,brows:7,browser:[1,3,9],btc:1,btc_usd:[1,4,5,8],btc_usdt:[4,5,6,13],btcd_btc:5,btcd_xmr:5,btm_btc:5,bts_btc:5,bug:[0,2,3],bui:1,build:[1,3,6,7,9],build_ext:3,burst_btc:5,button:[7,9],buy_and_hodl:[4,10],buy_btc_simpl:[1,4],buy_btc_simple_out:[1,4],buy_df:[1,4],buy_low_sell_high:10,calcul:[1,3,4,8,12],call:[1,2,3,4],can:[1,2,3,4,5,6,7,8,9,10,13],can_trad:[1,4,10],cancel_ord:[1,4],candl:[1,5,10,12],candle_s:4,candlestick:4,cannot:[1,4,7],canon:3,capabl:10,capit:[1,4],capital_bas:[1,4,8,10,13],capital_us:1,captur:1,cash:[1,2,3,4,10],catalyst_dev:[1,6,7],caus:[0,1,2,3],ccxt:10,cell:1,cert:10,certian:0,chanc:1,chang:[1,3,4,6,7,9,10],channel:[1,6,7],charact:3,charg:1,chart:[1,4,7],check:[1,2,3,4,5,7,8],checker:9,checkout:[3,9],choic:9,choos:[1,4,5,7,9,13],chosen:[1,13],chunk:[1,10],circumv:7,clam_btc:5,classic:[1,4],classifi:1,clean:[2,7,9,10,12],clear:2,cli:[1,4,10,13],click:[7,9],client:8,clone:3,close:[1,4,5,13],cmap:4,cmd:[1,7],code:[1,4,7,9,10,13],codebas:3,coin:[1,4,10],collect:[1,2,4],color:[1,4],colorbar:4,colour:4,column:[1,2,4],com:[1,2,3,8],combin:[7,8],come:[2,7],comment:1,common:1,commonli:1,commun:[5,7,11],comp:4,compar:[1,4,5,6,7,12],comparison:10,compat:[6,10],compil:[7,9,10],complement:4,complet:8,complex:[1,7],complianc:4,complimentari:13,comprehens:10,compress:[1,10],comput:[1,4,7,10,11],concept:1,conda:1,conda_build_matrix:9,condit:4,config:7,configur:[1,7,10],congratul:7,consid:[1,4],consist:[1,5,12],constant:1,constraint:2,consum:9,contain:[1,2,3,4,7,12],content:1,context:[1,4Line truncated
|
||||
Reference in new issue
Block a user