全部版块 我的主页
论坛 休闲区 十二区 灌水吧
1452 2
2017-02-20

Function mcld(CouponRate As Double, n As Integer, k As Integer, yield As Double)
    Dim i As Integer
    Dim PVCF() As Double
    Dim PVTCF As Double
    Dim duration As Double
    ReDim PVCF(1 To n * k)

    PVTCF = 0
    For i = 1 To n * k
        PVCF(i) = ((CouponRate / k) * 100) / Application.WorksheetFunction.Power(1 + yield / k, i)
        PVTCF = PVTCF + PVCF(i)
    Next i
    PVCF(n * k) = PVCF(n * k) + 100 / Application.WorksheetFunction.Power(1 + yield / k, n * k)
    PVTCF = PVTCF + 100 / Application.WorksheetFunction.Power(1 + yield / k, n * k)
    duration = 0
    For i = 1 To n * k
        duration = duration + PVCF(i) * i / k
    Next i
    duration = duration / PVTCF
    mcld = duration
End Function
Function MD(CouponRate As Double, n As Integer, k As Integer, yield As Double)
    MD = mcld(CouponRate, n, k, yield) / (1 + yield / k)
End Function

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2017-2-20 16:35:18
continue
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2017-2-20 16:35:37
顶起来
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群