init
This commit is contained in:
28
hts/HTS.py
28
hts/HTS.py
@@ -1,4 +1,7 @@
|
|||||||
|
import os
|
||||||
|
import re
|
||||||
import win32com.client
|
import win32com.client
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
class HTS:
|
class HTS:
|
||||||
|
|
||||||
@@ -201,10 +204,29 @@ class HTS:
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
hts = HTS()
|
|
||||||
#hts.all_stocks()
|
|
||||||
|
|
||||||
fileName = "%s/%d__p(%.2f)__b(%.2f)__s(%.2f)__%s__%d__%s_%s.html" % (fileName, isbuy, positionalEnergy, bolingerband_score, stochastic_score, state, buy_price,item_name.replace(" ", ""), item_code)
|
today = datetime.today()
|
||||||
|
|
||||||
|
PROJECT_HOME = os.path.join(os.path.dirname(os.path.join(os.path.dirname(__file__))))
|
||||||
|
RESOURCE_DIR = PROJECT_HOME + "/resources/analysis/"+today.strftime("%Y%m%d")
|
||||||
|
files = os.listdir(RESOURCE_DIR)
|
||||||
|
|
||||||
|
stocks = []
|
||||||
|
for file in files:
|
||||||
|
arr = file.split("__")
|
||||||
|
flag = int(arr[0])
|
||||||
|
p = float(arr[1][2:len(arr[1]) - 1])
|
||||||
|
b = float(arr[2][2:len(arr[2]) - 1])
|
||||||
|
s = float(arr[3][2:len(arr[3]) - 1])
|
||||||
|
state = arr[4]
|
||||||
|
buy = int(arr[5])
|
||||||
|
arrTemp = arr[6].split("_")
|
||||||
|
name = arrTemp[0]
|
||||||
|
cd = arrTemp[1][:arrTemp[1].find(".")]
|
||||||
|
stocks.append((flag, p, b, s, state, buy, name, cd))
|
||||||
|
|
||||||
|
hts = HTS()
|
||||||
|
hts.all_stocks()
|
||||||
|
|
||||||
stock_code = "094860"
|
stock_code = "094860"
|
||||||
hts.currentStock(stock_code)
|
hts.currentStock(stock_code)
|
||||||
|
|||||||
Reference in New Issue
Block a user