vectorbt
vectorbt copied to clipboard
multiple entry signals
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?
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
@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.
Not sure this is going through
The default size is infinity, lower it.
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
@VanBuren77 I think polakowo is saying the order size
, not cash size
?