Skip to content

enums module

Named tuples and enumerated types for generic data.

Defines enums and other schemas for vectorbtpro.generic.


BarZone BarZoneT

Bar zone.

BarZoneT(
    Open=0,
    Middle=1,
    Close=2
)

DistanceMeasure DistanceMeasureT

Distance measure.

DistanceMeasureT(
    MAE=0,
    MSE=1,
    RMSE=2
)

Attributes

MAE
Mean absolute error.
MSE
Mean squared error.
RMSE
Root mean squared error.

DrawdownStatus DrawdownStatusT

Drawdown status.

DrawdownStatusT(
    Active=0,
    Recovered=1
)

ErrorType ErrorTypeT

Error type.

ErrorTypeT(
    Absolute=0,
    Relative=1
)

Attributes

Absolute
Absolute error, that is, x1 - x0.
Relative
Relative error, that is, (x1 - x0) / x0.

InterpMode InterpModeT

Interpolation mode.

InterpModeT(
    Linear=0,
    Nearest=1,
    Discrete=2,
    Mixed=3
)

Attributes

Line

Linear interpolation.

For example: [1.0, 2.0, 3.0] -> [1.0, 1.5, 2.0, 2.5, 3.0]

Nearest

Nearest-neighbor interpolation.

For example: [1.0, 2.0, 3.0] -> [1.0, 1.0, 2.0, 3.0, 3.0]

Discrete

Discrete interpolation.

For example: [1.0, 2.0, 3.0] -> [1.0, np.nan, 2.0, np.nan, 3.0]

Mixed

Mixed interpolation.

For example: [1.0, 2.0, 3.0] -> [1.0, 1.5, 2.0, 2.5, 3.0]


OverlapMode OverlapModeT

Overlapping mode.

OverlapModeT(
    AllowAll=-2,
    Allow=-1,
    Disallow=0
)

Attributes

AllowAll
Allow any overlapping ranges, even if they start at the same row.
Allow
Allow overlapping ranges, but only if they do not start at the same row.
Disallow
Disallow any overlapping ranges.

Any other positive number will check whether the intersection of each two consecutive ranges is bigger than that number of rows, and if so, the range with the highest similarity will be selected.


RangeStatus RangeStatusT

Range status.

RangeStatusT(
    Open=0,
    Closed=1
)

RescaleMode RescaleModeT

Rescaling mode.

RescaleModeT(
    MinMax=0,
    Rebase=1,
    Disable=2
)

Attributes

MinMax

Array is rescaled from its min-max range to the min-max range of another array.

For example: [3.0, 2.0, 1.0] to [10, 11, 12] -> [12.0, 11.0, 10.0]

Use this to search for patterns irrespective of their vertical scale.

Rebase

Array is rebased to the first value in another array.

For example: [3.0, 2.0, 1.0] to [10, 11, 12] -> [10.0, 6.6, 3.3]

Use this to search for percentage changes.

Disable

Disable any rescaling.

For example: [3.0, 2.0, 1.0] to [10, 11, 12] -> [3.0, 2.0, 1.0]

Use this to search for particular numbers.


WType WTypeT

Rolling window type.

WTypeT(
    Simple=0,
    Weighted=1,
    Exp=2,
    Wilder=3,
    Vidya=4
)

drawdown_dt VoidDType

np.dtype of drawdown records.

np.dtype([
    ('id', 'int64'),
    ('col', 'int64'),
    ('start_idx', 'int64'),
    ('valley_idx', 'int64'),
    ('end_idx', 'int64'),
    ('start_val', 'float64'),
    ('valley_val', 'float64'),
    ('end_val', 'float64'),
    ('status', 'int64')
])

pattern_range_dt VoidDType

np.dtype of pattern range records.

np.dtype([
    ('id', 'int64'),
    ('col', 'int64'),
    ('start_idx', 'int64'),
    ('end_idx', 'int64'),
    ('status', 'int64'),
    ('similarity', 'float64')
])

range_dt VoidDType

np.dtype of range records.

