models.py 文件源码

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

项目:pytrade-me 作者: arshpreetsingh 项目源码 文件源码
def recommend_trade(self, nn_price, last_sample, fee_amount=get_fee_amount()):
        fee_amount = fee_amount * 2  # fee x 2 since we'd need to clear both buy and sell fees to be profitable
        fee_amount = fee_amount * settings.FEE_MANAGEMENT_STRATEGY  # see desc in settings.py
        anticipated_percent_increase = (nn_price - last_sample) / last_sample
        if abs(anticipated_percent_increase) < fee_amount:
            should_trade = 'HOLD'
        elif anticipated_percent_increase > fee_amount:
            should_trade = 'BUY'
        elif anticipated_percent_increase < fee_amount:
            should_trade = 'SELL'
        return should_trade
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号