用于股票交易的修改Pine脚本

问题描述 投票:0回答:1

我对松木脚本一无所知,甚至不知道任何编程语言。

我需要一个指标,该指标通过直方图显示两个不同值之间的指数移动平均值之差。

我试图修改类似的公共指标的脚本,该指标使用直方图来衡量价格和指数移动平均线之间的差异。

原始:] >>

//@version=3
study("My Script")
emaVal = input(12, "EMA Value")
varPrice = input(ohlc4, "Price")
varEMA = ema(varPrice, emaVal)

showEMA = input(false)
showPrice = input(false)
showHistogram = input(true)

output = varPrice - varEMA

plot(showEMA ? varEMA : na, color=blue)
plot(showPrice ? varPrice : na, color=purple)
plot(showHistogram and (varPrice > varEMA) ? output : na, color=green, linewidth=4, style=histogram)
plot(showHistogram and (varEMA > varPrice) ? output : na, color=red, linewidth=4, style=histogram)

我想做什么:

//@version=3
study("Hello")

emaVal = input(60, "EMA 1 Value")
emaVal = input(240, "EMA 2 Value")
varEMA = ema(emaVal, emaVal)


showHistogram = input(true)

output = emaVal2 - emaVal


plot(showHistogram and (emaVal > emaVal) ? output : na, color=green, linewidth=4, style=histogram)
plot(showHistogram and (emaVal2 > emaVal) ? output : na, color=red, linewidth=4, style=histogram)

[请不要惊慌,我只是试图在不完全了解的情况下采用逻辑。有人可以帮助我实现该脚本吗?

奖金问题:

请您链接我可以学习Pine脚本的资源吗?我在Google上进行了搜索,但很多垃圾和试图出售某些东西的人。我通过交易观点尝试了该手册,但我不知道很多单词的含义。

我对松木脚本一无所知,甚至不知道任何编程语言。我需要一个通过直方图显示两个不同值之间差异的指标...

pine-script trading tradingview-api
1个回答
0
投票

好,您两次定义了emaVal(第4行和第5行)...您可能打算在第5行上使用emaVal2

© www.soinside.com 2019 - 2024. All rights reserved.