IModel - mwhicks-dev/py-tradekit GitHub Wiki
The IModel interface simply generates a tuple of trade signals. This component is by far the least well-defined in order to allow for flexibility; it is surrounded by the other two components so that details can be abstracted away from it.
generate_signals(None): tuple[SignalDto, ...] provides a list of trade signals to be processed by a broker. The method takes no inputs, as dependency injection should be used in implementation to access the broker at runtime (although lazy loading techniques could suffice). This is the only method IModel requires.
| SignalDto |
|---|
| ticker: str amount: int action: Action contract: Contract time: datetime |
Action and Contract are enumerations:
| Action |
|---|
| Buy Sell |
| Contract |
|---|
| Call Put |
These are necessary to ensure that every IModel is interoperable with every broker.