Hi @cptanpanic
I am live trading since a few weeks on Bitfinex. Seems to work now after a few hickups. I'm trading with a single data feed/currency on the daily base. Bot sending me emails and telegram messages on all decisions and events.
Used a boilerplate from Rodrigo?? not using the BUY/SELL sentinels. As well got trailing and normal stop loss orders on Bitfinex working canceling them before buying or selling. Want to make it nicer and more generic with arguments like strategy to use to be parsed etc.... and how to use a systemd service on Linux to run the strategy or have it run in a screen... and finally make it available here as a starting point/boilerplate to say thanks to all the superbe people in this forum having made this possible!

Best posts made by Planet Winter
-
RE: Anyone use backtrader to do live trading on Bitcoin exchange?
Latest posts made by Planet Winter
-
RE: Anyone use backtrader to do live trading on Bitcoin exchange?
hi @mariano-bengeldorf. When plotting the open plot is a process stemming from your console script. Closing the plot will end the script as well. If this is not the problem or in general you can try backtesting with CSV files for example. They are certainly stopping your data feed and thus your script. Makes sense if you want to backtest over bigger time frames as well, having the data ready without loading data from the web API all the time. There are as well parameters to the ccxt feeds I don't remember as I don have my code ready. historical=? or so to ?
-
RE: Anyone use backtrader to do live trading on Bitcoin exchange?
Hi @cptanpanic
I am live trading since a few weeks on Bitfinex. Seems to work now after a few hickups. I'm trading with a single data feed/currency on the daily base. Bot sending me emails and telegram messages on all decisions and events.
Used a boilerplate from Rodrigo?? not using the BUY/SELL sentinels. As well got trailing and normal stop loss orders on Bitfinex working canceling them before buying or selling. Want to make it nicer and more generic with arguments like strategy to use to be parsed etc.... and how to use a systemd service on Linux to run the strategy or have it run in a screen... and finally make it available here as a starting point/boilerplate to say thanks to all the superbe people in this forum having made this possible! -
RE: Anyone use backtrader to do live trading on Bitcoin exchange?
@mariano-bengeldorf Did you try using a smaller size. It seems you can not buy with size=100 at a price of about 1000$ per BTC?!
-
RE: AttributeError: 'Plot_OldSync' object has no attribute 'mpyplot'
Hi dasch,
Thanks! I did a pip install --upgrade backtrader in my virtualenv which helped! I was sure I already did that but was apparently not true. This now gives me an IndexError I will look into that.
best,
Daniel -
AttributeError: 'Plot_OldSync' object has no attribute 'mpyplot'
Hi everyone,
I am new to backtrader and the forum. After looking at several platforms I came back to backtester.
I am not a professional programmer. However I attempted to import csv data and plot it which fails with AttributeError: 'Plot_OldSync' object has no attribute 'mpyplot'Can someone point me to the right direction? pudb debugging didn't get me further.
EDIT: setting todate and fromdate to the same values for both data, does not help.
Thanks in advance,
Danielimport datetime import backtrader as bt import backtrader.feeds as btfeeds import os import sys class GdaxCSVLHOC(btfeeds.GenericCSVData): """ bundle loading of gdax CSV files pass dataname as parameter with the name of the CSV file """ params = ( # reversed=True takes into account that the CSV data has already been reversed # and has the standard expected date ascending order ('reverse', False), ('headers', True), ('separator', ","), # defaults to min #fromdate=datetime.datetime(2000, 1, 1), # defaults to max #todate=datetime.datetime(2000, 12, 31), ('nullvalue', 0.0), # Format used to parse the datetime CSV field ('dtformate', '%Y-%m-%d %H:%M:%S'), # Format used to parse the time CSV field if "present" #('tmformat', ) #Fields order ('datetime', 0), ('high', 2), ('low', 1), ('open', 3), ('close', 4), ('volume', 5), ('openinterest', -1) ) if __name__ == '__main__': # Create a cerebro entity cerebro = bt.Cerebro() # Data is in an extra folder modpath = os.path.dirname(os.path.abspath(sys.argv[0])) datapath = os.path.join(modpath, '..', 'data') eth_eur = GdaxCSVLHOC(dataname = os.path.join(datapath, 'ETH-EUR_gdax.csv'), # Do not pass values before this date fromdate=datetime.datetime(2017, 6, 3), # Do not pass values after this date todate=datetime.datetime(2017, 8, 10) ) eth_usd = GdaxCSVLHOC(dataname = os.path.join(datapath, 'ETH-USD_gdax.csv'), # Do not pass values before this date fromdate=datetime.datetime(2017, 6, 3), # Do not pass values after this date todate=datetime.datetime(2017, 8, 10) ) cerebro.adddata(eth_eur) cerebro.adddata(eth_usd) cerebro.run() cerebro.plot()
I am running this in an up to date virtualenv. Backtrace:
(venv) [noisy:~/devel/planet-trader]: python strategies/bt_strat_gdax_csv.py Traceback (most recent call last): File "strategies/bt_strat_gdax_csv.py", line 76, in <module> cerebro.plot() File "/home/daniel/devel/planet-trader/venv/lib/python2.7/site-packages/backtrader/cerebro.py", line 943, in plot plotter.show() File "/home/daniel/devel/planet-trader/venv/lib/python2.7/site-packages/backtrader/plot/plot.py", line 777, in show self.mpyplot.show() AttributeError: 'Plot_OldSync' object has no attribute 'mpyplot'
Python 2.7.13
my pip packages:backtrader==1.9.54.122 certifi==2017.7.27.1 chardet==3.0.4 cycler==0.10.0 DateTime==4.2 functools32==3.2.3.post2 idna==2.5 matplotlib==2.0.2 numpy==1.13.0 pyparsing==2.2.0 python-dateutil==2.6.0 pytz==2017.2 requests==2.18.3 six==1.10.0 subprocess32==3.2.7 urllib3==1.22 zope.interface==4.4.2