This project covers the use of API Requests and the python MCSimulator library to run financial simulations on portfolio balances.
"The House always wins!"
This project uses Python, Pandas Libraries, and the MC Simulator to run virtual projections of possible profits.
In order to use this program please import and utilize the following libraries and dependencies:
import os
import requests
import json
import pandas as pd
from dotenv import load_dotenv
import alpaca_trade_api as tradeapi
from MCForecastTools import MCSimulation
%matplotlib inline
the following blocks of Pandas library are fundamental in executing the program.
load_dotenv()
This imports the ENV file.
requests.get().json()
This is needed for making a request of the python library and formatting it in the JSON output.
alpaca.get_bars()
This is needed to make an API request for the specific API "Alpaca".
MCSimulation.calc_cumulative_return()
This is a portion of code for running the sequence of simulations for forecasting.
MCSimulation.plot_simulation()
This code will plot above simulation as an overlay line plot.
Jeffrey J. Wiley Jr
MIT