We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
adjust_sl_func_nb
Hello, I would like to pass different arguments per Asset (price columns) into adjust_sl_func_nb. I use adjust_sl_args callback.
adjust_sl_args
For same args for all assets it works, e.g. like this: (here I pass 10 and 20 as inputs into adjust_sl_func_nb which is used by all assets):
pf=vbt.Portfolio.from_signals( close=np.array([[10.,20.,30.,40.],[100.,200.,300.,400.]]).T, entries=np.array([[True,False,False,False],[True,False,False,False]]).T, size=1, size_type='Amount',direction='LongOnly', use_stops=True, adjust_sl_func_nb=my_adjust_sl_func_nb, adjust_sl_args=(10., 20.), init_cash=10000)
But how do i pass different args per asset? I tried as below (tuple of tuples), but it does not work:
pf=vbt.Portfolio.from_signals( close=np.array([[10.,20.,30.,40.],[100.,200.,300.,400.]]).T, entries=np.array([[True,False,False,False],[True,False,False,False]]).T, size=1, size_type='Amount',direction='LongOnly', use_stops=True, adjust_sl_func_nb=my_adjust_sl_func_nb, adjust_sl_args=((10., 20.), (11., 21.)), init_cash=10000)
Error:
No implementation of function Function(<built-in function sub>) found for signature: >>> sub(float64, UniTuple(float64 x 2))
Thanks a lot.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello,
I would like to pass different arguments per Asset (price columns) into
adjust_sl_func_nb
. I useadjust_sl_args
callback.For same args for all assets it works, e.g. like this: (here I pass 10 and 20 as inputs into
adjust_sl_func_nb
which is used by all assets):But how do i pass different args per asset?
I tried as below (tuple of tuples), but it does not work:
Error:
Thanks a lot.
The text was updated successfully, but these errors were encountered: