收益率计算+T检验

摘要: from scipy import statsfrom matplotlib.finance import quotes_historical_yahooimport mathticker='ibm'begdate=(2013,1,1)enddate=(2013,11,9)p=quotes_hist... 阅读全文
posted @ 2015-11-22 10:39 midforest 阅读(631) 评论(0) 推荐(0)

realtime

摘要: # -*- coding: utf-8 -*-#!/usr/bin/pythonimport sysimport randomfrom PyQt4 import QtGui, QtCore,Qtclass report_painter: '''绘制行情类''' def __init__(self,p... 阅读全文
posted @ 2015-11-22 10:38 midforest 阅读(177) 评论(0) 推荐(0)

PyQt4AndMatplotlib3d

摘要: matplotlib.pyplot.figure()与matplotlib.figure()的区别:相同点: 两者都有add_subplot()方法,调用方法也一致不同点: matplotlib.pyplot.figure()import matplotlib.pyplot as plt之后的如下操... 阅读全文
posted @ 2015-11-21 17:14 midforest 阅读(267) 评论(0) 推荐(0)

matplotlib基础

摘要: ipython%pylab之后进入交互式绘图方式import numpy as npimport matplotlib.pyplot as pltt = np.arange(0.,5.,0.2)lines = plt.plot(t,t,'r--',t,t**2,'bs',t,t**3,'g^') ... 阅读全文
posted @ 2015-11-17 09:15 midforest 阅读(168) 评论(4) 推荐(0)

npv

摘要: In[11]:%matplotlib qt4%matplotlib inlineimport scipy as spfrom matplotlib.pyplot import *cashflows=[-100,50,60,70]rate=[]npv=[]x=(0,0.7)y=(0,0)for i i... 阅读全文
posted @ 2015-11-16 16:47 midforest 阅读(264) 评论(0) 推荐(0)

Numpy

摘要: Assume that we have two matrices/arrays x (n by k) and y (k by m); the dot productwill generate a matrix with n by m as shown in the following lines o... 阅读全文
posted @ 2015-11-16 09:10 midforest 阅读(166) 评论(2) 推荐(0)

Python基础财务计算

摘要: 二.基本财务操作 1.复利终值计算 FV=PV*(1+R)^n 两年后收到100,年回报率10%。PV=100/(1+0.1)**2 2.永续年金现值计算 PV=(C/R)*(1/(1+R)**(m-1)) m年后开始,每年收到C元,综合回报率为R(此值需要考虑资金成本,通胀率等因素综合考虑确定) 阅读全文
posted @ 2015-11-16 08:55 midforest 阅读(1663) 评论(0) 推荐(0)

Pathon基础操作

摘要: 这个主题组织使用Python做基础财务分析的一些操作代码 一.基本操作 2.del() 删除某个已定义变量 3.import import math from math import * from math import sqrt,log 4._ In the interactive mode, t... 阅读全文
posted @ 2015-11-16 08:48 midforest 阅读(521) 评论(0) 推荐(0)