mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-18 12:20:12 +08:00
Merge pull request #383 from quantopian/welcome-to-the-family
symbol as an api_method
This commit is contained in:
@@ -486,6 +486,15 @@ class TradingAlgorithm(object):
|
||||
for name, value in chain(positionals, iteritems(kwargs)):
|
||||
self._recorded_vars[name] = value
|
||||
|
||||
@api_method
|
||||
def symbol(self, symbol_str, as_of_date=None):
|
||||
"""
|
||||
Default symbol lookup for any source that directly maps the
|
||||
symbol to the identifier (e.g. yahoo finance).
|
||||
Keyword argument as_of_date is ignored.
|
||||
"""
|
||||
return symbol_str
|
||||
|
||||
@api_method
|
||||
def order(self, sid, amount,
|
||||
limit_price=None,
|
||||
|
||||
@@ -30,16 +30,7 @@ from zipline.finance.slippage import (
|
||||
batch_transform = zipline.transforms.BatchTransform
|
||||
|
||||
|
||||
def symbol(symbol_str, as_of_date=None):
|
||||
"""Default symbol lookup for any source that directly maps the
|
||||
symbol to the identifier (e.g. yahoo finance).
|
||||
|
||||
Keyword argument as_of_date is ignored.
|
||||
"""
|
||||
return symbol_str
|
||||
|
||||
__all__ = [
|
||||
'symbol',
|
||||
'slippage',
|
||||
'commission',
|
||||
'math_utils',
|
||||
|
||||
Reference in New Issue
Block a user