Skip to content

Instantly share code, notes, and snippets.

View TJConnellyContingentMacro's full-sized avatar

T.J. Connelly, CFA CMT TJConnellyContingentMacro

View GitHub Profile
@TJConnellyContingentMacro
TJConnellyContingentMacro / econev.py
Created August 15, 2022 16:16 — forked from rwev/econev.py
Python web-scraper for economic events on the Bloomberg Econoday calendar.
# -*- coding: utf-8 -*-
"""
ECONEV.PY: Economic Events
Python web-scraper for economic events on the Bloomberg Econoday calendar.
Saves result of scrape to plain text (in Eastern Time) for flexible processing by other applications.
Author: rwev (https://github.com/rwev)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@TJConnellyContingentMacro
TJConnellyContingentMacro / trend_following_1.ipynb
Created June 1, 2019 16:13 — forked from AnthonyFJGarner/trend_following_1.ipynb
A Simple Trend Following System in Python
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@TJConnellyContingentMacro
TJConnellyContingentMacro / gist:37eef8d7a2e1470f08e94005f11eedf0
Created April 24, 2019 04:19 — forked from 345161974/gist:63573abdf1dc9c303d6740fb29496657
Python Code for adding posts to WordPress remotely
import urllib
from wordpress_xmlrpc import Client, WordPressPost
from wordpress_xmlrpc.methods import posts
import xmlrpclib
from wordpress_xmlrpc.compat import xmlrpc_client
from wordpress_xmlrpc.methods import media, posts
import os
########################### Read Me First ###############################
'''
------------------------------------------In DETAIL--------------------------------
import pandas as pd
import pandas_datareader.data as web
import numpy as np
import datetime
from scipy.optimize import minimize
TOLERANCE = 1e-10
def _allocation_risk(weights, covariances):
@TJConnellyContingentMacro
TJConnellyContingentMacro / add_rec_bars.py
Created September 18, 2018 15:31 — forked from TomAugspurger/add_rec_bars.py
Adding recession bars to matplotlib axes.
import pandas as pd
def add_rec_bars(ax, dates=None):
if dates is None:
dates = pd.read_csv('/Users/tom/bin/rec_dates.csv',
parse_dates=['Peak', 'Trough'])
for row in dates.iterrows():
x = row[1]
y1, y2 = ax.get_ylim()