------------------ ------------------------- pip install zipline ----------------------------- pip install pandas numpy scipy matplotlib pytz ------------------------- [exchange] country = US timezone = US/Eastern ------------------------------ python from zipline.api import order, order_target_percent, record, symbol def initialize(context): context.stock = symbol('AAPL') def handle_data(context, data): order_target_percent(context.stock, 1.0) record(AAPL=data.current(context.stock, 'price')) zipline run -f <path_to_your_code_file.py> --start <start_date> --end <end_date> -o <output_file.pickle> ------------------------


上一篇:
下一篇:
切换中文