简体   繁体   English

python-zipline中没有这样的选项错误

[英]No such option error in python-zipline

I am a newbie to zipline. 我是高空滑索的新手。 I am following the beginner tutorial to get familiar with it. 我正在按照初学者教程熟悉它。 And when I tried to run the algorithm as taught by tutorial in the ipython cell: 当我尝试运行ipython单元格中的教程所教导的算法时:

from zipline.api import order_target, record, symbol, history
import numpy as np
import pandas as pd

from zipline.examples import buyapple
%load_ext zipline
%%zipline --start 2000-1-1 --end 2014-1-1 --symbols AAPL


def initialize(context):
    pass

def handle_data(context, data):
    order(symbol('AAPL'), 10)
    record(AAPL=data[symbol('AAPL')].price)

I got such an error: NoSuchOption: no such option: --symbols 我得到了这样一个错误: NoSuchOption: no such option: --symbols

I tried to run python -m zipline run -f ../../zipline/examples/buyapple.py --start 2000-1-1 --end 2014-1-1 --symbols AAPL -o buyapple_out.pickle in the cli and also got the same error. 我试着运行python -m zipline run -f ../../zipline/examples/buyapple.py --start 2000-1-1 --end 2014-1-1 --symbols AAPL -o buyapple_out.pickle in cli也得到了同样的错误。 Do you know what's the reason and how can I fix it? 你知道原因是什么,我该如何解决? Thank you in advance! 先感谢您!

I ran this command $ zipline ingest which defaulted to fetching quantopian-quandl data bundle. 我运行了这个命令$ zipline ingest zipline ingest,它默认为获取quantopian-quandl数据包。

After that finished downloading I removed the offending switch: --symbols AAPL and the tutorial seemed to run correctly. 完成下载后,我删除了有问题的开关:-- --symbols AAPL ,教程似乎运行正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM