Created
June 16, 2015 07:50
-
-
Save crtradeworks/d88e3686e04487715c75 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": 1, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [], | |
"source": [ | |
"%matplotlib inline\n", | |
"\n", | |
"# Import some packages\n", | |
"import csv # Python standard library\n", | |
"import math # Python standard library\n", | |
"import numpy # A 3rd party package\n", | |
"from datetime import datetime # Python standard library\n", | |
"\n", | |
"# Import data from csv files\n", | |
"EURUSDreader = csv.reader(open('EURUSD.csv'))\n", | |
"\n", | |
"EURUSD = []\n", | |
"for line in EURUSDreader:\n", | |
"\tEURUSD.append(line)\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 2, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [ | |
"# Time data processing\n", | |
"EURUSD_Time = []\n", | |
"for row in EURUSD:\n", | |
"\tEURUSD_Time.append(datetime.strptime((row[0] + \" \" + row[1]), \"%Y.%m.%d %H:%M\"))\n", | |
"\n", | |
"\n", | |
"# Price and volume data processing\n", | |
"EURUSD_Open = []\n", | |
"for row in EURUSD:\n", | |
"\tEURUSD_Open.append(float(row[2]))\n", | |
"\n", | |
"EURUSD_High = []\n", | |
"for row in EURUSD:\n", | |
"\tEURUSD_High.append(float(row[3]))\n", | |
"\n", | |
"EURUSD_Low = []\n", | |
"for row in EURUSD:\n", | |
"\tEURUSD_Low.append(float(row[4]))\n", | |
"\n", | |
"EURUSD_Close = []\t\n", | |
"for row in EURUSD:\n", | |
"\tEURUSD_Close.append(float(row[5]))\n", | |
"\n", | |
"EURUSD_Volume = []\n", | |
"for row in EURUSD:\n", | |
"\tEURUSD_Volume.append(float(row[6]))" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 3, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [ | |
"# Rate of return calculation\n", | |
"EURUSD_Return = []\n", | |
"for index in (range(len(EURUSD_Close) - 1)):\n", | |
"\ttemp = math.log(EURUSD_Close[index + 1]) - math.log(EURUSD_Close[index])\n", | |
"\tEURUSD_Return.append(temp)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 4, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"0.00128620478494\n" | |
] | |
} | |
], | |
"source": [ | |
"# Volatility using standard deviation, the function is from the 3rd party package \"Numpy\"\n", | |
"sd_EURUSD = numpy.std(EURUSD_Return)\t\n", | |
"\n", | |
"print sd_EURUSD" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 5, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"0.0252409711408\n" | |
] | |
} | |
], | |
"source": [ | |
"# Volatility using Exponetial Weighted Moving Average model, with the \"Pandas\" package\n", | |
"\n", | |
"import pandas # Import a 3rd party package \"Pandas\"\n", | |
"\n", | |
"EURUSD_ReturnSeries = pandas.Series(EURUSD_Return)\n", | |
"EWMA = pandas.stats.moments.ewma(EURUSD_ReturnSeries, (2/0.94-1))\n", | |
"\n", | |
"# Print the volatility to users\n", | |
"print EURUSD_ReturnSeries[len(EURUSD_ReturnSeries)-1]" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 6, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"<matplotlib.axes.AxesSubplot at 0x7f34e3fdb410>" | |
] | |
}, | |
"execution_count": 6, | |
"metadata": {}, | |
"output_type": "execute_result" | |
}, | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAEACAYAAACznAEdAAAABHNCS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I+djXr5VTP79zAJ+CuzP5N7P9sBVGBtd+r6tYjLvBYxCWJwLW8Xk3c+OwH8xdSqf\nVUzAvUzi5Hb5wW5dG7iWfxG2A9Yk+48C2yb7RQPwdqJ4MF/+3n+XSa9NdgD+CFMATfr9HIf5gG7A\nODVM4v1EGO+89+fym8R7SdGYSscK4B8xteRJvJ/nYu7lEsy9fB1TAZmIe5lEhaCZrIFrZbIWnRvl\nmrbYDDMB4YcxL/Kk38+XMf23O2C6jCbxft4HXInpLs1WQCbxXlKOwNSK98VMafOeivy7ej/zMDaq\nw4HnAPcBHxtRrrHfyyQqhNUMD3abx3i7TuryKKaGAKap+HCyn7+PuZj7KApPr5mXObc1w7UL32yK\nqbVdCHw1CZvk+0lZhzGYL2Yy72cB8BaM8fVi4JkY5fAIk3cvKU8m2yeAH2EGv07is3kYMwfb74H1\nwPcxA20n4tlMokL4JabfdC5mpPVrgJ8FlaicS4Bjkv03YD5gMDK/DvMMdsIY1H6JmQF2DoPBfG9g\ncH8/S44BXorpq8zXFHyxBfBDTEHz6Uz4pN7PNkkeABtjZt29hsm8n5MwhcyewGGY/uiDMf3wk3Yv\nYCoeKtnfGGM8vZLJfDZXYp5FOpj2SExX66Q+m4ng5ZgfYSXwkcCyZPk4xuV0LaZ/+iCM8e8ijKw/\nwfQlppyK6WdcxvBssUWD+TbHzA6bupvt2tJ9gPlA/4eBG+ByjGfDpN7PNpgC5s5Ejn9Iwif1flIW\nMPAymtR72Qy4jIHb6elJ+KTez2EYG9UyjCF4Yyb3XgRBEARBEARBEARBEARBEARBEARBEARBEARB\nEARBEARBEARBEARBEAShmP8D43QcbgNipn4AAAAASUVORK5CYII=\n", | |
"text/plain": [ | |
"<matplotlib.figure.Figure at 0x7f3500252c50>" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"# Plot the EWMA volatility series\n", | |
"EWMA.plot()" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": { | |
"collapsed": true | |
}, | |
"outputs": [], | |
"source": [] | |
} | |
], | |
"metadata": { | |
"celltoolbar": "Raw Cell Format", | |
"kernelspec": { | |
"display_name": "Python 2", | |
"language": "python", | |
"name": "python2" | |
}, | |
"language_info": { | |
"codemirror_mode": { | |
"name": "ipython", | |
"version": 2 | |
}, | |
"file_extension": ".py", | |
"mimetype": "text/x-python", | |
"name": "python", | |
"nbconvert_exporter": "python", | |
"pygments_lexer": "ipython2", | |
"version": "2.7.6" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 0 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment