庄股底部特征:股票长期缩量,在缩量过程中也伴随着成交额脉冲式向上后回落。
判断缩量:利用成交额20,60,160日移动平均线判断
脉冲判断1.0:利用成交额5,160日移动平均线交叉次数来判断(修改成5,160交叉了)
值越大,庄越强
优化思路:主力在不同时期的操盘手法是不同的。
a、主力在底部建仓以后可以用上面这个方法找强势股。(本阶段应该比较适合这种方法)
b、主力在股灾后就不能用这个方法了,这个时候应该研究哪些主力被套最深,套的越深,弹得越高。还有哪些主力操盘能力强,超盘能力越强(龙虎榜),越会在大反弹中出手。
c、牛市中找板块热点,找龙头,无脑买买买。
以上是我关于大盘的三个阶段的思考。
#庄股值计算 def cow_stock_value(stock,stock_time) :q = query(valuation).filter(valuation.code == stock)pb = get_fundamentals(q, stock_time)['pb_ratio'][0]cap = get_fundamentals(q, stock_time)['circulating_market_cap'][0]if cap>100: return 0num_fall=fall_money_day_3line(stock,120,20,60,160,stock_time)num_cross=money_5_cross_60(stock,120,5,160,stock_time)return (num_fall*num_cross)/(pb*(cap**0.5))#计算脉冲(1.0版本) def money_5_cross_60(stock , n,n1=5,n2=60,stock_time=datetime.datetime.now()):if not (n2 >n1 ) : log.info("fall_money_day 参数错误")return 0 #stock_m=attribute_history(stock, n+n2+1, '1d', ['money'], True)stock_m=get_price(stock,count=n+n2+1,end_date=stock_time,frequency='daily', \ fields=['money'], skip_paused=True)#print(len(stock_m)) i=0count=0while i<n:money_MA60=stock_m['money'][i+1:n2+i].mean()money_MA60_before=stock_m['money'][i:n2-1+i].mean()money_MA5=stock_m['money'][i+1+n2-n1:n2+i].mean()money_MA5_before=stock_m['money'][i+n2-n1:n2-1+i].mean()if (money_MA60_before-money_MA5_before)*(money_MA60-money_MA5)<0: count=count+1i=i+1 return count#3条移动平均线计算缩量 def fall_money_day_3line(stock,n,n1=20,n2=60,n3=120,stock_time=datetime.datetime.now()):if not ( n3>n2 and n2 >n1 ) : log.info("fall_money_day 参数错误")return 0 #stock_m=attribute_history(stock, n+n3, '1d', ['money'], True)stock_m=get_price(stock,count=n+n3,end_date=stock_time,frequency='daily', \ fields=['money'], skip_paused=True)#print(len(stock_m)) i=0count=0while i<n:money_MA200=stock_m['money'][i:n3-1+i].mean()money_MA60=stock_m['money'][i+n3-n2:n3-1+i].mean()money_MA20=stock_m['money'][i+n3-n1:n3-1+i].mean()if money_MA20<=money_MA60 and money_MA60<=money_MA200:count=count+1i=i+1return countcow_value_dict=dict()'''stock_list=['000935.XSHE']#stock_list=['600228.XSHG']for stock in stock_list:cow_value_dict[stock]=0 stock_time=datetime.datetime(2016,6,30,0,0,0)for stock in stock_list: cow_value=cow_stock_value(stock,stock_time) cow_value_dict[stock]=cow_value #s='%s:%s'%(stock,cow_stock_value(stock,stock_time))tmp= sorted(cow_value_dict.items(), key=lambda item:item[1],reverse=True)print (stock_time)for u in tmp:print(u)'''stock_list = get_index_stocks('000107.XSHG') \+get_index_stocks('000108.XSHG') \+get_index_stocks('000109.XSHG') \+get_index_stocks('000111.XSHG')for stock in stock_list:cow_value_dict[stock]=0 stock_time=datetime.datetime(2016,12,9,0,0,0)for stock in stock_list: cow_value=cow_stock_value(stock,stock_time)cow_value_dict[stock]=cow_value#s='%s:%s'%(stock,cow_stock_value(stock,stock_time))tmp= sorted(cow_value_dict.items(), key=lambda item:item[1],reverse=True)print (stock_time)for u in tmp:print(u)
2016-12-09 00:00:00 ('600327.XSHG', 32.907348124501119) ('600422.XSHG', 28.733081724755511) ('600828.XSHG', 28.569388969228601) ('600195.XSHG', 27.43367617597842) ('601058.XSHG', 25.010010815244197) ('600987.XSHG', 24.313623374769843) ('600697.XSHG', 23.086544920384632) ('600251.XSHG', 20.932463647804333) ('600859.XSHG', 20.537843841240125) ('600479.XSHG', 19.506927713475207) ('600825.XSHG', 19.367889151938883) ('600386.XSHG', 19.210033509503575) ('600351.XSHG', 18.826383984531137) ('600587.XSHG', 18.441735366692377) ('600624.XSHG', 17.811558544166438) ('600814.XSHG', 15.625672618501662) ('600135.XSHG', 15.399567291047131) ('600613.XSHG', 15.350688517527868) ('603818.XSHG', 14.706823622546823) ('603567.XSHG', 14.601139903313786) ('600511.XSHG', 14.577565046952156) ('603883.XSHG', 14.562767708048556) ('603008.XSHG', 14.538967055875096) ('600729.XSHG', 14.372182464736017) ('603508.XSHG', 14.160542116895341) ('601799.XSHG', 13.766304464665215) ('600831.XSHG', 13.604646954087855) ('600337.XSHG', 13.375955638692803) ('600363.XSHG', 13.286994597643693) ('600742.XSHG', 12.982585191250546) ('600439.XSHG', 12.945037166013019) ('603328.XSHG', 12.942222515802348) ('603997.XSHG', 12.837532791481465) ('600054.XSHG', 12.700917946483107) ('600557.XSHG', 12.699609597645557) ('600257.XSHG', 11.395641129084805) ('600628.XSHG', 11.192795718789213) ('600480.XSHG', 10.579108121183481) ('600088.XSHG', 10.469803373634401) ('603306.XSHG', 10.380242509592277) ('603806.XSHG', 10.298865718554508) ('600676.XSHG', 10.24014270774285) ('600750.XSHG', 10.189349885980098) ('600563.XSHG', 9.9681666626241103) ('600289.XSHG', 9.7443909625885361) ('600305.XSHG', 9.3918001748175985) ('600081.XSHG', 9.2906001387554156) ('603939.XSHG', 8.8650582183112583) ('600756.XSHG', 8.4644714766979554) ('601689.XSHG', 8.4324929798807666) ('600661.XSHG', 7.842410229357835) ('603898.XSHG', 7.5032247348412895) ('600571.XSHG', 7.1902709223094545) ('600285.XSHG', 7.1371960203365026) ('603609.XSHG', 6.7014677749597125) ('600381.XSHG', 6.4289451692517696) ('603600.XSHG', 6.1665439855235906) ('600566.XSHG', 5.7885096178678825) ('600993.XSHG', 5.7816235474293842) ('603288.XSHG', 5.7375251550504034) ('600651.XSHG', 5.4322688671853001) ('600420.XSHG', 5.3007837177384616) ('603118.XSHG', 5.0246146056422738) ('603369.XSHG', 4.964216878182544) ('600280.XSHG', 4.9314855073214048) ('603669.XSHG', 4.7590838087629095) ('600824.XSHG', 4.4703607360721183) ('600260.XSHG', 4.4623627640545811) ('603555.XSHG', 4.3989183729661203) ('600197.XSHG', 4.3060909486657808) ('600460.XSHG', 4.2535000958613196) ('603116.XSHG', 3.8603421217673288) ('603866.XSHG', 3.8288541288393452) ('603168.XSHG', 3.7187038860476647) ('600845.XSHG', 3.5381330814688479) ('600965.XSHG', 3.2721782351115762) ('603368.XSHG', 3.1826093395614459) ('603025.XSHG', 3.0603658341267437) ('600537.XSHG', 3.0044354677221077) ('600818.XSHG', 2.7458698866481441) ('600559.XSHG', 2.1920795510378919) ('603589.XSHG', 2.0025526482377223) ('603355.XSHG', 0.72470395798593279) ('600694.XSHG', 0) ('600594.XSHG', 0) ('600056.XSHG', 0) ('600297.XSHG', 0) ('603019.XSHG', 0) ('600664.XSHG', 0) ('600073.XSHG', 0) ('600171.XSHG', 0) ('601238.XSHG', 0) ('600682.XSHG', 0) ('600418.XSHG', 0) ('600380.XSHG', 0) ('600436.XSHG', 0) ('600763.XSHG', 0) ('600600.XSHG', 0) ('601311.XSHG', 0) ('600612.XSHG', 0) ('601098.XSHG', 0) ('600718.XSHG', 0) ('600654.XSHG', 0) ('600267.XSHG', 0) ('600398.XSHG', 0) ('600584.XSHG', 0) ('603766.XSHG', 0) ('600086.XSHG', 0) ('600572.XSHG', 0) ('600687.XSHG', 0) ('600536.XSHG', 0) ('600438.XSHG', 0) ('600666.XSHG', 0) ('601801.XSHG', 0) ('600640.XSHG', 0) ('600183.XSHG', 0) ('600298.XSHG', 0) ('600300.XSHG', 0) ('600062.XSHG', 0) ('600667.XSHG', 0) ('600811.XSHG', 0) ('600261.XSHG', 0) ('600601.XSHG', 0) ('600166.XSHG', 0) ('600410.XSHG', 0) ('600335.XSHG', 0) ('600122.XSHG', 0) ('600551.XSHG', 0) ('600562.XSHG', 0) ('601012.XSHG', 0) ('600850.XSHG', 0) ('600138.XSHG', 0) ('600754.XSHG', 0) ('601010.XSHG', 0) ('600884.XSHG', 0) ('600521.XSHG', 0) ('600482.XSHG', 0) ('600872.XSHG', 0) ('601231.XSHG', 0) ('600161.XSHG', 0) ('600366.XSHG', 0) ('600373.XSHG', 0) ('600597.XSHG', 0) ('600699.XSHG', 0) ('600329.XSHG', 0) ('600216.XSHG', 0) ('600201.XSHG', 0) ('600867.XSHG', 0) ('601777.XSHG', 0) ('603000.XSHG', 0)
、
本社区仅针对特定人员开放
查看需注册登录并通过风险意识测评
5秒后跳转登录页面...
移动端课程