Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • 05:32
    sceenmaker commented #2376
  • May 26 05:05
    ZhengxunWu commented #2488
  • May 25 14:12
    iamanvesh commented #2578
  • May 25 13:46
    iamanvesh commented #2578
  • May 24 09:26
    pratiksgith opened #2716
  • May 23 14:08
    richafrank labeled #2715
  • May 23 14:08
    richafrank labeled #2715
  • May 23 14:08
    richafrank labeled #2715
  • May 23 14:08
    richafrank opened #2715
  • May 22 08:56
    cemal95 commented #2480
  • May 22 01:30
    PatrickTunni commented #2480
  • May 21 21:21

    llllllllll on optimize-format-inputs

    WIP: attempt to optimize ``_for… (compare)

  • May 21 18:58
    tstevens02127 commented #2346
  • May 21 10:30
    sabirjana commented #2714
  • May 21 10:08
    matiasthunder commented #2568
  • May 21 09:04
    bhushanjawle commented #2568
  • May 21 06:26
    noobmaster29 commented #2706
  • May 20 10:35
    daraul closed #2694
  • May 20 10:35
    daraul commented #2694
  • May 20 10:34
    daraul commented #2695
does anyone know if there's a slack channel for zipline developers?
Mosfiqur Rahman
Hi everyone,
I have just started working with zipline and in need of some help to figure out how I should use it for custom algorithm and data.
Here' s a detailed post:
Yi Li
Hi everyone, what is the difference between order_percent and order_target_percent in terms of the end results? Say, no matter which function I use, and no matter what how may APPL stocks I have already have (order_target_percent will adjust the difference between the percentages), after running order_percent(APPLE, 0.30) or order_target_percent(APPLE, 0.30), I will always have my 30 percent of my current position invested in APPL, right? In this way, there is no difference between this two?
I think I misunderstand something ...
Andrew King
I would assume order precent orders a set percentage - like your algo says "I need another 5%" and order_target_percent orders exactly your target that amount, but target_precent orders whatever it takes to make that share of your portfolio gets to that percentage.
Yi Li
OK, I see. Thanks @aking1012 ! This is helpful. So order_percent is like "order_another_percent", while order_target_percent is like "order_to_percent" ...
Yi Li
Is there any restrictions on the ticker name and value for self ingested csv data? Say, if I want to ingest some asset XXXX: (1) how long could the name XXXX be? and can I do special characters like XX_YY? (2) Can the value of the asset be negative? The reason I asked this is because when I ingest the data (1) If I have "EUR" and "FEUR", the ingested data is wrong, but if "EUR" and "EURF" then they are correct. (2) If there is negative values in the csv file, the ingested data will be some very large number.
I tried volumn=1e10 in the simulated csv data. And the error says uint32 out of bound. Is it because the zipline datatype is unsigned integer? so that when I tried above negative value, the result goes wrong (very large number)? thanks!
Andrew King
Depends on the provider. Yahoo has some wonky conventions for some index funds and denies some ticker symbols. I just iterate and drop the parsing errors and add it to a badsyms list even though it's listed on NASDAQ's index CSV.
Andrew King
Generally, it indicates what exchange it's on. Like the exchange in India has longer sym names than NASDAQ, which has longer sym names than NYSE, and forex exchange rates on 6 characters.
Yi Li
Thanks @aking1012 !
Yi Li
It looks like when I ingest the data with csv file, zipline can only read 3 digits after the decimal point? Could I change this if my data looks like 0.007239, 0.007321, etc. (currently, my csv data has round 17 digits after the decimal point(even though it is not that necessary for such a long accuracy), but when printing data.current, everything is 0.007, which looks like constant.)
Yi Li
Finally, I found this line of code Is this the reason I can only get 0.001 accuracy in zipline? I tried ingesting several data, it looks like zipline can only stores up to 0.001 accuracy. Can we customize this?
Yi Li
Is there any tutorial or doc on how to ingest our own future (a financial product) data (like, from csv files)? Thanks!

Hello.. I've installed zipline, but when I try to execute some script with run_algorithm it takes me a warning and the result of backtest is a zero dataframe (i mean, every column is filled with zeros).

The warning is:
C:\Python36\lib\site-packages\empyrical\ RuntimeWarning: invalid value encountered in true_divide
C:\Python36\lib\site-packages\empyrical\ RuntimeWarning: invalid value encountered in true_divide
np.divide(average_annual_return, annualized_downside_risk, out=out)

I'm using python 3.6, numpy 1.15.4 and pandas 0.22 (current versions).
SO is windows 64bits.

Any idea?

Andy Chen
Is there any grin Chinese Grin official member?
Fabian Orccon
Jack Ouyang
Thiago Cândido
im having a issue with running an algorithm with a csv bundle
Mingzhou ZHUANG
Hi, I'm trying to define a custom TradingCalendar for Chinese market. I'm new to zipline. I'm confused about the sessions and open_times/close_times.
There's a lunch break in Chinese market. The opening time for the market is 9:30-11:30am and 13:00-15:00pm.
According to A session represents a contiguous set of minutes, do we need two sessions in one day?
What does open_times/close_times mean here? If multi-session in one day, then there will be multi-open/close time in one day.
hi all!
I have a fast and easy question, is there any article - anybody have already done that?
where you can use the library simply as a class to operate on my data? it has simply to keep track of orders and compute balance accordingly to buy/sell
maybe even something external, I'd like to find a class that I can feed with data that is no more than 40 lines long, is this already out there? did you know of it? thanks
Leon Hill
Hello. I just opened a new issue . I have one quick question. Which pandas to use for zipline 1.3.0 ?
Hi guys. I am new to algo trading, and I'm looking to setup my project with the right libraries. Looking into zipline, I noticed 2 things: Python 3.5 is the oldest python version supported => does it mean that development for zipline with python 3.6, 3.7 is stopped and will never come out ?
I also heard that zipline stopped supporting "live trading". I don't really understand what it implies, if someone could enlighten me on that.
Hi guys, is there any extra info about the option trading in zipline, I've searched in google and community but found limited, anyone have tried that before? or any posts about this topic?
Kolmar Kafran
Fellows, should I work with Decimal or Integers for Algo Trading?
did you guys know how to optimize run_algo using panel?
It is slow when i test BTC minutes data
Hey all, I’m looking to modify zipline to keep track of post-tax returns as well. This will require tracking individual position transaction dates. What I think is currently being done is that Positions are aggregated on asset id and values like cost_basis are taken as a weighted average and last_transaction_date is updated after additional transactions. Anyone know if there is a version of Zipline that is tax-conscious?
@LucCADORET, nothing clear yet about when these two versions will be supported. For live trading, you can check
@luizmauricio000 zipline is supported only on python 3.5 version :)
Hi zipline! I was wondering the idea of allocating a budget to an Algorithm is part of the Blotter's reponsiblity?
Yuze Ma
I ran into an issue for importing zipline with the Dockerfile in the github repo. it says No module named ''. I'm looking at the souces code and found the _adjustment.pyx file. Am I supposed to change it into .py file? or there is an issue with the installation guidance?
Yuze Ma
I managed to install it by using conda env
I have a quandle data set in csv format, columns [symbol, time, OHCLV] but for all stocks since 1996. How do i read this in the
What's a good data source to get minute data (free or paid) for back testing with zipline?
entry $niper
@sniper__trader_twitter quantopian is daily data is n’t it?
entry $niper
What template for column date for minute data should be?
hello, may I use quantopian in my anaconda spyder environment?