finterion-investing-algorithm-framework 0.10.10__py3-none-any.whl → 0.11__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 +19 -33
- finterion_investing_algorithm_framework/models/portfolio_configuration.py +0 -2
- {finterion_investing_algorithm_framework-0.10.10.dist-info → finterion_investing_algorithm_framework-0.11.dist-info}/METADATA +7 -33
- {finterion_investing_algorithm_framework-0.10.10.dist-info → finterion_investing_algorithm_framework-0.11.dist-info}/RECORD +7 -7
- {finterion_investing_algorithm_framework-0.10.10.dist-info → finterion_investing_algorithm_framework-0.11.dist-info}/WHEEL +1 -1
- {finterion_investing_algorithm_framework-0.10.10.dist-info → finterion_investing_algorithm_framework-0.11.dist-info}/LICENSE +0 -0
- {finterion_investing_algorithm_framework-0.10.10.dist-info → finterion_investing_algorithm_framework-0.11.dist-info}/top_level.txt +0 -0
|
@@ -1,16 +1,25 @@
|
|
|
1
1
|
from datetime import datetime
|
|
2
|
-
import ccxt
|
|
3
|
-
from dateutil import parser
|
|
4
2
|
from decimal import Decimal
|
|
5
3
|
|
|
6
|
-
from
|
|
7
|
-
from investing_algorithm_framework import Order
|
|
8
|
-
from investing_algorithm_framework.domain import OperationalException, \
|
|
9
|
-
parse_decimal_to_string
|
|
4
|
+
from dateutil import parser
|
|
10
5
|
from finterion import Finterion
|
|
6
|
+
from investing_algorithm_framework import Order
|
|
7
|
+
from investing_algorithm_framework.domain import parse_decimal_to_string
|
|
8
|
+
from investing_algorithm_framework.infrastructure import CCXTMarketService
|
|
9
|
+
|
|
11
10
|
|
|
11
|
+
class FinterionMarketService(CCXTMarketService):
|
|
12
|
+
|
|
13
|
+
def cancel_order(self, order):
|
|
14
|
+
pass
|
|
15
|
+
|
|
16
|
+
def get_open_orders(self, target_symbol: str = None,
|
|
17
|
+
trading_symbol: str = None):
|
|
18
|
+
pass
|
|
12
19
|
|
|
13
|
-
|
|
20
|
+
def get_closed_orders(self, target_symbol: str = None,
|
|
21
|
+
trading_symbol: str = None):
|
|
22
|
+
pass
|
|
14
23
|
|
|
15
24
|
def __init__(self, api_key, base_url=None, initialize=True):
|
|
16
25
|
self._api_key = api_key
|
|
@@ -22,29 +31,6 @@ class FinterionMarketService(MarketService):
|
|
|
22
31
|
else:
|
|
23
32
|
self._finterion = Finterion(api_key)
|
|
24
33
|
|
|
25
|
-
@property
|
|
26
|
-
def market(self):
|
|
27
|
-
return self._market
|
|
28
|
-
|
|
29
|
-
@market.setter
|
|
30
|
-
def market(self, value):
|
|
31
|
-
|
|
32
|
-
if not isinstance(value, str):
|
|
33
|
-
raise OperationalException("Market must be a string")
|
|
34
|
-
|
|
35
|
-
if value == "finterion":
|
|
36
|
-
return
|
|
37
|
-
|
|
38
|
-
self._market = value.lower()
|
|
39
|
-
|
|
40
|
-
if not hasattr(ccxt, self._market):
|
|
41
|
-
raise OperationalException(
|
|
42
|
-
f"No market service found for market id {self._market}"
|
|
43
|
-
)
|
|
44
|
-
|
|
45
|
-
self.exchange_class = getattr(ccxt, self._market)
|
|
46
|
-
self.exchange = self.exchange_class()
|
|
47
|
-
|
|
48
34
|
def initialize(self, portfolio_configuration):
|
|
49
35
|
pass
|
|
50
36
|
|
|
@@ -114,15 +100,15 @@ class FinterionMarketService(MarketService):
|
|
|
114
100
|
order = Order(
|
|
115
101
|
external_id=finterion_order.get("id"),
|
|
116
102
|
order_type=finterion_order.get("order_type"),
|
|
117
|
-
|
|
103
|
+
order_side=finterion_order.get("order_side"),
|
|
118
104
|
status=finterion_order.get("status"),
|
|
119
105
|
amount=finterion_order.get("amount"),
|
|
120
106
|
target_symbol=finterion_order.get("target_symbol"),
|
|
121
107
|
trading_symbol=finterion_order.get("trading_symbol"),
|
|
122
108
|
price=finterion_order.get("price"),
|
|
123
109
|
trade_closed_price=finterion_order.get("trade_closed_price"),
|
|
124
|
-
|
|
125
|
-
|
|
110
|
+
filled=finterion_order.get("filled"),
|
|
111
|
+
remaining=finterion_order.get("remaining"),
|
|
126
112
|
cost=finterion_order.get("cost"),
|
|
127
113
|
)
|
|
128
114
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: finterion-investing-algorithm-framework
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.11
|
|
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,7 +17,7 @@ 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.4
|
|
20
|
+
Requires-Dist: investing-algorithm-framework >=1.7.4
|
|
21
21
|
Requires-Dist: finterion >=0.7.4
|
|
22
22
|
|
|
23
23
|
# Finterion Investing Algorithm Framework Plugin
|
|
@@ -39,42 +39,16 @@ algorithm framework configured with the finterion platform.
|
|
|
39
39
|
> your algorithm on the finterion platform.
|
|
40
40
|
|
|
41
41
|
```python
|
|
42
|
-
import os
|
|
43
|
-
import pathlib
|
|
44
|
-
from datetime import datetime, timedelta
|
|
45
|
-
|
|
46
42
|
from finterion_investing_algorithm_framework import create_app
|
|
47
|
-
from investing_algorithm_framework import RESOURCE_DIRECTORY, TimeUnit, \
|
|
48
|
-
TradingTimeFrame, TradingDataType, OrderSide
|
|
49
43
|
|
|
50
|
-
|
|
51
|
-
app = create_app(
|
|
52
|
-
api_key="<your_api_key>",
|
|
53
|
-
config={RESOURCE_DIRECTORY: pathlib.Path(__file__).parent.resolve()}
|
|
54
|
-
)
|
|
44
|
+
app = create_app(api_key="<YOUR_TRADING_BOT_FINTERION_API_KEY>")
|
|
55
45
|
|
|
46
|
+
# Add your investing algorithm framework market data sources
|
|
47
|
+
# .....
|
|
56
48
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
interval=5,
|
|
60
|
-
market="binance", # Will retrieve trading data from binance
|
|
61
|
-
symbols=["BTC/USDT", "ETH/USDT", ["DOT/USDT"]], # Symbols must be in the format of TARGET/TRADE symbol (e.g. BTC/USDT)
|
|
62
|
-
trading_data_types=[TradingDataType.OHLCV, TradingDataType.TICKER, TradingDataType.ORDER_BOOK],
|
|
63
|
-
trading_time_frame_start_date=datetime.utcnow() - timedelta(days=1), # Will retrieve data from the last 24 hours
|
|
64
|
-
trading_time_frame=TradingTimeFrame.ONE_MINUTE # Will retrieve data on 1m interval (OHLCV)
|
|
65
|
-
)
|
|
66
|
-
def perform_strategy(algorithm, market_data):
|
|
67
|
-
print(algorithm.get_allocated())
|
|
68
|
-
print(algorithm.get_unallocated())
|
|
69
|
-
print(market_data)
|
|
70
|
-
algorithm.create_limit_order(
|
|
71
|
-
target_symbol="BTC",
|
|
72
|
-
side=OrderSide.BUY,
|
|
73
|
-
price=market_data["TICKER"]["BTC/USDT"]["BID"],
|
|
74
|
-
amount_target_symbol=0.00001
|
|
75
|
-
)
|
|
49
|
+
# Add your investing algorithm framework trading strategies
|
|
50
|
+
# ....
|
|
76
51
|
|
|
77
|
-
|
|
78
52
|
if __name__ == "__main__":
|
|
79
53
|
app.run()
|
|
80
54
|
```
|
|
@@ -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=tIQAhrWLGDf7d7TQyI48mKTGrSc_QtcpdYAbn073k_Y,1384
|
|
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=01S0jYDnDQln4aoaUPMxEZZbwIr9W3GPn3MQoK4L7ew,4031
|
|
5
5
|
finterion_investing_algorithm_framework/configuration/__init__.py,sha256=yz9TVm7RoGgF3EJ95-iLJrMup7eYoRvTXY1TyfEiGf4,42
|
|
6
6
|
finterion_investing_algorithm_framework/configuration/constants.py,sha256=bhabsdZ8omPvAZlQmdPGM70vHQHS2pcJm2olpkSEciU,93
|
|
7
7
|
finterion_investing_algorithm_framework/models/__init__.py,sha256=waEhKjOtg3oSSoyWHNFsQCcRklQm5EeOoAVCyEaMxSs,174
|
|
8
|
-
finterion_investing_algorithm_framework/models/portfolio_configuration.py,sha256=
|
|
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.
|
|
8
|
+
finterion_investing_algorithm_framework/models/portfolio_configuration.py,sha256=NFGMXRgfiLY2byxi_5yjUgdlV2Fy7DLG48B1hMw-QK4,851
|
|
9
|
+
finterion_investing_algorithm_framework-0.11.dist-info/LICENSE,sha256=wbVEDvoZiMPHufRY3sLEffvAr7GH5hOIngHF8y4HFQg,11343
|
|
10
|
+
finterion_investing_algorithm_framework-0.11.dist-info/METADATA,sha256=Hg_UCUkDsJpUqMgRgM0fMwmG9IfxZtOhc-TYbHAPVRI,2144
|
|
11
|
+
finterion_investing_algorithm_framework-0.11.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
12
|
+
finterion_investing_algorithm_framework-0.11.dist-info/top_level.txt,sha256=B97hJPQAFX_vRhcLE8uVZ6ac3a5ndS79p-O8-C2y-zw,40
|
|
13
|
+
finterion_investing_algorithm_framework-0.11.dist-info/RECORD,,
|
|
File without changes
|