eFinancialPlanner  V1.0 (proof of concept)
Personal Financial Planning based on Maslowian Portfolio Theory
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros Pages
investor Class Reference
Inheritance diagram for investor:
market investment_problem investor_ui simulation follow_up

Public Member Functions

string get_full_name ()
 
float age (int Mnbr=0)
 
int months2simulate ()
 
int load_from_db (string investorID)
 
void load_ER (int person=0, char person_type= 'i')
 
void save_ER (int person=0, char person_type= 'i')
 
void load_covar (int person, char person_type= 'i')
 
void save_covar (int person, char person_type= 'i')
 

Public Attributes

int investor_id
 
string user_name
 
string first_name
 
string last_name
 
string password
 
string currency
 the default currency for that customer More...
 
struct tm birth_date
 
float simulate_till_age
 
float * assetClass_covar = new float[(NBR_ASSET_CLASSES + 1) * (NBR_ASSET_CLASSES + 1)]
 
float assetClass_mu [(NBR_ASSET_CLASSES+1)]
 note: index 0 not used More...
 
std::map< int, string > assetClass_name
 note: index 0 not used More...
 
std::map< int, float > ER
 
std::map< int, std::map< int,
float > > 
covar
 

Protected Member Functions

int age2monthNbr (float theAge)
 
string dateStr2Age (string the_date)
 
bool save ()
 
int get_from_db (string investorID, string password)
 
bool add_to_db ()
 
bool exists (int iid)
 
void load_preferences ()
 sets the experience, knowledge and desirability vectors More...
 
bool save_preferences ()
 sets the experience, knowledge and desirability vectors More...
 
void set_max_exposure ()
 sets the max_exposure vector based on the experience, knowledge and desirability More...
 
bool set_scale (string scale_type, int ac, int val)
 
 investor ()
 
void reload_ER (int person, char person_type= 'i')
 TODO: the ER and assetClass_mu as well as the covar and assetClass_covar are redundant ==> eliminate the C-style assetClass_*. More...
 
void reload_covar (int person, char what2do, char person_type= 'i')
 

Protected Attributes

std::map< int, int > experience
 
std::map< int, int > knowledge
 
std::map< int, int > desirability
 
std::map< int, float > max_exposure
 the maximum exposure per asset class More...
 

Detailed Description

class investor

copyright: (c) Philippe De Brouwer 2014

last modification:

Definition at line 11 of file investor.class.cpp.

Constructor & Destructor Documentation

investor::investor ( )
inlineprotected

CONSTRUCTOR

needed because initalization of vectors cannot be done inside a class outside of a method

Definition at line 60 of file investor.class.cpp.

Member Function Documentation

bool investor::add_to_db ( )
protected

add_to_db

does not check data any more, simply tries to push it to the DB only returns 0 if the userID already exists.

Definition at line 313 of file investor.class.cpp.

float investor::age ( int  Mnbr = 0)
inline

returns the age of a customer in years (with decimal part)

Definition at line 108 of file investor.class.cpp.

int investor::age2monthNbr ( float  theAge)
inlineprotected

age2monthNbr

returns the month number for a given age note that this is negative for ages younger than the actual age.

Definition at line 200 of file investor.class.cpp.

string investor::dateStr2Age ( string  the_date)
inlineprotected

dateStr2Age

Definition at line 209 of file investor.class.cpp.

bool investor::exists ( int  iid)
protected

exists

checks if a given investor-id really exists

Definition at line 343 of file investor.class.cpp.

int investor::get_from_db ( string  uid,
string  password 
)
protected

get_from_db returns the investor_id if successful (otherwise 0)

Definition at line 249 of file investor.class.cpp.

string investor::get_full_name ( )

overloading << operator overload the << operator to output the goal in a readable format get_full_name returns the full name of an investor


Definition at line 103 of file investor.class.cpp.

void market::load_covar ( int  person,
char  person_type = 'i' 
)
inherited

load_covar

< note: person_type = 'i' for persons (later to provide for 'a' advisor, organization, etc.)

< TODO eliminate this

if we did not find a personalized expectation for each asset class, then we load the default values

< TODO eliminate this

Definition at line 135 of file market.class.cpp.

void market::load_ER ( int  person = 0,
char  person_type = 'i' 
)
inherited

