caculation_tool.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:stock 作者: Rockyzsu 项目源码 文件源码
def profit(self,start,end,code):


        start_price=ts.get_k_data(start=start,end=start,code=code)
        if len(start_price)==0:
            print "Not open for start day"
            #?????????????????.
        s_price=start_price['close'].values[0]
        print "Start price: ",s_price

        end_price=ts.get_k_data(start=end,end=end,code=code)

        if len(end_price)==0:
            print "Not open for end day"

        e_price=end_price['close'].values[0]
        print "End price: ",e_price
        earn_profit=(e_price-s_price)/s_price*100
        print "Profit: ",
        print round(earn_profit,2)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号