Skip to content

Instantly share code, notes, and snippets.

Avatar

Brian BlackArbsCEO

View GitHub Profile
View async_barchart_option_scraper.py
import os
import sys
import pandas as pd
import pandas_datareader.data as web
import numpy as np
import time
import asyncio
from fake_useragent import UserAgent
'''set path variables'''
project_dir = "YOUR/PROJECT/DIR"
View option_parser.py
import pandas as pd
import numpy as np
import re
# ================================================
class option_parser:
def __init__(self, symbol, response):
self.symbol = symbol
self.response = response
# ------------------------------------------------
View async_option_scraper.py
import asyncio
import aiohttp
# ================================================
# for first run only
class first_async_scraper:
def __init__(self):
pass
async def _fetch(self, symbol, url, session, headers):
View _Aggregate_Barchart_Options_Data_.py
# -*- coding: utf-8 -*-
"""
Created on Fri Sep 2 13:26:48 2016
@author: Brian Christopher, CFA [Blackarbs LLC]
"""
import time
import pandas as pd
import numpy as np
View _barchart_options_scraper_.py
# -*- coding: utf-8 -*-
"""
Created on Fri Sep 2 13:23:34 2016
@author: Brian Christopher, CFA [Blackarbs LLC]
"""
import pandas as pd
from more_itertools import unique_everseen
import requests
@BlackArbsCEO
BlackArbsCEO / Free_Intraday_StockData_Test_BarChart_API_Gist.py
Created Sep 22, 2015
Example code from 'Get Free Intraday Stock Data With Python and BarChart OnDemand API' blog post.
View Free_Intraday_StockData_Test_BarChart_API_Gist.py
# -*- coding: utf-8 -*-
import time
t0 = time.clock()
import pandas as pd
from pandas.tseries.offsets import BDay
import numpy as np
import datetime as dt
from copy import copy
@BlackArbsCEO
BlackArbsCEO / BlackArbs_ETF_Macro Valuation_SPDR_4112015
Last active Feb 6, 2018
BlackArbs Macro Valuation tool_ Implied Cost of Capital, risk, return
View BlackArbs_ETF_Macro Valuation_SPDR_4112015
{"metadata": {"language_info": {"mimetype": "text/x-python", "codemirror_mode": {"name": "ipython", "version": 3}, "file_extension": ".py", "name": "python", "pygments_lexer": "ipython3", "version": "3.4.3", "nbconvert_exporter": "python"}, "kernelspec": {"name": "python3", "language": "python", "display_name": "Python 3"}}, "cells": [{"source": "###**BlackArbs LLC Independent Research**", "cell_type": "markdown", "metadata": {}}, {"source": "\n####SPDR ETF Composite Sector Valuation [Saturday 4.11.2015]\n------------\n\nThe following Ipython Notebook examines the **Implied Cost of Capital (ICC)** method of valuation for purposes of trade/portfolio positioning. The goal is to identify asymmetric investing opportunities due to incongruence between *'recent'* historical valuations and forward looking expectations of earnings growth. \n\nI will attempt to accomplish the goal by first examining composite returns based on ETF category groupings. Then I will compare the historical data vs the forward looking **ICC*
@BlackArbsCEO
BlackArbsCEO / NFL QB Analysis_Wins vs TD_Int Ratio.ipynb
Last active Nov 26, 2018
Simple Linear Regression comparing NFL Quarterback Win Percentage vs. Touchdown to Interception ratio using data collected from Pro-football-reference.com
View NFL QB Analysis_Wins vs TD_Int Ratio.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View netfonds_intraday_stockData
'''
Netfonds import 5 days of intraday data
'''
import numpy as np
import pandas as p
from pandas.tseries.offsets import *
import datetime as dt
import matplotlib.pyplot as plt
size = (14,10)
You can’t perform that action at this time.