Giter Site home page Giter Site logo

inside-zipline's Introduction

Hi, I am Jing Xu(RainX), an experimenter of life, a father, a programmer, and someone eager to exchange stories with you. I am living in Beijing.

I have experienced (and am still experiencing) the following adventures in my life:

  • 🩼 As a primary school student, I started my programming career by using a machine with a 6502 chip and running Basic.
  • 🎮 During my university years, I wrote Tetris using Turbo C 2.0.
  • 🇾 As a graduate, I joined Yahoo!, which was the largest website in the world at that time (2004).
  • 🏪 I worked for Alibaba Group, which is the largest e-commerce website in China.
  • 📱 Towards the end of 2010, I left Alibaba Group and joined the boom of the mobile internet industry.
  • 📈 I researched and developed a Python project on quantitative trading, which was (once) well-known by many people. (In fact, I intended to learn Python development through this project)
  • 🏛️ I joined the startup company RightCapital and continued my career in the Fintech industry.
  • ❤️ I got married, welcomed the birth of my daughter, and accompanied her as she grew up.
  • 🎵 I was into K-pop culture.
  • 📖 I translated a book into Chinese, challenging my English skills(my English is very bad though).
  • 🚲 It took 12 days for me to ride from Beijing to Hangzhou, covering a distance of approximately 1400km.
  • ♾️ And more in the future,

inside-zipline's People

Contributors

rainx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

inside-zipline's Issues

请问zipline里面的factor函数如何处理?

rainx您好,看到您的gitbook感到非常受益。我最近也在研究这个zipline怎么用(也是用自己的数据)。这里有个关于数据的问题想请教您一下。

首先,我的数据是每天只有一个值的时间序列(不是OHLCV这样的,或者只有HL两个值)。目前感觉能work的方法只有把它当成pd.panel手动传入TradingAlgorithm的data argument里。(不过当然这个目前还能忍)

我的问题是,假如我想算一些复杂一点的因子,用这种panel data的方法,如何用zipline自带的那些因子函数?(当然了,如果这实在不行的话,只能自己重写一遍这些函数了。)

具体是这样的,比如在您的例子里面(也是zipline doc里面的一个例子),使用历史数据计算一些因子是用data.history(sym, 'close', 5, '1d').mean(),这样算的。这个例子只是一个简单的平均值,所以有现成的函数。但是如果是更复杂的一些因子,(除了自己写函数)我看zipline自己定义了一些factor的函数以及可以继承CustomFactor定义用户自己的因子,比如简单平均值 SimpleMovingAverage因子。所以我的核心问题是,他这些因子函数只能支持他们内部的数据格式,自己载入的数据如何用他们的这些因子函数?

比方说,Quantopian bundle自己的美股数据都是这个USEquityPricing类的,每一列(似乎就是在这里定义了数据必须要OHLCV形式?比如如果自己的数据只有HL或者O,在这里改?当然了貌似这又涉及到还得自己些对应的data loader?)都是一个Column类,在这里和DataSet和CustomFactor定义的。

可是如果要是用上面double moving average的例子,比如,data.history(sym, 'close', 5, '1d').value什么的只是长度是5的一个list。如果直接带入SimpleMovingAverage这种函数里会报错(比如少了一些他们自己data类型的成员变量,比如window_safe之类的)。所以我主要就是想问怎么把自己的数据(panel data的或者DataFrame的)转换成他们这个因子函数能用的形式?

当然了,既然data.history(sym, 'close', 5, '1d').value只是一个基本的list,所以实在不行可以自己重写一些函数或者使用一些能直接处理这些基本数据结构的函数(比如pandas里的或者别的包里的)。但是,要是能用他们现成的是最好的。 不知道您在load国内数据的时候遇到过这种情况么(进一步要进行一些常规的计算,用他们zipline的还是自己当成list用pandas,numpy什么的自己算)?还是说您国内的数据形式也已经是OHLCV形式的,所以直接搞成一个和他们类似的bundle,没有这种问题?

非常感谢!

zipline如何支持同时多个trading calendar呢?

比如说原来股指期货早15分钟开盘,晚15分钟收盘

应该是支持的,但是不知道怎么用

Karen Rubin Jun 17, 2016
Hi Everyone,
We continue to work away on adding futures support to Quantopian. Last week we merged a big change to Zipline that enables support for multiple trading calendars. This is critical to allow for futures trading outside of NYSE market hours. We've also made great progress at ingesting futures data.

The next steps for the project are to work on building out the calendars for the CBOE, CME and ICE exchanges. Part of this will be solving problems around allowing algorithms to trade both equities and futures at the same time, and dealing with time management throughout the system.

We will be launching an alpha after this next phase is complete. You can sign up for it here, and also learn a little bit more (such as which contracts we plan to support).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.