Market sentiment
Txs Tools has forecast sales of 500 in January, with an expected increase of 5% per month for the rest of the quarter.
However, this is dependent on the market sentiment. Based on historical trends, the following information has been provided:
- If the market sentiment drops below 0.6 then the sales will only be realized at an increase of 2% per month.
- If market sentiment increases above 0.8. then sales are expected to increase by 7%.
Cet exercice fait partie du cours
Financial Forecasting in Python
Exercice interactif pratique
Essayez cet exercice en complétant cet exemple de code.
# 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