是否有一个在pine脚本上设置的选项,以便在提交新的订单命令时,它会取消之前未完成的命令? if secondbuycond and firstbuycond and (time >= testPeriodStart and time <= testPeriodStop)
strategy.entry("buy", strategy.long, stop=((valuewhen(firstbuycond,open,0))*x))
strategy.exit("Trailing Stop", "buy", trail_
我只是想知道如何将Python ()函数转换成PineScript代码。我的解释正确吗?
Pine脚本示例如下:
plot(dev(close, 10))
// the same on pine
pine_dev(source, length) =>
mean = sma(source, length)
sum = 0.0
for i = 0 to length - 1
val = source[i]
sum := sum + abs(val - mean)
dev = sum/length
plot(pine_dev(c
每个人可能都知道"Transp = is deprecated“,我知道如何重写color.new并重新编码这部分。 然而,在pine脚本的不同部分中,我看到了"transp = lines? 0: 100“,它允许在脚本中操纵颜色和滑块。 谁能告诉我在哪里可以找到如何重写pine脚本的这一部分? 提前谢谢你 下面是新旧代码显示的图片(旧的是彩色的和可选的,新的是黑白的) Old #1 Old #2 New just BW
我需要以与Pine脚本相同的方式计算ATR,即交易视图代码。我说的是股票或外汇技术分析中的平均真实范围指标。在Pine脚本中的文档中,says是这样计算的:
plot(rma(close, 15))
// same on pine, but much less efficient
pine_rma(x, y) =>
alpha = y
sum = 0.0
sum := (x + (alpha - 1) * nz(sum[1])) / alpha
plot(pine_rma(close, 15))
RETURNS
Exponential moving averag
我有这个pine3交易视图脚本,我用电视转换器把它转换成pine 4。
然而,当我在转换后执行它时,我会收到这个错误。
line 110: Variable 'results' was declared with 'series[integer]' type. Cannot assign it expression of type 'series[float]'.
怎么解决这个问题?
我是Pine脚本的新手,我编写了一个在某些条件下打开头寸的策略,问题是这些条件经常发生,所以交易一个接一个地打开,而第一个没有关闭。我想放一个过滤器,防止我打开一个职位,如果我已经打开一个。这个函数看似微不足道,但由于某种原因,我无法让它工作,在进入strategy.opentrades之后,图表中不再有打开的交易。
你能帮我一下吗?
strategy.opentrades == 0
strategy.order("buy", true, 1, when = MeanPrcDev50<-LimitX and MeanPrcDev100<-LimitX and
M
我想做一个脚本来做以下工作:
我有file_ori.txt,它的内容是这样的(数字只是行号,而不是实际文本)
1 This is test line with random text
2 This is also a line with lalala text
3 This is that and this and that of a line
4 start sequence
5 This isn't also a line with lalala text
6 This is test line with random text
7 This is also a line with