.NET实现Excel的产量功能产量、功能、NET、Excel

2023-09-07 08:47:49 作者:丢了回忆失了心っ

Excel的加载项命名为分析工具库提供了收益功能对收益的计算上的安全性,定期支付利息。

Excel's add-in named "Analysis ToolPak" provides "Yield" function for calculation of yield on security that pays periodic interest.

功能运作良好,并返回正确的数据。

Function works well and returns proper data.

我的理解是一种迭代函数库也不是那么容易的在我的code实现它。

My understanding is function base on kind of iteration it is not so easy implement it in my code.

我的问题是任何人都知道,在C#中(最终其他语言),并可以分享/可见执行? 或者,(也许)的一些技巧如何实现的呢?比我能分享:)

My question is anybody know/seen implementation in C# (eventually other languages) and can share? Or (maybe) some tips how to implement it? Than I can share :)

编辑:

感谢所有张贴我公式,但是这并不完全对我很有用。 请注意,MS的公式查找应用程序在1情况下,只有: 时,有一个计息期或更小,直到赎回,

Thanks all posting me "formula" but this is not fully useful to me. Please note that MS' formula finds application in 1 case only: "when there is one coupon period or less until redemption",

否则:

(...)产量是通过百次迭代计算的。 并且对于这种情况下,没有确切的公式

"(...) Yield is calculated through a hundred iterations." and there is no exact formula for that case

我可以阅读方程并加以实施(希望如此),但我的问题是,如果有人已经或锯已实现功能的编程语言。

I can read equations and implement them (hopefully), but my question was if somebody has or saw already implemented function in programming language.

我不懒,但我不喜欢分解开的门......

I'm not lazy but I dont like break down open doors...

推荐答案

首先,你需要的价格功能的实现。产量再使用的牛顿求解的解决价格功能的正确率和给定目标价。 code价格的功能和$ C $下的牛顿求解器可以在这个类似的帖子中找到:java实施的Excel价格,产量的功能

First you need an implementation of the PRICE function. YIELD then uses a Newton Solver to solve the PRICE function for the correct yield and a given target price. Code for price function and code for the Newton solver can be found in this similar post: java implementation of excel price,yield functions