106 float V, x, curr_age =
age(0);
110 V =
goalZ[g].saving_plan[0] -
goalZ[g].means_goal[0];
111 goalZ[g].simulation_string =
"[" + to_string(curr_age) +
"," + to_string(V) +
"]";
123 V +=
goalZ[g].saving_plan[m] -
goalZ[g].means_goal[m];
125 x = curr_age + (float)m / 12;
126 goalZ[g].simulation_string =
goalZ[g].simulation_string +
", [" + to_string(x) +
"," + to_string(V) +
"]";
127 goalZ[g].simulation_endvalue = V;
142 float curr_age =
age(0);
143 std::map<int, std::string> evol_str;
151 evol_value.at(ac) = 100;
158 cout <<
"<table border=\"1\"><tr><th>Asset Class</th><th>Expected Return</th><th>Estimated Volatility</th></tr>";
165 cout <<
"</table>" << endl;
170 comma = (m == 1)?
"" :
", ";
171 x = curr_age + (float)m / 12;
175 evol_str[ac] = evol_str[ac] + comma +
"[" + to_string(x) +
", " + to_string(evol_value[ac]) +
"]";
181 cout <<
"<script class=\"code\" type=\"text/javascript\">$(document).ready(function(){ ";
184 cout <<
"var l" << ac <<
" = [" + evol_str[ac] +
"]; ";
186 cout <<
"var plotME = $.jqplot('chartMEvol', [";
189 comma = (ac == 1)?
"" :
", ";
190 cout << comma <<
" l" << ac;
194 cout <<
"seriesDefaults: {rendererOptions: { smooth: false }},";
195 cout <<
"legend: {show: true, location: 'e', placement: 'outside', marginRight: \"600px\",";
199 comma = (ac == 1)?
"" :
", ";
206 comma = (ac == 1)?
"" :
", ";
207 cout << comma <<
"{showMarker: false}" ;
211 cout <<
"axesDefaults: {labelRenderer: $.jqplot.CanvasAxisLabelRenderer},";
212 cout <<
"axes: {xaxis: {label: \"age\" }, yaxis: {label: \"market evolution\"}}";
213 cout <<
" } ); }); </script>";
226 int defaultValue = 12;
228 vector<FormEntry>::iterator nYears =
cgi.getElement(
"nYears");
229 if(nYears !=
cgi.getElements().end())
231 n = atoi(
cgi(
"nYears").c_str()) * 12;
237 vector<FormEntry>::iterator nMonths =
cgi.getElement(
"nMonths");
238 if(nMonths !=
cgi.getElements().end())
240 n = n + atoi(
cgi(
"nMonths").c_str());
const bool simul_show_table
true if we show the table of E[R] and vol in the simulation-overview
int get_nbrMonths2simulate()
returns the number of months to simulate as in "37"
int nbrMonths
the number of months to simulate, per goal we simulate max(realization_monthNbr, nbrMonths) ...
#define MIN_MNTHS_2_SIMULATE
the maximum number of months that we allow to visualize a simulation
unordered_map< int, string > goal_type_i2s
#define MAX_MNTHS_2_SIMULATE
the maximum number of months that we allow to visualize a simulation
#define NBR_ASSET_CLASSES
the nunmber of asset classes (not dynamically updated!)
string error_message
global message variables
void simulate_market()
sets nbrMonths
void solve()
allocates means (with a benchmark) to goals
html_helper hh
own c++ classes
void simulate_portfolios()
float assetClass_mu[(NBR_ASSET_CLASSES+1)]
note: index 0 not used
std::map< int, std::map< int, float > > market_return
void set_nbrMonths2simulate_from_env()
std::map< int, string > assetClass_name
note: index 0 not used
const string assetClassColors
#define INDEX(x, y)
this macro allows to address int cell = array[INDEX(2,3)]; in stead of array[2+NBR_ASSET_CLASSES*3]; ...
config oConfig
mysql connection mysql connector from dev.mysql.com
std::map< int, aGOAL > goalZ
map containing all goals