diff --git a/ChanLun.py b/ChanLun.py index a402053..f016748 100644 --- a/ChanLun.py +++ b/ChanLun.py @@ -10,12 +10,8 @@ from ChanZS import ChanZS from ChanBSP import ChanBSP import talib.abstract as ta import pandas as pd -import matplotlib.pyplot as plt -from matplotlib.dates import DateFormatter, date2num -import matplotlib.patches as patches from technical.util import resample_to_interval from decimal import Decimal -import xgboost as xgb import numpy as np from ChanMACD import ChanMACD from TF_DF import TF_DF diff --git a/TF_DF.py b/TF_DF.py index 3e10e95..6c811ab 100644 --- a/TF_DF.py +++ b/TF_DF.py @@ -123,13 +123,13 @@ class TF_DF(): return klu_state_list def check_fx(self, klc): if klc.pre and klc.next: - if klc.high > klc.pre.high and klc.high > klc.next.high and klc.low > klc.pre.low and klc.low > klc.next.low: - #if (klc.close > klc.ema52 or klc.next.close > klc.next.ema52) and klc.macd > 0 and klc.macd > klc.macdhist: + if klc.high > klc.pre.high and klc.high > klc.next.high and klc.low > klc.pre.low and klc.low > klc.next.low and klc.signal > 0: + #if (klc.close > klc.ema52 or klc.next.close > klc.next.ema52) and klc.macd > 0: klc.set_fx(Chan_FX_TYPE.TOP) #print(klc.start_time, klc.end_time,klc.next.start_time, klc.next.end_time, klc.macd, klc.state, klc.fx, "TOP") return Chan_FX_TYPE.TOP - elif klc.low < klc.pre.low and klc.low < klc.next.low and klc.high < klc.pre.high and klc.high < klc.next.high: - #if (klc.close < klc.ema52 or klc.next.close < klc.next.ema52) and klc.macd < 0 and klc.macd < klc.macdhist: + elif klc.low < klc.pre.low and klc.low < klc.next.low and klc.high < klc.pre.high and klc.high < klc.next.high and klc.signal < 0: + #if (klc.close < klc.ema52 or klc.next.close < klc.next.ema52) and klc.macd < 0: klc.set_fx(Chan_FX_TYPE.BOTTOM) #print(klc.start_time, klc.end_time,klc.next.start_time, klc.next.end_time, klc.macd, klc.state, klc.fx, "BOTTOM") return Chan_FX_TYPE.BOTTOM diff --git a/web/app.py b/web/app.py index 36e354b..f1b525e 100644 --- a/web/app.py +++ b/web/app.py @@ -8,9 +8,6 @@ import requests from datetime import datetime, timedelta import sys import os -import matplotlib -matplotlib.use('Agg') # 设置使用非GUI后端,必须在导入pyplot之前设置 -import matplotlib.pyplot as plt import io import base64 import time