Open kevin851066 opened 3 months ago
You just need to remove size and size_type, VBT enters with full capital by default.
And for position reversal, instead of providing short_entries and short_exits you can simply use direction="both".
I see. Thank for your quick reply!
Another question:
I would like to calculate the benchmark's mdd, sharpe ratio. Could it be done by pf.stats()
?
My current usage for pf.stats()
:
stats = pf.stats(metrics=[
'start',
'end',
'total_return',
'benchmark_return',
'sharpe_ratio',
'max_dd',
'total_trades',
'win_rate'], agg_func=None)
First of all, thanks for developing this excellent library!
My strategy will enter short/long position right after closing long/short position, while short/long signal happens. And each postion will entry with full capital
Here is my code:
And I got an error, seems like vectorbt does not support this behavior.
Is there any methods that can implement it?
The first straightforward method came up with my mind is that I can let
short_entries = np.roll(exits, 1)
to make them not to happen at the same time. But this method will make the backtest result inaccurate since my short_entries lag by one timeframeThanks in advance!