如何将形状垂直放置在条形上方 5 倍?
How can I place a shape 5 times vetically above a bar?
我想展示一个形状,它垂直持有一个形状 5 次,您可以在图像中看到它。有没有人可以建议如何在松脚本中做到这一点?
我已将形状标记为三角形
这段代码展示了实现效果的不同方法:
//@version=4
study("Lift text", "", true)
// Use U+200E (Decimal 8206) as a non-printing space after the last "\n".
// The line will become difficult to edit in the editor, but the character will be there.
// You can use https://unicode-table.com/en/tools/generator/ to generate a copy/pastable character.
plotshape(true, "", shape.arrowup, location.abovebar, color.green, text="A")
plotshape(true, "", shape.arrowup, location.abovebar, color.lime, text="B\n")
plotshape(bar_index % 2 == 0, "", shape.arrowdown, location.belowbar, #00000000, text="▼\n▼\n▼\n▼\n▼", textcolor = color.red)
plotchar(bar_index % 2 == 1, "bar_index % 2 == 0", "", location.belowbar, text = "▲\n▲\n▲\n▲\n▲\n")
在编辑器中,FAQ 中的代码应如下所示,红色方块表示 Unicode 白色 space 字符。
我想展示一个形状,它垂直持有一个形状 5 次,您可以在图像中看到它。有没有人可以建议如何在松脚本中做到这一点?
我已将形状标记为三角形
这段代码展示了实现效果的不同方法:
//@version=4
study("Lift text", "", true)
// Use U+200E (Decimal 8206) as a non-printing space after the last "\n".
// The line will become difficult to edit in the editor, but the character will be there.
// You can use https://unicode-table.com/en/tools/generator/ to generate a copy/pastable character.
plotshape(true, "", shape.arrowup, location.abovebar, color.green, text="A")
plotshape(true, "", shape.arrowup, location.abovebar, color.lime, text="B\n")
plotshape(bar_index % 2 == 0, "", shape.arrowdown, location.belowbar, #00000000, text="▼\n▼\n▼\n▼\n▼", textcolor = color.red)
plotchar(bar_index % 2 == 1, "bar_index % 2 == 0", "", location.belowbar, text = "▲\n▲\n▲\n▲\n▲\n")
在编辑器中,FAQ 中的代码应如下所示,红色方块表示 Unicode 白色 space 字符。