Skip to content
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

multiple entry signals #426

Open
VanBuren77 opened this issue Mar 29, 2022 · 6 comments
Open

multiple entry signals #426

VanBuren77 opened this issue Mar 29, 2022 · 6 comments

Comments

@VanBuren77
Copy link

It looks like vectorbt auto cleans duplicate entry signals. There is no documentation on how to make multiple entries

I.e., buy a share on day X and then buy another share on day Y

vectorbt will see the day Y entry as a duplicate and clean it

Is it possible in vectorbt to do this?

@VanBuren77
Copy link
Author

For example, if I execute a strategy that buys 1 share every 5 days of the spy500

Then at the end, I have 150 shares and I sell them all, I get an incorrectly computed total return and trade pnl

initial cash = 10000000

image

image

image

@polakowo
Copy link
Owner

@VanBuren77 it's documented: set accumulate to True in from_signals to allow accumulation of orders.

Return is calculated correctly: your large initial cash inflates the total portfolio value, thus total return seems small. Setting init_cash to "auto" will make both numbers match.

@VanBuren77
Copy link
Author

Not sure this is going through

image

@polakowo
Copy link
Owner

The default size is infinity, lower it.

@VanBuren77
Copy link
Author

Perhaps I'm not understanding, I tried different values for init_cash and read the documentation on InitCashMode

I tried 0 & 10000. When init_cash is set to 0 it should be "auto" via the docs (correct me if i'm wrong) but I get the error:

"Attempt to go in long direction infinitely"

When I set it to a value like 10000 or 100000, then I get the same plot as I posted above, where no accumulation occurs

image
image

@eromoe
Copy link

eromoe commented Jan 16, 2023

@VanBuren77 I think polakowo is saying the order size , not cash size ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants