This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tweepy import Stream | |
from tweepy import OAuthHandler | |
from tweepy.streaming import StreamListener | |
from pymongo import MongoClient | |
import json | |
import sys | |
MONGO_HOST= 'mongodb://localhost/miscdb' # assuming you have mongoDB installed locally |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from zipline.api import * | |
from configparser import ConfigParser | |
import datetime | |
import ast | |
def initialize(context): | |
print ("Starting the robo advisor") | |
core_series = symbols('VTI', 'VXUS', 'BND', 'BNDX') | |
crsp_series = symbols('VUG', 'VTV', 'VB', 'VEA', 'VWO', 'BSV', 'BIV', 'BLV', 'VMBS', 'BNDX') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[CORE_SERIES] | |
0 = (0,0,0.686,0.294) | |
1 = (0.059,0.039,0.617,0.265) | |
2 = (0.118,0.078,0.549,0.235) | |
3 = (0.176,0.118,0.480,0.206) | |
4 = (0.235,0.157,0.412,0.176) | |
5 = (0.294,0.196,0.343,0.147) | |
6 = (0.353,0.235,0.274,0.118) | |
7 = (0.412,0.274,0.206,0.088) | |
8 = (0.470,0.314,0.137,0.059) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from zipline.api import * | |
import datetime | |
def initialize(context): | |
context.stocks = symbols('VTI', 'VXUS', 'BND', 'BNDX') | |
context.bought = False | |
risk_level = 5 | |
risk_based_allocation = {0: (0,0,0.686,0.294), | |
1: (0.059,0.039,0.617,0.265), |