Day16 list(frequency 4)

 

1 distinct distinction distinctive distinctlydistinctiveness

2 distinguish  distinguished distinguishing distinguishable

3 diverse diversify  diversification

4 documentary document documentation

5 drain   brain drain  down the drain drainage

6 drought

7 echo echoic

8 embark

9 emit emission

10 empire emperor empress

11 encounter confront meet    run into

12 endure endurable endurance

13 erode erosion

14 essence essential essentially

15 estate

16 exception exceptional except

17 excess  excessively

 

 

1 exert  exertion

2 expedition excursion march voyage

3 explicit explicitly explicitness implicit

4 exploit exploitation exploitative

5 explore explorer exploration exploratory

6 fallow fellow follow

7 fantastic fantasy  fantasize

8 fatigue weary/weariness tiredness/tire  exhaust

9 file

10 freeze froze frozen  chill congeal halt

11 fulfill fulfillment

12 gadget

13 gear

14 glue

15 govern government governmental

16 graze

17 hail

18 handful    a handful of of

19 handout  hand out

20 harden  hardship

21 hockey

 

 

 

 

1 hollow

2 hut cabin cottage

3 immune immunity immunization

4 impress impressive  impression

5 incidence incident incidental

6 incorporate  incorporation

7 indicate indication indicative indicator

8 industry industrial industrialize  industrially industrialization

9 inevitable  evitable inevitably

10 infection infect infected infectious


 

11 inspire inspiration  inspirational

12 instinct instinctive   by instinct

13 intelligence intelligent intelligible

14 isolate isolation

15 juvenile

16 landlord landlady

17 landmark

18 layout

19 lifespan

20 limit limitation limited

21 log

22 magic magical  magician

23 manual

24 memory memorial  memorize memorable

 

 

 

import datetime today = datetime.date.today() ## 获取今天的日期 day1=datetime.date.today()-datetime.timedelta(300) ### 获取300天之前的日期 day2=datetime.datetime.strftime(today,"%Y-%m-%d" ) all_stock = get_all_securities(types=['stock'], date=day2) ### 获取所有股票代码 code=list(all_stock.index) ## 判断是否ST 并且删除st的股票代码 df_st=get_extras('is_st',code,start_date=day1,end_date=day2) for i in code: if any(df_st[i].values): code.remove(i) stock_list=[] for i in code: start_date=get_security_info(i).start_date days=(today-start_date).days if days>300: #### 选出上市满天300的股票 stock_list.append(i) data=dict() for i in stock_list: df=get_price(i,start_date=day1,end_date=day2,frequency='daily', fields=['open','close','high','low']) data[i]=df ### 将数据分成选股数据和回测数据。假设用中间的120根k线,后60根k线回测 code=[] n=45 ## n为回测k线的个数 s设为45 (可以随意调整) for i in stock_list: df=data[i] max_=max(df.high[-190:-n-1]) ### 选140=(190-45)根k线(可以随意调整) min_=min(df.low[-190:-n-1]) max_close=max(df.close[-190:-n-1]) ### 选出平台震荡期间振幅小于50%的,且,最后三天连涨,最后一天突破平台最大收盘价超过5%的所有股票 if all([max_/min_<1.5,df.close[-n-1]>df.close[-n-2]>df.close[-n-3],df.close[-n-1]/max_close>1.05]): code.append(i) ### 买入过程 ## 假设根据上面平台突破选出来的股票作为买入标的 ## 买入原则是 当天选出来的股票第二天以开盘价买入。且把选出来的每只股票以,同等资金额买入 capital=100000 ## 初始资金为 10万元 position=dict() ## 初始持仓手数为一个空字典 def handle(stock_list,capital,posttion,data,n): capital_=0 for i in code: capital_per=capital/len(code) position[i]=int(capital_per/(data[i].open[-n]*100)) capital_+=capital_per-position[i]*data[i].open[-n]*100 return ([position,capital_]) position_result=handle(get_code(),capital,position,data,n)修改上述代码,使能在jupyter里面运行
06-06
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值