vector <double> dailyreturns; for (int i = 0; i < y.size(); i++) { int findex = y.size() - 1; int previousindex = cprice - 1; if (i > 0) { double prices = y[findex] * (y[i] / y[previousindex]); dailyreturns.push_back(prices); }
Close_price_today
Close_price_yesterday
y[price_today] / y[price_today]
1
double return_prices = (y[price_yesterday] - y[price_today]) / y[price_today];
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)