RegimeRegion#

API documentation for tradeexecutor.analysis.regime.RegimeRegion Python class in Trading Strategy framework.

class RegimeRegion[source]#

Bases: object

One regime colouring region for the charts.

__init__(start, end, regime)#
Parameters:
Return type:

None

Methods

__init__(start, end, regime)

get_duration()

is_predition_correct(close[, ...])

Check if the region matches actual data.

Attributes

start

end

regime

is_predition_correct(close, crab_region_tolerance=0.02)[source]#

Check if the region matches actual data.

  • Bull region is correct if we closed higher since start

  • Bear region is correct if we closed lowed since start

  • Crab

Parameters:
  • close (Series) – Close price series

  • crab_region_tolerance (float) –

Returns:

Tuple (match, diff).

True if the underlying market data matches the region, and what was % observed price movement within the region.

Return type:

tuple[bool, float]

__init__(start, end, regime)#
Parameters:
Return type:

None