enums module¶
Named tuples and enumerated types for signals.
Defines enums and other schemas for vectorbtpro.signals.
FactoryMode FactoryModeT¶
Factory mode.
Attributes
Entries-
Generate entries only using
generate_func_nb.Takes no input signal arrays. Produces one output signal array -
entries.Such generators often have no suffix.
Exits-
Generate exits only using
generate_ex_func_nb.Takes one input signal array -
entries. Produces one output signal array -exits.Such generators often have suffix 'X'.
Both-
Generate both entries and exits using
generate_enex_func_nb.Takes no input signal arrays. Produces two output signal arrays -
entriesandexits.Such generators often have suffix 'NX'.
Chain-
Generate chain of entries and exits using
generate_enex_func_nb.Takes one input signal array -
entries. Produces two output signal arrays -new_entriesandexits.Such generators often have suffix 'CX'.
SignalRelation SignalRelationT¶
SignalRelation between two masks.
Attributes
OneOne- One source signal maps to exactly one succeeding target signal.
OneMany- One source signal can map to one or more succeeding target signals.
ManyOne- One or more source signals can map to exactly one succeeding target signal.
ManyMany- One or more source signals can map to one or more succeeding target signals.
Chain- First source signal maps to the first target signal after it and vice versa.
AnyChain- First signal maps to the first opposite signal after it and vice versa.
StopType StopTypeT¶
Stop type.
GenEnContext class¶
Context of an entry signal generator.
Superclasses
builtins.tuple
col method-wrapper¶
Column of the segment.
entries_out method-wrapper¶
Output array with entries.
from_i method-wrapper¶
Start index of the segment (inclusive).
only_once method-wrapper¶
Whether to run the placement function only once.
out method-wrapper¶
Current segment of the output array with entries.
target_shape method-wrapper¶
Target shape.
to_i method-wrapper¶
End index of the segment (exclusive).
wait method-wrapper¶
Number of ticks to wait before placing the next entry.
GenEnExContext class¶
GenEnExContext(
target_shape,
entry_wait,
exit_wait,
entries_out,
exits_out,
entries_turn,
wait,
out,
from_i,
to_i,
col
)
GenEnExContext(target_shape, entry_wait, exit_wait, entries_out, exits_out, entries_turn, wait, out, from_i, to_i, col)
Superclasses
builtins.tuple
col method-wrapper¶
Alias for field number 10
entries_out method-wrapper¶
Alias for field number 3
entries_turn method-wrapper¶
Alias for field number 5
entry_wait method-wrapper¶
Alias for field number 1
exit_wait method-wrapper¶
Alias for field number 2
exits_out method-wrapper¶
Alias for field number 4
from_i method-wrapper¶
Alias for field number 8
out method-wrapper¶
Alias for field number 7
target_shape method-wrapper¶
Alias for field number 0
to_i method-wrapper¶
Alias for field number 9
wait method-wrapper¶
Alias for field number 6
GenExContext class¶
Context of an entry/exit signal generator.
Superclasses
builtins.tuple
col method-wrapper¶
Column of the segment.
entries method-wrapper¶
Input array with entries.
exits_out method-wrapper¶
Output array with exits.
from_i method-wrapper¶
Start index of the segment (inclusive).
out method-wrapper¶
Current segment of the output array with entries/exits.
skip_until_exit method-wrapper¶
Whether to skip processing entry signals until the next exit.
to_i method-wrapper¶
End index of the segment (exclusive).
until_next method-wrapper¶
Whether to place signals up to the next entry signal.
wait method-wrapper¶
Number of ticks to wait before placing entries/exits.
RankContext class¶
RankContext(
mask,
reset_by,
after_false,
after_reset,
reset_wait,
col,
i,
last_false_i,
last_reset_i,
all_sig_cnt,
all_part_cnt,
all_sig_in_part_cnt,
nonres_sig_cnt,
nonres_part_cnt,
nonres_sig_in_part_cnt,
sig_cnt,
part_cnt,
sig_in_part_cnt
)
Context of a ranker.
Superclasses
builtins.tuple
after_false method-wrapper¶
Whether to disregard the first partition of True values if there is no False value before them.
after_reset method-wrapper¶
Whether to disregard the first partition of True values coming before the first reset signal.
all_part_cnt method-wrapper¶
Number of all partitions encountered including this.
all_sig_cnt method-wrapper¶
Number of all signals encountered including this.
all_sig_in_part_cnt method-wrapper¶
Number of signals encountered in the current partition including this.
col method-wrapper¶
Current column.
i method-wrapper¶
Current row.
last_false_i method-wrapper¶
Row of the last False value in the main mask.
last_reset_i method-wrapper¶
Row of the last True value in the resetting mask.
Doesn't take into account reset_wait.
mask method-wrapper¶
Source mask.
nonres_part_cnt method-wrapper¶
Number of non-resetting partitions encountered including this.
nonres_sig_cnt method-wrapper¶
Number of non-resetting signals encountered including this.
nonres_sig_in_part_cnt method-wrapper¶
Number of signals encountered in the current non-resetting partition including this.
part_cnt method-wrapper¶
Number of valid and resetting partitions encountered including this.
reset_by method-wrapper¶
Resetting mask.
reset_wait method-wrapper¶
Number of ticks to wait before resetting the current partition.
sig_cnt method-wrapper¶
Number of valid and resetting signals encountered including this.
sig_in_part_cnt method-wrapper¶
Number of signals encountered in the current valid and resetting partition including this.