![]() |
eFinancialPlanner
V1.0 (proof of concept)
Personal Financial Planning based on Maslowian Portfolio Theory
|
#include <iostream>#include <string>#include <ctime>#include <vector>#include <map>#include <unordered_map>#include <math.h>#include <locale>#include <iomanip>#include <errno.h>#include "normdist.h"#include <cgicc/Cgicc.h>#include <cgicc/HTTPHTMLHeader.h>#include <cgicc/HTMLClasses.h>#include <cppconn/prepared_statement.h>#include <mysql_connection.h>#include <driver.h>#include <exception.h>#include <resultset.h>#include <statement.h>#include <string.h>#include <cmath>#include "config.class.cpp"#include "t_personalize_Eng_UK.h"#include "texts_Eng_UK.h"#include "t_disclaimer_Eng_UK.h"#include "global_functions.h"#include "bootstrap.namespace.cpp"#include "html_helper.class.cpp"#include "db_helper.class.cpp"#include "frequency.class.cpp"#include "currency.class.cpp"#include "asset_class.class.cpp"#include "asset.class.cpp"#include "column.class.cpp"#include "bona.class.cpp"#include "bona_goal.class.cpp"#include "bona_cf.class.cpp"#include "portfolio.class.cpp"#include "market.class.cpp"#include "investor.class.cpp"#include "aGOAL.struct.cpp"#include "investment_problem.class.cpp"#include "simulation.class.cpp"#include "follow_up.class.cpp"#include "investor_ui.class.cpp"Go to the source code of this file.
Macros | |
| #define | SECONDS_IN_MONTH 2629800 |
| Marco's: More... | |
| #define | MAX_AGE 150 |
| the maximum age allowed in the goals More... | |
| #define | MIN_ALPHA 0.075 |
| = (1 - confidence_level) for the most important goal More... | |
| #define | MAX_ALPHA 0.25 |
| = (1 - confidence_level) for the least important goal More... | |
| #define | ALPHA_UPPER_LIMIT 0.4 |
| the upper limit for all alpha's to be used More... | |
| #define | ALPHA_LOWER_LIMIT 0.1 |
| the lower limit for all alpha's to be used More... | |
| #define | ALPHA_PLOT_LOW 0.1 |
| the low alpha value to plot More... | |
| #define | ALPHA_PLOT_HIGH 0.9 |
| the high alpha to plot More... | |
| #define | RAINY_DAY_MONTH_NBR 3 |
| the artificial horizon in months for the "rainy day goal" More... | |
| #define | RETIREMENT_AGE 65 |
| the standard retirement age (applied to everyone!) More... | |
| #define | SIMULATE_TILL_DEFAULT 90 |
| the standard age to stop the simulation More... | |
| #define | MIN_YEARS_TO_SIMULATE 2 |
| the minimal number of years that can be simulated with this tool More... | |
| #define | NBR_ITERATIONS 20 |
| number of iterations in goalseek procedures More... | |
| #define | PRECISSION 0.000001 |
| equals roundup (1 / 2^NBR_ITERATIONS) More... | |
| #define | CURR_LEN 14 |
| the maximum length of an amount in number of digits (eg. 14) More... | |
| #define | NBR_TABS 7 |
| number of tabs in the main menu of the software More... | |
| #define | NBR_SUB_TABS 3 |
| maximum number of tabs used in the sub-menu More... | |
| #define | NBR_RIGHT_MENU 3 |
| the number of menu items floated to the right More... | |
| #define | INPUT_WIDTH_TEXT 15 |
| the widht of input-text field in all forms More... | |
| #define | INPUT_WIDTH_FLOAT 5 |
| the widht of an input field for a float More... | |
| #define | INPUT_WIDTH_INT 2 |
| the widht of an input field for an int More... | |
| #define | MAX_MONTHS_TO_SAFEST 3 |
| the maximum number of months for realization_monthNbr to be forced to the safest portfolio More... | |
| #define | NBR_SCALE 5 |
| the number of items in a ordinal scale (labels are in t_scale125i2s) More... | |
| #define | DEFAULT_SCALE 3 |
| the default value to use for preferences (on a scale from 1 to 5) More... | |
| #define | MAX_SCALE 5 |
| the maximum value for the scale (5) (on a scale from 1 to 5) More... | |
| #define | MIN_SCALE 1 |
| the minimum of the scale (1) (on a scale from 1 to 5) More... | |
| #define | MAX_MNTHS_2_SIMULATE 600 |
| the maximum number of months that we allow to visualize a simulation More... | |
| #define | MIN_MNTHS_2_SIMULATE 1 |
| the maximum number of months that we allow to visualize a simulation More... | |
| #define | NBR_ASSET_CLASSES 10 |
| the nunmber of asset classes (not dynamically updated!) More... | |
| #define | INDEX(x, y) ((y-1)+((NBR_ASSET_CLASSES)*(x-1))) |
| this macro allows to address int cell = array[INDEX(2,3)]; in stead of array[2+NBR_ASSET_CLASSES*3]; (using a one dimensional array to store a two dimnesional one!) More... | |
Functions | |
| int | main (int argc, char **argv) |
Variables | |
| Cgicc | cgi |
| string | error_message = "" |
| global message variables More... | |
| string | std_message = "" |
| config | oConfig |
| mysql connection mysql connector from dev.mysql.com More... | |
| unordered_map< string, int > | goal_type_s2i |
| Global lists. More... | |
| unordered_map< int, string > | goal_type_i2s |
| html_helper | hh |
| own c++ classes More... | |
| db_helper | db |
| cls_currency | oCurrency |
| asset_class | oAssetClass |
| asset | oAsset |
| goal | oGoal |
| cash_flow | oCF |
| investor_ui | oInvestor |
| #define ALPHA_LOWER_LIMIT 0.1 |
| #define ALPHA_UPPER_LIMIT 0.4 |
| #define CURR_LEN 14 |
| #define DEFAULT_SCALE 3 |
| #define INDEX | ( | x, | |
| y | |||
| ) | ((y-1)+((NBR_ASSET_CLASSES)*(x-1))) |
this macro allows to address int cell = array[INDEX(2,3)]; in stead of array[2+NBR_ASSET_CLASSES*3]; (using a one dimensional array to store a two dimnesional one!)
| #define INPUT_WIDTH_FLOAT 5 |
| #define INPUT_WIDTH_INT 2 |
| #define INPUT_WIDTH_TEXT 15 |
| #define MAX_ALPHA 0.25 |
| #define MAX_MNTHS_2_SIMULATE 600 |
| #define MAX_MONTHS_TO_SAFEST 3 |
| #define MAX_SCALE 5 |
| #define MIN_ALPHA 0.075 |
| #define MIN_MNTHS_2_SIMULATE 1 |
| #define MIN_SCALE 1 |
| #define MIN_YEARS_TO_SIMULATE 2 |
| #define NBR_ASSET_CLASSES 10 |
| #define NBR_ITERATIONS 20 |
| #define NBR_RIGHT_MENU 3 |
| #define NBR_SCALE 5 |
| #define NBR_SUB_TABS 3 |
| #define NBR_TABS 7 |
| #define PRECISSION 0.000001 |
| #define RAINY_DAY_MONTH_NBR 3 |
| #define RETIREMENT_AGE 65 |
| #define SECONDS_IN_MONTH 2629800 |
| #define SIMULATE_TILL_DEFAULT 90 |
| int main | ( | int | argc, |
| char ** | argv | ||
| ) |
main
< the investor is load whenever it is available (not only for thre screens that really need it –> so full name will be available for example within the disclaimers
< allows for non-logged in people to see the inventory
< personalisation
< personalisation ///< save personalisation
< personalisation
< show edit form
< execute the edit (when save is pressed)
< show the help screen to add goals in a more supported way
< save the relevant goals and show the list of goals
< show the list of investment goals
< add one goal
< edit one goal
< save one goal
< delete one goal
< show the list of investment cash_flows
< add one cash_flow
< edit one cash_flow
< save one cash_flow
< delete one cash_flow
< show feedback
< simulation
< follow_up dashboard
< edit the account information
< edit the account information
< do this after the customer has the screen displayed
| unordered_map<int, string> goal_type_i2s |
| unordered_map<string, int> goal_type_s2i |
| html_helper hh |
| asset_class oAssetClass |
| config oConfig |
| cls_currency oCurrency |
| investor_ui oInvestor |