mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-03 19:29:40 +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:
@@ -38,6 +38,7 @@ from zipline.test_algorithms import (TestRegisterTransformAlgorithm,
|
||||
handle_data_api,
|
||||
noop_algo,
|
||||
api_algo,
|
||||
api_symbol_algo,
|
||||
call_all_order_methods,
|
||||
record_variables,
|
||||
record_float_magic
|
||||
@@ -294,6 +295,10 @@ class TestAlgoScript(TestCase):
|
||||
algo = TradingAlgorithm(script=api_algo)
|
||||
algo.run(self.df)
|
||||
|
||||
def test_api_symbol(self):
|
||||
algo = TradingAlgorithm(script=api_symbol_algo)
|
||||
algo.run(self.df)
|
||||
|
||||
def test_fixed_slippage(self):
|
||||
# verify order -> transaction -> portfolio position.
|
||||
# --------------
|
||||
|
||||
Reference in New Issue
Block a user