diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/futures.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/python/futures.py b/python/futures.py index d0968d15..112a9037 100644 --- a/python/futures.py +++ b/python/futures.py @@ -1,7 +1,9 @@ import json
import datetime
import requests
+import common
import sys
+import os
ticker = "GE"
monthcodes = ["F", "G", "H", "J", "K", "M", "N", "Q", "U", "V", "X", "Z"]
@@ -34,6 +36,6 @@ uri = "http://www.cmegroup.com/CmeWS/md/MDServer/V1/Venue/G/Exchange/XCME/FOI/FU r = requests.get(uri)
quotes = json.loads(r.text)
-with open("futures-{0}.csv".format(datetime.date.today()), "w") as fh:
+with open(os.path.join(common.root, "data", "Yield Curves", "futures-{0}.csv".format(datetime.date.today())), "w") as fh:
for q in quotes[u'marketDataInfoAsStringList'][u'message']:
fh.write("{0}, {1}\n".format(q['ticker'], q['tradePrice']))
|
