openfund-maker 2.1.9__py3-none-any.whl → 2.1.10__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.
@@ -1,5 +1,6 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  import traceback
3
+ from typing import override
3
4
  import pandas as pd
4
5
 
5
6
  from maker.SMCStrategyMaker import SMCStrategyMaker
@@ -8,7 +9,7 @@ from maker.SMCStrategyMaker import SMCStrategyMaker
8
9
  class BestFVGStrategyMaker(SMCStrategyMaker):
9
10
  def __init__(self, config, platform_config, feishu_webhook=None,logger=None):
10
11
  super().__init__(config, platform_config, feishu_webhook, logger)
11
- self.place_order_prices = {} # 记录每个symbol的挂单价格
12
+
12
13
  self.htf_last_CHoCH = {} #记录HTF的CHoCH struct
13
14
 
14
15
  def check_price_in_fvg(self, df, side, fvg):
@@ -37,6 +38,13 @@ class BestFVGStrategyMaker(SMCStrategyMaker):
37
38
  max_price = max(df['high'].iloc[fvg_index+2:])
38
39
  return fvg_bot <= max_price
39
40
 
41
+ @override
42
+ def reset_all_cache(self, symbol):
43
+ """
44
+ 重置所有缓存
45
+ """
46
+ super().reset_all_cache(symbol)
47
+ self.htf_last_CHoCH[symbol] = {}
40
48
 
41
49
  def process_pair(self,symbol,pair_config):
42
50
  self.logger.info("=" * 60)
maker/SMCStrategyMaker.py CHANGED
@@ -516,6 +516,15 @@ class SMCStrategyMaker(ThreeLineStrategyMaker):
516
516
  ce = (pivot_high + pivot_low) / 2
517
517
  return float(self.round_price(symbol, ce))
518
518
 
519
+ def calculate_pe(self,symbol,pivot_high, pivot_low) -> float:
520
+ pe = (pivot_high + pivot_low) / 2
521
+ return float(self.round_price(symbol, pe))
522
+
523
+ def reset_all_cache(self, symbol):
524
+ """_summary_
525
+ 重置所有缓存数据
526
+ """
527
+ self.place_order_prices[symbol] = {}
519
528
 
520
529
  def process_pair(self,symbol,pair_config):
521
530
  self.logger.info("=" * 60)
@@ -531,7 +540,8 @@ class SMCStrategyMaker(ThreeLineStrategyMaker):
531
540
  if self.check_position(symbol=symbol) :
532
541
  self.logger.info(f"{symbol} : 有持仓合约,不进行下单。")
533
542
  if symbol in self.place_order_prices:
534
- self.place_order_prices[symbol] = {}
543
+ self.reset_all_cache(symbol)
544
+
535
545
  return
536
546
 
537
547
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: openfund-maker
3
- Version: 2.1.9
3
+ Version: 2.1.10
4
4
  Summary: Openfund-maker.
5
5
  Requires-Python: >=3.9,<4.0
6
6
  Classifier: Programming Language :: Python :: 3
@@ -1,6 +1,6 @@
1
- maker/BestFVGStrategyMaker.py,sha256=IGCk6TUwaJMWOSjM4fJU5BQ7ckCfTZBOMoSlI9Cka8U,11391
1
+ maker/BestFVGStrategyMaker.py,sha256=KnrqOaWEJSoba549CiOzSjoC6oQk42YVxa5e_pZJhSg,11532
2
2
  maker/MACDStrategyMaker.py,sha256=iS5HO04piKHFJxUI2e5QmicxzGeK-V1aphJSr2n_4Ac,12651
3
- maker/SMCStrategyMaker.py,sha256=gXhYs-QvKBZ-mdR4UN2EF7OwFGI5JyW2-0RJLXq7SSc,34695
3
+ maker/SMCStrategyMaker.py,sha256=w1ARnwVAkbm1R5ZeI_XX3dMevz5-lQGvtWqoEFHNVRA,35026
4
4
  maker/ThreeLineStrategyMaker.py,sha256=ArjnHlGECiD3cCFXxO0Ex5scR2agwoxZY-4mKukyKc4,30402
5
5
  maker/WickReversalStrategyMaker.py,sha256=7DqPDVJot4EM0_lSAcFAHrR9rNvkIds9KLMoDOiAHEc,17486
6
6
  maker/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -10,7 +10,7 @@ maker/main_m.py,sha256=0PzDTnuBrxfpy5WDfsIHKAzZ_7pkuvuqqeWik0vpWio,15522
10
10
  maker/okxapi.py,sha256=_9G0U_o0ZC8NxaT6PqpiLgxBm9gPobC9PsFHZE1c5w0,553
11
11
  maker/zhen.py.bak,sha256=HNkrQbJts8G9umE9chEFsc0cLQApcM9KOVNMYPpkBXM,10918
12
12
  maker/zhen_2.py,sha256=4IaHVtTCMSlrLGSTZrWpW2q-f7HZsUNRkW_-5QgWv24,10509
13
- openfund_maker-2.1.9.dist-info/METADATA,sha256=c1XSHMHdIfzcFnDqdI3yk6JvWnRXrNnvRUKHf-sEEu0,1953
14
- openfund_maker-2.1.9.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
15
- openfund_maker-2.1.9.dist-info/entry_points.txt,sha256=gKMytICEKcMRFQDFkHZLnIpID7UQFoTIM_xcpiiV6Ns,50
16
- openfund_maker-2.1.9.dist-info/RECORD,,
13
+ openfund_maker-2.1.10.dist-info/METADATA,sha256=OjXDHNmAz3AJNRy7tav1RuJhBicfPvbhmHCFJaWYX20,1954
14
+ openfund_maker-2.1.10.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
15
+ openfund_maker-2.1.10.dist-info/entry_points.txt,sha256=gKMytICEKcMRFQDFkHZLnIpID7UQFoTIM_xcpiiV6Ns,50
16
+ openfund_maker-2.1.10.dist-info/RECORD,,