eFinancialPlanner  V1.0 (proof of concept)
Personal Financial Planning based on Maslowian Portfolio Theory
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros Pages
efp.cpp File Reference
#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
 

Macro Definition Documentation

#define ALPHA_LOWER_LIMIT   0.1

the lower limit for all alpha's to be used

Definition at line 70 of file efp.cpp.

#define ALPHA_PLOT_HIGH   0.9

the high alpha to plot

Definition at line 72 of file efp.cpp.

#define ALPHA_PLOT_LOW   0.1

the low alpha value to plot

Definition at line 71 of file efp.cpp.

#define ALPHA_UPPER_LIMIT   0.4

the upper limit for all alpha's to be used

Definition at line 69 of file efp.cpp.

#define CURR_LEN   14

the maximum length of an amount in number of digits (eg. 14)

Definition at line 79 of file efp.cpp.

#define DEFAULT_SCALE   3

the default value to use for preferences (on a scale from 1 to 5)

Definition at line 89 of file efp.cpp.

#define INDEX (   x,
 
)    ((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!)

Definition at line 100 of file efp.cpp.

#define INPUT_WIDTH_FLOAT   5

the widht of an input field for a float

Definition at line 84 of file efp.cpp.

#define INPUT_WIDTH_INT   2

the widht of an input field for an int

Definition at line 85 of file efp.cpp.

#define INPUT_WIDTH_TEXT   15

the widht of input-text field in all forms

Definition at line 83 of file efp.cpp.

#define MAX_AGE   150

the maximum age allowed in the goals

Definition at line 66 of file efp.cpp.

#define MAX_ALPHA   0.25

= (1 - confidence_level) for the least important goal

Definition at line 68 of file efp.cpp.

#define MAX_MNTHS_2_SIMULATE   600

the maximum number of months that we allow to visualize a simulation

Definition at line 92 of file efp.cpp.

#define MAX_MONTHS_TO_SAFEST   3

the maximum number of months for realization_monthNbr to be forced to the safest portfolio

Definition at line 87 of file efp.cpp.

#define MAX_SCALE   5

the maximum value for the scale (5) (on a scale from 1 to 5)

Definition at line 90 of file efp.cpp.

#define MIN_ALPHA   0.075

= (1 - confidence_level) for the most important goal

Definition at line 67 of file efp.cpp.

#define MIN_MNTHS_2_SIMULATE   1

the maximum number of months that we allow to visualize a simulation

Definition at line 93 of file efp.cpp.

#define MIN_SCALE   1

the minimum of the scale (1) (on a scale from 1 to 5)

Definition at line 91 of file efp.cpp.

#define MIN_YEARS_TO_SIMULATE   2

the minimal number of years that can be simulated with this tool

Definition at line 76 of file efp.cpp.

#define NBR_ASSET_CLASSES   10

the nunmber of asset classes (not dynamically updated!)

Definition at line 97 of file efp.cpp.

#define NBR_ITERATIONS   20

number of iterations in goalseek procedures

Definition at line 77 of file efp.cpp.

#define NBR_RIGHT_MENU   3

the number of menu items floated to the right

Definition at line 82 of file efp.cpp.

#define NBR_SCALE   5

the number of items in a ordinal scale (labels are in t_scale125i2s)

Definition at line 88 of file efp.cpp.

#define NBR_SUB_TABS   3

maximum number of tabs used in the sub-menu

Definition at line 81 of file efp.cpp.

#define NBR_TABS   7

number of tabs in the main menu of the software

Definition at line 80 of file efp.cpp.

#define PRECISSION   0.000001

equals roundup (1 / 2^NBR_ITERATIONS)

Definition at line 78 of file efp.cpp.

#define RAINY_DAY_MONTH_NBR   3

the artificial horizon in months for the "rainy day goal"

Definition at line 73 of file efp.cpp.

#define RETIREMENT_AGE   65

the standard retirement age (applied to everyone!)

Definition at line 74 of file efp.cpp.

#define SECONDS_IN_MONTH   2629800

Marco's:

the number of seconds in the average month = 60 * 60 * 24 * 365.25 / 12

Definition at line 65 of file efp.cpp.

#define SIMULATE_TILL_DEFAULT   90

the standard age to stop the simulation

Definition at line 75 of file efp.cpp.

Function Documentation

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

Definition at line 218 of file efp.cpp.

Variable Documentation

Cgicc cgi

Definition at line 129 of file efp.cpp.

Definition at line 183 of file efp.cpp.

string error_message = ""

global message variables

Definition at line 132 of file efp.cpp.

unordered_map<int, string> goal_type_i2s
Initial value:
=
{
{0, "unallocated"},
{1, "amount@date"},
{2, "income from/to"},
{3, "rainy day savings"}
}

Definition at line 168 of file efp.cpp.

unordered_map<string, int> goal_type_s2i
Initial value:
=
{
{"unallocated", 0},
{"amount@date", 1},
{"income from/to", 2},
{"rainy day savings", 3},
{"amount asap", 4}
}

Global lists.

Definition at line 160 of file efp.cpp.

own c++ classes

Definition at line 180 of file efp.cpp.

asset oAsset

Definition at line 193 of file efp.cpp.

asset_class oAssetClass

Definition at line 190 of file efp.cpp.

cash_flow oCF

Definition at line 200 of file efp.cpp.

config oConfig

mysql connection mysql connector from dev.mysql.com

< used in global_functions.h::phi(x) own include c++ files

Definition at line 149 of file efp.cpp.

cls_currency oCurrency

Definition at line 187 of file efp.cpp.

goal oGoal

Definition at line 198 of file efp.cpp.

investor_ui oInvestor

Definition at line 211 of file efp.cpp.

string std_message = ""

Definition at line 133 of file efp.cpp.