openfund-maker 1.0.3__py3-none-any.whl → 1.0.5__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.
- maker/ThreeLineOrderBot.py +6 -8
- {openfund_maker-1.0.3.dist-info → openfund_maker-1.0.5.dist-info}/METADATA +1 -1
- {openfund_maker-1.0.3.dist-info → openfund_maker-1.0.5.dist-info}/RECORD +5 -5
- {openfund_maker-1.0.3.dist-info → openfund_maker-1.0.5.dist-info}/WHEEL +0 -0
- {openfund_maker-1.0.3.dist-info → openfund_maker-1.0.5.dist-info}/entry_points.txt +0 -0
maker/ThreeLineOrderBot.py
CHANGED
@@ -307,8 +307,8 @@ class ThreeLineOrdergBot:
|
|
307
307
|
def judge_k_line_direction(self,symbol, pair_config, ema) -> int:
|
308
308
|
tick_size = float(self.exchange.market(symbol)['precision']['price'])
|
309
309
|
|
310
|
-
ema_range_period =
|
311
|
-
ema_range_limit =
|
310
|
+
ema_range_period = float(pair_config.get('ema_range_period', 3))
|
311
|
+
ema_range_limit = float(pair_config.get('ema_range_limit', 1))
|
312
312
|
# 20250210 判断EMA均线是否走平,用EMA周期内的极差计算,极差在阈值范围内为平
|
313
313
|
ema_ranges = ema.rolling(window=ema_range_period).max() - ema.rolling(window=ema_range_period).min()
|
314
314
|
ema_slope = ema.diff()
|
@@ -401,9 +401,12 @@ class ThreeLineOrdergBot:
|
|
401
401
|
return float(self.round_price_to_tick(place_order_price,tick_size))
|
402
402
|
|
403
403
|
def process_pair(self,symbol,pair_config):
|
404
|
+
# 检查是否有持仓,有持仓不进行下单
|
404
405
|
if self.check_position(symbol=symbol) :
|
405
406
|
self.logger.info(f"{symbol} 有持仓合约,不进行下单。")
|
406
407
|
return
|
408
|
+
# 取消之前的挂单
|
409
|
+
self.cancel_all_orders(symbol=symbol)
|
407
410
|
|
408
411
|
try:
|
409
412
|
klines = self.get_historical_klines(symbol=symbol)
|
@@ -483,7 +486,7 @@ class ThreeLineOrdergBot:
|
|
483
486
|
|
484
487
|
self.logger.debug(f"{symbol} 当前K线的前三根K线 最高价: {max_high}, 最低价: {min_low}")
|
485
488
|
|
486
|
-
|
489
|
+
|
487
490
|
|
488
491
|
long_amount_usdt = pair_config.get('long_amount_usdt', 5)
|
489
492
|
short_amount_usdt = pair_config.get('short_amount_usdt', 5)
|
@@ -529,11 +532,6 @@ class ThreeLineOrdergBot:
|
|
529
532
|
|
530
533
|
|
531
534
|
def monitor_klines(self):
|
532
|
-
# self.fetch_and_store_all_instruments()
|
533
|
-
import importlib.metadata
|
534
|
-
|
535
|
-
version = importlib.metadata.version("openfund-wick-reversal")
|
536
|
-
self.logger.info(f" ++ openfund-wick-reversal:{version} is doing...")
|
537
535
|
symbols = list(self.trading_pairs_config.keys()) # 获取所有币对的ID
|
538
536
|
batch_size = 5 # 每批处理的数量
|
539
537
|
while True:
|
@@ -1,4 +1,4 @@
|
|
1
|
-
maker/ThreeLineOrderBot.py,sha256=
|
1
|
+
maker/ThreeLineOrderBot.py,sha256=t4AFalkMoO-UBE-0go5kU7u5ge5ZJ6Lk3D-yKOdOvUM,23278
|
2
2
|
maker/WickReversalOrderBot.py,sha256=Oc6wChdWu39lfWh3NRHM8BqvaRIYDNZiDR6PDnE9XUM,17374
|
3
3
|
maker/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
4
|
maker/config.py,sha256=YPxghO5i0vgRg9Cja8kGj9O7pgSbbtzOgf3RexqXXwY,1188
|
@@ -7,7 +7,7 @@ maker/main_m.py,sha256=0PzDTnuBrxfpy5WDfsIHKAzZ_7pkuvuqqeWik0vpWio,15522
|
|
7
7
|
maker/okxapi.py,sha256=_9G0U_o0ZC8NxaT6PqpiLgxBm9gPobC9PsFHZE1c5w0,553
|
8
8
|
maker/zhen.py.bak,sha256=HNkrQbJts8G9umE9chEFsc0cLQApcM9KOVNMYPpkBXM,10918
|
9
9
|
maker/zhen_2.py,sha256=4IaHVtTCMSlrLGSTZrWpW2q-f7HZsUNRkW_-5QgWv24,10509
|
10
|
-
openfund_maker-1.0.
|
11
|
-
openfund_maker-1.0.
|
12
|
-
openfund_maker-1.0.
|
13
|
-
openfund_maker-1.0.
|
10
|
+
openfund_maker-1.0.5.dist-info/METADATA,sha256=SbFTNFcQFCMR3Knw2ExvO3Z_Xr9M3NZrGmHFQr2Cdn0,1965
|
11
|
+
openfund_maker-1.0.5.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
|
12
|
+
openfund_maker-1.0.5.dist-info/entry_points.txt,sha256=gKMytICEKcMRFQDFkHZLnIpID7UQFoTIM_xcpiiV6Ns,50
|
13
|
+
openfund_maker-1.0.5.dist-info/RECORD,,
|
File without changes
|
File without changes
|