diff --git a/app.py b/app.py index fd95a7e..a65ef30 100644 --- a/app.py +++ b/app.py @@ -18,6 +18,7 @@ def index(): return flask.render_template("index.html", pages = pages.GenLists) + if __name__ == '__main__': args = parser.parse_args() app.run(host=args.host, port=args.port, debug=args.debug) diff --git a/gen.py b/gen.py index c3b56cc..d01e2fd 100644 --- a/gen.py +++ b/gen.py @@ -75,8 +75,8 @@ def isVolumeMulPriceGreaterThan(stock: pd.DataFrame, threshold: int, nday: int) return stock.iloc[nday]['VOLUME'] * stock.iloc[nday]['CLOSE'] > threshold def isMACDCrossSignal(signal: pd.Series, macd: pd.Series, nday: int, order=1) -> bool: - return (signal.iloc[nday] < macd.iloc[nday] and - signal.iloc[nday+order] > macd.iloc[nday+order]) + return (signal.iloc[nday] > macd.iloc[nday] and + signal.iloc[nday+order] < macd.iloc[nday+order]) def isRelativeDiffLessThan(a:pd.Series,b:pd.Series, threshold: float,nday:int) -> bool: return (a.iloc[nday] - b.iloc[nday]) / b.iloc[nday] < threshold @@ -186,11 +186,10 @@ if __name__ == "__main__": days = v.corpListByDate.keys() days = list(days) - days.append(datetime.date.today().isoformat()) days.sort(reverse=True) days = days[:5] - html = template.render(collected=v, title=k, days=days) + html = template.render(collected=v, title=k, days=days, lastUpdate=datetime.date.today().isoformat()) if args.printStdout: print(html) else: diff --git a/pages.py b/pages.py index af5fa4d..09aa02f 100644 --- a/pages.py +++ b/pages.py @@ -34,8 +34,8 @@ d20d5의 조건에서 더해서 거래량이 이전 날짜보다 5배 증가한 거래량이 이전 날짜보다 5배 증가한 시점을 찾습니다. """}, {name:"macd",desc: """\ -signal과 macd가 서로 교차한 시점을 찾습니다. 즉 signal이 아래로 떨어지고 -macd가 위로 올라가는 시점을 찾습니다. macd 는 5일선과 10일선으로 이루어지고 +signal과 macd가 서로 교차한 시점을 찾습니다. 즉 signal이 올라가고 +macd가 아래로 내려가는 시점을 찾습니다. macd 는 5일선과 10일선으로 이루어지고 시그널을 구하기 위한 이동 평균은 4일입니다. """}, { diff --git a/templates/Lists.html b/templates/Lists.html index 0809ee3..45e1520 100644 --- a/templates/Lists.html +++ b/templates/Lists.html @@ -40,6 +40,7 @@

{{title}} Stock List

+

{{lastUpdate}}

{{collected.description}}