Comments (1)
I get better results by resampling the dataframe prior to using it in the backtest:
e.g
import pandas as pd
import yfinance as yf
df = yf.download('AAPL', period='5y', interval='1d') # rounding=True
df1 = df.resample('2d').agg({'Open': 'first',
'High': 'max',
'Low': 'min',
'Close': 'last',
'Volume': 'sum'})
Hope it helps
from backtesting.py.
Related Issues (20)
- Code citation
- self.buy(size=10.15) `size` can it be a floating point number greater than 1? HOT 2
- parallel trades
- A few questions about execution on lower timeframes and weekly vwap
- Implement 2 strategies at the same time HOT 1
- --
- Friendly Note Regarding Your GitHub & backtesting Profile Picture HOT 4
- Assertion Error due to negative stop loss using Optimize
- Trades seem to be done in reversed chronological order HOT 1
- Get Balance and Equity evolution over time HOT 1
- An urgent request for a new maintainer HOT 5
- Get more than one statistic when optimize HOT 3
- Attach date column when printing '_equity_curve` HOT 1
- Backtesting.py
- Absolute Value Maximum Drawdown HOT 1
- Stop orders do not work
- Issue with bt.plot() HOT 4
- Fractional Shares / Currencies not supported HOT 1
- increase the cash in successful trades HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from backtesting.py.