kernc / backtesting.py

:mag_right: :chart_with_upwards_trend: :snake: :moneybag: Backtest trading strategies in Python.
https://kernc.github.io/backtesting.py/
GNU Affero General Public License v3.0
5.04k stars 987 forks source link

Can I choose other Buy/Sell prices rather than Open/Close prices? #1085

Open htluandc2 opened 8 months ago

htluandc2 commented 8 months ago

Expected Behavior

Hi there, I use backtesting.py for my project. I want to adjust Buy/Sell price by rolling average of Open/Close price, with conditional: new Buy/Sell price in range of High/Low price. How can I do it ?

Actual Behavior

Maybe I can make a new Open price column in Pandas that is calculated by rolling average of actual Open price. Then I run backtesting.py with that. But my candlestick sticks chart look like wrong. I also research about Order class to find other solution.

Additional info