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

### Expected Behavior The equity should not change when buying on the last day with trade_on_close = True. ### Actual Behavior The equity increases by data.Close[-1]/data.Close[-2] (assuming data.Close[-1] > data.Close[-2])...

### Expected Behavior ``` /home/mab/Documents/RESEARCH/GARS/.env/lib/python3.9/site-packages/backtesting/_stats.py:122: RuntimeWarning: divide by zero encountered in double_scalars s.loc['Sortino Ratio'] = np.clip((annualized_return - risk_free_rate) / (np.sqrt(np.mean(day_returns.clip(-np.inf, 0)**2)) * np.sqrt(annual_trading_days)), 0, np.inf) # noqa: E501 ``` ###...

bug
good first issue

``` import pandas as pd import numpy as np from backtesting.test import GOOG tg = GOOG.head(30).copy() nums = list(range(1,7)) + list(range(6,2,-1)) + list(range(6,20)) + list(range(14,17)) + list(range(15,12,-1)) tg["Open"] = tg["Close"]...

Hello again. Many apologies for my butchering of the PR process. Git is certainly something I am no expert at. :cry: This is another PR which implements the tagging feature,...

Hi, It's good to see the stats include SQN. According to https://evilspeculator.com/tools-section/concepts/: SQN = root(n) * expectancy / stdev(R) but I suspect it's not correctly calculated: https://github.com/kernc/backtesting.py/blob/77f4c46b82169c2689e1c4ad5994765556179eb2/backtesting/_stats.py#L139 as it's not...

help wanted

Fixes https://github.com/kernc/backtesting.py/issues/356

Original Discussion Post: #355 There's something that I noticed which makes it difficult to view indicator graph on the chart if you're backtesting for longer period. Below is an example...

enhancement

This is just a question about whats in the title. - Why is the framework closing the positions automatically at the end of the simulation? - Is there any way...

enhancement
Hacktoberfest