【发布时间】:2022-01-19 03:26:26
【问题描述】:
我有这个脚本:
strategy("My strategy")
var float start_price = na
var float end_price = na
var float[] start_prices = array.new_float(0)
var float[] end_prices = array.new_float(0)
var float p = na
f(x) => math.round(x / 500) * 500
lo = (high + close) / 2
var i = 0
if bar_index == 1
start_price := f(lo)
end_price := f(start_price * 1.015)
else
if close <= start_price
strategy.entry(str.format("Long {0}",i), strategy.long)
array.push(end_prices, end_price)
array.push(start_prices, end_price)
i := i + 1
start_price := start_price - 500
end_price := f(start_price * 1.015)
for j = 0 to (array.size(end_prices) == 0 ? na : array.size(end_prices) - 1)
p := array.get(end_prices, j)
if close >= p
strategy.exit(str.format("Long {0}",j), limit=end_price)
我想控制台/调试/显示start_prices数组中的值
但是我一生都无法弄清楚如何做到这一点,没有console.log或类似的东西。我是一个有点称职的python程序员,但我总是使用print()... 无论如何,人们如何用这种语言进行调试?
【问题讨论】:
标签: arrays debugging pine-script