-
hi, Situation: Let's say I want 3 indicators:
and create 3 signals with the indicators from above
Question: What I now have is following
but what I want is following
Example:
I hope my question/title is understandable. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 16 replies
-
Hi @krema, take your three parameter arrays, pass them into itertools.product, unzip them, and pass each array to its corresponding indicator. This way, all three indicators will produce the same number of columns so you can use them in above and below methods. |
Beta Was this translation helpful? Give feedback.
-
Hi @forLinDre @polakowo, Thank you for your input and answers. I'm also working on my studies again. The original question was answered with using the product with itertools. This worked quite well for simple studies but now with increasing parameters I have a memory problem because of the many combinations I have to provide. For optimization reasons I generated the signals (entries, exits) separately, removed duplicated columns and created then the combinations (using The signals after optimization and reshaping look like this:
The use of these signals with the Click to expand the errorTypingError: Failed in nopython mode pipeline (step: nopython frontend)
Failed in nopython mode pipeline (step: nopython frontend)
non-precise type array(pyobject, 0d, C)
During: typing of argument at /Users/krema/.pyenv/versions/3.9.7/lib/python3.9/site-packages/vectorbt/portfolio/nb.py (2342)
File "../../../.pyenv/versions/3.9.7/lib/python3.9/site-packages/vectorbt/portfolio/nb.py", line 2342:
def ls_enex_signal_func_nb(c: SignalContext,
<source elided>
"""Get an element of direction-aware signals."""
is_long_entry = flex_select_auto_nb(long_entries, c.i, c.col, c.flex_2d)
^
During: resolving callee type: type(CPUDispatcher(<function ls_enex_signal_func_nb at 0x137505940>))
During: typing of call at /Users/krema/.pyenv/versions/3.9.7/lib/python3.9/site-packages/vectorbt/portfolio/nb.py (2087)
During: resolving callee type: type(CPUDispatcher(<function ls_enex_signal_func_nb at 0x137505940>))
During: typing of call at /Users/krema/.pyenv/versions/3.9.7/lib/python3.9/site-packages/vectorbt/portfolio/nb.py (2087)
During: resolving callee type: type(CPUDispatcher(<function ls_enex_signal_func_nb at 0x137505940>))
During: typing of call at /Users/krema/.pyenv/versions/3.9.7/lib/python3.9/site-packages/vectorbt/portfolio/nb.py (2087)
During: resolving callee type: type(CPUDispatcher(<function ls_enex_signal_func_nb at 0x137505940>))
During: typing of call at /Users/krema/.pyenv/versions/3.9.7/lib/python3.9/site-packages/vectorbt/portfolio/nb.py (2087)
During: resolving callee type: type(CPUDispatcher(<function ls_enex_signal_func_nb at 0x137505940>))
During: typing of call at /Users/krema/.pyenv/versions/3.9.7/lib/python3.9/site-packages/vectorbt/portfolio/nb.py (2087)
File "../../../.pyenv/versions/3.9.7/lib/python3.9/site-packages/vectorbt/portfolio/nb.py", line 2087:
def simulate_from_signal_func_nb(target_shape: tp.Shape,
<source elided>
is_long_entry, is_long_exit, is_short_entry, is_short_exit = \
signal_func_nb(signal_ctx, *signal_args)
^ Now with further discussion, answers and ideas I will give it a try with
|
Beta Was this translation helpful? Give feedback.
Hi @krema, take your three parameter arrays, pass them into itertools.product, unzip them, and pass each array to its corresponding indicator. This way, all three indicators will produce the same number of columns so you can use them in above and below methods.