繁体   English   中英

如何向该指标添加另外两种货币?

[英]how to add two more currencies to this indicator?

//@version=5
////////////////////////////////////////////////////////////
//  NISMO BINARY MONSTER GT
////////////////////////////////////////////////////////////
indicator(title='NISMO BINARY MONSTER GT', precision=2)
input_barwidth = input(4, title='Bar Width')
input_percentorprice = input(false, title='Price Change')
input_abs = input(false, title='Abs. Value')
input_barsback = input(1, title='Look Back')
hline(0, color=color.blue, linestyle=hline.style_solid)
xPrice = close
xPrice1 = 0.0
xPrice1 := input_percentorprice ? xPrice - xPrice[input_barsback] : (xPrice - xPrice[input_barsback]) * 100 / xPrice[input_barsback]
colorg = xPrice1 < 0 ? color.red : color.green
xPrice1 := input_abs ? math.abs(xPrice1) : xPrice1
plot(xPrice1, color=colorg, style=plot.style_histogram, linewidth=input_barwidth, title='Change')

我想以不同的颜色向该指标添加另外两种货币以进行比较,以便您可以比较条形图。 我怎样才能做到这一点? 我是新手,所以请帮忙。

您需要使用安全function 从其他代码获取数据。

您可以请求开盘价、收盘价、最高价、最低价(或任何其他变量)和 plot 如果您正在寻找它们。

下面的代码 rqeuests 来自纽约证券交易所的closeNYSE:IBM股票代码。

//@version=4
study("Example security 1", overlay=true)
ibm_close = security("NYSE:IBM", timeframe.period, close)
plot(ibm_close)

暂无
暂无

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

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