<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                # 4.16 K 線分析 ? 尋找夜空中最亮的星 > 來源:https://uqer.io/community/share/557c4527f9f06c6518ad1543 星蠟燭線(簡稱星線)的實體較小,并且在它的實體與它前面的蠟燭線的實體之間形成了價格跳空。只要星線的實體與前一個實體沒有任何重疊,那么這個星蠟燭線就是成立的。星線對形態反轉有著重要意義。 + step 1. 獲取股票池。 + step 2. 股票池篩選:最近趨勢為跌-->換手率>2%-->近兩天出現過星線。 + step 3. 輸出這些股票的最近k線圖。 ```py from lib.kbase import K def trend(closePrices, before=5): '''趨勢 @param closePrices: 收盤價格列表,由先到后順序 @return: 上漲趨勢返回1,下跌趨勢返回-1, 趨勢不明返回0 ''' if len(closePrices) < before: return 0 up = 0 down = 0 for i, price in enumerate(closePrices[-before:]): if i == 0: pre_price = price continue if pre_price < price: up += 1 elif pre_price > price: down += 1 pre_price = price if up > down and closePrices[-2] > closePrices[before-1]: return 1 elif down > up and closePrices[-2] < closePrices[before-1]: return -1 else: return 0 def is_star_line(infos): ''' @param infos: [(openPrice,lowestPrice,highestPrice,closePrice), ...] ''' ks = [K(e) for e in infos] stars = [] for k in ks[-3:]: if k.length > 0 and (k.entityLen/k.length) <= 0.1: stars.append(k) for star in stars: idx = ks.index(star) pre = ks[idx-1] if pre.isRed: if star.openPrice >= pre.closePrice and star.closePrice >= pre.closePrice: return True elif star.openPrice <= pre.openPrice and star.closePrice <= pre.openPrice: return True else: if star.openPrice >= pre.openPrice and star.closePrice >= pre.openPrice: return True elif star.openPrice <= pre.closePrice and star.closePrice <= pre.closePrice: return True return False ``` ```py def get_k_pic(tid, ecd): if ecd == 'XSHE': pic = '![%s](http://hqpick.eastmoney.com/EM_Quote2010PictureProducter/Index.aspx?ImageType=KXL&ID=%s%s&EF=&Formula=MACD)' % \ (tid, tid, 2) else: pic = '![%s](http://hqpick.eastmoney.com/EM_Quote2010PictureProducter/Index.aspx?ImageType=KXL&ID=%s%s&EF=&Formula=MACD)' % \ (tid, tid, 1) return pic ``` ```py from lib.kbase import K today = '20150612' beginDate = '20150601' def get_active_tickers(): tickers = DataAPI.EquGet(equTypeCD="A", listStatusCD="L", field=['ticker', 'ListSector']) tickers = tickers[tickers['ListSector'] != '創業板'] tickers = [val[0] for val in tickers.values] return tickers def get_last_with_star_line_tickers(count): tickers = [] all_tickers = get_active_tickers() for ticker in all_tickers: infos = DataAPI.MktEqudAdjGet(ticker=ticker, beginDate=beginDate, field=["ticker", "secShortName", "exchangeCD", "tradeDate", "openPrice", "lowestPrice", "highestPrice", "closePrice"]) infos = infos[infos['openPrice'] > 0] closePrices = [val[-1] for val in infos.values] if not closePrices: continue if trend(closePrices) != -1: continue vol5 = DataAPI.MktStockFactorsOneDayGet(tradeDate=today,ticker=infos.values[0][0],field=["ticker","VOL5"]) vol5 = vol5.values[0][1] if vol5 < 0.02: continue _infos = [val[-4:] for val in infos.values] if is_star_line(_infos): tickers.append(infos) if len(tickers) >= count: break return tickers if __name__ == '__main__': tickers = get_last_with_star_line_tickers(1000) for t in tickers: print '###%s(%s)\n' % (t.values[0][1], t.values[0][0]) print get_k_pic(t.values[0][0], t.values[0][2]) print '\n' ``` 錦龍股份(000712) ![000712](https://box.kancloud.cn/2016-07-31_579d7a002b8be.png) 中科金財(002657) ![002657](https://box.kancloud.cn/2016-07-31_579d7a003c0c7.png) 克明面業(002661) ![002661](https://box.kancloud.cn/2016-07-31_579d7a004d22d.png) 龍洲股份(002682) ![002682](https://box.kancloud.cn/2016-07-31_579d7a005dcdb.png) 麥趣爾(002719) ![002719](https://box.kancloud.cn/2016-07-31_579d7a0071861.png) 浙能電力(600023) ![600023](https://box.kancloud.cn/2016-07-31_579d7a00830e5.png) 中新藥業(600329) ![600329](https://box.kancloud.cn/2016-07-31_579d7a0094760.png) 太平洋(601099) ![601099](https://box.kancloud.cn/2016-07-31_579d7a00a5a02.png) 明星電纜(603333) ![603333](https://box.kancloud.cn/2016-07-31_579d7a00b6dda.png)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看