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

I want to request the ability to adjust the margin while backtesting. **Why is this important?** When implementing a strategy, there are periods where we want to have less or...

enhancement

after running `backtest.run()` and receiving `stats` Is there a way to add TP and SL into `stats['_trades']` if the orders placed utilized any of them?

enhancement

I want to trade with 10% of my total capital for each orders... Can't find any information about it in the documentation. So is there any way to do that...

An incomplete attempt to add multiple-instrument backtest, which is mentioned in https://github.com/kernc/backtesting.py/issues/20 and https://github.com/kernc/backtesting.py/discussions/418 Aim: full backwards compatibility How? class `Backtest` will accept `data` as either a `pd.DataFrame` or a...

Fixes https://github.com/kernc/backtesting.py/issues/20 An incomplete attempt to add multiple-symbol backtest, which is mentioned in #20. Not sure if this fits the current structure. Lots of necessary changes haven't been done yet,...

### Discussed in https://github.com/kernc/backtesting.py/discussions/705 Originally posted by **lxxseunghh** July 31, 2022 Hi, I got hundreds of this same warning using `backtest.plot` method. `.../venv/lib/python3.8/site-packages/backtesting/_plotting.py:148:` `FutureWarning: Passing method to Int64Index.get_loc is deprecated...

bug
good first issue

the strategy is long only. the logic is as such: when price is over 50ema put a limit at the 50ema with tp and sl being 4 percent higher and...

This PR expands the [alternatives documentation](https://github.com/kernc/backtesting.py/blob/master/doc/alternatives.md) by adding [AutoTrader](https://github.com/kieran-mackle/AutoTrader), an automated trading framework exposing a feature-rich backtesting API.

### Expected Behavior The graph should be shown. ### Additional info backtesting.py version is 0.3.3 Python version is 3.10 https://github.com/kernc/backtesting.py/blob/65f54f6819cac5f36fd94ebf0377644c62b4ee3d/backtesting/_plotting.py#L47-L55 In my jupyter notebook on Docker (VSCode remote containers), `IS_JUPYTER_NOTEBOOK...

bug
good first issue

### Expected Behavior expect draw a plot html (resample param is True by default, same code is works fine when using 1day data, seems like it is because there is...

bug