vectorbt icon indicating copy to clipboard operation
vectorbt copied to clipboard

Percentage exposure Time Strategy

Open jhontd03 opened this issue 2 years ago • 1 comments

Hi

It is possible to calculate the percentage exposure time of a strategy with vectorbt

jhontd03 avatar Dec 23 '22 10:12 jhontd03

from pf.trades.records_readable, you can take the delta of entry and exit times to get a column for duration and work from there. Then run your calculations from that column. Not sure if there was some other easier way

trade_tbl['duration'] = trade_tbl['Exit Timestamp'] - trade_tbl['Entry Timestamp']

httran13 avatar Jan 18 '23 01:01 httran13

This issue is stale because it has been open for 90 days with no activity.

github-actions[bot] avatar Feb 22 '24 01:02 github-actions[bot]