Skip to content

Using a power of Python, making an API calls to collect the data. Evaluating performance of Crypto Assets to include into Diversified Portfolio

Notifications You must be signed in to change notification settings

nataliaburrey/Diversified_Crypto_portfolio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Screen Shot 2021-05-18 at 9 50 41 AM

"Diversification is a protection against ignorance. It can be achieved by combining assets that move in the opposite direction, which means those assets react to the same economic event differently. "

Diversified portfolio analyzer

⭐ Cryptocurrencies and index funds.

In this Project, we assumed the role of a quantitative analyst for a FinTech investing platform. This platform aims to offer clients a one-stop online investment solution for their portfolio.

Screen Shot 2021-05-18 at 10 22 37 AM

Table of content

An executive summary

  • A portfolio analyzer: Create a framework can be used in the future to create a Diversified Portfolio can be tune in for any goal and risk-tolerance
  • Put into practice our new skills we learned: collect, clean and analyze complex financial data and how to use APIs to access a wide range of high-quality, up-to-date data in real time.
  • Using Python and Pandas libraries compares the performance of different assets. Include calculations, tables, financial models and interactive visualizations. Also include information about past performance of the portfolios, as well as suggestions for portfolio composition to insure moderate risk/return profile.

Screen Shot 2021-05-18 at 10 28 47 AM

Overview of the project and project goals.

  • We’re been tasked with evaluating various investment options for inclusion in the client portfolios. Need to determine the options with most investment potential based on key risk-management metrics: the daily returns, standard deviations, Sharpe ratios.
  • To keep the costs low, the firm uses algorithms to build each client's portfolio. The algorithms choose from various investment styles and options.
  • Our solution is for unexperienced investor-somebody with low risk tolerance, Interested in cryptocurrency but would like to chose the ones with higher returns to create a riskier part of portfolio with higher returns to take advantage of emerging market
  • On one hand, our customer does not have a time to individually pick the stock-so we chose 3 most popular indexes, which will introduce diversify to a customers portfolio in allow user to have moderate returns with lower risk as user plans for retirement

Screen Shot 2021-05-18 at 10 38 59 AM

  • On the other hand, following the hype of emerging crypto market, our investor would like to take an advantage of fabulous returns. For this reason we decided to introduce moderate risk into the portfolio, by picking one of the most known and established cryptocurrencies on the market: Bitcoin (BTC), Ethereum (ETH), Litecoin (LTC) and Ripple (XRP) to balance out low-risk low-return index portion

What is special about out project?

  • Very well commented code with deeply analyses and explained results for technical user lacking an understanding
  • Reading financial data and making the connection between code results and meaning of it for the user unexperienced in financial tools and lanscrape

Screen Shot 2021-05-18 at 10 54 47 AM

Software version control

Libraries / interfaces

  • Pandas - is a software library designed for data analytics that makes it easier to work with data from practically any type of file. Pandas supplies powerful tools for working with time data in particular, and time is a key aspect of financial analysis. Analysts typically compare and measure financial assets—from single stocks to large portfolios—across time.
  • With the combination of Pandas and Jupyter Notebook, you can efficiently import, prepare, and analyze data of any type or quantity.
  • Following libraries were used to analyze the data
# Import the required 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 pathlib import Path
import numpy as np
import matplotlib.pyplot as plt
import hvplot.pandas
import seaborn as sns
%matplotlib inline

  • New libriry we used helped us to clean the warnings in the code

Screen Shot 2021-05-20 at 8 57 23 PM

Run Alpaca

In order to succesfully run the file you have to generate your own Alpaca key and save it to .env file. Those files are hidden so Hold down the Command, Shift and Period keys (for Mac) to be sure you have it in the same folder as Jupyter Lab notebook

 cmd + shift + [.]

To generate Alpaca key you have to create your own account and request a new key. Save it in .env file, make sure to name the variables ALPACA_API_KEY and ALPACA_SECRET_KEY


ALPACA_API_KEY = '<your key>'
ALPACA_SECRET_KEY = '<your key>'

Those steps are nessesary to maintain a security of private information.

Work with GitHub

  • Repository created on GitHub
  • Our group made sure that files were frequently committed to repository
  • Our repository is organized, and includes Resources folder with CSV project files,
  • Jupyter Notebook with code well commented with concise, relevant notes.
  • Detailed explanation of each step with explanation of financial data and conclusions of analyses (example)

How to install

  • Save remote repo from GitHub to your computer (Desktop): in Terninal type:
cd desktop

git clone https://github.com/nataliaburrey/SQL_Financial_Application.git

now you can find repo on your desktop

  • Open a Jupyter Lab: In Terminal type command
jupyter lab
  • In Jupyter Lab access saved repo folder
  • Choose [ project_1.ipynb ] file to see the analysis report.

How to use Voila

Following screenshots and videos of the web application, created by deploying your Jupyter notebook via the Voilà library

To deploy Voilà library via terminal type in code:

conda activate <name-of-your-enviroment>
cd <relative-path-to-notebook>
voila <notebook_name>

The file will be opened into default WEB browser, like on the following video.

Screen.Recording.2021-05-18.at.11.13.31.AM.mov

User will be able to explore and interact with Analyses report. Following video shows the interactive visualization withing the Jupyter Notebook in action

Screen.Recording.2021-05-18.at.11.18.20.AM.mov

Work with data

Data Collection

  • We used various skills learned in a bootcamp and various sources of date to collect information: data collected from CSV files, APIs, or databases by using Python or a Python library
  • Source of data: Cryptocurrensies - Coindesk, ETF index funds - Fred
  • Imported data from a CSV file into a Pandas DataFrame.
  • API calls: Cryptocurrensies - JSON

Screen Shot 2021-05-18 at 8 01 09 PM

Screen Shot 2021-05-18 at 8 03 37 PM

Cleanup & Analyse

  • We identified and cleaned up missing, incomplete, erroneous, and duplicated text values in the dataset
  • Generate summary statistics and visualizations to help you better understand the DataFrame
  • Reorganized subsets of information within the DataFrame to do a targeted analysis
  • Write Python code to capture the price differences across the cryptocurrency market.

Data visualization

  • The next step was to dive a bit more deeply into that data through visualizations.
  • Some sets of data to analyses use a simple plot function, but for others included longer time period and overlaying data we included interactive visualizations to explore and uncover relationships and patterns in your data
  • We will be able to present information to our client using Voila

Results and summary of the analysis

Data cleanup resulting DataFrame

Screen Shot 2021-05-19 at 10 11 51 PM

Financial analyses we used include following steps:

Screen Shot 2021-05-20 at 8 34 40 PM

We presented results into interactive hvplots like:

  • LinePlot for Cumulative return

Screen Shot 2021-05-20 at 8 51 59 PM

  • Box Plot for daily returnes

Screen Shot 2021-05-20 at 8 53 45 PM

  • Heatmap for correlation of the assets

Screen Shot 2021-05-20 at 8 46 43 PM

  • The resulting portfolio is presented in a pie chart to better understand procentage

Screen Shot 2021-05-20 at 8 33 54 PM

  • Next steps for our project would be following

Screen Shot 2021-05-20 at 8 54 55 PM

Team

License

MIT

Links

About

Using a power of Python, making an API calls to collect the data. Evaluating performance of Crypto Assets to include into Diversified Portfolio

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published