np.dtype([
    ('id', 'int64'),
    ('col', 'int64'),
    ('start_idx', 'int64'),
    ('end_idx', 'int64'),
    ('status', 'int64')
])

EWMMeanAIS class

EWMMeanAIS(
    i,
    value,
    old_wt,
    weighted_avg,
    nobs,
    alpha,
    minp,
    adjust
)

A named tuple representing the input state of ewm_mean_acc_nb().

To get alpha, use one of the following:

Superclasses

  • builtins.tuple

adjust method-wrapper

Alias for field number 7


alpha method-wrapper

Alias for field number 5


i method-wrapper

Alias for field number 0


minp method-wrapper

Alias for field number 6


nobs method-wrapper

Alias for field number 4


old_wt method-wrapper

Alias for field number 2


value method-wrapper

Alias for field number 1


weighted_avg method-wrapper

Alias for field number 3


EWMMeanAOS class

EWMMeanAOS(
    old_wt,
    weighted_avg,
    nobs,
    value
)

A named tuple representing the output state of ewm_mean_acc_nb().

Superclasses

  • builtins.tuple

nobs method-wrapper

Alias for field number 2


old_wt method-wrapper

Alias for field number 0


value method-wrapper

Alias for field number 3


weighted_avg method-wrapper

Alias for field number 1


EWMStdAIS class

EWMStdAIS(
    i,
    value,
    mean_x,
    mean_y,
    cov,
    sum_wt,
    sum_wt2,
    old_wt,
    nobs,
    alpha,
    minp,
    adjust
)

A named tuple representing the input state of ewm_std_acc_nb().

For tips on alpha, see EWMMeanAIS.

Superclasses

  • builtins.tuple

adjust method-wrapper

Alias for field number 11


alpha method-wrapper

Alias for field number 9


cov method-wrapper

Alias for field number 4


i method-wrapper

Alias for field number 0


mean_x method-wrapper

Alias for field number 2


mean_y method-wrapper

Alias for field number 3


minp method-wrapper

Alias for field number 10


nobs method-wrapper

Alias for field number 8


old_wt method-wrapper

Alias for field number 7


sum_wt method-wrapper

Alias for field number 5


sum_wt2 method-wrapper

Alias for field number 6


value method-wrapper

Alias for field number 1


EWMStdAOS class

EWMStdAOS(
    mean_x,
    mean_y,
    cov,
    sum_wt,
    sum_wt2,
    old_wt,
    nobs,
    value
)

A named tuple representing the output state of ewm_std_acc_nb().

Superclasses

  • builtins.tuple

cov method-wrapper

Alias for field number 2


mean_x method-wrapper

Alias for field number 0


mean_y method-wrapper

Alias for field number 1


nobs method-wrapper

Alias for field number 6


old_wt method-wrapper

Alias for field number 5


sum_wt method-wrapper

Alias for field number 3


sum_wt2 method-wrapper

Alias for field number 4


value method-wrapper

Alias for field number 7


RollCorrAIS class

RollCorrAIS(
    i,
    value1,
    value2,
    pre_window_value1,
    pre_window_value2,
    cumsum1,
    cumsum2,
    cumsum_sq1,
    cumsum_sq2,
    cumsum_prod,
    nancnt,
    window,
    minp
)

A named tuple representing the input state of rolling_corr_acc_nb().

Superclasses

  • builtins.tuple

cumsum1 method-wrapper

Alias for field number 5


cumsum2 method-wrapper

Alias for field number 6


cumsum_prod method-wrapper

Alias for field number 9


cumsum_sq1 method-wrapper

Alias for field number 7


cumsum_sq2 method-wrapper

Alias for field number 8


i method-wrapper

Alias for field number 0


minp method-wrapper

Alias for field number 12


nancnt method-wrapper

Alias for field number 10


pre_window_value1 method-wrapper

Alias for field number 3


pre_window_value2 method-wrapper

Alias for field number 4


value1 method-wrapper

Alias for field number 1


value2 method-wrapper

Alias for field number 2


window method-wrapper

Alias for field number 11


RollCorrAOS class

