Closed as not planned
Closed as not planned
Description
Expected Behavior
I'd like to request an enhancement to the Backtesting.py library that introduces two new parameters, order_validity and trade_validity, to the buy and sell methods within the Strategy class. order_validity = 10 the order auto cacels after 10 bar after the order if not filled and trade_validity = 20 the trade auto cancels after 20 bar after the order is filled and if trade not already exited (by sl or tp)
Implementation example
def buy(
self, *, size=1, limit=100, sl=95, tp=110, order_validity=10, trade_validity=20
):
def sell(
self, *, size=1, limit=100, sl=105, tp=90, order_validity=10, trade_validity=20
):
Additional info
If anyone already has implemented or interested please comment down.