对齐交易量和MACD图

This commit is contained in:
jackyu66git
2025-05-30 17:59:07 +08:00
parent 843534a039
commit db071831ec
6 changed files with 524 additions and 280 deletions
+1
View File
@@ -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):
Binary file not shown.
Binary file not shown.
+4
View File
@@ -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")
+6 -1
View File
@@ -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)
app.run(debug=True, host='0.0.0.0', port=8120)
+513 -279
View File
File diff suppressed because it is too large Load Diff