This is the server side to calculate the ideal portfolio. This is open as an API in case anyone is interested.
This server lives on https://hsii-server.herokuapp.com.
To get the percentages ping the url
https://hsii-server.herokuapp.com/calculate
.
The data should look as such:
{ values: {1:500,2:1500}, percentages: {1:0.5,2:0.5}, deposit: 5000 }
This means the current values are 500 and 1500 of product 1 and 2 respectively. The desired
percentages are 0.5 of both. The amount to be deposited is 5000. This will return a json.
{division_perc:[%f,%f]}
Where %f will be the percentages by which to divide the deposit.