From db071831ec9e67c6b38afd0e150c178a365511d0 Mon Sep 17 00:00:00 2001 From: jackyu66git Date: Fri, 30 May 2025 17:59:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E9=BD=90=E4=BA=A4=E6=98=93=E9=87=8F?= =?UTF-8?q?=E5=92=8CMACD=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ChanKLC.py | 1 + __pycache__/ChanKLC.cpython-312.pyc | Bin 72824 -> 72824 bytes __pycache__/ChanKLU.cpython-312.pyc | Bin 16082 -> 16082 bytes strategies/ChanLun_BTC_15.py | 4 + web/app.py | 7 +- web/templates/index.html | 792 ++++++++++++++++++---------- 6 files changed, 524 insertions(+), 280 deletions(-) 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 e8d3dda6d7074f831642098e33fb06f9b864595c..9b0f3f530fceba908c9e13216e885d96238bf9be 100644 GIT binary patch delta 322 zcmWlVze@rE97peSzr?FMB~6TzGzu4&;FgMh5fKC}P7N6?4dGChK?G6`{ggE7AgAh2 zi25dH1QFE`Bo%EnM1g}f)FF`u4(S`-_Lf)9^5rZq-^sGXRLQ9wQ`g6GNCB^hm4NiF zdQB@Y`%FncROZpGJ8g^T)l;?=^pnFL;xIrF#|AJ%f6h)|mNeHR5GCHd3B)MXQ~;J~ zLG1z7DC22kk)W66p=lgYOY%y?D&;ThcwCTqv&Z3;)^7_O>M4@@6wpOuPl^Q-6n-v> z*rM^bEQfP)<@W_V(CJ5?h!XvLkBacq$gf|NCq;&dvS64vV>YCN7C30P60{<2Dm0ktT*>MlXv?a1cm{1Q7%+P7PU0OE`#F5D}PzQ5G6?kdyQ$ zM17Or5d;wpK`%s`fzaS!5h)U4;E+DUvpvhxHpR9nDvyd{CYJi5~RCcfh39UEU-=ap&F2) zO-~5erIL4yN0#1wb8!@DBzLDHL)BZmh#P9$p9-kZ-a}1*of1!95`wh!rdqHF;IwD;GmOE#EKnOm0*=% zvL72}c|0>+K? 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 @@
-
+
-
+
-