diff --git a/ChanKLC.py b/ChanKLC.py index 74ddc33..5bee3a3 100644 --- a/ChanKLC.py +++ b/ChanKLC.py @@ -54,6 +54,7 @@ class ChanKLC(): for klu in self.klus: klu.update_realtime_analysis() if klu.fx_type == self.fx and klu.fx_strength > 1.8: + #print(klu.time, klu.fx_type, klu.fx_strength) return True return False def set_next(self, klc): diff --git a/__pycache__/ChanKLC.cpython-312.pyc b/__pycache__/ChanKLC.cpython-312.pyc index e8d3dda..9b0f3f5 100644 Binary files a/__pycache__/ChanKLC.cpython-312.pyc and b/__pycache__/ChanKLC.cpython-312.pyc differ diff --git a/__pycache__/ChanKLU.cpython-312.pyc b/__pycache__/ChanKLU.cpython-312.pyc index 2dc2c15..c332c16 100644 Binary files a/__pycache__/ChanKLU.cpython-312.pyc and b/__pycache__/ChanKLU.cpython-312.pyc differ diff --git a/strategies/ChanLun_BTC_15.py b/strategies/ChanLun_BTC_15.py index e3c9961..1e702c8 100644 --- a/strategies/ChanLun_BTC_15.py +++ b/strategies/ChanLun_BTC_15.py @@ -173,6 +173,8 @@ class ChanLun_BTC_15(IStrategy): def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: state_str = 'resample_{}_state'.format(self.get_ticker_indicator()*self.time5) fx_str = 'resample_{}_fx'.format(self.get_ticker_indicator()*self.time5) + #state_str = 'state' + #fx_str = 'fx' dataframe.loc[ ( #(dataframe['state'] == "-30") @@ -199,6 +201,8 @@ class ChanLun_BTC_15(IStrategy): def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: state_str = 'resample_{}_state'.format(self.get_ticker_indicator()*self.time5) fx_str = 'resample_{}_fx'.format(self.get_ticker_indicator()*self.time5) + #state_str = 'state' + #fx_str = 'fx' dataframe.loc[ ( #(dataframe['state']== "30") diff --git a/web/app.py b/web/app.py index 048d789..3bb3668 100644 --- a/web/app.py +++ b/web/app.py @@ -685,8 +685,13 @@ def analyze(): # 对小周期数据进行缠论分析 element_analysis = analyze_chan(element_df) + # 计算小周期MACD数据 + element_macd_data = calculate_macd(element_df) + # 添加小周期分析结果到返回数据 result['element_timeframe'] = element_timeframe + result['element_macd'] = element_macd_data # 添加小周期MACD数据 + result['element_bi_list'] = [{ 'start_time': bi.start_klc.end_time if isinstance(bi.start_klc.end_time, str) else bi.start_klc.end_time.astimezone(client_tz).isoformat(), 'end_time': (bi.end_klc.end_time if isinstance(bi.end_klc.end_time, str) else bi.end_klc.end_time.astimezone(client_tz).isoformat()) if bi.end_klc else None, @@ -984,4 +989,4 @@ def format_fx_type(fx_type): return fx_type_map.get(fx_type, fx_type) if __name__ == '__main__': - app.run(debug=True, host='0.0.0.0', port=8123) \ No newline at end of file + app.run(debug=True, host='0.0.0.0', port=8120) \ No newline at end of file diff --git a/web/templates/index.html b/web/templates/index.html index dcf9ec3..e4860b3 100644 --- a/web/templates/index.html +++ b/web/templates/index.html @@ -56,10 +56,13 @@ background-color: #fff; position: relative; box-shadow: 0 1px 3px rgba(0,0,0,0.05); + margin-bottom: 20px; /* 增加下边距,防止被下方数据面板遮挡 */ } #tradingview_chart { width: 100%; height: 100%; + position: relative; + z-index: 1; /* 确保图表在数据面板之上 */ } .chart-options { position: absolute; @@ -73,13 +76,14 @@ box-shadow: 0 1px 4px rgba(0,0,0,0.1); } .data-container { - margin-top: 10px; + margin-top: 30px; /* 增加上边距,避免与图表重叠 */ position: relative; z-index: 10; background-color: white; border-radius: 8px; padding: 15px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); + clear: both; /* 清除浮动 */ } .nav-tabs { margin-bottom: 10px; @@ -292,14 +296,14 @@
-
+
-
+
-