繁体   English   中英

如何更改 plotshape 与蜡烛的距离

[英]how to change the distance of plotshape from the candle

我希望能够指定 plotshape 的距离。 我发现这篇文章相关,但那里没有有用的答案。

所以基本上我希望能够指定箭头与蜡烛顶部的距离,所以稍后我能够在蜡烛顶部设置 plot 多个箭头。 举个例子:

在此处输入图像描述

或者

在此处输入图像描述

或者

在此处输入图像描述

我希望最终能够做到这一点

在此处输入图像描述

如果你想为此使用plotshape() ,请将你的location参数设置为location.absolute 然后调整position的价格。

您也可以为此使用labels

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © vitruvius

//@version=5
indicator("My script", overlay = true)

atr = ta.atr(10)
pos1 = high + (1 * atr)
pos2 = high + (2 * atr)
pos3 = high + (3 * atr)
c = barstate.islast

plotshape(c ? pos1 : na , "One", shape.xcross, location.absolute, color.red, 0, "One")
plotshape(c ? pos2 : na , "Two", shape.diamond, location.absolute, color.yellow, 0, "Two")
plotshape(c ? pos3 : na , "Three", shape.square, location.absolute, color.green, 0, "Three")

在此处输入图像描述

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM