Skip to content

Commit e2049af

Browse files
committed
refactor to support latest investing algorithm framework version
1 parent 05edd80 commit e2049af

File tree

17 files changed

+3986
-1587
lines changed

17 files changed

+3986
-1587
lines changed

README.md

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,38 @@ pip install finterion-investing-algorithm-framework
88
```
99

1010
## Usage
11-
In order to use the plugin you must use the 'create_app' function provided
12-
by the plugin. This function will return an instance of the investing
13-
algorithm framework configured with the finterion platform.
11+
In order to use the plugin you must register the following components in your investing algorithm framework application:
12+
- **FinterionOrderExecutor**: This component is responsible for executing orders on the finterion platform.
13+
- **FinterionPortfolioProvider**: This component is responsible for connecting the portfolio and syncing positions.
14+
- **FinterionPingHook**: This component is responsible for pinging the finterion platform.
1415

1516
> **Note:** You must provide the API key of your algorithm in order to use
1617
> the plugin. You can find your API keys in the developer dashboard of
1718
> your algorithm on the finterion platform.
1819
20+
## Example
1921
```python
20-
from finterion_investing_algorithm_framework import create_app
22+
import logging.config
23+
from dotenv import load_dotenv
2124

22-
app = create_app(api_key="<YOUR_TRADING_BOT_FINTERION_API_KEY>")
25+
from investing_algorithm_framework import create_app, DEFAULT_LOGGING_CONFIG
2326

24-
# Add your investing algorithm framework market data sources
25-
# .....
27+
from finterion_investing_algorithm_framework import \
28+
FinterionPortfolioProvider, FinterionOrderExecutor, FinterionPingAction
2629

27-
# Add your investing algorithm framework trading strategies
28-
# ....
2930

30-
if __name__ == "__main__":
31-
app.run()
31+
load_dotenv()
32+
logging.config.dictConfig(DEFAULT_LOGGING_CONFIG)
33+
34+
app = create_app()
35+
app.on_strategy_run(FinterionPingAction)
36+
app.add_order_executor(FinterionOrderExecutor)
37+
app.add_portfolio_provider(FinterionPortfolioProvider)
38+
app.add_market(
39+
market="Finterion",
40+
api_key="<FINTERION_API_KEY>", # Or set the environment variable FINTERION_API_KEY
41+
trading_symbol="EUR",
42+
)
3243
```
3344

3445
## Documentation
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
from finterion_investing_algorithm_framework.create_app import create_app
1+
from .order_executor import FinterionOrderExecutor
2+
from .portfolio_provider import FinterionPortfolioProvider
3+
from .ping_hook import FinterionPingAction
24

35
__all__ = [
4-
"create_app",
6+
"FinterionOrderExecutor",
7+
"FinterionPortfolioProvider",
8+
"FinterionPingAction"
59
]

finterion_investing_algorithm_framework/configuration/__init__.py

Lines changed: 0 additions & 3 deletions
This file was deleted.

finterion_investing_algorithm_framework/configuration/constants.py

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
BASE_URL = "https://api.finterion.com/algs/"

finterion_investing_algorithm_framework/create_app.py

Lines changed: 0 additions & 68 deletions
This file was deleted.

finterion_investing_algorithm_framework/exceptions.py

Lines changed: 0 additions & 5 deletions
This file was deleted.

finterion_investing_algorithm_framework/market_service.py

Lines changed: 0 additions & 183 deletions
This file was deleted.

finterion_investing_algorithm_framework/models/__init__.py

Lines changed: 0 additions & 6 deletions
This file was deleted.

finterion_investing_algorithm_framework/models/portfolio_configuration.py

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)