Unlike traditional stocks, futures, and options markets, crypto markets trade 24/7. Therefore, it's necessary to adjust your crypto price data to match the data from exchange traded securities when doing certain equity time series analysis. For this video, I use the Yahoo_fin library to get historical equity price data and the CoinGecko API to get historical crypto price data.
Here's the code from the video
https://github.com/AdamGetbags/cleaningCryptoTimeSeries/blob/main/adjustingCryptoData.py
1:17 get equity data from yahoo_fin
1:34 get crypto data from CoinGecko API
2:00 reformat dates datatype, set index, other reformatting
3:57 join equity and crypto data together on the index
5:50 calculate log returns
Let me explain. Say you wanted to know if there was a relationship between NYSE/NASDAQ/AMEX exchange traded financial asset and an asset in the crypto market. For example, what is the beta of Riot Blockchain with respect to Bitcoin price. It will be helpful to adjust your crypto price data by removing the weekends and US market holidays from your time series.
It all depends on the analytical task, but for linear regression, correlation, machine learning, and other statistical analysis techniques, this adjustment can be useful.
In regards to the crypto data, there are some dangerous assumptions to be made about removing ~2/7th of all your observations. So, be mindful about the specific task you are doing.
- - -
Subscribe to join our community and receive value on all things finance and technology!
If you love the content, buy me a coffee!
https://www.buymeacoffee.com/adamgetbags
Keep up with me!
https://www.instagram.com/damgetbags
- - -
Need some ideas for your project portfolio?
Check out how to get stock price data in Python with TD Ameritrade API.
https://youtu.be/ZeA8aE-sfIY
Here's how to stream real time option data in Python with TD Ameritrade API.
https://youtu.be/wQk0hT9xpiE
Here's how to build a web scraping robot that gets crypto price data in Python
https://youtu.be/jUS64V2jDiY
- - -
DISCLAIMER: The Information on Adam Getbags on Youtube.com is provided for education and informational purposes only, without any express or implied warranty of any kind, including warranties of accuracy, completeness, or fitness for any particular purpose. The Information contained in or provided from or through Adam Getbags on Youtube.com is not intended to be and does not constitute financial advice, investment recommendations, investment advice, trading advice, or any other advice. The Information on Adam Getbags on Youtube.com is general in nature and is not specific to you the User or anyone else. You should not make any decision, financial, investment, trading, or otherwise, based on any of The Information presented on Adam Getbags on Youtube.com without undertaking independent due diligence and consultation with a professional broker or financial advisory.
Тэги:
#adam_getbags #adjusting_crypto_price_data_for_equity_time_series_analysis_in_python #crypto_price_data_adjustment #crypto_price_data #crypto_data_analysis #stock_price_data_analysis #data_analysis_in_python #financial_analysis_in_python #python_for_finance #python #finance #stock_price_analysis #match_crypto_data_to_stock_data #how_to_get_crypto_data #getting_crypto_price_data #data_trader #part_time_larry #option_alpha #freecodecamp #cs_dojo #alex_the_analyst #python_programmer