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
1 answer

How to execute trades in Binance Futures after back-testing with pandas Data-frame

I have back-tested my trading strategy using pandas data-frames and found the win-rate, sharpe ratio etc. import pandas as pd import talib import numpy as np import matplotlib.pyplot as plt import mplfinance as mpf import…
Skuller
  • 23
  • 4
0
votes
0 answers

Is there universal way of increasing matplotlib Python chart size in Jupyter?

I've found that various packages don't allow for use of plt.figure(figsize=(12,10)) and set default values figure size on very low level. I met this problem for example in pyalgotrade module: So the question it how to increase chart size in more…
Qbik
  • 5,885
  • 14
  • 62
  • 93
0
votes
1 answer

Ist there Something as a vectorized Backtesting Platform?

I got a pandas series of timevalues and 1s for a Trade and 0s for Not to Trade (plus different Takeprofit and stoploss values) and i am Planing to Backtest it. However the Last Time I used backtrader I manually had to search the current…
0
votes
1 answer

How can I get the yesterday's adjusted closing price in a data in pyalgotrade dataseries?

I want to compare today's closing price to yesterday's closing price, however I could not find a method to get yesterday's price. I also looked for shifting the closingPrice dataseries(which I received by getAdjCloseDataSeries()) but could not solve…
lalalal
  • 3
  • 2
0
votes
1 answer

pyalgotrade can not procee csv feed in strategy

I am trying to load 1- minutes data into pyalgotrade. The feed is loaded correctly but I have some weird error in initializing strategy. Anyone can give some advice on this? Here is the code class MyStrategy(strategy.BacktestingStrategy): def…
XZXZ
  • 1
  • 2
0
votes
1 answer

no module named rsi2 in python? cannot import through pip

I'm new to python, and trying to get a simple backtest to work using these examples pyalgotrade examples however when I try to run the line: import rsi2 in an IPython Notebook I get: ModuleNotFoundError: No module named 'rsi2' Since every other…
Rilcon42
  • 9,584
  • 18
  • 83
  • 167
0
votes
1 answer

Pyalgotrade - how to get average fill price for all open position

i need average fill price for shares when using pyalgotrade on each bar... i am unable to figure out a way to get the same using callout for getAvgFillPrice function. this would help me to decide to enter next trade or not. any help will be…
0
votes
1 answer

Specifying alternative datetime format "Exception: Invalid datetime. It must be bigger than that last one"

I am attempting to read in a csv that has a new data entry every 15 minutes. From what I can gather, the reason I am returning this exception is because the date doesn't change every row, but the time does. However, the feed isn't reading in the…
Phil
  • 15
  • 2
0
votes
1 answer

Q: Resample bitstamp bars in pyalgotrade

I'm working with an algo on the bitstamp client that works better with 30-min bars, rather than seeing each trade as a bar. Is there a "right" way to resample those bars into 30-min intervals on the fly? I can do it no problem with the bitcoincharts…
Josh Peck
  • 1
  • 1
0
votes
1 answer

python adding multiple items in variable

I'm trying to add the multiple stock quotes (e.g.APPL,TSLA, AMZN ) in the instrument variable so that metaplotlib can generate bollinger band graph for multiple stock quotes.For now it just shows the graph for one stock. I tried using the…
sandy
  • 93
  • 1
  • 8
0
votes
1 answer

Pyalgotrade's ninjatraderfeed fails after 7 onBars() calls

I'm trying to use the ninjaTrader feed via CSV files containing minute data. The program works as intended for seven onBars calls, then spits an error: self.info(str(instr) + " current Open price: %.2f" % (bars.getBar(instr).getOpen()))…
0
votes
0 answers

Python pyalgotrade Quandl feed Error

having an error with feed.addBarsFromCSV when combined with quandlefeed as below and used on instrument "CBOE/VIX" import quandl as qd from pyalgotrade.tools import quandl from pyalgotrade.barfeed import quandlfeed name = '%s.csv' sym = "VIX" data…
stats999
  • 43
  • 1
  • 3
0
votes
1 answer

newbie using pyalgotrade and yahoofinance

I am trying to use yahoofinance.build_feed from pyalgotrade (version 0.18) to build a cvs file containing OHLC data. I have no clue why I get this error. Thank you for any help. from pyalgotrade.tools import yahoofinance instruments =…
0
votes
1 answer

Function returning same values for supposedly different inputs

I'm using pyalgotrade to create a trading strategy. I'm going through a list of tickers(testlist) and adding them to a dictionary(list_large{}) alongside their score which I'm getting using a get_score function. My latest problem is that each ticker…
RageAgainstheMachine
  • 901
  • 2
  • 11
  • 28
0
votes
1 answer

Assertion Error - Pyalgotrade

I'm trying to use a technical indicator (Stochastic) but I'm getting an assertion error for this line : self.__slow_stoch = stoch.StochasticOscillator(feed[instrument],self.__stoch, 3, self.__slow_d) I'm using pyalgotrade to run a trading strategy…
RageAgainstheMachine
  • 901
  • 2
  • 11
  • 28