市场情绪
Txs Tools 预计 1 月销售额为 500,且本季度剩余月份每月预计增长 5%。
不过,这取决于市场情绪。基于历史趋势,提供了以下信息:
- 如果市场情绪低于 0.6,则销售额每月仅按 2% 的增幅实现。
- 如果市场情绪高于 0.8,则预计销售额每月增长 7%。
本练习是课程的一部分
Python 金融预测
交互式实操练习
通过完成这段示例代码来试试这个练习。
# Create the computevariance function
def ____(amount, sentiment):
if (____ < 0.6):
res = amount + (amount * ____)
elif (sentiment > 0.8):
res = ____ + (____ * 0.07)
else:
res = amount + (amount * 0.05)
return res