forked from assafY/bitcoinMargin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprimary.py
More file actions
36 lines (33 loc) · 1.02 KB
/
primary.py
File metadata and controls
36 lines (33 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import json
import csv
import cleaner
import prediction
import dataGather
#import chartMaker
def exportCSV():
#a = json.loads(dataGather.get(bitcoinName,currency,amount))
dct = json.load(open("historicalBitcoinData.json"))
cleaned = cleaner.use(dct)
cp = prediction.getClosingPrices(cleaned)
times = prediction.getClosingTimes(cleaned)
with open("output.csv","wb") as csvfile:
writer = csv.writer(csvfile)
writer.writerow([str(fa) for fa in cp])
writer.writerow([str(gb) for gb in times])
def chartFromNothing():
#bitcoinName = "XBTC"
#currency = "GBP"
#amount = "40"
time=1 #time in days
#data = json.loads(dataGather.get(bitcoinName,currency,amount))
data = json.load(open("historicalBitcoinData.json"))
cleanedData = cleaner.use(data)
print(cleanedData)
expectation = prediction.flux(data,time)
#chart = chartMaker.makeChart(data, expectation)
chart = chartMaker.makeChart(cleanedData)
#cleanedData
#Do something to print the chart
#FANCY IOS MAGIC GOES HERE
if __name__ == "__main__":
chartFromNothing()