backtesting.py icon indicating copy to clipboard operation
backtesting.py copied to clipboard

Backtesting options

Open bryanbmb opened this issue 5 years ago • 2 comments

Is it possible to back test stock options? I have some simple strategies based on the underlying stock price that I'd like to back test. Thanks.

bryanbmb avatar Jun 16 '20 05:06 bryanbmb

I think you can back test stock options with the right parameters. Just read more documentation, my dear pal.

albertwh1te avatar Sep 28 '20 02:09 albertwh1te

@AlbertWh1te Somehow we can do that but it will be much better to have at least price selector from which o/c/h/l column names in the main dataframe to be used for the current buy/sell trade. That way we can analyze the underlying security with indicators by using its standard names Open, Close, High, Low in order to be easier when using external TA libs and we can select the price set we need for PUT or CALL for the needed strike and expiration. Using Bid/Ask will not match exactly the current implementation but I already keep the options history for 1 min o/c/h/l dataframes adjusted by midpoint bid/ask for open/close and bid for low and ask for high. That way it will produce acceptable results. I'm going to modify it the way I explained to make my life easier until waiting the official implementation. Do you have better solution without modifying backtesting.py?

AGG2017 avatar Aug 18 '21 15:08 AGG2017