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
评论列表
文章目录