backtesting.py icon indicating copy to clipboard operation
backtesting.py copied to clipboard

:mag_right: :chart_with_upwards_trend: :snake: :moneybag: Backtest trading strategies in Python.

Results 231 backtesting.py issues
Sort by recently updated
recently updated
newest added

While calculating day_returns the Data is resampled to Day, but for Monthly and Weekly data the value is not correct and provides incorrect values wherever day_returns or annual_trading_days is used....

Hello, I am trying to open a long limit order when the time is between 2:55pm and 3pm and only in that timeframe. In raw python it would look like...

question

### Expected Behavior Consider a stop-loss order placed at a stop-loss price `p`. When the opening price is way below the stop-loss price `p`, I would expect the stop-loss order...

bug

When I'm importing data from Coinbase API (you don't need any API keys to reproduce the issue, just copy-paste the snippet below) ```self.buy()``` and ```self.sell()``` do not work at all....

Can you make it so we can buy at Open and close the position at Close the same candlestick? Thanks

enhancement

this is how `Buy & Hold Return` is calculated: ``` c = data.Close.values s.loc['Buy & Hold Return [%]'] = (c[-1] - c[0]) / c[0] * 100 # long-only return ```...

bug
good first issue
Hacktoberfest

I have set the reference price for the cash PnL at the spread between two securities (I am backtesting a mean reversion strategy). However, in the html output of the...

enhancement
good first issue
Hacktoberfest

### Expected Behavior No errors, plot shows. ### Actual Behavior ``` /usr/local/lib/python3.7/dist-packages/backtesting/_plotting.py:104: UserWarning: Data contains too many candlesticks to plot; downsampling to '15T'. See `Backtest.plot(resample=...)` warnings.warn(f"Data contains too many candlesticks...

bug
Hacktoberfest

### Expected Behavior Allow trailing with PRC instead of ATR ### Actual Behavior Currently the backtesting allow trailing sels only based on ATR, most of crypto bots works in pct...

enhancement
Hacktoberfest

### Expected Behavior There should be a way to specify meaningful legend names when multiple series values are used in a single Indicator ### Actual Behavior Currently, you can only...

enhancement
Hacktoberfest