有没有可能在下一根蜡烛的下面和上面打印出之前的最高和最低价格?
我还想知道如何在图表上放置计算值,这是可能的吗?谢谢
study(title = "HiLo Last Candle", shorttitle = "HiLO", overlay=true)
h=high[1]
plotchar(h,text=tostring(h, 0.0),location=location.abovebar) 发布于 2019-04-18 21:05:48
现在还不可能在图表上打印值。
要将计算值放到图表上,用户通常使用研究函数的overlay=true参数:
//@version=3
study(title = "MyStudy", overlay=true)
plot(sma(close, 7))看起来你对这种方法很熟悉。另一种方法是使用plotcandle/plotbar函数“创建”您自己的图表,您可以自己创建条形图:
//@version=3
study(title = "MyStudy")
len = input(title="sma length", type=integer, minval=1, maxval=100, defval=7)
close_sma = sma(close, len)
open_sma = sma(open, len)
high_sma = sma(high, len)
low_sma = sma(low, len)
actual_high = max(close_sma, max(open_sma, max(high_sma, low_sma)))
actual_low = min(close_sma, min(open_sma, min(high_sma, low_sma)))
plotcandle(open_sma, actual_high, actual_low, close_sma, color = close_sma > open_sma ? green : red)发布于 2019-09-12 12:45:19
//@version=4
study("HL of previous bar",overlay=true)
h = label.new(bar_index, na, tostring(high[1]),
color=color.green,
textcolor=color.white,
style=label.style_labeldown, yloc=yloc.abovebar)
label.delete(h[1]) // remove the previous label when new bar appears
l = label.new(bar_index, na, tostring(low[1]),
color=color.red,
textcolor=color.white,
style=label.style_labelup, yloc=yloc.belowbar)
label.delete(l[1]) // remove the previous label when new bar appearshttps://stackoverflow.com/questions/55744426
复制相似问题