feat: add pages

This commit is contained in:
monoid 2023-10-26 22:11:58 +09:00
parent fae9cc8154
commit ca9dd95461
2 changed files with 21 additions and 5 deletions

13
gen.py
View File

@ -91,7 +91,7 @@ def isMACDCrossSignal(signal: pd.Series, macd: pd.Series, nday: int, order=1) ->
signal.iloc[nday+order] < macd.iloc[nday+order])
def isRelativeDiffLessThan(a:pd.Series,b:pd.Series, threshold: float,nday:int) -> bool:
return abs(a.iloc[nday] - b.iloc[nday]) / b.iloc[nday] < threshold
return abs(a.iloc[nday] - b.iloc[nday + 1]) / b.iloc[nday + 1] < threshold
def isDiffGreaterThan(a:pd.Series,b:pd.Series, nday:int) -> bool:
"""a is bigger than b"""
@ -154,8 +154,14 @@ def collect(data: DataStore, collector: OutputCollector, corp: database.KRXCorp
bollinger_upperband = d25 + 2* d_std25
a = [d5, d20, d45, d60]
a = [d5, d20, d45]
for nday in ndays:
if openv[nday] <= d240[nday] and d240[nday] <= close[nday] and d240[nday + 1] < d240[nday]:
collector.collect("양봉사이240일선증가", corp, stock.index[nday])
if d5[nday + 1] < d5[nday] and d5[nday + 2] > d5[nday + 1] and d20[nday + 1] < d20[nday]:
collector.collect("5일선반등120선증가", corp, stock.index[nday])
if openv[nday] <= d20[nday] and d20[nday] <= close[nday]:
collector.collect("양봉사이20일선", corp, stock.index[nday])
@ -205,6 +211,9 @@ def collect(data: DataStore, collector: OutputCollector, corp: database.KRXCorp
if (D240BiggerThanYesterDay):
collector.collect("240일 증가", corp, stock.index[nday])
if max([d[nday] for d in (d20, d60, d120)]) < min(close[nday], openv[nday]):
collector.collect("떠있음", corp, stock.index[nday])
if (d60[nday + 1] < d60[nday]):
collector.collect("정배열60", corp, stock.index[nday])
if (d20[nday + 1] < d20[nday]):

View File

@ -36,11 +36,11 @@
macd가 아래로 내려가는 시점을 찾습니다. macd 는 5일선과 10일선으로 이루어지고
시그널을 구하기 위한 이동 평균은 4일입니다.
- name: 뭉침
description: d5, d20, d45, d60 만난것 종가 5% 이내
description: d5, d20, d45 만난것 종가 5% 이내
- name: 뭉침01
description: d5, d20, d45, d60 만난것 종가 1% 이내
description: d5, d20, d45 만난것 종가 1% 이내
- name: 뭉침03
description: d5, d20, d45, d60 만난것 종가 3% 이내
description: d5, d20, d45 만난것 종가 3% 이내
- name: 45일선 반등
description: 45일 선반등
@ -64,6 +64,13 @@
description: '볼린저 밴드(25일선 ,표준편차 2배)의 위 밴드 값을 넘었을 때 표시.'
- name: 양봉사이20일선
description: Open과 Close 사이 20일 선
- name: 양봉사이240일선증가
description: Open과 Close 사이 240일 선. 240일 선 증가
- name: 떠있음
description: |
양봉, 음봉이 20일선, 60일선, 120선보다 떠있으면
- name: 5일선반등120선증가
description: 5일선이 반등 120 선 증가
- name: 120선240선추월
description: |
120선이 상승해서 240일 선을 뚫을때