PROTECTED SOURCE SCRIPT
已更新 K-Line Midline Indicator@yuanmu

指标概述
K线中线指标是一款用于技术分析的自定义工具,专注于在K线图上绘制每根K线的中心位置线。该指标能够帮助交易者快速识别价格的平均位置、观察价格重心的变化趋势,并通过影线分析功能识别潜在的关键支撑阻力位。
核心功能
双模式中线绘制:
实体中线:(开盘价 + 收盘价) ÷ 2,反映多空力量平衡点
整根K线中线:(最高价 + 最低价) ÷ 2,反映整根K线的价格重心
智能影线分析:
自动识别异常长影线K线
双重过滤条件确保只标记有意义的影线
在最长影线中点位置绘制标记线
完全自定义显示:
可调节显示K线数量(1-200根)
独立设置中线和影线的颜色、线宽、线型
透明度渐变效果:当前K线最清晰,历史K线逐渐淡化
性能优化:
只在最后K线时绘制历史数据,避免重复计算
最大线条数量限制,确保图表运行流畅
自动检测可用历史数据范围
应用场景
短线交易:使用实体中线观察多空博弈,辅助判断入场时机
波段分析:使用整根K线中线识别价格重心,判断趋势强度
关键位识别:通过影线中点标记寻找潜在的支撑阻力区域
价格结构分析:观察中线排列形态,识别价格运行结构
参数设置
中线颜色/线宽/线型:调整主中线的视觉效果
显示K线数量:控制同时显示的K线中线数量
影线标记开关:启用/禁用影线分析功能
影线条件设置:调整影线筛选的灵敏度
影线样式设置:自定义影线标记的视觉样式
技术规格 (Technical Specifications)
开发平台: TradingView Pine Script v6
兼容性: 所有交易品种和时间周期
最大显示K线: 200根
线条数量限制: 最多500条线
更新频率: 实时更新
内存占用: 低至中等,取决于显示数量设置
使用提示 (Usage Tips)
从较小的显示数量开始(如20-30根),逐步增加
中线与影线标记使用对比色,便于区分
根据市场波动性调整影线条件参数
结合其他指标使用,如移动平均线或成交量指标
观察中线排列的形态变化,识别趋势转换信号
开发者信息 (Developer Information)
名称: 原木 (Yuanmu)
版本: 1.0
特点: 简洁高效,专注核心功能,注重用户体验
Indicator Overview
K-Line Midline Indicator is a custom technical analysis tool designed to plot the center line of each candlestick on the price chart. This indicator helps traders quickly identify price average positions, observe shifts in price gravity, and identify potential key support/resistance levels through shadow analysis functionality.
Core Features
Dual-Mode Midline Drawing:
Body Midline: (Open + Close) ÷ 2, reflecting the balance point between bullish and bearish forces
Whole K-Line Midline: (High + Low) ÷ 2, reflecting the price gravity of the entire candlestick
Intelligent Shadow Analysis:
Automatically identifies K-lines with abnormally long shadows
Dual-filtering conditions ensure only meaningful shadows are marked
Draws marker lines at the midpoint of the longest shadow
Fully Customizable Display:
Adjustable number of displayed K-lines (1-200)
Independent color, width, and style settings for midline and shadow markers
Transparency gradient effect: current K-line is most clear, historical K-lines gradually fade
Performance Optimization:
Draws historical data only on the last bar to avoid redundant calculations
Maximum line count limit ensures smooth chart operation
Automatic detection of available historical data range
Application Scenarios
Short-term Trading: Use body midline to observe bull-bear battles and assist entry timing decisions
Swing Analysis: Use whole K-line midline to identify price gravity and determine trend strength
Key Level Identification: Locate potential support/resistance areas through shadow midpoint markers
Price Structure Analysis: Observe midline arrangement patterns to identify price movement structures
Parameter Settings
Midline Color/Width/Style: Adjust visual appearance of main midline
Number of K-lines Displayed: Control how many K-line midlines are shown simultaneously
Shadow Marker Toggle: Enable/disable shadow analysis functionality
Shadow Condition Settings: Adjust sensitivity of shadow filtering
Shadow Style Settings: Customize visual appearance of shadow markers
K线中线指标是一款用于技术分析的自定义工具,专注于在K线图上绘制每根K线的中心位置线。该指标能够帮助交易者快速识别价格的平均位置、观察价格重心的变化趋势,并通过影线分析功能识别潜在的关键支撑阻力位。
核心功能
双模式中线绘制:
实体中线:(开盘价 + 收盘价) ÷ 2,反映多空力量平衡点
整根K线中线:(最高价 + 最低价) ÷ 2,反映整根K线的价格重心
智能影线分析:
自动识别异常长影线K线
双重过滤条件确保只标记有意义的影线
在最长影线中点位置绘制标记线
完全自定义显示:
可调节显示K线数量(1-200根)
独立设置中线和影线的颜色、线宽、线型
透明度渐变效果:当前K线最清晰,历史K线逐渐淡化
性能优化:
只在最后K线时绘制历史数据,避免重复计算
最大线条数量限制,确保图表运行流畅
自动检测可用历史数据范围
应用场景
短线交易:使用实体中线观察多空博弈,辅助判断入场时机
波段分析:使用整根K线中线识别价格重心,判断趋势强度
关键位识别:通过影线中点标记寻找潜在的支撑阻力区域
价格结构分析:观察中线排列形态,识别价格运行结构
参数设置
中线颜色/线宽/线型:调整主中线的视觉效果
显示K线数量:控制同时显示的K线中线数量
影线标记开关:启用/禁用影线分析功能
影线条件设置:调整影线筛选的灵敏度
影线样式设置:自定义影线标记的视觉样式
技术规格 (Technical Specifications)
开发平台: TradingView Pine Script v6
兼容性: 所有交易品种和时间周期
最大显示K线: 200根
线条数量限制: 最多500条线
更新频率: 实时更新
内存占用: 低至中等,取决于显示数量设置
使用提示 (Usage Tips)
从较小的显示数量开始(如20-30根),逐步增加
中线与影线标记使用对比色,便于区分
根据市场波动性调整影线条件参数
结合其他指标使用,如移动平均线或成交量指标
观察中线排列的形态变化,识别趋势转换信号
开发者信息 (Developer Information)
名称: 原木 (Yuanmu)
版本: 1.0
特点: 简洁高效,专注核心功能,注重用户体验
Indicator Overview
K-Line Midline Indicator is a custom technical analysis tool designed to plot the center line of each candlestick on the price chart. This indicator helps traders quickly identify price average positions, observe shifts in price gravity, and identify potential key support/resistance levels through shadow analysis functionality.
Core Features
Dual-Mode Midline Drawing:
Body Midline: (Open + Close) ÷ 2, reflecting the balance point between bullish and bearish forces
Whole K-Line Midline: (High + Low) ÷ 2, reflecting the price gravity of the entire candlestick
Intelligent Shadow Analysis:
Automatically identifies K-lines with abnormally long shadows
Dual-filtering conditions ensure only meaningful shadows are marked
Draws marker lines at the midpoint of the longest shadow
Fully Customizable Display:
Adjustable number of displayed K-lines (1-200)
Independent color, width, and style settings for midline and shadow markers
Transparency gradient effect: current K-line is most clear, historical K-lines gradually fade
Performance Optimization:
Draws historical data only on the last bar to avoid redundant calculations
Maximum line count limit ensures smooth chart operation
Automatic detection of available historical data range
Application Scenarios
Short-term Trading: Use body midline to observe bull-bear battles and assist entry timing decisions
Swing Analysis: Use whole K-line midline to identify price gravity and determine trend strength
Key Level Identification: Locate potential support/resistance areas through shadow midpoint markers
Price Structure Analysis: Observe midline arrangement patterns to identify price movement structures
Parameter Settings
Midline Color/Width/Style: Adjust visual appearance of main midline
Number of K-lines Displayed: Control how many K-line midlines are shown simultaneously
Shadow Marker Toggle: Enable/disable shadow analysis functionality
Shadow Condition Settings: Adjust sensitivity of shadow filtering
Shadow Style Settings: Customize visual appearance of shadow markers
版本注释
K线中线指标 - 更新日志版本历史
v1.2.0 - 2024年
新增功能:
添加实体中线独立开关
优化绘制逻辑,分离实体中线和影线标记
功能调整:
实体中线开关仅控制实体中线的显示/隐藏
影线标记显示保持独立,不受实体中线开关影响
保持整根中线功能不受开关影响
v1.1.0 - 2024年
功能优化:
添加线条偏移功能,可在K线内调整线条位置
优化线型选择逻辑,支持实线、虚线和点线
改进影线标记条件计算算法
v1.0.0 - 2024年
初始版本:
实现基础K线中线功能
支持实体中线和整根中线两种模式
可自定义颜色、线宽、线型
影线中点标记功能
可调节影线标记条件
设置显示K线数量限制
功能特点
核心功能
中线类型选择 - 实体中线(开盘价与收盘价中点)或整根中线(最高价与最低价中点)
实体中线控制 - 独立开关控制实体中线的显示/隐藏
线条偏移 - 可调整线条在K线内的水平位置
影线标记 - 智能识别长影线并标记中点
自定义选项
颜色、线宽、线型全面自定义
影线标记条件可调节(影线/实体倍数、影线间倍数)
显示K线数量限制(1-200根)
智能特性
当前K线使用实色,历史K线使用半透明色
仅在最后K线时绘制,避免性能问题
线条数量自动限制,防止图表过载
使用说明
基本操作
选择中线类型:实体中线或整根中线
控制实体中线:使用独立开关显示/隐藏实体中线
调整线条位置:使用偏移量微调线条在K线内的位置
设置影线标记:开启后自动标记符合条件的影线中点
注意事项
实体中线开关仅对实体中线模式有效
整根中线模式不受实体中线开关影响
影线标记独立显示,不受实体中线开关影响
偏移量调整范围为-0.49到+0.49,负值向左,正值向右
技术特性
性能优化
最大线条数量限制500条
只在最后K线时绘制,减少计算量
历史K线使用半透明色,减少视觉干扰
兼容性
Pine Script v6
适用于TradingView平台
支持所有时间框架
兼容所有交易品种
开发者说明
代码结构
用户设置区域 - 所有可调节参数集中管理
功能函数区域 - 核心算法和辅助函数
主绘制逻辑 - 分离的实体中线和影线标记绘制
扩展能力
模块化设计便于功能扩展
清晰的函数接口便于维护
灵活的配置系统支持未来功能添加
K-Line Midline Indicator - Update Log
Version History
v1.2.0 - 2024
New Features:
Added independent toggle switch for entity midline
Optimized drawing logic, separated entity midline and shadow marking
Feature Adjustments:
Entity midline toggle only controls display/hide of entity midline
Shadow marking display remains independent, unaffected by entity midline toggle
Whole line midline function remains unaffected by toggle
v1.1.0 - 2024
Feature Optimizations:
Added line offset function to adjust line position within K-line
Optimized line style selection logic, supporting solid, dashed, and dotted lines
Improved shadow marking condition calculation algorithm
v1.0.0 - 2024
Initial Version:
Implemented basic K-line midline functionality
Supports two modes: entity midline and whole line midline
Fully customizable colors, line widths, and line styles
Shadow midpoint marking function
Adjustable shadow marking conditions
Configurable K-line display count limit
Key Features
Core Functions
Midline Type Selection - Entity midline (midpoint of open and close prices) or whole line midline (midpoint of high and low prices)
Entity Midline Control - Independent toggle to control entity midline display/hide
Line Offset - Adjust horizontal position of lines within K-lines
Shadow Marking - Intelligently identifies long shadows and marks their midpoints
Customization Options
Comprehensive customization of colors, line widths, and line styles
Adjustable shadow marking conditions (shadow/entity ratio, shadow-to-shadow ratio)
Display K-line count limit (1-200 bars)
Smart Features
Current K-line uses solid colors, historical K-lines use semi-transparent colors
Drawing occurs only on the last bar to avoid performance issues
Automatic line count limitation prevents chart overload
User Guide
Basic Operations
Select Midline Type: Entity midline or whole line midline
Control Entity Midline: Use independent toggle to show/hide entity midline
Adjust Line Position: Use offset to fine-tune line position within K-lines
Set Shadow Marking: When enabled, automatically marks midpoint of qualified shadows
Important Notes
Entity midline toggle only affects entity midline mode
Whole line midline mode is unaffected by entity midline toggle
Shadow marking displays independently, unaffected by entity midline toggle
Offset adjustment range: -0.49 to +0.49 (negative values shift left, positive values shift right)
Technical Specifications
Performance Optimization
Maximum line count limited to 500 lines
Drawing occurs only on the last bar to reduce calculations
Historical K-lines use semi-transparent colors to reduce visual clutter
Compatibility
Pine Script v6
Compatible with TradingView platform
Supports all timeframes
Compatible with all trading instruments
Developer Notes
Code Structure
User Settings Area - Centralized management of all adjustable parameters
Function Area - Core algorithms and helper functions
Main Drawing Logic - Separate drawing logic for entity midline and shadow marking
Extensibility
Modular design for easy feature expansion
Clear function interfaces for maintainability
Flexible configuration system supports future feature additions
版本注释
K线中线指标 - 更新日志版本历史
v1.2.0 - 2024年
新增功能:
添加实体中线独立开关
优化绘制逻辑,分离实体中线和影线标记
功能调整:
实体中线开关仅控制实体中线的显示/隐藏
影线标记显示保持独立,不受实体中线开关影响
保持整根中线功能不受开关影响
v1.1.0 - 2024年
功能优化:
添加线条偏移功能,可在K线内调整线条位置
优化线型选择逻辑,支持实线、虚线和点线
改进影线标记条件计算算法
v1.0.0 - 2024年
初始版本:
实现基础K线中线功能
支持实体中线和整根中线两种模式
可自定义颜色、线宽、线型
影线中点标记功能
可调节影线标记条件
设置显示K线数量限制
功能特点
核心功能
中线类型选择 - 实体中线(开盘价与收盘价中点)或整根中线(最高价与最低价中点)
实体中线控制 - 独立开关控制实体中线的显示/隐藏
线条偏移 - 可调整线条在K线内的水平位置
影线标记 - 智能识别长影线并标记中点
自定义选项
颜色、线宽、线型全面自定义
影线标记条件可调节(影线/实体倍数、影线间倍数)
显示K线数量限制(1-200根)
智能特性
当前K线使用实色,历史K线使用半透明色
仅在最后K线时绘制,避免性能问题
线条数量自动限制,防止图表过载
使用说明
基本操作
选择中线类型:实体中线或整根中线
控制实体中线:使用独立开关显示/隐藏实体中线
调整线条位置:使用偏移量微调线条在K线内的位置
设置影线标记:开启后自动标记符合条件的影线中点
注意事项
实体中线开关仅对实体中线模式有效
整根中线模式不受实体中线开关影响
影线标记独立显示,不受实体中线开关影响
偏移量调整范围为-0.49到+0.49,负值向左,正值向右
技术特性
性能优化
最大线条数量限制500条
只在最后K线时绘制,减少计算量
历史K线使用半透明色,减少视觉干扰
兼容性
Pine Script v6
适用于TradingView平台
支持所有时间框架
兼容所有交易品种
开发者说明
代码结构
用户设置区域 - 所有可调节参数集中管理
功能函数区域 - 核心算法和辅助函数
主绘制逻辑 - 分离的实体中线和影线标记绘制
扩展能力
模块化设计便于功能扩展
清晰的函数接口便于维护
灵活的配置系统支持未来功能添加
K-Line Midline Indicator - Update Log
Version History
v1.2.0 - 2024
New Features:
Added independent toggle switch for entity midline
Optimized drawing logic, separated entity midline and shadow marking
Feature Adjustments:
Entity midline toggle only controls display/hide of entity midline
Shadow marking display remains independent, unaffected by entity midline toggle
Whole line midline function remains unaffected by toggle
v1.1.0 - 2024
Feature Optimizations:
Added line offset function to adjust line position within K-line
Optimized line style selection logic, supporting solid, dashed, and dotted lines
Improved shadow marking condition calculation algorithm
v1.0.0 - 2024
Initial Version:
Implemented basic K-line midline functionality
Supports two modes: entity midline and whole line midline
Fully customizable colors, line widths, and line styles
Shadow midpoint marking function
Adjustable shadow marking conditions
Configurable K-line display count limit
Key Features
Core Functions
Midline Type Selection - Entity midline (midpoint of open and close prices) or whole line midline (midpoint of high and low prices)
Entity Midline Control - Independent toggle to control entity midline display/hide
Line Offset - Adjust horizontal position of lines within K-lines
Shadow Marking - Intelligently identifies long shadows and marks their midpoints
Customization Options
Comprehensive customization of colors, line widths, and line styles
Adjustable shadow marking conditions (shadow/entity ratio, shadow-to-shadow ratio)
Display K-line count limit (1-200 bars)
Smart Features
Current K-line uses solid colors, historical K-lines use semi-transparent colors
Drawing occurs only on the last bar to avoid performance issues
Automatic line count limitation prevents chart overload
User Guide
Basic Operations
Select Midline Type: Entity midline or whole line midline
Control Entity Midline: Use independent toggle to show/hide entity midline
Adjust Line Position: Use offset to fine-tune line position within K-lines
Set Shadow Marking: When enabled, automatically marks midpoint of qualified shadows
Important Notes
Entity midline toggle only affects entity midline mode
Whole line midline mode is unaffected by entity midline toggle
Shadow marking displays independently, unaffected by entity midline toggle
Offset adjustment range: -0.49 to +0.49 (negative values shift left, positive values shift right)
Technical Specifications
Performance Optimization
Maximum line count limited to 500 lines
Drawing occurs only on the last bar to reduce calculations
Historical K-lines use semi-transparent colors to reduce visual clutter
Compatibility
Pine Script v6
Compatible with TradingView platform
Supports all timeframes
Compatible with all trading instruments
Developer Notes
Code Structure
User Settings Area - Centralized management of all adjustable parameters
Function Area - Core algorithms and helper functions
Main Drawing Logic - Separate drawing logic for entity midline and shadow marking
Extensibility
Modular design for easy feature expansion
Clear function interfaces for maintainability
Flexible configuration system supports future feature additions
受保护脚本
此脚本以闭源形式发布。 但是,您可以自由使用,没有任何限制 — 了解更多信息这里。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
受保护脚本
此脚本以闭源形式发布。 但是,您可以自由使用,没有任何限制 — 了解更多信息这里。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。