finterion-investing-algorithm-framework 0.7__py3-none-any.whl → 0.9__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of finterion-investing-algorithm-framework might be problematic. Click here for more details.
- finterion_investing_algorithm_framework/market_service.py +31 -5
- {finterion_investing_algorithm_framework-0.7.dist-info → finterion_investing_algorithm_framework-0.9.dist-info}/METADATA +3 -3
- {finterion_investing_algorithm_framework-0.7.dist-info → finterion_investing_algorithm_framework-0.9.dist-info}/RECORD +6 -6
- {finterion_investing_algorithm_framework-0.7.dist-info → finterion_investing_algorithm_framework-0.9.dist-info}/LICENSE +0 -0
- {finterion_investing_algorithm_framework-0.7.dist-info → finterion_investing_algorithm_framework-0.9.dist-info}/WHEEL +0 -0
- {finterion_investing_algorithm_framework-0.7.dist-info → finterion_investing_algorithm_framework-0.9.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from datetime import datetime
|
|
2
2
|
|
|
3
3
|
from investing_algorithm_framework.infrastructure.services import MarketService
|
|
4
|
+
from investing_algorithm_framework import Order
|
|
4
5
|
from finterion import Finterion
|
|
5
6
|
|
|
6
7
|
|
|
@@ -18,10 +19,12 @@ class FinterionMarketService(MarketService):
|
|
|
18
19
|
pass
|
|
19
20
|
|
|
20
21
|
def get_order(self, order):
|
|
21
|
-
|
|
22
|
+
order = self._finterion.get_order(order.external_id)
|
|
23
|
+
return self._conver_order(order)
|
|
22
24
|
|
|
23
25
|
def get_orders(self, symbol, since: datetime = None):
|
|
24
|
-
|
|
26
|
+
orders = self._finterion.get_orders(symbol=symbol)
|
|
27
|
+
return [self._conver_order(order) for order in orders]
|
|
25
28
|
|
|
26
29
|
def get_balance(self):
|
|
27
30
|
positions = self._finterion.get_positions()
|
|
@@ -40,11 +43,12 @@ class FinterionMarketService(MarketService):
|
|
|
40
43
|
trading_symbol: str,
|
|
41
44
|
amount: float,
|
|
42
45
|
):
|
|
43
|
-
|
|
46
|
+
order = self._finterion.create_market_order(
|
|
44
47
|
order_side="sell",
|
|
45
48
|
amount=amount,
|
|
46
49
|
target_symbol=target_symbol,
|
|
47
50
|
)
|
|
51
|
+
return self._conver_order(order)
|
|
48
52
|
|
|
49
53
|
def create_limit_sell_order(
|
|
50
54
|
self,
|
|
@@ -53,12 +57,13 @@ class FinterionMarketService(MarketService):
|
|
|
53
57
|
amount: float,
|
|
54
58
|
price: float
|
|
55
59
|
):
|
|
56
|
-
|
|
60
|
+
order = self._finterion.create_limit_order(
|
|
57
61
|
order_side="sell",
|
|
58
62
|
amount=amount,
|
|
59
63
|
target_symbol=target_symbol,
|
|
60
64
|
price=price
|
|
61
65
|
)
|
|
66
|
+
return self._conver_order(order)
|
|
62
67
|
|
|
63
68
|
def create_limit_buy_order(
|
|
64
69
|
self,
|
|
@@ -67,9 +72,30 @@ class FinterionMarketService(MarketService):
|
|
|
67
72
|
amount: float,
|
|
68
73
|
price: float
|
|
69
74
|
):
|
|
70
|
-
|
|
75
|
+
order = self._finterion.create_limit_order(
|
|
71
76
|
order_side="buy",
|
|
72
77
|
amount=amount,
|
|
73
78
|
target_symbol=target_symbol,
|
|
74
79
|
price=price
|
|
75
80
|
)
|
|
81
|
+
return self._conver_order(order)
|
|
82
|
+
|
|
83
|
+
def _conver_order(self, finterion_order):
|
|
84
|
+
return Order(
|
|
85
|
+
external_id=finterion_order.get("id"),
|
|
86
|
+
type=finterion_order.get("order_type"),
|
|
87
|
+
side=finterion_order.get("order_side"),
|
|
88
|
+
status=finterion_order.get("status"),
|
|
89
|
+
amount=finterion_order.get("amount"),
|
|
90
|
+
target_symbol=finterion_order.get("target_symbol"),
|
|
91
|
+
trading_symbol=finterion_order.get("trading_symbol"),
|
|
92
|
+
price=finterion_order.get("price"),
|
|
93
|
+
created_at=finterion_order.get("created_at"),
|
|
94
|
+
updated_at=finterion_order.get("updated_at"),
|
|
95
|
+
trade_closed_at=finterion_order.get("trade_closed_at"),
|
|
96
|
+
trade_closed_price=finterion_order.get("trade_closed_price"),
|
|
97
|
+
filled_amount=finterion_order.get("filled_amount"),
|
|
98
|
+
remaining_amount=finterion_order.get("remaining_amount"),
|
|
99
|
+
cost=finterion_order.get("cost"),
|
|
100
|
+
fee=finterion_order.get("fee"),
|
|
101
|
+
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: finterion-investing-algorithm-framework
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.9
|
|
4
4
|
Summary: Official Finterion plugin for the investing algorithm framework
|
|
5
5
|
Home-page: https://github.com/finterion/finterion-investing-algorithm-framework.git
|
|
6
6
|
Author: Finterion
|
|
@@ -17,8 +17,8 @@ Classifier: Operating System :: OS Independent
|
|
|
17
17
|
Requires-Python: >=3
|
|
18
18
|
Description-Content-Type: text/markdown
|
|
19
19
|
License-File: LICENSE
|
|
20
|
-
Requires-Dist: investing-algorithm-framework (>=1.3.
|
|
21
|
-
Requires-Dist: finterion (>=0.
|
|
20
|
+
Requires-Dist: investing-algorithm-framework (>=1.3.1)
|
|
21
|
+
Requires-Dist: finterion (>=0.6.0)
|
|
22
22
|
|
|
23
23
|
# Finterion Investing Algorithm Framework Plugin
|
|
24
24
|
This is the official plugin for the [investing algorithm framework](https://investing-algorithm-framework.com) open source project.
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
finterion_investing_algorithm_framework/__init__.py,sha256=u-srn87VlLUPUJHWR5hgMAHqw2BWtb1v0eH0tQ8M16w,107
|
|
2
2
|
finterion_investing_algorithm_framework/create_app.py,sha256=9ULhy8MR0yQNaSMXShri_YGpXreoI214hppZfqSqZ8Q,1455
|
|
3
3
|
finterion_investing_algorithm_framework/exceptions.py,sha256=KOaDjHQC7vNpKwYYNxJ2nuaJYceMmvExW3BLSzPSWJk,197
|
|
4
|
-
finterion_investing_algorithm_framework/market_service.py,sha256=
|
|
4
|
+
finterion_investing_algorithm_framework/market_service.py,sha256=127maeiI6fXd2yHkG2IrVpgU8q1_rTZ-xxJX5AU_Cos,3223
|
|
5
5
|
finterion_investing_algorithm_framework/configuration/__init__.py,sha256=370OXcHya0GtGhrA59sIuznTYSn8xJy-dciCOSTsfl8,102
|
|
6
6
|
finterion_investing_algorithm_framework/configuration/constants.py,sha256=bhabsdZ8omPvAZlQmdPGM70vHQHS2pcJm2olpkSEciU,93
|
|
7
7
|
finterion_investing_algorithm_framework/models/__init__.py,sha256=96Cq_doBIVXfK9OJW3SnMTiXx9WPnd9LITlpT5vEFzw,176
|
|
8
8
|
finterion_investing_algorithm_framework/models/portfolio_configuration.py,sha256=1QesgEDUDoPk50ZFsDZFpFNldP_PExoUgdhKHp3w908,515
|
|
9
|
-
finterion_investing_algorithm_framework-0.
|
|
10
|
-
finterion_investing_algorithm_framework-0.
|
|
11
|
-
finterion_investing_algorithm_framework-0.
|
|
12
|
-
finterion_investing_algorithm_framework-0.
|
|
13
|
-
finterion_investing_algorithm_framework-0.
|
|
9
|
+
finterion_investing_algorithm_framework-0.9.dist-info/LICENSE,sha256=wbVEDvoZiMPHufRY3sLEffvAr7GH5hOIngHF8y4HFQg,11343
|
|
10
|
+
finterion_investing_algorithm_framework-0.9.dist-info/METADATA,sha256=58VY6DoxGNwtnvzWjH1DilYCRJQm-asXsje8FYRScbs,3289
|
|
11
|
+
finterion_investing_algorithm_framework-0.9.dist-info/WHEEL,sha256=AtBG6SXL3KF_v0NxLf0ehyVOh0cold-JbJYXNGorC6Q,92
|
|
12
|
+
finterion_investing_algorithm_framework-0.9.dist-info/top_level.txt,sha256=B97hJPQAFX_vRhcLE8uVZ6ac3a5ndS79p-O8-C2y-zw,40
|
|
13
|
+
finterion_investing_algorithm_framework-0.9.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|