Example #1
0
                        else:
                            top_dif = top_dif.sort_values(
                                by=['dff', 'percent', 'ratio'],
                                ascending=[1, 0, 1])

                    # top_all=top_all.sort_values(by=['percent','dff','couts','ratio'],ascending=[0,0,1,1])
                    # print rl.format_for_print(top_dif[:10])
                    # top_dd = pd.concat([top_dif[:5],top_temp[:3],top_dif[-3:],top_temp[-3:]], axis=0)
                    if percent_status == 'y' and (cct.get_now_time_int() > 935
                                                  or cct.get_now_time_int() <
                                                  900) and ptype == 'low':
                        top_dif = top_dif[top_dif.percent >= 0]
                        top_temp = top_dif[:ct.PowerCount].copy()
                        top_end = top_dif[-5:].copy()
                        top_temp = pct.powerCompute_df(top_temp,
                                                       dl=ct.PowerCountdl,
                                                       talib=True,
                                                       newdays=newdays)
                        top_end = pct.powerCompute_df(top_end,
                                                      dl=ct.PowerCountdl,
                                                      talib=True,
                                                      newdays=newdays)

                    # elif percent_status == 'y' and cct.get_now_time_int() > 935 and ptype == 'high' :
                    elif ptype == 'low':
                        # top_dif = top_dif[top_dif.percent >= 0]
                        top_temp = top_dif[:ct.PowerCount].copy()
                        top_end = top_dif[-5:].copy()
                        top_temp = pct.powerCompute_df(top_temp,
                                                       dl=ct.PowerCountdl,
                                                       talib=True,
                                                       newdays=newdays)
Example #2
0
                                & (top_all.low >= top_all.ma51d) &
                                (top_all.lasth1d > top_all.lasth2d)]
                            # top_temp = top_all[((top_all.open > top_all.lastp1d)) & (
                            # top_all.low >= top_all.lastl1d) & (top_all.lasth1d > top_all.lasth2d)]
                            # top_temp = top_all[  (top_all.low >= top_all.lastl1d) & (top_all.lasth1d > top_all.lasth2d) & (top_all.low >= top_all.nlow) & ((top_all.open >= top_all.nlow *0.998) & (top_all.open <= top_all.nlow*1.002)) ]
                            # top_temp = top_all[ (top_all.volume >= 1.2 ) & (top_all.low >= top_all.lastl1d) & (top_all.lasth1d > top_all.lasth2d) & (top_all.close > top_all.lastp1d)]
                    else:
                        top_temp = top_all.copy()

                    # if st_key_sort != '4':
                    #     top_temp = stf.filterPowerCount(top_temp, ct.PowerCount)

                    top_end = top_all[-int((ct.PowerCount) / 10):].copy()

                    top_temp = pct.powerCompute_df(top_temp,
                                                   dl=ct.PowerCountdl,
                                                   talib=True)
                    top_end = pct.powerCompute_df(top_end, dl=ct.PowerCountdl)

                    goldstock = len(
                        top_dif[(top_dif.buy >= top_dif.lhigh * 0.99)
                                & (top_dif.buy >= top_dif.llastp * 0.99)])

                    cct.set_console(width,
                                    height,
                                    title=[
                                        'dT:%s' % cct.get_time_to_date(time_s),
                                        'G:%s' % len(top_dif),
                                        'zxg: %s' %
                                        (blkname + '-' + market_blk)
                                    ])
Example #3
0
                else:

                    if 'couts' in top_dif.columns.values:
                        top_dif = top_dif.sort_values(
                            by=ct.Monitor_sort_count,
                            ascending=[0, 0, 0, 1, 1])
                    else:
                        # print "Good Morning!!!"
                        top_dif = top_dif.sort_values(
                            by=['dff', 'percent', 'ratio'],
                            ascending=[0, 0, 1])

                    # top_all=top_all.sort_values(by=['percent','dff','couts','ratio'],ascending=[0,0,1,1])
                    # print rl.format_for_print(top_dif[:10])
                    top_temp = top_dif[:ct.PowerCount].copy()
                    top_temp = pct.powerCompute_df(top_temp,
                                                   dl=ct.PowerCountdl)
                    goldstock = len(
                        top_dif[(top_dif.buy >= top_dif.lhigh * 0.99)
                                & (top_dif.buy >= top_dif.llastp * 0.99)])

                    cct.set_console(width,
                                    height,
                                    title=[
                                        'dT:%s' % cct.get_time_to_date(time_s),
                                        'G:%s' % len(top_dif),
                                        'zxg: %s' % (blkname)
                                    ])

                    top_all = tdd.get_powerdf_to_all(top_all, top_temp)
                    top_temp = stf.getBollFilter(df=top_temp,
                                                 boll=ct.bollFilter,