-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed as not planned
Closed as not planned
Copy link
Labels
enhancementNew feature or requestNew feature or requestwontfixThis will not be worked onThis will not be worked on
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.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestwontfixThis will not be worked onThis will not be worked on