[Mod] flake8 code quanlity improve

This commit is contained in:
vn.py 2019-11-07 15:33:48 +08:00
parent 65fc733a02
commit 3ed0131b44
3 changed files with 52 additions and 50 deletions

View File

@ -85,7 +85,7 @@ class DataAnalysis:
t = [] t = []
o = [] o = []
h = [] h = []
l = [] l = [] # noqa
c = [] c = []
v = [] v = []
@ -274,11 +274,13 @@ class DataAnalysis:
elif data.iloc[i]["close"] < data.iloc[i]["boll_down"] and data.iloc[i - 1]["close"] > data.iloc[i - 1]["boll_down"]: elif data.iloc[i]["close"] < data.iloc[i]["boll_down"] and data.iloc[i - 1]["close"] > data.iloc[i - 1]["boll_down"]:
down_signal.append(i) down_signal.append(i)
fig = plt.figure(figsize=(20, 8)) plt.figure(figsize=(20, 8))
close = data["close"] close = data["close"]
plt.plot(close, lw=1) plt.plot(close, lw=1)
plt.plot(close, '^', markersize=5, color='r', label='UP signal', markevery=up_signal) plt.plot(close, '^', markersize=5, color='r',
plt.plot(close, 'v', markersize=5, color='g', label='DOWN signal', markevery=down_signal) label='UP signal', markevery=up_signal)
plt.plot(close, 'v', markersize=5, color='g',
label='DOWN signal', markevery=down_signal)
plt.plot(data["boll_up"], lw=0.5, color="r") plt.plot(data["boll_up"], lw=0.5, color="r")
plt.plot(data["boll_down"], lw=0.5, color="g") plt.plot(data["boll_down"], lw=0.5, color="g")
plt.legend() plt.legend()