Statemachine¶
The base strategy comes with a state machine that can be used by your strategy.
Similar to Storage, the methods of this class can be used in your
strategy directly, e.g., via self.get_state()
, since the class is
inherited by Base Strategy.
API¶
-
class
stakemachine.statemachine.
StateMachine
(*args, **kwargs)¶ Generic state machine
-
add_state
(state)¶ Add a new state to the state machine
Parameters: state (str) – Name of the state
-
get_state
()¶ Return state of state machine
-
set_state
(state)¶ Change state of the state machine
Parameters: state (str) – Name of the new state
-