import sys import datetime from external_package import tushare_helper as th from inner_package import standardized as standard from inner_package import show # original = th.TushareHelper('000001', datetime.date.today()+ datetime.timedelta(days=-1),datetime.date.today() + datetime.timedelta(days=+1),'1min') original = th.TushareHelper('000001', '2017-12-04', '2017-12-12', 'D') original.data_transfer() sta = standard.StandardHandle(original.data_original) sta.deal_candle() sta.get_top_bottom() date_tickers = original.date_tickers my_plot = show.PlotShow(date_tickers, '000001') my_plot.candle_show(original.data_original_ex, []) date_tickers = sta.date_tickers my_plot = show.PlotShow(date_tickers, '000001') # my_plot.candle_show(sta.standardized_list_ex, []) my_plot.candle_show(sta.standardized_list_ex, sta.top_bottom_list_ex) my_plot.candle_show(sta.standardized_list_ex, sta.standardized_top_bottom_list_ex)
# print('cut') ''' ''' # 画图的部分 date_tickers = original.date_tickers # 获取原始标记的时间 my_plot = show.PlotShow(date_tickers, code [0]) my_plot.candle_show(original.data_original_ex, []) # 原图 ''' date_tickers = sta.date_tickers my_plot = show.PlotShow(date_tickers, code [0]) # my_plot.candle_show(sta.standardized_list_ex, []) my_plot.candle_show(sta.standardized_list_ex, sta.top_bottom_list_ex) # 所有顶底分型 #分型的问题,通过后一个分型确定前一个,导致了最后一个分型不会画出来,同样 #在数据库里添加标签,表示未定分型方便后续的修改和添加 形成: 起点分型,未定分型,终点分型 三种分型 # 添加开始和结尾的点坐标,但是划线需要修改(仅是画图的功能修改) #添加起始分型 # sta.standardized_top_bottom_list_ex.insert(0, sta.standardized_list_ex[0]) #添加最后一个未确定的分型 #修正 应该是最后一个 未识别的反向分型 # sta.standardized_top_bottom_list_ex.append(sta.standardized_top_bottom_list_ex[-1]) #添加结束分型 # sta.standardized_top_bottom_list_ex.append(sta.standardized_list_ex[-1]) # 缺少的是开始和结尾的顶底分型坐标
# 储存data_original_ex筛选数据,data_original全部数据,date_tickers添加时间数据 original.data_transfer() ####################################################################################################################################################### # K线数据标准化处理,输入的是列表,对输入的数据进行处理 sta = standard.StandardHandle(original.data_original) # 处理K线deal_candle sta.deal_candle() # 思路 # 1、先获取所有的顶和底,标准转向 # 2、连续顶底的处理 # 3、输出 sta.get_top_bottom() #画图的部分 date_tickers = original.date_tickers #获取原始标记的时间 my_plot = show.PlotShow(date_tickers, stock_list[0]) my_plot.candle_show(original.data_original_ex, []) #原图 date_tickers = sta.date_tickers my_plot = show.PlotShow(date_tickers, stock_list[0]) # my_plot.candle_show(sta.standardized_list_ex, []) my_plot.candle_show(sta.standardized_list_ex, sta.top_bottom_list_ex) #所有顶底分型 print('shaixuan') #添加开始和结尾的点坐标,但是划线需要修改 sta.standardized_top_bottom_list_ex.insert(0, sta.standardized_list_ex[0]) sta.standardized_top_bottom_list_ex.append(sta.standardized_list_ex[-1]) #缺少的是开始和结尾的顶底分型坐标 my_plot.candle_show(sta.standardized_list_ex, sta.standardized_top_bottom_list_ex) #筛选后的顶底分型
import datetime sys.path.append( os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir))) from external_package import tushare_helper as th from inner_package import standardized as standard from inner_package import show from inner_package import ma_kiss as mk code = "002500" original = th.TushareHelper( code, datetime.date.today() + datetime.timedelta(days=-30), datetime.date.today() + datetime.timedelta(days=1), '60min') original.data_transfer_ma() makiss = mk.MAKiss(code, original.data_frame_ma_mini) my_plot = show.PlotShow([], code) # 交点获取 makiss.get_intersections() print(len(makiss.intersections)) print(makiss.intersections) # 吻获取 makiss.get_lip_kiss() print(makiss.lip_kiss) # 打印 my_plot.ma_kiss_show(makiss)
import sys import datetime from external_package import tushare_helper as th from inner_package import standardized as standard from inner_package import show # original = th.TushareHelper('000001', datetime.date.today()+ datetime.timedelta(days=-1),datetime.date.today() + datetime.timedelta(days=+1),'1min') # original = th.TushareHelper('000001', '2017-12-04', '2018-12-12', 'D') # original = th.TushareHelper('600756', '2018-01-01', '2018-12-31', 'D', [5,20],'E') original = th.TushareHelper('600756', '2018-08-01', '2018-12-31', '60MIN', [5, 20], 'E') original.data_transfer() sta = standard.StandardHandle(original.data_original) sta.deal_candle() sta.get_top_bottom() date_tickers = sta.date_tickers my_plot = show.PlotShow(date_tickers, '600756') # my_plot.candle_show(sta.standardized_list_ex, []) # my_plot.candle_show(sta.standardized_list_ex, sta.top_bottom_list_ex) my_plot.candle_show(sta.standardized_list_ex, sta.standardized_top_bottom_list_ex)