-
-
Notifications
You must be signed in to change notification settings - Fork 565
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open short position right after closing long position with full capital #697
Comments
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: My current usage for
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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!
The text was updated successfully, but these errors were encountered: