-
Notifications
You must be signed in to change notification settings - Fork 0
/
strategy_former.py
58 lines (48 loc) · 1.54 KB
/
strategy_former.py
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
__author__ = 'Michyo'
import csv
import process_data
import os
import datetime
''' LOG OUTPUT
log_name = "out.log"
log_file = open(log_name, "a")
sys.stdout = log_file
'''
write_in_file = "RSI_band.csv"
print ""
print "* --- * --- * --- * --- * --- * --- *"
print ""
print "--- NAME: RSI LINES ---"
print datetime.datetime.now()
print "--- START ---"
'''
for f in os.listdir(process_data.folder):
file_name_type_separate = os.path.splitext(f)
if file_name_type_separate[1] == ".csv":
print "file = " + f
print process_data.computeOneBollinger(f, -20, 2)
for f in os.listdir(process_data.folder):
file_name_type_separate = os.path.splitext(f)
if file_name_type_separate[1] == ".csv":
print "file = " + f
print "RSI = " + str(process_data.computeOneRSI(f, 14))
'''
'''
# Output into .csv
with open(write_in_file, "ab+") as csv_file:
csv_writer = csv.writer(csv_file, dialect='excel')
file_id = 0
for f in os.listdir(process_data.folder):
file_name_type_separate = os.path.splitext(f)
if file_name_type_separate[1] == ".csv":
print "file = " + f
bollinger = process_data.computeOneBollinger(f, -20, 2)
print bollinger
csv_writer.writerow([str(file_id), f, str(bollinger[0]), str(bollinger[1]), str(bollinger[2]), str(bollinger[3])])
RSI = process_data.computeOneRSI(f, 14)
print RSI
csv_writer.writerow([str(file_id), f, str(RSI)])
file_id += 1
'''
print datetime.datetime.now()
print "--- END ---"