コード例 #1
0
ファイル: main.py プロジェクト: sachdevs/SoybeanCorrelation
def calculateCorrelationCoefficient():
	soyF_df = pullquandl.pullSoybeanFutures()
	soyF_df['dailyReturns'] = (soyF_df['Last'] - soyF_df['Open'])/soyF_df['Open']
	soyOilF_df = pullquandl.pullSoybeanOilFutures()
	soyOilF_df['dailyReturns'] = (soyOilF_df['Last'] - soyOilF_df['Open'])/soyOilF_df['Open']
	print(soyF_df['dailyReturns'].corr(soyOilF_df['dailyReturns'], method='pearson'))
コード例 #2
0
ファイル: main.py プロジェクト: sachdevs/SoybeanCorrelation
def plotSoybeanOilData():
	soyOilF_df = pullquandl.pullSoybeanOilFutures()
	soyOilCTR_df = pullquandl.pullSoybeanOilCTR()
	graph.draw(soyOilF_df, 'Total Long Short Ratio Of Soybean Oil Future since 2006', 'Total Longs/Total Shorts', \
		soyOilCTR_df, 'Cumulative Daily Returns For Soybean Oil since 1959', 'Cumulative Daily Returns For Soybean Oil')