Skip to content

Instantly share code, notes, and snippets.

View HumanRupert's full-sized avatar
:shipit:

Ali HumanRupert

:shipit:
View GitHub Profile
@scubamut
scubamut / print_bundle_symbols.py
Last active March 18, 2023 09:11
How to print symbols in the zipline bundle
# HOW TO PRINT BUNDLE SYMBOLS
import os
from pandas import Timestamp
from zipline.data.bundles import load
now = Timestamp.utcnow()
bundle = load('US_stock_bundle', os.environ, now)
symbols = set(str(asset.symbol)
for asset in bundle.asset_finder.retrieve_all(
@martinjc
martinjc / simpson.py
Created May 7, 2014 09:26
Simpson Diversity Index
#!/usr/bin/env python
# Simpson Diversity Index
# http://en.wikipedia.org/wiki/Diversity_index
# modified from Shannon Diversity Index implementation by audy
# https://gist.github.com/audy/783125
# https://gist.github.com/audy
def simpson_di(data):
@xav-b
xav-b / genetic_function.py
Last active April 10, 2022 03:12
Genetic optimization of a trading strategy for zipline backtester
import time
import random
import math
import numpy as np
import logbook
log = logbook.Logger('Optimization')
from neuronquant.network.transport import ZMQ_Dealer