RollCorrAOS(
    cumsum1,
    cumsum2,
    cumsum_sq1,
    cumsum_sq2,
    cumsum_prod,
    nancnt,
    window_len,
    value
)

A named tuple representing the output state of rolling_corr_acc_nb().

Superclasses

  • builtins.tuple

cumsum1 method-wrapper

Alias for field number 0


cumsum2 method-wrapper

Alias for field number 1


cumsum_prod method-wrapper

Alias for field number 4


cumsum_sq1 method-wrapper

Alias for field number 2


cumsum_sq2 method-wrapper

Alias for field number 3


nancnt method-wrapper

Alias for field number 5


value method-wrapper

Alias for field number 7


window_len method-wrapper

Alias for field number 6


RollCovAIS class

RollCovAIS(
    i,
    value1,
    value2,
    pre_window_value1,
    pre_window_value2,
    cumsum1,
    cumsum2,
    cumsum_prod,
    nancnt,
    window,
    minp,
    ddof
)

A named tuple representing the input state of rolling_cov_acc_nb().

Superclasses

  • builtins.tuple

cumsum1 method-wrapper

Alias for field number 5


cumsum2 method-wrapper

Alias for field number 6


cumsum_prod method-wrapper

Alias for field number 7


ddof method-wrapper

Alias for field number 11


i method-wrapper

Alias for field number 0


minp method-wrapper

Alias for field number 10


nancnt method-wrapper

Alias for field number 8


pre_window_value1 method-wrapper

Alias for field number 3


pre_window_value2 method-wrapper

Alias for field number 4


value1 method-wrapper

Alias for field number 1


value2 method-wrapper

Alias for field number 2


window method-wrapper

Alias for field number 9


RollCovAOS class

RollCovAOS(
    cumsum1,
    cumsum2,
    cumsum_prod,
    nancnt,
    window_len,
    value
)

A named tuple representing the output state of rolling_cov_acc_nb().

Superclasses

  • builtins.tuple

cumsum1 method-wrapper

Alias for field number 0


cumsum2 method-wrapper

Alias for field number 1


cumsum_prod method-wrapper

Alias for field number 2


nancnt method-wrapper

Alias for field number 3


value method-wrapper

Alias for field number 5


window_len method-wrapper

Alias for field number 4


RollMeanAIS class

RollMeanAIS(
    i,
    value,
    pre_window_value,
    cumsum,
    nancnt,
    window,
    minp
)

A named tuple representing the input state of rolling_mean_acc_nb().

Superclasses

  • builtins.tuple

cumsum method-wrapper

Alias for field number 3


i method-wrapper

Alias for field number 0


minp method-wrapper

Alias for field number 6


nancnt method-wrapper

Alias for field number 4


pre_window_value method-wrapper

Alias for field number 2


value method-wrapper

Alias for field number 1


window method-wrapper

Alias for field number 5


RollMeanAOS class

RollMeanAOS(
    cumsum,
    nancnt,
    window_len,
    value
)

A named tuple representing the output state of rolling_mean_acc_nb().

Superclasses

  • builtins.tuple

cumsum method-wrapper

Alias for field number 0


nancnt method-wrapper

Alias for field number 1


value method-wrapper

Alias for field number 3


window_len method-wrapper

Alias for field number 2


RollOLSAIS class

RollOLSAIS(
    i,
    value1,
    value2,
    pre_window_value1,
    pre_window_value2,
    validcnt,
    cumsum1,
    cumsum2,
    cumsum_sq1,
    cumsum_prod,
    nancnt,
    window,
    minp
)

A named tuple representing the input state of rolling_ols_acc_nb().

Superclasses

  • builtins.tuple

cumsum1 method-wrapper

Alias for field number 6


cumsum2 method-wrapper

Alias for field number 7


cumsum_prod method-wrapper

Alias for field number 9


cumsum_sq1 method-wrapper

Alias for field number 8


i method-wrapper

Alias for field number 0


minp method-wrapper

Alias for field number 12


nancnt method-wrapper

Alias for field number 10


pre_window_value1 method-wrapper

Alias for field number 3


