The "PythonPortfolioAnalyzer" is a Git repository that forms a vital part of the final project for the "Programming 2" course. This project aims to develop a Python application that empowers users to calculate the risk and return of a stock portfolio, making it an essential tool for investors and financial analysts.
and label as second return
['percentil_5','percentil_10','percentil_50', 'percentil_90','percentil_95']
because plotterlib recive and do:
`def fig_cache(self, cache_path, lblshow=False):
# Itera sobre as listas de dados e plota cada linha
if lblshow:
for i in range(1, len(self.matrix)):
plt.plot(self.matrix[0], self.matrix[i], label=self.labels[i - 1])
plt.legend()
else:
for i in range(1, len(self.matrix)):
plt.plot(self.matrix[0], self.matrix[i])
# Adiciona legendas e rótulos
plt.xlabel(self.X_title)
plt.ylabel(self.Y_title)
if self.bgcollor is not None:
plt.gca().set_facecolor(self.bgcollor)
if self.grid_check:
plt.grid(True)
if self.title is not None:
plt.title(self.title)
plt.savefig(cache_path)`
create a function last simulation function
when called this function must do:
search in portfolio the last simulation data
and convert to two listst
must be the first return:
[[temporal_data,percentil_5,percentil_10,percentil_50, percentil_90_percentil_95], [temporal_data,percentil_5,percentil_10,percentil_50, percentil_90_percentil_95], [temporal_data,percentil_5,percentil_10,percentil_50, percentil_90_percentil_95], [temporal_data,percentil_5,percentil_10,percentil_50, percentil_90_percentil_95]]
and label as second return ['percentil_5','percentil_10','percentil_50', 'percentil_90','percentil_95']
because plotterlib recive and do:
cahce_path will be used by gcache