Questions tagged [pyalgotrade]

PyAlgoTrade is an event driven algorithmic trading Python library.

Python Algorithmic Trading Library

PyAlgoTrade is a Python Algorithmic Trading Library with focus on backtesting and support for paper-trading and live-trading. Let’s say you have an idea for a trading strategy and you’d like to evaluate it with historical data and see how it behaves. PyAlgoTrade allows you to do so with minimal effort.

Main Features

  • Event driven.
  • Supports Market, Limit, Stop and StopLimit orders.
  • Supports any type of time-series data in CSV format like Yahoo! Finance, Google Finance, Quandl and NinjaTrader.
  • Bitcoin trading support through Bitstamp.
  • Technical indicators and filters like SMA, WMA, EMA, RSI, Bollinger Bands, Hurst exponent and others.
  • Performance metrics like Sharpe ratio and drawdown analysis.
  • Handling Twitter events in realtime.
  • Event profiler.
  • TA-Lib integration.

Home page: http://gbeced.github.io/pyalgotrade/

77 questions
0
votes
2 answers

PYALGOTRADE - Multiple Tickers

I have a strategy that consists of using multiple technical indicators to generate a buy signal. How would I go about to implement this with Pyalgotrade for multiple lists of tickers in such a way that the strategy is not analyzed on a per ticker…
RageAgainstheMachine
  • 901
  • 2
  • 11
  • 28
0
votes
1 answer

Pyalgotrade - TA-LIB - Indicator Returns "NONE"

I'm working with Pyalgotrade to test a trading strategy in python. Pyalgotrade allows for the use of a library called TA-LIB,which is a technical analysis library. For some reason, when I use the PPO indicator it returns "None". The indicator takes…
0
votes
1 answer

ERROR with Pyalgotrade

from pyalgotrade import strategy from pyalgotrade.feed import csvfeed from pyalgotrade.technical import ma from pyalgotrade.bar import Frequency class MyStrategy(strategy.BacktestingStrategy): def __init__(self, feed, instrument): …
Ken Ho
  • 470
  • 2
  • 5
  • 18
0
votes
0 answers

PyAlgoTrade - Stochastic indicator - Error:Exception: inputs are all NaN

I'm trying to use the stochastic indicator in my trading strategy but I'm getting the following error: 2016-07-06 16:14:24,414 yahoofinance [INFO] Downloading AAPL 2015 to .\AAPL-2015-yahoofinance.csv 2016-07-06 16:14:24,585 yahoofinance [INFO]…
RageAgainstheMachine
  • 901
  • 2
  • 11
  • 28
0
votes
1 answer

Highest high for a specific time span

How can I get the highest high for a specific time span, e.g. from 08:00 - 10:00 am using a pyalogtrade or ta-lib indicator. Of course I could write two if statements to check the time on the current bar, but I thought there must be a more elegant…
Fari
  • 86
  • 4
0
votes
2 answers

More examples for the event profiler in pyalgotrade

I'm trying to learn how to implement custom strategies into the event profiler for pyalgotrade. This is the default example they give. from pyalgotrade import eventprofiler from pyalgotrade.technical import stats from…
0
votes
1 answer

pyalgotrade VWAP calcuation using yahoo historical data seems to be incorrect

I have just started with pyalgotrade, using a modified sample code I got online that is using VWAP ( volume adjusted average ) calculation, as well as software's own method of acquiring yahoo historical data, I have noted the output VWAP…
0
votes
2 answers

What is "orcl" in the following pyalgotrade code? Further, i have a csv file and how can i upload data from it into my code?

I wanted to implement my own strategy for backtesting but am unable to modify the code according to my needs from pyalgotrade.tools import yahoofinance yahoofinance.download_daily_bars('orcl', 2000, 'orcl-2000.csv') from pyalgotrade import…
0
votes
1 answer

KeyError importing yahoo bars with Pyalgotrade

I have run into a problem where python is throwing a KeyError when trying to reference stock prices in pyalgotrade's onBars function. The interesting thing is that it depends which stocks you are trying to access. The following code does not work…
kbcool
  • 695
  • 6
  • 18
0
votes
2 answers

meaning of setUseAdjustedValues(True) om pyalgotrade

Here is an example of SMA cross strategy, what is the reason we use self.setUseAdjustedValues(True) and how does it works? from pyalgotrade import strategy from pyalgotrade.technical import ma from pyalgotrade.technical import cross class…
epx
  • 571
  • 4
  • 16
  • 27
0
votes
2 answers

Pyalgotrade Tutorial Attribute Error

I have been googling for a while now, but am still unable to find a solution, or even determine the problem, honestly. My installation of Python and Pyalgotrade is correct, as verified by the successful imports. Nonetheless, I can't manage to run…
m_br
  • 17
  • 4
0
votes
1 answer

NameError: global name 'indicator' is not defined using Pyalgotrade in Python

I trying to write a Ultimate Oscillator in python using the list function in Pyalgotrade library. My code is below: from pyalgotrade.tools import yahoofinance from pyalgotrade import strategy from pyalgotrade.barfeed import yahoofeed from…
qifengwu
  • 129
  • 1
  • 13
0
votes
1 answer

AttributeError: 'float' object has no attribute 'getLow' using Pyalgotrade in Python

I trying to write a Stochastic Oscillator in python using the list function in Pyalgotrade library. Pyalgotrade library is a Python library for backtesting stock trading strategies. Let’s say you have an idea for a trading strategy and you’d like to…
qifengwu
  • 129
  • 1
  • 13
0
votes
0 answers

iolib import error in python

On Mac OS X Mountain Lion, I try import numpy as np import os import statsmodels.api as sm I get this error: /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python /Users/idf/PycharmProjects/PyAlgoTrade/GoldvsMiners.py Traceback…
user1676605
  • 1,337
  • 3
  • 13
  • 21
-1
votes
1 answer

I can not tell the computer when to exit. I am creating a mm model

Highestprice = ta.highest(close, 20) LowestPrice = ta.lowest(close, 200) Bid1exitCondition = state == 1 and close > fairValue and close < Highestprice[1] if Bid1exitCondition strategy.close("Bid 1 Close") state:= 0 I was expecting an…