pre_window_value2 method-wrapper

Alias for field number 4


validcnt method-wrapper

Alias for field number 5


value1 method-wrapper

Alias for field number 1


value2 method-wrapper

Alias for field number 2


window method-wrapper

Alias for field number 11


RollOLSAOS class

RollOLSAOS(
    validcnt,
    cumsum1,
    cumsum2,
    cumsum_sq1,
    cumsum_prod,
    nancnt,
    window_len,
    slope_value,
    intercept_value
)

A named tuple representing the output state of rolling_ols_acc_nb().

Superclasses

  • builtins.tuple

cumsum1 method-wrapper

Alias for field number 1


cumsum2 method-wrapper

Alias for field number 2


cumsum_prod method-wrapper

Alias for field number 4


cumsum_sq1 method-wrapper

Alias for field number 3


intercept_value method-wrapper

Alias for field number 8


nancnt method-wrapper

Alias for field number 5


slope_value method-wrapper

Alias for field number 7


validcnt method-wrapper

Alias for field number 0


window_len method-wrapper

Alias for field number 6


RollProdAIS class

RollProdAIS(
    i,
    value,
    pre_window_value,
    cumprod,
    nancnt,
    window,
    minp
)

A named tuple representing the input state of rolling_prod_acc_nb().

Superclasses

  • builtins.tuple

cumprod method-wrapper

Alias for field number 3


i method-wrapper

Alias for field number 0


minp method-wrapper

Alias for field number 6


nancnt method-wrapper

Alias for field number 4


pre_window_value method-wrapper

Alias for field number 2


value method-wrapper

Alias for field number 1


window method-wrapper

Alias for field number 5


RollProdAOS class

RollProdAOS(
    cumprod,
    nancnt,
    window_len,
    value
)

A named tuple representing the output state of rolling_prod_acc_nb().

Superclasses

  • builtins.tuple

cumprod method-wrapper

Alias for field number 0


nancnt method-wrapper

Alias for field number 1


value method-wrapper

Alias for field number 3


window_len method-wrapper

Alias for field number 2


RollStdAIS class

RollStdAIS(
    i,
    value,
    pre_window_value,
    cumsum,
    cumsum_sq,
    nancnt,
    window,
    minp,
    ddof
)

A named tuple representing the input state of rolling_std_acc_nb().

Superclasses

  • builtins.tuple

cumsum method-wrapper

Alias for field number 3


cumsum_sq method-wrapper

Alias for field number 4


ddof method-wrapper

Alias for field number 8


i method-wrapper

Alias for field number 0


minp method-wrapper

Alias for field number 7


nancnt method-wrapper

Alias for field number 5


pre_window_value method-wrapper

Alias for field number 2


value method-wrapper

Alias for field number 1


window method-wrapper

Alias for field number 6


RollStdAOS class

RollStdAOS(
    cumsum,
    cumsum_sq,
    nancnt,
    window_len,
    value
)

A named tuple representing the output state of rolling_std_acc_nb().

Superclasses

  • builtins.tuple

cumsum method-wrapper

Alias for field number 0


cumsum_sq method-wrapper

Alias for field number 1


nancnt method-wrapper

Alias for field number 2


value method-wrapper

Alias for field number 4


window_len method-wrapper

Alias for field number 3


RollSumAIS class

RollSumAIS(
    i,
    value,
    pre_window_value,
    cumsum,
    nancnt,
    window,
    minp
)

A named tuple representing the input state of rolling_sum_acc_nb().

Superclasses

  • builtins.tuple

cumsum method-wrapper

Alias for field number 3


i method-wrapper

Alias for field number 0


minp method-wrapper

Alias for field number 6


nancnt method-wrapper

Alias for field number 4


pre_window_value method-wrapper

Alias for field number 2


value method-wrapper

Alias for field number 1


window method-wrapper

Alias for field number 5


RollSumAOS class

RollSumAOS(
    cumsum,
    nancnt,
    window_len,
    value
)

A named tuple representing the output state of rolling_sum_acc_nb().

Superclasses

  • builtins.tuple

