I have set up back testing to work so far, and plan to set it up for at least live manual trade signals if not just full automated trading. I have seen a few questions, but was wondering if anyone has created a live data feed and/or broker for an exchange like gdax, bitfinex, etc.
Best posts made by CptanPanic
-
Anyone use backtrader to do live trading on Bitcoin exchange?
-
Why do I get 'None' as value for SharpeRatio?
So I am new to backtrader, and have setup an initial strategy. I have a few analyzer added, and the other ones give a value, but the SharpeRatio one gives me 'None' Any ideas?
cerebro = bt.Cerebro() cerebro.broker.setcash(1000.0) print('STart Portfolio Value: %.2f' % cerebro.broker.getvalue()) # Add a strategy cerebro.addstrategy(TestStrategy) # Pass it to the backtrader datafeed and add it to the cerebro #data_feed = bt.feeds.PandasData(dataname=data['USDT_ETH']) # Create a Data Feed data_feed = bt.feeds.InfluxDB( dataname="USDT_ETH", username="admin", password="conStant", database="finance", host="192.168.1.82", open="open", close="close", high="high", low="low", # Do not pass values before this date fromdate=datetime.datetime(2017, 1, 1), # Do not pass values after this date todate=datetime.datetime(2017, 12, 31)) cerebro.adddata(data_feed) data_feed = bt.feeds.InfluxDB( dataname="USDT_BTC", username="admin", password="conStant", database="finance", host="192.168.1.82", open="open", close="close", high="high", low="low", # Do not pass values before this date fromdate=datetime.datetime(2017, 1, 1), # Do not pass values after this date todate=datetime.datetime(2017, 12, 31)) cerebro.adddata(data_feed) # Analyzer cerebro.addanalyzer(btanalyzers.SharpeRatio, _name='mysharpe') cerebro.addanalyzer(btanalyzers.AnnualReturn, _name='annual') thestrats = cerebro.run() thestrat = thestrats[0] cerebro.plot() print('Sharpe Ratio:', thestrat.analyzers.mysharpe.get_analysis()) print('Anual Ratio:', thestrat.analyzers.annual.get_analysis()) print('Final Portfolio Value: %.2f' % cerebro.broker.getvalue()) '''
-
RE: Anyone use backtrader to do live trading on Bitcoin exchange?
@ricpruss Actually that library ccxt looks great, it has support for tons of exchanges and is updated frequently. Would make sense to make a backtrader broker that just takes a ccxt object, and backtrader wouldn't have to worry about individual exchanges at all.
-
RE: Tearsheets - QSTrader
I'm just wondering what you mean by pyfolio tear-sheets are 'iffy'?
-
PyFolio analyzer multiple data sources not working.
If i call get_pf_items, the positions does not show positions from all data sources. Looking at source, the suspect line is https://github.com/mementum/backtrader/blob/master/backtrader/analyzers/pyfolio.py#L130
the v[-2:] is assuming there is only one data, and should be based on number of datas.
Latest posts made by CptanPanic
-
Is it possible to do nested talib indicators?
I would like to do something like the the LINEARREG of the output of another talib indicator. Is this possible directly, or do I need to just make my own indicator that combines them?
Thanks.
-
RE: Copyright Abuse?
@Richard-O'Regan so you think this "no further messages will be answered and no pull-requests will be accepted" is a temporary thing, and @backtrader is still developing 2.0 in private?
-
RE: Copyright Abuse?
The no pull-requests thing is most troubling. That is the one of the best things about FOSS, is the community can contribute. Combined with the fact that he might be saying he isn't going to post messages in forum anymore, that is a project killer. Maybe we should start submitting pull requests to @Richard-O-Regan 's fork https://github.com/rich-oregan/backtrader
-
RE: Optimization Exceptions on Windows 10 and Anaconda 3
You are on to something. I currently had 3 analyzers, Calmar, Returns, and PyFolio. Multicore fails if I enable Calmar or Pyfolio. @backtrader Any ideas?
-
RE: Optimization Exceptions on Windows 10 and Anaconda 3
I am currently debugging a similar error in Linux, my current work around is to set maxcpus=1 when creating Cerebro()
-
Once datas have been added with adddata(), is there a way to adjust time period that backtest operates on?
I am working on my own version of a walk-forward optimization algorithm, and ideally I would just add all the backtest data with adddata(), and call run() with different todate, and fromdate. I don't see this as an parameter to run(), so what is the best way to do this, hacky or otherwise.
Thanks.
-
RE: Walk Forward Analysis Demonstration
@Curtis-Miller nice job, any new work on this?
-
RE: Anyone use backtrader to do live trading on Bitcoin exchange?
@ricpruss Actually that library ccxt looks great, it has support for tons of exchanges and is updated frequently. Would make sense to make a backtrader broker that just takes a ccxt object, and backtrader wouldn't have to worry about individual exchanges at all.