Git Product home page Git Product logo

flyingfox's People

Contributors

zhaimac 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

flyingfox's Issues

Default data bundle changed to quantopian quandl

Hi,

first of all, thank you for introducing the quantopian backtesting module into R! While running your basic example classic dual moving average crossover I get the following error after running the chunk

``
performance <- fly_run_algorithm(
initialize = fly_initialize,
handle_data = fly_handle_data,
start = as.Date("2013-01-01"),
end = as.Date("2016-01-01")
)

``
Error in py_call_impl(callable, dots$args, dots$keywords) :
ValueError: no data for bundle 'quandl' on or before 2018-08-12 22:48:44.663246+00:00
maybe you need to run: $ zipline ingest -b quandl

Detailed traceback:
File "", line 50, in py_run
File "C:\Users\Simon\Anaconda3\Lib\site-packages\zipline\utils\run_algo.py", line 430, in run_algorithm
blotter=blotter,
File "C:\Users\Simon\Anaconda3\Lib\site-packages\zipline\utils\run_algo.py", line 141, in _run
bundle_timestamp,
File "C:\Users\Simon\Anaconda3\Lib\site-packages\zipline\data\bundles\core.py", line 521, in load
timestr = most_recent_data(name, timestamp, environ=environ)
File "C:\Users\Simon\Anaconda3\Lib\site-packages\zipline\data\bundles\core.py", line 497, in most_recent_data
timestamp=timestamp,

After trying zipline ingest -b quandl the following error emerges:

Traceback (most recent call last):
File "C:\Users\Simon\Anaconda3\Scripts\zipline-script.py", line 11, in
load_entry_point('zipline==1.3.0', 'console_scripts', 'zipline')()
File "C:\Users\Simon\Anaconda3\Lib\site-packages\click\core.py", line 722, in call
return self.main(*args, **kwargs)
File "C:\Users\Simon\Anaconda3\Lib\site-packages\click\core.py", line 697, in main
rv = self.invoke(ctx)
File "C:\Users\Simon\Anaconda3\Lib\site-packages\click\core.py", line 1066, in invoke
return process_result(sub_ctx.command.invoke(sub_ctx))
File "C:\Users\Simon\Anaconda3\Lib\site-packages\click\core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:\Users\Simon\Anaconda3\Lib\site-packages\click\core.py", line 535, in invoke
return callback(*args, **kwargs)
File "C:\Users\Simon\Anaconda3\Lib\site-packages\zipline_main
.py", line 348, in ingest
show_progress,
File "C:\Users\Simon\Anaconda3\Lib\site-packages\zipline\data\bundles\core.py", line 451, in ingest
pth.data_path([name, timestr], environ=environ),
File "C:\Users\Simon\Anaconda3\Lib\site-packages\zipline\data\bundles\quandl.py", line 209, in quandl_bundle
environ.get('QUANDL_DOWNLOAD_ATTEMPTS', 5)
File "C:\Users\Simon\Anaconda3\Lib\site-packages\zipline\data\bundles\quandl.py", line 113, in fetch_data_tabl
"Failed to download Quandl data after %d attempts." % (retries)
ValueError: Failed to download Quandl data after 5 attempts.

Googling around a bit it seems the quantopian guys have changed the default bundle to quantopian quandl as the command zipline ingest -b quantopian-quandl works.

What needs to be changed in calling you example code, so that it searches for data in quantopian quandl and not quandl dataset?

security list

Hi ,

This is not a bug. but I don't know where to put my question.
i tried to assign a security list to the context, like:

python:
context.security_list = [sid(24), sid(5061), sid(39840), sid(21435)]

flyingfox:

fly_initialize <- function(context) {
context$i <- 0L
sList <- c("ARNC","AAPL","ABT","ADSK","TAP","ADBE","ADI","ADM")
context$asset <-  sList
}

fly_handle_data <- function(context, data) {
  
  # Increment day
  context$i <- context$i + 1L
  
  # While < 300 days of data, return
  if(context$i < 21L) {
    return()
  }

  price_hist <- fly_data_history(data, context$asset, "price", bar_count = 21L, frequency = "1d")

}

Error:

debugSource('~/ShortTermMeanReversion.R')
Error in py_call_impl(callable, dots$args, dots$keywords) :
RuntimeError: Evaluation error: ValueError: invalid literal for int() with base 10: 'ARNC'.

Can you help? Or do you have some example that I can follow?

thanks

Mark

error in install_zipline

hi David,

thank you for the fantastic job. One quick question. you mention

To get started with zipline, you’ll need the zipline Python module. Install it with:
install_zipline()

i tried the following:

library(flyingfox)
install_zipline()
Solving environment: ...working... failed

PackagesNotFoundError: The following packages are not available from current channels:

  • zipline

Current channels:

however, install zipline in anaconda worked.

here is anaconda info:

(base) C:\Windows\system32>conda info

 active environment : base
active env location : C:\ProgramData\Anaconda3
        shell level : 1
   user config file : C:\Users\mark\.condarc

populated config files : C:\Users\mark.condarc
conda version : 4.5.4
conda-build version : 3.10.9
python version : 3.5.5.final.0
base environment : C:\ProgramData\Anaconda3 (writable)
channel URLs : https://conda.anaconda.org/Qantopian/win-64
https://conda.anaconda.org/Qantopian/noarch
https://repo.anaconda.com/pkgs/main/win-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/free/win-64
https://repo.anaconda.com/pkgs/free/noarch
https://repo.anaconda.com/pkgs/r/win-64
https://repo.anaconda.com/pkgs/r/noarch
https://repo.anaconda.com/pkgs/pro/win-64
https://repo.anaconda.com/pkgs/pro/noarch
https://repo.anaconda.com/pkgs/msys2/win-64
https://repo.anaconda.com/pkgs/msys2/noarch
package cache : C:\ProgramData\Anaconda3\pkgs
C:\Users\mark\AppData\Local\conda\conda\pkgs
envs directories : C:\ProgramData\Anaconda3\envs
C:\Users\mark\AppData\Local\conda\conda\envs
C:\Users\mark.conda\envs
platform : win-64
user-agent : conda/4.5.4 requests/2.19.1 CPython/3.5.5 Windows/7 Wi
ndows/6.1.7601
administrator : True
netrc file : None
offline mode : False

(base) C:\Windows\system32>

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.