OlympusTrader.insight.executors package

Subpackages

Submodules

OlympusTrader.insight.executors.base_executor module

class OlympusTrader.insight.executors.base_executor.BaseExecutor(strategy: BaseStrategy, state: InsightState, version: float = '1.0', allowed_assets: set[str] | None = None, allowed_alphas: set[str] | None = None, allowed_insight_change_state: bool = True)

Bases: ABC

### Abstract class for BaseExecutor implementations. Used to manage orders based on insights.

ALLOWED_ALPHAS: set[str] | None = {}

Set of allowed alphas for the executor

ALLOWED_ASSETS: set[str] | None = {}

Set of allowed assets for the executor

ALLOW_INSIGHT_CHANGE_STATE: bool = True
NAME: str
STRATEGY: BaseStrategy

Reference to the strategy instance.

VERSION: str

Version of the executor model.

changeState(insight: Insight, state: InsightState, message: str = None) None

Change the state of the insight

get_asset(symbol: str) IAsset

Get the asset of a symbol

get_history(symbol: str) DataFrame

Get the history of a symbol

get_latest_bar(symbol: str) DataFrame

Get the latest bar of a symbol

get_latest_quote(insight: Insight) IQuote

Get the latest quote of an insight

get_previos_bar(symbol: str) DataFrame

Get the previous bar of a symbol

isAllowedAlpha(alpha: str) bool

Check if the alpha is allowed

isAllowedAsset(symbol: str) bool

Check if the asset is allowed

returnResults(passed: bool, success: bool = True, message: str = None) ExecutorResults
abstractmethod run(insight: Insight) ExecutorResults

Run the executor.

should_run(insight: Insight) bool

Check if the executor should run

state: InsightState

Reference to the working state of the executor

class OlympusTrader.insight.executors.base_executor.ExecutorResults(passed: bool, success: bool = True, message: str = None, executor: str = None)

Bases: object

### Executor Results This class is used to store the results of the executor.

executor: str

Name of the executor.

message: str

Message indicating the result of the executor.

passed: bool

Boolean value indicating if the executor passed or not.

success: bool

Boolean value indicating if the executor was ran successful or not.

Module contents