|
1 | 1 | # risktools |
2 | 2 |
|
3 | | -Python wrapper for R library RTL found at https://github.com/risktoollib/RTL |
| 3 | +Python implementation of the R package RTL. |
4 | 4 |
|
5 | | -NOTES: |
6 | | -* Only works with rpy2 version >= 3.0. Verified working with version 3.2.6 |
7 | | -* All datetimes are given in UTC |
8 | | -* Verified working for RTL version 0.1.1 |
| 5 | +See CRAN for original R version |
9 | 6 |
|
10 | | -Must have the following R libraries already installed on host machine: |
| 7 | +https://cran.r-project.org/web/packages/RTL/index.html |
11 | 8 |
|
12 | | -* RTL |
13 | | -* devtools |
14 | | -* tidyverse |
15 | | -* tidyquant |
16 | | -* Quandl |
| 9 | +Purpose |
17 | 10 |
|
18 | | -And the following Python libaries: |
| 11 | + Purposely designed functions for trading, trading analytics and risk practitioners in Commodities and Finance. |
| 12 | + Build to support delivery of Finance classes from one of the co-authors of RTL at the Alberta School of Business. |
19 | 13 |
|
20 | | -* rpy2 |
21 | | -* pandas |
22 | | -* numpy |
23 | | -* tzlocal |
| 14 | +Features |
| 15 | + |
| 16 | + Historical forward curves charting. |
| 17 | + |
| 18 | + Calendars and expiry dates data objects for a wide range of commodity futures contracts. |
| 19 | + |
| 20 | + roll_adjust to adjust continuous contracts returns for roll adjustments using expiries above. |
| 21 | + |
| 22 | + Morningstar Marketplace API functions getPrice(), getPrices() and getCurve() using your own Morningstar credentials. Current feeds included: |
| 23 | + ICE_EuroFutures and ICE_EuroFutures_continuous. |
| 24 | + CME_NymexFutures_EOD and CME_NymexFutures_EOD_continuous. |
| 25 | + CME_NymexOptions_EOD. |
| 26 | + CME_CbotFuturesEOD and CME_CbotFuturesEOD_continuous. |
| 27 | + CME_Comex_FuturesSettlement_EOD and CME_Comex_FuturesSettlement_EOD_continuous. |
| 28 | + LME_AskBidPrices_Delayed. |
| 29 | + CME_CmeFutures_EOD and CME_CmeFutures_EOD_continuous. |
| 30 | + CME_STLCPC_Futures. |
| 31 | + ICE_NybotCoffeeSugarCocoaFutures and ICE_NybotCoffeeSugarCocoaFutures_continuous. |
| 32 | + Morningstar_FX_Forwards. |
| 33 | + … see ?getPrice for up to date selection and examples. |
| 34 | + |
| 35 | + chart_zscore() supports seasonality adjusted analysis of residuals, particularly useful when dealing with commodity stocks and/or days demand time series with trends as well as non-constant variance across seasonal periods. |
| 36 | + |
| 37 | + chart_eia_steo() and chart_eia_sd() return either a chart or dataframe of supply demand balances from the EIA. |
| 38 | + |
| 39 | + chart_spreads() to generate specific contract spreads across years e.g. ULSD March/April. Requires Morningstar credentials. |
| 40 | + |
| 41 | + swapInfo() returns all information required to price first line futures contract averaging swap or CMA physical trade, including a current month instrument with prior settlements. |
| 42 | + |
| 43 | +Data Sets |
| 44 | + |
| 45 | +Accessible via risktools.data.open_data(datsetname). Also use risktools.data.get_names() to get list of available data. |
| 46 | + |
| 47 | + expiry_table: Historical and forward futures contract metadata. |
| 48 | + holidaysOil: Holiday calendars for ICE and NYMEX. |
| 49 | + tickers_eia: Mapping of EIA tickers to crude and refined products markets for building supply demand balances. |
| 50 | + usSwapIRDef: Data frame of definitions for instruments to build a curve for use with RQuantlib. Use getIRswapCurve() to extract the latest data from FRED and Morningstar. |
| 51 | + usSwapIR: Sample data set output of getIRswapCurve. |
| 52 | + usSwapCurves: Sample data set output of RQuantlib::DiscountCurve(). |
| 53 | + cancrudeassays contains historical Canadian crude assays by batch from Crudemonitor. cancrudeassayssum is a summarised average assays version. |
| 54 | + crudeassaysXOM for all publicly available complete assays in Excel format from ExxonMobil |
| 55 | + crudeassaysBP for all publicly available complete assays in Excel format from BP |
| 56 | + eiaStocks: Sample data set of EIA.gov stocks for key commodiities. |
| 57 | + eiaStorageCap: EIA crude storage capacity by PADD. |
| 58 | + dflong and dfwide contain continuous futures prices sample data sets for Nymex (CL, HO, RB and NG contracts) and ICE Brent. |
| 59 | + crudepipelines and refineries contain GIS information in the North American crude space. |
| 60 | + |
| 61 | +Usernames and password for API services are required. |
0 commit comments