today study_2005.1.22

2005年1月22日

今天状态还算可以,能够静下心来学习一些东西了。老婆走了以后就像掉了魂一样,但我知道这样下去是不行的,时间对我来说是很紧张的,我不能够浪费。踏踏实实的学些东西吧,如果连这一关都过不了,我还能干什么?!

Other threads might enter a sleeping state only to be awakened periodically to poll for a change or update status information.

其他线程可能进入休眠状态,只被定期唤醒以轮询更改或更新状态信息。

awaken: <script language=javascript>doOutputPhone("2E5weIkEn3")</script>

<script language=javascript>doOutputChinese("vi. 醒,觉醒|vt. 1.唤醒,使觉醒 2.唤起,激起");</script> vi. 醒,觉醒
vt. 1.唤醒,使觉醒 2.唤起,激起

periodically:ad. 周期性地,定时性地

poll: <script language=javascript>doOutputPhone("2p[ul3")</script>  

<script language=javascript>doOutputChinese("n. 投票,投票数,民意测验 |v. 投票,进行民意测验");</script> n. 投票,投票数,民意测验
v. 投票,进行民意测验

One thread monitors the status of several wait operations queued to the thread pool.

一个线程监视排到线程池的若干个等待de操作的状态。

monitor: <script language=javascript>doOutputPhone("25mCnItE3")</script>  n.班长;监视器 v.监视,监控

Each thread uses the default stack size and runs at the default priority.

每个线程使用默认的堆栈大小并按照默认的优先级运行。

priority: <script language=javascript>doOutputPhone("2praI5CrItI3")</script> n.1.优先,重点;优先权 2.优先考虑的事
These members
    ' can be implemented as read-only properties, read/write
    ' properties with validation, and so on, as required.
implement: <script language=javascript>doOutputPhone("25ImplImEnt3")</script> vt. 实现;完成;履行协定,贯彻 n.工具,服装
validation: <script language=javascript>doOutputPhone("27vAlI5deIF[n3")</script> n. 批准;确认
The thread procedure performs the independent task.
independent: <script language=javascript>doOutputPhone("2IndI5pendEnt3")</script>

<script language=javascript>doOutputChinese("a.(of)独立的,自主的");</script> a.(of)独立的,自主的
<script language=javascript>doOutputChinese("a.(of)独立的,自主的");</script> a.(of)独立的,自主的

Returns the result of explicitly converting an expression to a specified data type, object, structure, class, or interface.
返回表达式显式地转换为指定数据类型、对象、结构、类或接口后的结果。
valid: <script language=javascript>doOutputPhone("25vAlId3")</script> a. 有效的;合理的,正确的,具有法律效力的
Any expression that is legal within an As clause in a Dim statement, that is, the name of any data type, object, structure, class, or interface. 

任何在 Dim 语句的 AS 子句内合法的表达式,即任何数据类型、对象、结构、类或接口的名称。 
 legal: <script language=javascript>doOutputPhone("25lI:g[l3")</script> a. 法律的,法定的;合法的,正当的
clause: <script language=javascript>doOutputPhone("2klC:z3")</script> n. 1.条款,款项 2.分句,从句
CType is compiled inline, meaning the conversion code is part of the code that evaluates the expression. Execution is faster because there is no call to a procedure to accomplish the conversion.

CType 采用内联方式编译,即转换代码是计算表达式的代码的一部分。因为不需要调用完成转换的过程,因此执行速度更快。
evaluate: <script language=javascript>doOutputPhone("2I5vAljueIt3")</script> v. 估价,评价;求…的值


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是修改后的代码: ```python import datetime pro = ts.pro_api() df = pro.daily(fields='ts_code,trade_date,open,close') def get_stock_pool(df): stock_pool = [] for code in df['ts_code'].unique(): temp_df = df[df['ts_code'] == code] for i in range(len(temp_df)-3): if (temp_df.iloc[i+3]['close'] > temp_df.iloc[i+2]['close']) and \ (temp_df.iloc[i+2]['close'] > temp_df.iloc[i+2]['open']) and \ (temp_df.iloc[i+1]['close'] > temp_df.iloc[i+1]['open']) and \ (temp_df.iloc[i]['close'] > temp_df.iloc[i]['open']): stock_pool.append(code) break return stock_pool def buy_stock(stock_pool, df): buy_list = [] for code in stock_pool: temp_df = df[df['ts_code'] == code] for i in range(len(temp_df)-2): if (temp_df.iloc[i+2]['close'] < temp_df.iloc[i+2]['open']) and \ (temp_df.iloc[i+1]['close'] < temp_df.iloc[i+1]['open']) and \ (temp_df.iloc[i]['close'] < temp_df.iloc[i]['open']) and \ (temp_df.iloc[i+2]['close'] < temp_df.iloc[i+1]['close']) and \ (temp_df.iloc[i+1]['close'] < temp_df.iloc[i]['close']): buy_list.append((code, temp_df.iloc[i+2]['trade_date'])) break return buy_list def sell_stock(buy_list, df): sell_list = [] for stock in buy_list: buy_date = datetime.datetime.strptime(stock[1], "%Y%m%d") current_date = datetime.datetime.today() days_held = (current_date - buy_date).days if days_held >= 3: sell_list.append(stock[0]) print("sell list:", sell_list) ``` 我对代码进行了几个修改: 1. 在 `get_stock_pool`、`buy_stock` 和 `sell_stock` 的函数定义之后,我在每个函数调用的括号中添加了参数。这些参数是调用函数所需的数据。 2. 在 `buy_stock` 和 `sell_stock` 中,我将 `buy_list.append(code)` 和 `sell_list.append(stock[0])` 分别改为 `buy_list.append((code, temp_df.iloc[i+2]['trade_date']))` 和 `sell_list.append(stock[0])`。这是因为在 `buy_stock` 中,列表中的元素需要包含股票代码和买入日期,而在 `sell_stock` 中,列表中的元素只需要包含股票代码。 3. 在 `sell_stock` 中,我将 `for stock in buy_list:` 改为 `for stock in buy_list:`,因为在 `buy_stock` 函数中返回的是一个元组列表,而不是一个股票代码列表。同时,我将 `buy_list` 改为 `buy_list`,因为这是函数参数的名称。 希望这些修改能够帮助你解决问题!
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值