mirror of
https://github.com/wassname/catalyst.git
synced 2026-09-12 12:12:04 +08:00
ENH: Add symbol api function
A symbol() lookup feature was added to Quantopian. By adding the same API function to zipline we can make copy&pasting of a zipline algo to Quantopian easier.
This commit is contained in:
@@ -745,6 +745,17 @@ def handle_data(context, data):
|
||||
record(incr=context.incr)
|
||||
"""
|
||||
|
||||
api_symbol_algo = """
|
||||
from zipline.api import (order,
|
||||
symbol)
|
||||
|
||||
def initialize(context):
|
||||
pass
|
||||
|
||||
def handle_data(context, data):
|
||||
order(symbol(0), 1)
|
||||
"""
|
||||
|
||||
call_all_order_methods = """
|
||||
from zipline.api import (order,
|
||||
order_value,
|
||||
|
||||
Reference in New Issue
Block a user