不用大的时间周期了

This commit is contained in:
jackyu66git
2025-09-27 02:26:28 +08:00
parent 6139af98c3
commit 1507f9f929
2 changed files with 7 additions and 8 deletions
+2 -2
View File
@@ -49,9 +49,9 @@ class ChanLun():
self.time1y = 12*30*24*60 self.time1y = 12*30*24*60
self.time_M_intervals = [2*30*24*60, 3*30*24*60, 6*30*24*60, 12*30*24*60] self.time_M_intervals = [2*30*24*60, 3*30*24*60, 6*30*24*60, 12*30*24*60]
self.time_M_symbols = ['2M', '3M', '6M', '1y'] self.time_M_symbols = ['2M', '3M', '6M', '1y']
self.time_symbols = ['1m', '3m', '5m', '15m', '30m', '1h', '2h', '4h', '6h', '8h', '12h', '16h', '1d', '2d', '3d', '1w', '2w', '1M', '3M', '6M', '1y'] self.time_symbols = ['1m', '3m', '5m', '10m', '15m', '30m', '1h', '2h', '4h', '6h', '8h', '12h', '16h', '1d', '2d', '3d', '1w', '2w', '1M', '3M', '6M', '1y']
self.tf_df_dict = {} self.tf_df_dict = {}
self.ema_symbols = ['1m', '3m', '5m', '15m', '30m', '1h', '2h', '4h', '6h', '8h', '12h', '16h', '1d', '2d', '3d', '1w', '2w'] self.ema_symbols = ['1m', '3m', '5m', '10m', '15m', '30m', '1h', '2h', '4h', '6h', '8h', '12h', '16h', '1d', '2d', '3d']
def init_data(self, dataframe, intervals, timeframes): def init_data(self, dataframe, intervals, timeframes):
for index in range(0, len(intervals)): for index in range(0, len(intervals)):
timeframe = timeframes[index] timeframe = timeframes[index]
+5 -6
View File
@@ -8724,6 +8724,7 @@
'1m': '#FF0000', // 红色 '1m': '#FF0000', // 红色
'3m': '#FF6600', // 橙红色 '3m': '#FF6600', // 橙红色
'5m': '#FF9900', // 橙色 '5m': '#FF9900', // 橙色
'10m': '#DDAA00', // 黄色
'15m': '#FFCC00', // 黄色 '15m': '#FFCC00', // 黄色
'30m': '#99FF00', // 黄绿色 '30m': '#99FF00', // 黄绿色
'1h': '#00FF00', // 绿色 '1h': '#00FF00', // 绿色
@@ -8736,12 +8737,10 @@
'1d': '#9900FF', // 紫红色 '1d': '#9900FF', // 紫红色
'2d': '#CC00FF', // 品红色 '2d': '#CC00FF', // 品红色
'3d': '#FF00CC', // 粉红色 '3d': '#FF00CC', // 粉红色
'1w': '#FF0099', // 玫瑰色
'2w': '#FF3366' // 深粉色
}; };
// 按照预定义顺序排列时间周期 // 按照预定义顺序排列时间周期
const orderedTimeframes = ['1m', '3m', '5m', '15m', '30m', '1h', '2h', '4h', '6h', '8h', '12h', '16h', '1d', '2d', '3d', '1w', '2w']; const orderedTimeframes = ['1m', '3m', '5m', '10m', '15m', '30m', '1h', '2h', '4h', '6h', '8h', '12h', '16h', '1d', '2d', '3d'];
// 获取主图表容器 // 获取主图表容器
const chartContainer = document.getElementById('tradingview_chart'); const chartContainer = document.getElementById('tradingview_chart');
@@ -8762,7 +8761,7 @@
color: color, color: color,
lineWidth: 1, lineWidth: 1,
lineStyle: 2, // 虚线样式 lineStyle: 2, // 虚线样式
title: `EMA52-${timeframe}`, title: ``,
lastValueVisible: false, // 不在价格标尺显示数值 lastValueVisible: false, // 不在价格标尺显示数值
priceLineVisible: false, // 不显示默认价格线 priceLineVisible: false, // 不显示默认价格线
crosshairMarkerVisible: false, crosshairMarkerVisible: false,
@@ -8802,7 +8801,7 @@
} }
// 创建右偏移的时间点(在最后一根K线右边) // 创建右偏移的时间点(在最后一根K线右边)
const rightOffsetTime = lastTime + timeInterval * 0.3; const rightOffsetTime = lastTime + timeInterval*100;
// 创建一个新的线系列用于显示文字标记 // 创建一个新的线系列用于显示文字标记
const markerSeries = tvWidget.mainChart.addLineSeries({ const markerSeries = tvWidget.mainChart.addLineSeries({
@@ -8826,7 +8825,7 @@
position: 'inBar', position: 'inBar',
color: color, color: color,
shape: 'square', shape: 'square',
text: `${timeframe} ${value.toFixed(2)}`, text: ` ${timeframe} ${value.toFixed(2)}`,
size: 1, size: 1,
}]); }]);