bitunix-automated-crypto-trading 3.1.1__py3-none-any.whl → 3.1.2__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.
- bitunix_automated_crypto_trading/BitunixApi.py +6 -8
- bitunix_automated_crypto_trading/BitunixSignal.py +1 -1
- bitunix_automated_crypto_trading/TickerManager.py +9 -16
- {bitunix_automated_crypto_trading-3.1.1.dist-info → bitunix_automated_crypto_trading-3.1.2.dist-info}/METADATA +1 -1
- {bitunix_automated_crypto_trading-3.1.1.dist-info → bitunix_automated_crypto_trading-3.1.2.dist-info}/RECORD +8 -8
- {bitunix_automated_crypto_trading-3.1.1.dist-info → bitunix_automated_crypto_trading-3.1.2.dist-info}/WHEEL +0 -0
- {bitunix_automated_crypto_trading-3.1.1.dist-info → bitunix_automated_crypto_trading-3.1.2.dist-info}/entry_points.txt +0 -0
- {bitunix_automated_crypto_trading-3.1.1.dist-info → bitunix_automated_crypto_trading-3.1.2.dist-info}/top_level.txt +0 -0
@@ -249,21 +249,19 @@ class BitunixApi:
|
|
249
249
|
function_name = stack[-2].name
|
250
250
|
logger.info(f"Function: {function_name}, {e}, {e.args}, {type(e).__name__}")
|
251
251
|
|
252
|
-
async def GetKlineHistory(self, ticker, interval, limit):
|
252
|
+
async def GetKlineHistory(self, ticker, interval, limit, starttime):
|
253
253
|
data = []
|
254
254
|
lm=limit
|
255
|
-
|
255
|
+
st=starttime
|
256
256
|
try:
|
257
257
|
while True:
|
258
|
-
url = f'{self.kline_Url}?symbol={ticker}&startTime={
|
258
|
+
url = f'{self.kline_Url}?symbol={ticker}&startTime={st}&interval={interval}&limit={lm}'
|
259
259
|
resp = self.session.get(url)
|
260
260
|
datajs = resp.json()
|
261
|
-
|
262
|
-
|
263
|
-
|
261
|
+
data.extend(datajs['data'])
|
262
|
+
if len(datajs['data']) < lm:
|
263
|
+
st = int(datajs['data'][-1]['time']) + 1
|
264
264
|
lm=limit-len(data)
|
265
|
-
if len(data) >= limit:
|
266
|
-
break
|
267
265
|
else:
|
268
266
|
break
|
269
267
|
return data
|
@@ -218,7 +218,7 @@ class BitunixSignal:
|
|
218
218
|
intervals = self.tickerObjects.get_intervalIds()
|
219
219
|
for ticker in self.tickerList:
|
220
220
|
for intervalId in intervals:
|
221
|
-
data = await self.bitunixApi.GetKlineHistory(ticker, intervalId, self.settings.BARS)
|
221
|
+
data = await self.bitunixApi.GetKlineHistory(ticker, intervalId, self.settings.BARS, int(time.time()))
|
222
222
|
if data is not None:
|
223
223
|
self.tickerObjects.load_kline_history(ticker, intervalId, self.settings.BARS, data)
|
224
224
|
if self.settings.VERBOSE_LOGGING:
|
@@ -53,24 +53,21 @@ class Interval:
|
|
53
53
|
# Calculate the Moving Averages
|
54
54
|
if self.settings.EMA_STUDY:
|
55
55
|
df['ma_fast'] = talib.EMA(df['close'], timeperiod=self.settings.MA_FAST)
|
56
|
-
df['ma_fast'] =
|
57
|
-
df.fillna({'ma_fast':0}, inplace=True)
|
56
|
+
df.dropna(subset=['ma_fast'], inplace=True)
|
58
57
|
df['ma_fast_slope'] = df['ma_fast'].diff()
|
59
58
|
df['ma_fast_angle'] = np.degrees(np.arctan(df['ma_fast_slope']))
|
60
59
|
df.fillna({'ma_fast_slope':0}, inplace=True)
|
61
60
|
df.fillna({'ma_fast_angle':0}, inplace=True)
|
62
61
|
|
63
62
|
df['ma_medium'] = talib.EMA(df['close'], timeperiod=self.settings.MA_MEDIUM)
|
64
|
-
df['ma_medium'] =
|
65
|
-
df.fillna({'ma_medium':0}, inplace=True)
|
63
|
+
df.dropna(subset=['ma_medium'], inplace=True)
|
66
64
|
df['ma_medium_slope'] = df['ma_medium'].diff()
|
67
65
|
df['ma_medium_angle'] = np.degrees(np.arctan(df['ma_medium_slope']))
|
68
66
|
df.fillna({'ma_medium_slope':0}, inplace=True)
|
69
67
|
df.fillna({'ma_medium_angle':0}, inplace=True)
|
70
68
|
|
71
69
|
df['ma_slow'] = talib.EMA(df['close'], timeperiod=self.settings.MA_SLOW)
|
72
|
-
df['ma_slow']
|
73
|
-
df.fillna({'ma_slow':0}, inplace=True)
|
70
|
+
df.dropna(subset=['ma_slow'],inplace=True)
|
74
71
|
df['ma_slow_slope'] = df['ma_slow'].diff()
|
75
72
|
df['ma_slow_angle'] = np.degrees(np.arctan(df['ma_slow_slope']))
|
76
73
|
df.fillna({'ma_slow_slope':0}, inplace=True)
|
@@ -114,14 +111,12 @@ class Interval:
|
|
114
111
|
df['MACD_Signal'] = 0.0
|
115
112
|
df['MACD_Histogram'] = 0.0
|
116
113
|
df['MACD_Line'], df['MACD_Signal'], df['MACD_Histogram'] = talib.MACD(df['close'], fastperiod=self.settings.MACD_SHORT, slowperiod=self.settings.MACD_LONG, signalperiod=self.settings.MACD_PERIOD)
|
117
|
-
df.
|
118
|
-
df.fillna({'MACD_Signal':0}, inplace=True)
|
119
|
-
df.fillna({'MACD_Histogram':0}, inplace=True)
|
120
|
-
|
114
|
+
df.dropna(subset=['MACD_Line', 'MACD_Signal', 'MACD_Histogram'], inplace=True)
|
121
115
|
df['MACD_Line_slope'] = df['MACD_Line'].diff()
|
122
116
|
df['MACD_Line_angle'] = np.degrees(np.arctan(df['MACD_Line_slope']))
|
123
117
|
df.fillna({'MACD_Line_slope':0}, inplace=True)
|
124
|
-
df.fillna({'MACD_Line_angle':0}, inplace=True)
|
118
|
+
df.fillna({'MACD_Line_angle':0}, inplace=True)
|
119
|
+
|
125
120
|
|
126
121
|
if self.settings.MACD_CROSSING:
|
127
122
|
if df['MACD_Line'].iloc[-2] <= df['MACD_Signal'].iloc[-2] and df['MACD_Line'].iloc[-1] > df['MACD_Signal'].iloc[-1]:
|
@@ -147,9 +142,7 @@ class Interval:
|
|
147
142
|
df['BBM'] = 0.0
|
148
143
|
df['BBU'] = 0.0
|
149
144
|
df['BBU'], df['BBM'], df['BBL'] = talib.BBANDS(df['close'], timeperiod=self.settings.BBM_PERIOD, nbdevup=self.settings.BBM_STD, nbdevdn=self.settings.BBM_STD, )
|
150
|
-
df.
|
151
|
-
df.fillna({'BBM':0}, inplace=True)
|
152
|
-
df.fillna({'BBU':0}, inplace=True)
|
145
|
+
df.dropna(subset=['BBM', 'BBU', 'BBL'], inplace=True)
|
153
146
|
|
154
147
|
df['BBM_slope'] = df['BBM'].diff()
|
155
148
|
df['BBM_angle'] = np.degrees(np.arctan(df['BBM_slope']))
|
@@ -177,14 +170,14 @@ class Interval:
|
|
177
170
|
# Calculate the RSI
|
178
171
|
if self.settings.RSI_STUDY:
|
179
172
|
df['rsi_fast'] = talib.RSI(df['close'],timeperiod=self.settings.RSI_FAST)
|
180
|
-
df.
|
173
|
+
df.dropna(subset=['rsi_fast'], inplace=True)
|
181
174
|
df['rsi_fast_slope'] = df['rsi_fast'].diff()
|
182
175
|
df['rsi_fast_angle'] = np.degrees(np.arctan(df['rsi_fast_slope']))
|
183
176
|
df.fillna({'rsi_fast_slope':0}, inplace=True)
|
184
177
|
df.fillna({'rsi_fast_angle':0}, inplace=True)
|
185
178
|
|
186
179
|
df['rsi_slow'] = talib.RSI(df['close'],timeperiod=self.settings.RSI_SLOW)
|
187
|
-
df.
|
180
|
+
df.dropna(subset=['rsi_slow'], inplace=True)
|
188
181
|
df['rsi_slow_slope'] = df['rsi_slow'].diff()
|
189
182
|
df['rsi_slow_angle'] = np.degrees(np.arctan(df['rsi_slow_slope']))
|
190
183
|
df.fillna({'rsi_slow_slope':0}, inplace=True)
|
@@ -1,17 +1,17 @@
|
|
1
1
|
bitunix_automated_crypto_trading/AsyncThreadRunner.py,sha256=LJ6ny1KSCVoIbfeNypsY4aHYcbkGME9M3epQ9e8B1O8,3224
|
2
|
-
bitunix_automated_crypto_trading/BitunixApi.py,sha256=
|
3
|
-
bitunix_automated_crypto_trading/BitunixSignal.py,sha256=
|
2
|
+
bitunix_automated_crypto_trading/BitunixApi.py,sha256=gmhWi83k4EHOMIY7ZPa3x2NuIgVyzH13Sjk9AlVKjtQ,11163
|
3
|
+
bitunix_automated_crypto_trading/BitunixSignal.py,sha256=z8-mvwZOR1VAAmrgy9HjgFyv-IRx1GxogcXjwCPJ4oY,64687
|
4
4
|
bitunix_automated_crypto_trading/BitunixWebSocket.py,sha256=mbuvk8UFWKgv4KLV07TgLgxLVTRJnOKuf02mLB-VoCY,11143
|
5
5
|
bitunix_automated_crypto_trading/DataFrameHtmlRenderer.py,sha256=Pqdzhh_nfIxFEZH9L_R5QXB8moDPbgeTGT_hmBkHWMg,2899
|
6
6
|
bitunix_automated_crypto_trading/NotificationManager.py,sha256=pqDquEe-oujD2v8B543524vo62aRMjfB4YW-3DMhVGQ,795
|
7
7
|
bitunix_automated_crypto_trading/ThreadManager.py,sha256=WmYRQu8aNrgp5HwSqpBqX1WESNSEpbD2CznPFpd9HuI,2330
|
8
|
-
bitunix_automated_crypto_trading/TickerManager.py,sha256=
|
8
|
+
bitunix_automated_crypto_trading/TickerManager.py,sha256=g9Imr3uJijWeLqJbmCDrcDBwCHaBXV6P6sse73akmTA,33082
|
9
9
|
bitunix_automated_crypto_trading/__init__.py,sha256=1hzk6nX8NnUCr1tsq8oFq1qGCNhNwnwldWE75641Eew,78
|
10
10
|
bitunix_automated_crypto_trading/bitunix.py,sha256=c5vKRuN1-UaNz_ZB5Txu4-2UM6PsnRhs-ztvhRtpEzc,32779
|
11
11
|
bitunix_automated_crypto_trading/config.py,sha256=QWAe5Ruq8A5anaFS-CamVm-3t1wMJjGG1DWaPIIWfiM,4521
|
12
12
|
bitunix_automated_crypto_trading/logger.py,sha256=tAaTQcv5r--zupk_Fhfe1USfBAzSiXzVa4QRnaOFIFY,2933
|
13
|
-
bitunix_automated_crypto_trading-3.1.
|
14
|
-
bitunix_automated_crypto_trading-3.1.
|
15
|
-
bitunix_automated_crypto_trading-3.1.
|
16
|
-
bitunix_automated_crypto_trading-3.1.
|
17
|
-
bitunix_automated_crypto_trading-3.1.
|
13
|
+
bitunix_automated_crypto_trading-3.1.2.dist-info/METADATA,sha256=5hhgVdOaJ-kqG0zdmen-OXVGpvBtXJxXjoU-tg_8-WI,996
|
14
|
+
bitunix_automated_crypto_trading-3.1.2.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
15
|
+
bitunix_automated_crypto_trading-3.1.2.dist-info/entry_points.txt,sha256=UXREYHuSl2XYd_tOtLIq0zg3d1kX3lixX5SpN8yGBw4,82
|
16
|
+
bitunix_automated_crypto_trading-3.1.2.dist-info/top_level.txt,sha256=uyFzHUCOsp8elnG2Ovor6xXcf7dxRxY-C-Txiwix64Q,33
|
17
|
+
bitunix_automated_crypto_trading-3.1.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|