polakowo/vectorbt

Time-based closing Condition

SharathkumaraKR opened this issue · 1 comments

I'm using Portfolio.from_signals in vectorbt with timestamped index data.

Buy Signal: Triggered when value > 15, allowing multiple accumulated trades.

Trade Duration: I need each trade to close automatically if open for more than 6 hours.

How can I implement this time-based closing condition with from_signals?

Could you please provide a sample code?