金融数据分析与效率评估应用详解
1. 有效前沿图表更新代码
有效前沿图表以散点图(带连接点的类型)形式存在, UpdateChart 子过程会用 EfficientFrontier 工作表中新计算的数据填充该图表。以下是具体代码:
Sub UpdateChart()
' This sub updates the efficient frontier chart.
Dim sourceRange As Range
Dim minX As Single, maxX As Single
Dim minY As Single, maxY As Single
Dim xLength As Single, yLength As Single
' Set minX, minY, etc. is for scaling the axes nicely.
With wsEfficientFrontier
Set sourceRange = .Range("B4:C14")
minX = .Range("B4").Value
maxX = .Range("B14").Value
minY = .Range("C4").Value
maxY = .Range("C14").Value
xLength = maxX - minX
yLength = maxY - minY
End With
' Update the chart settings to update the chart.
With wsEfficientFrontier.ChartObje
超级会员免费看
订阅专栏 解锁全文
6931

被折叠的 条评论
为什么被折叠?



