【发布时间】:2020-06-12 17:08:35
【问题描述】:
我对 pine 脚本一无所知,我什至不知道任何编程语言。
我需要一个指标,通过直方图显示两个不同值指数移动平均线之间的差异。
我尝试修改类似公共指标的脚本,该指标使用直方图衡量价格和指数移动平均线之间的差异。
原文:
//@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 脚本的资源吗?我在谷歌上搜索,但有很多垃圾和试图卖东西的人。我通过交易视图尝试了手册,但我不知道很多单词的含义。
【问题讨论】:
标签: pine-script trading