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
import React from 'react' | |
import { connect } from 'react-redux' | |
import { bindActionCreators } from 'redux' | |
import isFunction from 'lodash/isFunction' | |
import techan from 'techan' | |
import { log_debug, log_critical } from 'logging' | |
import { CHART_HEADER_HEIGHT, CHART_SIDEBAR_WIDTH } from 'finance/constants' | |
import { niceLogMin, niceLogMax, getLogTickValues } from 'finance/utils/logScale' |
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 __future__ import print_function | |
import httplib2 | |
import os | |
from apiclient import discovery | |
import oauth2client | |
from oauth2client import client | |
from oauth2client import tools | |
from datetime import datetime |
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
import numpy as np | |
from collections import deque | |
from talib.abstract import Function | |
class Bar(object): | |
'''A simplistic holder for bar data with attribute and dict-style lookup.''' |
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
diff --git a/zipline/algorithm.py b/zipline/algorithm.py | |
index 839812f..102dc21 100644 | |
--- a/zipline/algorithm.py | |
+++ b/zipline/algorithm.py | |
@@ -100,6 +100,9 @@ class TradingAlgorithm(object): | |
else: | |
self.data_frequency = None | |
+ if 'source' in kwargs: | |
+ self.set_sources(kwargs['source']) # is it better to pop here? |
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
### zipline/utils/factory.py additions/modifications ### | |
from zipline.utils.protocol_utils import ndict | |
# hack around zipline's internal requirement of representing symbols as ints | |
def symbol_to_id(symbol): | |
symbol = symbol.upper() # we rely on 2-digit ASCII codes for id -> symbol | |
id_ = [] | |
for char in symbol: | |
id_.append(str(ord(char))) |