Python红利折扣模型

时间:2018-08-19 18:33:38

标签: python modeling finance stock

我一直在调整Gordon增长模型,该模型基于折现股利流计算公司的净现值。传统模型没有考虑通货膨胀或持有期,因此我也想在给定的持有期中使用适当的无风险利率(国债利率)。该程序输出了合理的值,但我想将其提交给团队成员,以确保我在程序中没有做出错误的假设,并且确保我的程序整洁。任何想法,技巧或反馈将不胜感激!

这就是我所拥有的:

price = float(input("Enter the current price"))
dividend= float(input("Enter this years dividend payment"))
dividend_growth_rate = float(input("Enter the dividend growth rate"))
inflation = float(input("Enter the expected rate of inflation"))
beta = float(input("Enter the current beta value"))
market_return = float(input("Enter the y/o/y return of a comparative index"))
time = int(input("Enter your desired holding perid"))

t1 = 0.0244
t3 = 0.0268
t5 = 0.0275
t7 = 0.0282
t10 = 0.0287
t20 = 0.0295
t30 = 0.0303

if time == 1:
    treasury = t1
elif time > 1 and time <= 3:
    treasury = t3
elif time > 3 and time <= 5:
    treasury = t5
elif time > 5 and time <= 7:
    treasury = t7
elif time > 7 and time <= 10:
    treasury = t10
elif time > 10 and time <= 20:
    treasury = t20
elif time > 20 and time <= 30:
    treasury = t30
elif time > 30:
    treasury = t30

capm = treasury + beta * (market_return - treasury)

counter = 0
future_div_stream = 0

for counter in range(0,time):
    counter = counter + 1
    future_dividend = dividend/(1+dividend_growth_rate)**counter
    future_div_stream = future_div_stream + future_dividend

principal_value = price/(1+capm)

div_stream_less_inflation = (future_div_stream*(1-inflation)**time)

net_present_value = (div_stream_less_inflation + principal_value)

print("Net present value is: "+str(net_present_value))

0 个答案:

没有答案