Closed boneyalch closed 6 years ago
The error indicates that you are still using Quantopian's zipline.
I recommend that you take out Spyder from the picture and follow the tutorial step by step. Once it works then you can try to make it happen within Spyder.
Hope this helps, Tibor
Your previous (now inaccessible -- not sure why) comment indicates that you don't have virtualenv installed. Please do a pip install virtualenv
, then try out the steps from the tutorial.
If you need further assistance we're available at Slack (find the details on the contact page).
Hope this helps, Tibor
Hello, I had an problem of a similarly superficial level as well as a lack of programming literacy. When I try to install zipline-live, I had an issue at the second line calling source
(C:\ProgramData\Anaconda2) C:\Users\q>virtualenv ~/venv-zipline-live New python executable in C:\Users\Q~1\~\VENV-Z~1\Scripts\python.exe Installing setuptools, pip, wheel...done. (C:\ProgramData\Anaconda2) C:\Users\q>source ~/venv-zipline-live/bin/activate 'source' is not recognized as an internal or external command, operable program or batch file.
I have source package version 1.2.0 installed, any help appreciated
The tutorial assumes that you are running the commands on Linux / Mac OS X.
I don't have a windows machine, therefore cannot provide a solution here. What I'd suggest that you read through on anaconda's documentation and try to replace virtualenv with conda: https://conda.io/docs/user-guide/tasks/manage-environments.html
Something like this:
conda create --name zipline-live pip
activate zipline-live
pip install zipline-live[ib]
Please let us know how this works. Thanks!
Your solution worked I was using Anaconda prompt, which appears to creates its own Anaconda virtual environment using its python installation. After I activate the zipline-live environment, it deactivates the Anaconda environment and I lose my path to python. When I added python to the windows path and executed your lines in command prompt, there was no issue
@tqzlin : Glad it worked! Did you managed to connect to TWS too? Would be happy to hear any feedback on the demo algo too.
Yes it connected to TWS, but apparently I lacked a data subscription for AAPL. I thought it would fall under US Securities Snapshot and Futures Value Bundle.
By the way @tibkiss @tqzlin I also got that 502 error when I ran my test last weekend. Do you know if this means it's not connected correctly? I only saw this issue when I tried zipline-live with IB Gateway. When I ran it with TWS it does not show the 502 error.
My guess is that it's an API version issue? But that wouldn't make sense since I downloaded the latest IB Gateway and also the latest TWS.
The terminal log at http://www.zipline-live.io/tutorial also indicates the 504 error but still successfully prints security fields in handle_data, so I don't think 504 is an actual error. Could I ask what market data subscriptions you have?
Gotcha thanks for clearing that up @tqzlin. I have the same subscriptions as the ones noted in the image above
@tqzlin : I have the streaming bundle. That might explain.
There are two strange things in your output: 1) length of the (masked) managed accounts. Maybe you have more than one account listed there? zipline-live takes the first account from that list and uses that account id to extract the open positions. 2) 'Error validating request: -'ba'. I don't have this message either.
Folks, could some of you create a tutorial on how to install zipline-live on Windows? I personally don't have that OS and would be a great help if someone could provide working instructions for that platform.
Not sure what format or depth the tutorial should have, so I copied your webpage with minimal changes to the text =P.
I subscribed to the US Equity Options Add-on Streaming Bundle that you mentioned and am now able to successfully execute the demo algorithm.
This issue has been resolved with: https://github.com/zipline-live/zipline-live.github.io/pull/10 Thanks Mohammed for the tutorial!
Hello Friends,
I've had a very hard time getting zipline-live to function based off of the tutorial on the site. I've created a project in Spyder to get it going in Py 2.7. I've properly set up my Trader Workstation settings and logged on, and set the ports correctly.
I've set the PYTHON PATH MANAGER to see the Zipline folder/files, the zipline-live folder, and in the python console the tutorial code seems to be functioning:
from zipline.api import order, symbol
import logbook log = logbook.Logger('algo')
def initialize(context): pass
def handle_data(context, data): sym = symbol("AAPL") log.info("handle_data: last_traded={} price={} OHLC={}/{}/{}/{} Volume={}".format( data.current(sym, 'last_traded'), data.current(sym, 'price'), data.current(sym, 'open'), data.current(sym, 'high'), data.current(sym, 'low'), data.current(sym, 'close'), data.current(sym, 'volume')))
seems to process fine (no error messages).
However, when I go back to terminal and put in:
zipline run -f ~/zipline-algos/demo.py --broker ib --broker-uri localhost:7496:1232 --bundle quantopian-quandl --data-frequency minute
as suggested in the tutorial, I get an error message in terminal (on a mac).
Error: no such option: --broker
I'm new to Python (been trading for 12 year) I've had a very difficult time with just setting up a Python Project and properly linking files just to get things going, the programming aspect of it makes complete sense, but the setting up of proper directories and folders is very obtuse and there is very little basic introduction to how to get running from the ground up. Any help is greatly appreciated!