- Get key ratio, return csv format file
http://financials.morningstar.com/ajax/exportKR2CSV.html?t=<market>:<stock>
Market
- XHKG: Hong Kong Stock Exchange
- XASE: American Stock Exchange
- XNAS: Nasdaq Stock Exchange >* XNYS: New York Stock Exchange
| ;; See my explanation of this config here: https://github.com/jorgenschaefer/elpy/issues/1087 | |
| (provide 'my-python-config) | |
| (require 'python) | |
| ;;; NOTE: PATH environment var must have your path to Anaconda | |
| ;;; environment, e.g., ~/anaconda/bin, as the last thing for | |
| ;;; everything else below to work. | |
| ;;; [[file:~/Encrypted/org-mode-repo/OrgModeFiles/howto-python.org]] | |
| ;;; explains how to work with Anaconda virtual envs and Emacs. |
| import numba as nb | |
| import numpy as np | |
| def impact_perm(nu, gamma, beta): | |
| """Returns the permenant dollar price impact per unit time | |
| In paper as :math:`g(\nu)` | |
| Args: |
| def dc(ohlcv, thresh=0.005): | |
| upturn_event = True | |
| p_h = p_l = ohlcv['close'][0] | |
| dc_ranges = defaultdict(list) | |
| tuples = tuple(ohlcv.itertuples()) | |
| # here we find the timedelta between the timeseries index, 1 and 0, so 1 day for daily data | |
| step = tuples[1].Index - tuples[0].Index | |
| # loop over tuples of ohlcv and time as Index, |
| """ | |
| Python code for fractional differencing of pandas time series | |
| illustrating the concepts of the article "Preserving Memory in Stationary Time Series" | |
| by Simon Kuttruf | |
| While this code is dedicated to the public domain for use without permission, the author disclaims any liability in connection with the use of this code. | |
| """ | |
| import numpy as np | |
| import pandas as pd |
| import numpy as np | |
| import pandas as pd | |
| from datetime import datetime | |
| from fastparquet import write | |
| def compute_vwap(df): | |
| q = df['foreignNotional'] | |
| p = df['price'] |
| { | |
| "metadata": { | |
| "name": "" | |
| }, | |
| "nbformat": 3, | |
| "nbformat_minor": 0, | |
| "worksheets": [ | |
| { | |
| "cells": [ | |
| { |