load_ER

< note: person_type = 'i' for persons (later to provide for 'a' advisor, organization, etc.)

Definition at line 61 of file market.class.cpp.

int investor::load_from_db ( string  uid)

returns the investor_id if successful (otherwise 0) NOTE for user interaction use get_from_db(uid, password) for password verification!!


Definition at line 134 of file investor.class.cpp.

void investor::load_preferences ( )
protected

sets the experience, knowledge and desirability vectors

set_preferences

Definition at line 383 of file investor.class.cpp.

int investor::months2simulate ( )
inline

months2simulate

Definition at line 124 of file investor.class.cpp.

void market::reload_covar ( int  person,
char  what2do,
char  person_type = 'i' 
)
protectedinherited

reload_vol

the situation here is more complex as the user expect that only the volatilities will be reset to the default values and not the correlations ...

what2do = [v|c|b] as in [vol | corr | both]

< both

< volatilities

< correlations

Definition at line 281 of file market.class.cpp.

void market::reload_ER ( int  person,
char  person_type = 'i' 
)
protectedinherited

TODO: the ER and assetClass_mu as well as the covar and assetClass_covar are redundant ==> eliminate the C-style assetClass_*.

set_mu

the expect value for all asset classes set_covar

the expect value for all assets reload_ER

note: person_type = 'i' for persons (later to provide for 'a' advisor, organization, etc.)

this function simply deletes the personalized expected returns. This is sufficient because later we check if they exists and only then load them (see function load_ER().

Definition at line 247 of file market.class.cpp.

bool investor::save ( )
protected

save

Definition at line 220 of file investor.class.cpp.

void market::save_covar ( int  person,
char  person_type = 'i' 
)
inherited

save_covar

Definition at line 172 of file market.class.cpp.

void market::save_ER ( int  person = 0,
char  person_type = 'i' 
)
inherited

save_ER

Definition at line 109 of file market.class.cpp.

bool investor::save_preferences ( )
protected

sets the experience, knowledge and desirability vectors

save_preferences()

Definition at line 416 of file investor.class.cpp.

void investor::set_max_exposure ( )
protected

sets the max_exposure vector based on the experience, knowledge and desirability

get_max_exposure

sets the map max_exposure in this object

Definition at line 363 of file investor.class.cpp.

bool investor::set_scale ( string  scale_type,
int  ac,
int  val 
)
protected

set_scale

Definition at line 402 of file investor.class.cpp.

Member Data Documentation

float* market::assetClass_covar = new float[(NBR_ASSET_CLASSES + 1) * (NBR_ASSET_CLASSES + 1)]
inherited

Definition at line 16 of file market.class.cpp.

float market::assetClass_mu[(NBR_ASSET_CLASSES+1)]
inherited

note: index 0 not used

Definition at line 17 of file market.class.cpp.

std::map<int, string> market::assetClass_name
inherited

note: index 0 not used

Definition at line 18 of file market.class.cpp.

struct tm investor::birth_date

Definition at line 20 of file investor.class.cpp.

std::map<int, std::map<int, float> > market::covar
inherited

Definition at line 26 of file market.class.cpp.

string investor::currency

the default currency for that customer

Definition at line 19 of file investor.class.cpp.

std::map<int, int> investor::desirability
protected

Definition at line 41 of file investor.class.cpp.

std::map<int, float> market::ER
inherited

Definition at line 25 of file market.class.cpp.

std::map<int, int> investor::experience
protected

Definition at line 39 of file investor.class.cpp.

string investor::first_name

Definition at line 16 of file investor.class.cpp.

int investor::investor_id

Definition at line 14 of file investor.class.cpp.

std::map<int, int> investor::knowledge
protected

Definition at line 40 of file investor.class.cpp.

string investor::last_name

Definition at line 17 of file investor.class.cpp.

std::map<int, float> investor::max_exposure
protected

the maximum exposure per asset class

Definition at line 42 of file investor.class.cpp.

string investor::password

Definition at line 18 of file investor.class.cpp.

float investor::simulate_till_age

Definition at line 21 of file investor.class.cpp.

string investor::user_name

Definition at line 15 of file investor.class.cpp.


The documentation for this class was generated from the following file: