44 lines
728 B
Python
44 lines
728 B
Python
|
# %%
|
||
|
import matplotlib.pyplot as plt
|
||
|
# %%
|
||
|
import gen
|
||
|
# %%
|
||
|
dataStore = gen.DataStore()
|
||
|
stock = dataStore.getStockPrice("108320",250)
|
||
|
close = stock["CLOSE"]
|
||
|
|
||
|
d45 = close.loc[::-1].rolling(window=45).mean().dropna().loc[::-1]
|
||
|
rsi = gen.calc_rsi(close.loc[::-1],14).dropna().loc[::-1]
|
||
|
rsi.reset_index(drop = True, inplace = True)
|
||
|
# %%
|
||
|
|
||
|
|
||
|
# %%
|
||
|
|
||
|
krxCrops = dataStore.getAllKRXCorp()
|
||
|
krxCrops
|
||
|
# %%
|
||
|
krxCrops[0]
|
||
|
# %%
|
||
|
# %%
|
||
|
#%%time
|
||
|
lst = []
|
||
|
for entry in krxCrops:
|
||
|
data = dataStore.getStockPrice(entry.Code, 120)
|
||
|
lst.append(data)
|
||
|
print("a")
|
||
|
# %%
|
||
|
lst
|
||
|
# %%
|
||
|
#%%time
|
||
|
|
||
|
lst_mean = [ s["CLOSE"].mean() for s in lst]
|
||
|
|
||
|
# %%
|
||
|
len(krxCrops)
|
||
|
# %%
|
||
|
|
||
|
RANGE = 50
|
||
|
plt.plot(d45.iloc[:RANGE].loc[::-1])
|
||
|
plt.plot(close.iloc[:RANGE].loc[::-1])
|
||
|
plt.show()
|