IniziaInizia gratis

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%.

Questo esercizio fa parte del corso

Financial Forecasting in Python

Visualizza il corso

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

# 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
Modifica ed esegui il codice