属性参考
本页列出了 set_candlestick_property / get_candlestick_property 以及 set_annotation_property / get_annotation_property 接受的所有属性名。属性名为点分隔路径,子路径可读写 bundle 中的单个字段。
值类型
PropertyValue 变体 | Rust 类型 | 说明 |
|---|---|---|
Color(c) | navi_visuals::Color | RGBA 颜色 |
Float(v) | f64 | 浮点数 |
Bool(b) | bool | 开关 |
Int(i) | i32 | 整数(用于位标志) |
Enum(i) | usize | 枚举选项索引 |
Stroke(s) | Stroke { color, width, style } | 线条外观 bundle |
Enableable(e) | EnableableValue { enabled, value } | 可开关的子值 |
GroupItems(v) | Vec<GroupItemValue> | 有序列表(层级、颜色对等) |
GroupItem(i) | GroupItemValue { enabled, number, value } | 列表中的单项 |
TextStyle(s) | TextStyle { color, fontSize, bold, italic } | 文字外观 bundle |
Text(s) | String | 可编辑文本内容 |
子路径语法
Bundle 可整体或逐字段寻址:
Stroke(描边)
| 路径 | 类型 | 说明 |
|---|---|---|
stroke | Stroke | 完整 bundle(颜色 + 宽度 + 样式) |
stroke.color | Color | 线条颜色 |
stroke.width | Float | 线条宽度(逻辑像素) |
stroke.style | Enum | 0 = 实线,1 = 虚线,2 = 点线 |
部分标注在自定义前缀下暴露描边(如 line、border、median、top、bottom),子路径规则相同:line.color、border.width 等。
Fill(填充)
| 路径 | 类型 | 说明 |
|---|---|---|
fill 或 fill.color | Color | 填充颜色(RGBA,alpha 控制不透明度) |
TextStyle(文字样式)
| 路径 | 类型 | 说明 |
|---|---|---|
textStyle | TextStyle | 完整 bundle |
textStyle.color | Color | 文字颜色 |
textStyle.fontSize | Float | 字体大小(逻辑像素) |
textStyle.bold | Bool | 粗体 |
textStyle.italic | Bool | 斜体 |
text.color | Color | textStyle.color 的别名 |
TextAlignment(文字对齐)
| 路径 | 类型 | 说明 |
|---|---|---|
textAlignment.align | Enum | 水平:0 = 左,1 = 居中,2 = 右 |
textAlignment.valign | Enum | 垂直:0 = 上,1 = 居中,2 = 下 |
层级组(Level Groups)
Fibonacci、Gann、通道、叉形线等标注通过层级组暴露多条线:
| 路径 | 类型 | 说明 |
|---|---|---|
levels | GroupItems | 全部层级 |
levels.N | GroupItem | 第 N 条层级(0 起始) |
levels.N.enabled | Bool | 第 N 条层级是否可见 |
levels.N.color | Color | 第 N 条层级的线条颜色 |
levels.N.width | Float | 第 N 条层级的线条宽度 |
levels.N.style | Enum | 第 N 条层级的线条样式 |
K 线图样式属性
属性作用于由 set_candlestick_style 设置的当前活跃样式,只有活跃样式的属性才可读写。
Candlestick(蜡烛图)
| 属性 | 类型 | 说明 |
|---|---|---|
colorBasedOnPrevClose | Bool | 以前一根 K 线收盘价(而非开盘价)作为涨跌判断基准 |
body | GroupItems[2] | 实体颜色([0] = 上涨,[1] = 下跌) |
border | GroupItems[2] | 边框颜色 |
wick | GroupItems[2] | 影线颜色 |
HollowCandle / VolumeCandle(空心蜡烛 / 量价蜡烛)
| 属性 | 类型 | 说明 |
|---|---|---|
body | GroupItems[2] | 实体颜色 |
border | GroupItems[2] | 边框颜色 |
wick | GroupItems[2] | 影线颜色 |
HeikinAshi(平均K线)
| 属性 | 类型 | 说明 |
|---|---|---|
realPricesOnScale | Bool | 坐标轴显示真实价格而非 Heikin Ashi 价格 |
colorBasedOnPrevClose | Bool | 以前一根收盘价为涨跌判断基准 |
body | GroupItems[2] | 实体颜色 |
border | GroupItems[2] | 边框颜色 |
wick | GroupItems[2] | 影线颜色 |
Bars(OHLC 柱)
| 属性 | 类型 | 说明 |
|---|---|---|
colorBasedOnPrevClose | Bool | 以前一根收盘价为涨跌判断基准 |
hlc | Bool | 显示为 HLC 柱(省略开盘刻度) |
thin | Bool | 绘制单像素细柱 |
color | GroupItems[2] | 涨跌颜色 |
Line / LineWithMarkers / StepLine(折线 / 折线+标记 / 阶梯线)
| 属性 | 类型 | 说明 |
|---|---|---|
priceSource | Enum | 0=收盘,1=开盘,2=最高,3=最低,4=HL2,5=HLC3,6=OHLC4 |
fillMode | Enum | 0 = 纯色,1 = 渐变 |
stroke | Stroke | 线条颜色、宽度、样式 (纯色模式) |
gradientColor1 | Color | 渐变顶部颜色 (渐变模式) |
gradientColor2 | Color | 渐变底部颜色 (渐变模式) |
lineWidth | Stroke | 仅宽度描边 (渐变模式,只有 .width 有效) |
Area(面积图)
| 属性 | 类型 | 说明 |
|---|---|---|
priceSource | Enum | 0=收盘,1=开盘,2=最高,3=最低,4=HL2,5=HLC3,6=OHLC4 |
line | Stroke | 折线颜色、宽度、样式 |
fillColor1 | Color | 上方填充颜色(默认为折线颜色 80% 不透明度) |
fillColor2 | Color | 下方填充颜色(默认为折线颜色 0% 不透明度) |
HlcArea(HLC 面积图)
| 属性 | 类型 | 说明 |
|---|---|---|
highLine | Enableable<Stroke> | 最高价线(可开关) |
lowLine | Enableable<Stroke> | 最低价线(可开关) |
closeLine | Stroke | 收盘价线 |
fillColor1 | Color | 上方区域填充颜色 |
fillColor2 | Color | 下方区域填充颜色 |
Baseline(基准线图)
| 属性 | 类型 | 说明 |
|---|---|---|
priceSource | Enum | 0=收盘,1=开盘,2=最高,3=最低,4=HL2,5=HLC3,6=OHLC4 |
topLine | Enableable<Stroke> | 上方线(可开关) |
bottomLine | Enableable<Stroke> | 下方线(可开关) |
fillTop | GroupItems[2] | 基准线上方填充:[0] = 近线颜色,[1] = 远端颜色 |
fillBottom | GroupItems[2] | 基准线下方填充:[0] = 近线颜色,[1] = 远端颜色 |
level | Float | 基准线在价格轴上的位置比例(0.0–1.0) |
Columns(柱状图)
| 属性 | 类型 | 说明 |
|---|---|---|
priceSource | Enum | 0=收盘,1=开盘,2=最高,3=最低,4=HL2,5=HLC3,6=OHLC4 |
colorBasedOnPrevClose | Bool | 以前一根收盘价为涨跌判断基准 |
color | GroupItems[2] | 涨跌颜色 |
HighLow(高低线图)
| 属性 | 类型 | 说明 |
|---|---|---|
bodyColor | Color | 柱体颜色(默认为主题文字色) |
borderColor | Color | 边框颜色(默认为主题文字色) |
labelColor | Color | 高低标签颜色(默认为主题次级文字色) |
标注属性
线条类
TrendLine / Ray(趋势线 / 射线)
| 属性 | 类型 | 说明 |
|---|---|---|
stroke | Stroke | 线条颜色、宽度、样式 |
extend | Int(位标志) | 延伸方向:第 0 位 = 向左,第 1 位 = 向右 |
textStyle | TextStyle | 标签文字外观 |
textAlignment.align | Enum | 标签水平位置 |
textAlignment.valign | Enum | 标签垂直位置(0=上,1=中,2=下) |
ExtendedLine(双向延伸线)
| 属性 | 类型 | 说明 |
|---|---|---|
stroke | Stroke | 线条颜色、宽度、样式 |
textStyle | TextStyle | 标签文字外观 |
textAlignment.align | Enum | 标签水平位置 |
textAlignment.valign | Enum | 标签垂直位置 |
HorizontalLine / HorizontalRay(水平线 / 水平射线)
| 属性 | 类型 | 说明 |
|---|---|---|
stroke | Stroke | 线条颜色、宽度、样式 |
showPriceLabel | Bool | 在线上显示价格标签 |
textStyle | TextStyle | 标签文字外观 |
textAlignment.align | Enum | 标签水平位置 |
textAlignment.valign | Enum | 标签垂直位置 |
VerticalLine(垂直线)
| 属性 | 类型 | 说明 |
|---|---|---|
stroke | Stroke | 线条颜色、宽度、样式 |
showTimeLabel | Bool | 在线上显示时间标签 |
textStyle | TextStyle | 标签文字外观 |
textAlignment.align | Enum | 标签水平位置 |
textAlignment.valign | Enum | 标签垂直位置 |
CrossLine(十字线)
| 属性 | 类型 | 说明 |
|---|---|---|
stroke | Stroke | 线条颜色、宽度、样式 |
Arrow(箭头线)
| 属性 | 类型 | 说明 |
|---|---|---|
stroke | Stroke | 箭头线颜色、宽度、样式 |
textStyle | TextStyle | 标签文字外观 |
textAlignment.align | Enum | 标签水平位置 |
textAlignment.valign | Enum | 标签垂直位置 |
ArrowMarkUp / ArrowMarkDown(上/下箭头标记)
| 属性 | 类型 | 说明 |
|---|---|---|
color | Color | 箭头填充颜色 |
textStyle | TextStyle | 标签文字外观 |
形状类
Rectangle / RotatedRectangle(矩形 / 旋转矩形)
| 属性 | 类型 | 说明 |
|---|---|---|
stroke | Stroke | 边框颜色、宽度、样式 |
fill.color | Color | 填充颜色 |
textStyle | TextStyle | 标签文字外观 |
textAlignment.align | Enum | 标签水平位置 |
textAlignment.valign | Enum | 标签垂直位置 |
Circle / Ellipse / Triangle / Polyline / Sector(圆 / 椭圆 / 三角形 / 折线 / 扇形)
| 属性 | 类型 | 说明 |
|---|---|---|
stroke | Stroke | 边框颜色、宽度、样式 |
fill.color | Color | 填充颜色 |
文字与符号
Text(文字)
| 属性 | 类型 | 说明 |
|---|---|---|
stroke | Stroke | 文字框边框 |
fill.color | Color | 文字框背景色 |
textStyle | TextStyle | 文字外观(颜色、大小、粗体、斜体) |
Emoji(表情符号)
| 属性 | 类型 | 说明 |
|---|---|---|
textStyle | TextStyle | 表情外观(大小通过 textStyle.fontSize 控制) |
textAlignment.align | Enum | 水平锚点 |
Note / PriceNote(注释 / 价格注释)
| 属性 | 类型 | 说明 |
|---|---|---|
line | Stroke | 从锚点到标签的引导线 |
border | Stroke | 标签框边框 |
fill.color | Color | 标签框背景色 |
textStyle | TextStyle | 标签文字外观 |
textAlignment.align | Enum | 框内水平对齐 |
textAlignment.valign | Enum | 框内垂直对齐 |
Callout(气泡注释)
| 属性 | 类型 | 说明 |
|---|---|---|
stroke | Stroke | 气泡边框及引导线 |
fill.color | Color | 气泡背景色 |
textStyle | TextStyle | 文字外观 |
textAlignment.align | Enum | 水平对齐 |
textAlignment.valign | Enum | 垂直对齐 |
通道类
ParallelChannel(平行通道)
| 属性 | 类型 | 说明 |
|---|---|---|
levels | GroupItems[7] | 通道线(索引 0/2/4/6 为主线,1/3/5 为中线) |
extend | Int(位标志) | 延伸:第 0 位 = 向左,第 1 位 = 向右 |
fill.color | Color | 通道填充颜色 |
textStyle | TextStyle | 标签文字外观 |
textAlignment.align | Enum | 标签水平位置 |
textAlignment.valign | Enum | 标签垂直位置 |
FlatTopBottom(平顶平底)
| 属性 | 类型 | 说明 |
|---|---|---|
top | Stroke | 上边界线 |
bottom | Stroke | 下边界线 |
fill.color | Color | 通道填充颜色 |
prices | Enableable<TextStyle> | 价格标签外观(含开关) |
DisjointChannel(分离通道)
| 属性 | 类型 | 说明 |
|---|---|---|
lineA | Stroke | 上边界线 |
lineB | Stroke | 下边界线 |
fill.color | Color | 通道填充颜色 |
prices | Enableable<TextStyle> | 价格标签外观(含开关) |
RegressionTrend(回归趋势)
| 属性 | 类型 | 说明 |
|---|---|---|
baseLine | Stroke | 回归中心线 |
upperLine | Stroke | 上偏差线 |
lowerLine | Stroke | 下偏差线 |
upperFill.color | Color | 上方填充 |
lowerFill.color | Color | 下方填充 |
Fibonacci 工具
所有 Fibonacci 标注共用以下核心属性,各工具可能有所增减:
| 属性 | 类型 | 说明 |
|---|---|---|
levels | GroupItems[N] | Fibonacci 层级(FibRetracement 为 24 条,其他类型各异) |
levels.N.enabled | Bool | 第 N 条层级是否可见 |
levels.N.color | Color | 第 N 条层级的颜色 |
levels.N.width | Float | 第 N 条层级的宽度 |
levels.N.style | Enum | 第 N 条层级的样式 |
extend | Int(位标志) | 延伸:第 0 位 = 向左,第 1 位 = 向右 |
trendLine | Enableable<Stroke> | 主趋势线(FibRetracement、FibChannel) |
fillAlpha | Float | 层级间填充不透明度(0.0–1.0) |
reverse | Bool | 翻转层级顺序(FibRetracement) |
showPrices | Bool | 在每条层级旁显示价格标签 |
Gann 工具
GannSquare / GannSquareFixed(Gann 正方形)
| 属性 | 类型 | 说明 |
|---|---|---|
levels | GroupItems[6] | 水平价格网格线 |
fans | GroupItems[11] | 扇形角度线 |
arcs | GroupItems[11] | 弧形线 |
fillAlpha | Float | 填充不透明度(0.0–1.0) |
reverse | Bool | 翻转正方形(仅 GannSquare) |
showLevelNumbers | Bool | 在网格线旁显示数字标签 |
textStyle | TextStyle | 标签文字外观 |
GannFan(Gann 扇形)
| 属性 | 类型 | 说明 |
|---|---|---|
levels | GroupItems[9] | 扇形角度线 |
fillAlpha | Float | 填充不透明度 |
labels | Enableable<TextStyle> | 角度标签外观 |
GannBox(Gann 箱形)
| 属性 | 类型 | 说明 |
|---|---|---|
priceLevels | GroupItems[7] | 水平价格分割线 |
timeLevels | GroupItems[7] | 垂直时间分割线 |
angles | Enableable<Stroke> | 对角线 |
fillAlpha | Float | 填充不透明度 |
reverse | Bool | 翻转箱形 |
叉形线
Pitchfork(叉形线)
| 属性 | 类型 | 说明 |
|---|---|---|
style | Enum | 0=Original,1=Schiff,2=Modified Schiff,3=Inside |
extendLines | Bool | 将所有线延伸至锚点外 |
median | Stroke | 中心(中位)线 |
levels | GroupItems[9] | 平行手柄线(每项可开关) |
fillAlpha | Float | 线间填充不透明度 |
Pitchfan(叉形扇)
| 属性 | 类型 | 说明 |
|---|---|---|
median | Stroke | 中心线 |
levels | GroupItems[9] | 扇形线(每项可开关) |
fillAlpha | Float | 填充不透明度 |
测量工具
InfoLine(信息线)
| 属性 | 类型 | 说明 |
|---|---|---|
stroke.color | Color | 线条颜色 |
stroke.width | Float | 线条宽度 |
stats | Int(位标志) | 显示哪些统计数据:第 0 位=价格区间,1=涨跌幅,2=点差,3=K 线数,4=日期时间范围,5=距离,6=角度 |
statsPos | Enum | 统计标签位置:0=自动,1=左,2=居中,3=右 |
alwaysShowStats | Bool | 未选中时也显示统计数据 |
textStyle | TextStyle | 统计文字外观 |
TrendAngle(趋势角)
| 属性 | 类型 | 说明 |
|---|---|---|
stroke.color | Color | 线条颜色 |
stroke.width | Float | 线条宽度 |
stats | Int(位标志) | 统计标志(位定义同 InfoLine) |
statsPos | Enum | 统计标签位置 |
alwaysShowStats | Bool | 未选中时也显示统计数据 |
PriceRange / DateRange(价格范围 / 日期范围)
| 属性 | 类型 | 说明 |
|---|---|---|
stroke.color | Color | 标尺线颜色 |
stroke.width | Float | 标尺线宽度 |
DateAndPriceRange(日期+价格范围)
| 属性 | 类型 | 说明 |
|---|---|---|
stroke.color | Color | 标尺线颜色 |
stroke.width | Float | 标尺线宽度 |
fill.color | Color | 区域框填充颜色 |
自由绘制
Brush / Highlighter(画笔 / 高亮笔)
| 属性 | 类型 | 说明 |
|---|---|---|
stroke.color | Color | 笔触颜色 |
stroke.width | Float | 笔触宽度 |
量价与 VWAP
VolumeProfileAnchored / VolumeProfileFixedRange
| 属性 | 类型 | 说明 |
|---|---|---|
stroke | Stroke | 轮廓线颜色、宽度、样式 |
AnchoredVwap
AnchoredVwap 同时暴露参数 Tab 和样式 Tab 属性。
参数 Tab(category = Inputs):
| 属性 | 类型 | 说明 |
|---|---|---|
source | Enum | 价格来源:0=收盘价、1=开盘价、2=最高价、3=最低价、4=HL2、5=HLC3、6=OHLC4 |
bandsMode | Enum | 波段计算模式:0=标准差、1=百分比(乘数 1 表示 1%)——带提示说明 |
bands.0 | Enableable<Number> | 波段 1 乘数(最小 0.01,步长 0.5) |
bands.1 | Enableable<Number> | 波段 2 乘数 |
bands.2 | Enableable<Number> | 波段 3 乘数 |
样式 Tab(category = Style):
| 属性 | 类型 | 说明 |
|---|---|---|
stroke | Stroke | VWAP 线颜色、宽度、样式 |
bandStyles.0.upper | Enableable<Stroke> | 波段 1 上轨线 |
bandStyles.0.lower | Enableable<Stroke> | 波段 1 下轨线 |
background | Enableable<Fill> | 波段 1 背景填充 |
bandStyles.1.upper | Enableable<Stroke> | 波段 2 上轨线 |
bandStyles.1.lower | Enableable<Stroke> | 波段 2 下轨线 |
bandStyles.2.upper | Enableable<Stroke> | 波段 3 上轨线 |
bandStyles.2.lower | Enableable<Stroke> | 波段 3 下轨线 |
showPriceLabel | Bool | 在右侧价格轴显示价格标签 |
仓位工具
LongPosition / ShortPosition(多头仓位 / 空头仓位)
| 属性 | 类型 | 说明 |
|---|---|---|
stroke | Stroke | 水平线颜色、宽度、样式 |
fill.color | Color | 盈亏区域填充颜色 |
周期与曲线工具
CyclicLines / SineLine / Curve / DoubleCurve / Arc / Path / GhostFeed
| 属性 | 类型 | 说明 |
|---|---|---|
stroke | Stroke | 线条颜色、宽度、样式 |
TimeCycles(时间循环)
| 属性 | 类型 | 说明 |
|---|---|---|
stroke | Stroke | 线条颜色、宽度、样式 |
fill.color | Color | 周期区域填充颜色 |
杂项
PositionForecast / BarPattern / Sector
| 属性 | 类型 | 说明 |
|---|---|---|
stroke | Stroke | 轮廓颜色、宽度、样式 |
fill.color | Color | 填充颜色 |
形态与艾略特波浪
所有形态(XabcdPattern、CypherPattern、AbcdPattern、HeadAndShoulders、TrianglePattern、ThreeDrivesPattern)和艾略特波浪类型(ElliottImpulseWave、ElliottCorrectiveWave、ElliottTriangleWave、ElliottDoubleCombo、ElliottTripleCombo)只暴露:
| 属性 | 类型 | 说明 |
|---|---|---|
stroke | Stroke | 形态线条颜色、宽度、样式 |