Questions tagged [quantopian]

Quantopian is a website and API for writing investment algorithms using Python.

29 questions
5
votes
1 answer

How to solve AssertionError when running backtest on zipline

I'm working through the book Trading Evolved by Andreas Clenow and am running into an AssertionError when trying to run the code for the first backtest on zipilne. I am new to python and zipline and appreciate any guidance on how to solve this…
econlearner
  • 351
  • 2
  • 3
  • 10
3
votes
1 answer

Why is Quantopian's pf.create_full_tear_sheet() function giving me a DateTimeArray error?

I'm trying to run Pyfolio's pf.create_full_tear_sheet(df_returns) function on my own set of returns data df_returns (pandas dataframe) which looks like this: However I'm getting the error: TypeError: Addition/subtraction of integers and…
spidermarn
  • 959
  • 1
  • 10
  • 18
2
votes
0 answers

How to retrieve the cash dividends from the quantopian-quandl data bundle with Zipline?

https://www.zipline.io/bundles.html By default zipline comes with the quantopian-quandl data bundle which uses quandl’s WIKI dataset. The quandl data bundle includes daily pricing data, splits, cash dividends, and asset metadata. Quantopian has…
Vincent Roye
  • 2,751
  • 7
  • 33
  • 53
2
votes
0 answers

Stop loss and Take profit question in Quantopian

I need to set a stop loss and take profit to every trade I make in Quantopian. This is the code I have at the moment but it's not working as intended. The order logic (to enter a short or long trade) is scheduled only once per day while the take…
cristianc
  • 51
  • 1
  • 2
  • 8
2
votes
1 answer

Start loop at second column

I am looping through columns but keep getting an error on the first column because it seems to be datetime. Is there a way for me to start a for loop at the second column. This is using Quantopian Fundamental data for column in Fundamentals.columns:…
J.J.
  • 75
  • 8
2
votes
1 answer

Why does this AttributeError happen?

Good afternoon, I am a student and I was trying to implement the WaveTrend Oscillator strategy on the Quantopian Platform: https://www.tradingview.com/script/2KE8wTuF-Indicator-WaveTrend-Oscillator-WT/ what I wanted to do is selling AAPL when the…
1
vote
1 answer

Quantopian live algorithm - How to?

The big question is : How can I put live my quantopian algorithms, with all the strategies that I've set with alphas combination ? I didn't find any answer. I found Alpaca that works with zipeline but I can't use morningstar or Q1500US with alpaca,…
jmauclair
  • 17
  • 1
  • 6
1
vote
1 answer

Mean of normal distribution generated using numpy.random.randn() is not '0'

I am trying to follow this tutorial from quantopian where they are trying to show that samples progressively exhibit characteristics of a normal distribution with increase in size . I tried to generate a normal distribution using the…
Banad
  • 11
  • 4
1
vote
1 answer

Is there a way to create a pipeline locally using zipline?

I have set up zipline locally on PyCharm. The simulations work, moreover, I have access to premium data from quandl (which automatically updated when I entered my API key). However, now my question is, how do I make a pipeline locally using zipline.…
cem
  • 15
  • 7
1
vote
1 answer

from numexpr import evaluate on Quantopian

I'm trying to get some technical ind. with some of those commands in this link:https://github.com/enigmampc/catalyst/blob/master/catalyst/pipeline/factors/equity/technical.py, but in the quant.notebook I'm not able to get "from numexpr import…
BloomShell
  • 833
  • 1
  • 5
  • 20
1
vote
1 answer

How to write a CustomFactor for weekly EMA - Python, Quantopian

class EWMAWeekly(CustomFactor): inputs = [USEquityPricing.close] window_length = (13 + 2 * 13 - 1) * 5 # Initial 13 weeks for sma, then 25 more weeks to improve the accuracy of the current ema. def compute( self, …
1
vote
0 answers

How to correctly use scipy.stats.lognorm?

I'm trying to learn Python through the lecture series at Quantopian and am having trouble understanding how to use scipy.stats.lognorm and the documentation. This are the excerpts: pdf(x, s, loc=0, scale=1) ppf(q, s, loc=0, scale=1) I've included…
1
vote
2 answers

Python Zipline Offline Testing

I want to use zipline offline without jupyter notebooks. I have tried to get zipline to ingest from quandl and use the data successfully but I haven't succeeded. Here is my environment - python 3.5, using pycharm, pip3 freeze gives me -…
user10443822
1
vote
2 answers

How to add custom Trading Calendar in Zipline

I'm using zipline and trying to add a custom calendar to the system so that I can apply it to our country's exchange. I've looked up on stackoverflow and found this post : How to use a custom calendar in a custom zipline bundle? However, I couldn't…
1
vote
1 answer

Zipline Fundamental data

Does Zipline have the same fundamental data access as quantopian, if not how do I access it? from quantopian.pipeline.data import Fundamentals
J.J.
  • 75
  • 8
1
2