cumsum method-wrapper

Alias for field number 0


nancnt method-wrapper

Alias for field number 1


value method-wrapper

Alias for field number 3


window_len method-wrapper

Alias for field number 2


RollZScoreAIS class

RollZScoreAIS(
    i,
    value,
    pre_window_value,
    cumsum,
    cumsum_sq,
    nancnt,
    window,
    minp,
    ddof
)

A named tuple representing the input state of rolling_zscore_acc_nb().

Superclasses

  • builtins.tuple

cumsum method-wrapper

Alias for field number 3


cumsum_sq method-wrapper

Alias for field number 4


ddof method-wrapper

Alias for field number 8


i method-wrapper

Alias for field number 0


minp method-wrapper

Alias for field number 7


nancnt method-wrapper

Alias for field number 5


pre_window_value method-wrapper

Alias for field number 2


value method-wrapper

Alias for field number 1


window method-wrapper

Alias for field number 6


RollZScoreAOS class

RollZScoreAOS(
    cumsum,
    cumsum_sq,
    nancnt,
    window_len,
    value
)

A named tuple representing the output state of rolling_zscore_acc_nb().

Superclasses

  • builtins.tuple

cumsum method-wrapper

Alias for field number 0


cumsum_sq method-wrapper

Alias for field number 1


nancnt method-wrapper

Alias for field number 2


value method-wrapper

Alias for field number 4


window_len method-wrapper

Alias for field number 3


VidyaAIS class

VidyaAIS(
    i,
    prev_value,
    value,
    pre_window_prev_value,
    pre_window_value,
    pos_cumsum,
    neg_cumsum,
    prev_vidya,
    nancnt,
    window,
    minp
)

A named tuple representing the input state of vidya_acc_nb().

Superclasses

  • builtins.tuple

i method-wrapper

Alias for field number 0


minp method-wrapper

Alias for field number 10


nancnt method-wrapper

Alias for field number 8


neg_cumsum method-wrapper

Alias for field number 6


pos_cumsum method-wrapper

Alias for field number 5


pre_window_prev_value method-wrapper

Alias for field number 3


pre_window_value method-wrapper

Alias for field number 4


prev_value method-wrapper

Alias for field number 1


prev_vidya method-wrapper

Alias for field number 7


value method-wrapper

Alias for field number 2


window method-wrapper

Alias for field number 9


VidyaAOS class

VidyaAOS(
    pos_cumsum,
    neg_cumsum,
    nancnt,
    window_len,
    cmo,
    vidya
)

A named tuple representing the output state of vidya_acc_nb().

Superclasses

  • builtins.tuple

cmo method-wrapper

Alias for field number 4


nancnt method-wrapper

Alias for field number 2


neg_cumsum method-wrapper

Alias for field number 1


pos_cumsum method-wrapper

Alias for field number 0


vidya method-wrapper

Alias for field number 5


window_len method-wrapper

Alias for field number 3


WMMeanAIS class

WMMeanAIS(
    i,
    value,
    pre_window_value,
    cumsum,
    wcumsum,
    nancnt,
    window,
    minp
)

A named tuple representing the input state of wm_mean_acc_nb().

Superclasses

  • builtins.tuple

cumsum method-wrapper

Alias for field number 3


i method-wrapper

Alias for field number 0


minp method-wrapper

Alias for field number 7


nancnt method-wrapper

Alias for field number 5


pre_window_value method-wrapper

Alias for field number 2


value method-wrapper

Alias for field number 1


wcumsum method-wrapper

Alias for field number 4


window method-wrapper

Alias for field number 6


WMMeanAOS class

WMMeanAOS(
    cumsum,
    wcumsum,
    nancnt,
    window_len,
    value
)

A named tuple representing the output state of wm_mean_acc_nb().

Superclasses

  • builtins.tuple

cumsum method-wrapper

Alias for field number 0


nancnt method-wrapper

Alias for field number 2


value method-wrapper

Alias for field number 4


wcumsum method-wrapper

Alias for field number 1


window_len method-wrapper

Alias for field number 3