How to apply formulas on tables?

Table-valued functions in finaquant .net libraries

How to apply formulas on tables?

Postby javaterm » 26 Sep 2013, 19:27

Hi, is it possible to apply user-defined formulas on tables?
javaterm
 
Posts: 1
Joined: 26 Sep 2013, 19:25

Re: How to apply formulas on tables?

Postby finaquant » 30 Sep 2013, 19:41

Yes, please see related article:
Transforming rows: row-by-row processing of tables
You may find code examples in this article, like the following one:

Code: [Select all] [Expand/Collapse] [Download] (Untitled.txt)
  1. // User-defined function for transforming rows (row-by-row processing)
  2. // price = (1 + margin_percentage) * costs
  3. public static void CalculatePriceDic_1(
  4.     ref Dictionary<string, string> TextAttribDic,
  5.     ref Dictionary<string, int> NumAttribDic,
  6.     ref Dictionary<string, double> KeyFigDic)
  7. {
  8.     // user-defined formula for price
  9.     KeyFigDic["price"] = (1 + KeyFigDic["margin_percentage"]) * KeyFigDic["costs"];
  10. }
  11.  
GeSHi ©


There is also a related demo function in the Visual Studio project file
FinaquantCalcsStarter or
FinaquantProtosStarter
Image
User avatar
finaquant
 
Posts: 61
Joined: 16 Sep 2013, 18:37


Return to Table Functions

Who is online

Users browsing this forum: No registered users and 1 guest

cron