Replies: 2 comments
|
You can also use |
0 replies
|
@kernc |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I would like to backtest a breakout strategy, but is it that backtesting.py is unable to implement intra-bar backtesting?
For example, when using day-level data, I expect to execute a buy immediately when the price rises above the previous day's closing price plus 1. However, I've found that the current code can only execute trades at the earliest in the next trading day.
breakout = self.data.Close[-1] + 1If I want to implement a similar strategy, I can only use lower time frame data—for instance, switching to hour-level data. But there are still similar issues: even if the price breaks through the preset level at 9:45 after the market opens at 9:30, the earliest trade can only be executed at 10:30. To optimize this, I would need to use even lower time frames, but it becomes relatively more difficult to obtain a large amount of relevant data (e.g., half-hourly or minute-level data).
All reactions