SimuladorInvestimentosPy
Investment Simulator built on Google Colab as part of an assignment proposed at university.
Install / Use
/learn @DanielTomazi/SimuladorInvestimentosPyREADME
SimuladorInvestimentosPy
Investment Simulator built on Google Colab as part of an assignment proposed at university.
This code performs a series of operations related to financial investments:
1 - Portfolio Evaluation: Defines a function avaliar_carteira that calculates the performance of an investment portfolio based on the returns and risks of each investment.
2 - Genetic Algorithm: Implements functions for tournament selection, one-point crossover, and swap mutation, used in a genetic algorithm to optimize the composition of an investment portfolio over several generations.
3 - Investment List: Generates a list of investments with random values for return and risk, representing different types of financial investments, such as stocks, government bonds, mutual funds, among others.
4 - Simulation of Investment Fluctuations: Simulates fluctuations in investments over time.
5 - Data Management: Creates a CSV file to store simulated investment data and reads this data for analysis.
6 - Data Visualization: Uses the Matplotlib library to visualize the simulated data in a scatter plot, where the x-axis represents risk, the y-axis represents return, and the color of the points indicates the level of risk. It also generates a histogram of the investment returns.
The code can be used to optimize the composition of an investment portfolio based on different types of investments and their return and risk characteristics.
