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

pyalgotrade trouble with exit-order-event (onExitOk)

Struggelig a bit with my trading algo. It seems that the orders cant finish before the next onBars() is called, and the quantities become a mess. Im using the enterLongLimit() to enter a trade, which calls onEnterOk() when it finishes - but im using…
shakalakka
  • 105
  • 1
  • 1
  • 8
1
vote
1 answer

How to reuse the instance strategy class of pyalgotrade

I define a class as follows. But I can only run myStrategy once. If I change the parameters and run myStrategy again, nothing changes. I hope to use the same strategy many times with different stocks and parameters. """ from pyalgotrade import…
1
vote
3 answers

Python Pyalgotrade find most recent peak (min or max) in Dataseries

I am using Pyalgotrade (usually in combination with ta-lib indicators), but I am missing a function to find a local maxima and minima in the data series. I am aware of the min and max functions, but this is not what I am looking for. E. g. MIN(low,…
Ale
  • 247
  • 3
  • 10
1
vote
1 answer

Pyalgotrade SMA Coding Clarification

I've started learning and testing PyAlgoTrade and having a hard time understanding some of the logic behind the code of some of the technicals like SMA and RSI. I understand the self.info() function prints out the dataframe feed it takes as a…
stats999
  • 43
  • 1
  • 3
1
vote
1 answer

Formatting data from a new source in pyalgotrade

I am trying to adapt a pyalgotrade feed to use data streamed from another source. I am getting an error inside of the run_strategy method when I try to point the feed to data obtained using the function getdata(). NOTE that getdata returns data in…
Rilcon42
  • 9,584
  • 18
  • 83
  • 167
1
vote
1 answer

Pyalgotrade - AttributeError: 'SequenceDatasSeries' object has no attribute 'getHighDataSeries'

I'm using pyalgotrade to write a trading algo. I got the error above and can't seem to fix it. I'm trying to use the "SLOW STOCHASTIC", any help on solving this error and getting the slow stochastic to work is greatly…
1
vote
1 answer

NotImplementedError() what does this mean, event profiler pyalgotrade

I'm trying to run pyalgotrade's event profiler. I'm using custom data, it works when I run it with the default stratergy/predicate 'BuyOnGap' however when I try and run it with a simple custom strategy it throw the error: Traceback (most recent call…
David Hancock
  • 1,063
  • 4
  • 16
  • 28
1
vote
1 answer

PyAlgo Trade failed to read a csv file

i tried to code below: from pyalgotrade.feed import csvfeed feed=csvfeed.Feed("Date","%Y.%M.%d %H:%m:%S") feed.addValuesFromCSV('/Users/emacsen/Duka_Data/EURUSD_UTC_1 Min_Bid_2005.01.01_2015.10.05.csv') and an error turned out to be : dateTime…
Emacsen
  • 11
  • 2
1
vote
1 answer

broker.backtesting [DEBUG] Not enough cash to fill 600800 order [1684] for 998 share/s

I am using optimizer in Pyalgotrade to run my strategy to find the best parameters. The message I get is this: 2015-04-09 19:33:35,545 broker.backtesting [DEBUG] Not enough cash to fill 600800 order [1681] for 888 share/s 2015-04-09 19:33:35,546…
epx
  • 571
  • 4
  • 16
  • 27
1
vote
1 answer

ImportError from using the trading strategy in PyAlgoTrade tutorial

I got an import error while I am running a simple python written trading strategy in Pyalgotrade. from pyalgotrade.tools import yahoofinance yahoofinance.download_daily_bars('orcl', 2000, 'orcl-2000.csv') from pyalgotrade import strategy from…
qifengwu
  • 129
  • 1
  • 13
1
vote
1 answer

error from downloading example data from yahoo finance in PyAlgoTrade

I am trying to follow the introduction in PyAlgoTrade website to download the data from yahoo finance using the given code. But I always got an error. Here is the website: …
qifengwu
  • 129
  • 1
  • 13
0
votes
0 answers

How do I count the dynamic orderIds generated through API in this code?

This code simply prints "the orderId is 1 to 3", but what I want is, I want to Count the Orderid that is' generated through API.. order_params = { "variety": "NORMAL", "tradingsymbol": TRADING_SYMBOL, "symboltoken": TOKEN, "transactiontype":…
0
votes
1 answer

Pinescript giving unexpected alerts

i am new to this automated trading, but recently i developed a system using supertrend and breakouts. but i am facing trouble in setting alerts, 90% time they are working fine but sometimes i am getting alerts without even signal is…
0
votes
1 answer

How can I place a Bracket Order in Angelone Smartapi

I have following method - def place_order(token,symbol,qty,buy_sell,ordertype,price,variety= 'NORMAL',exch_seg='NSE',triggerprice=0): try: orderparams = { "variety": variety, "tradingsymbol": symbol, …
qagourab
  • 11
  • 4
0
votes
1 answer

Create vwap in angel broking smartapi

How can I calculate vwap using angel broking smartapi data. Able to create smartapi object data. totp=pyotp.TOTP(Token).now() SMART_API_OBJ = SmartConnect(api_key) # ************login api call************ history_data =…
qagourab
  • 11
  • 4