如何查看正在计算的 pine 编辑器的值
How to see what value is being calculated pine Editor
我有以下脚本运行打算在交易开始 4 天后关闭交易。
TimeDiff = time - time[1]
MinutesPerBar = TimeDiff / 60000
//calcuates how long one bar is in minutes
BarsSinceSwingLongCondition = barssince(SwingLongCondition)
// Calculates how many bars have passed since open of trade
CurrentSwingTradeDuration = BarsSinceSwingLongCondition * MinutesPerBar
//calculates the duration that the trade has been opened for (minutes*number of bars)
MaximumSwingTradeDuration = 4*1440
// Sets maximum trade duration. Set at 4 Days in minutes
SwingLongCloseLogic3 = CurrentSwingTradeDuration > MaximumSwingTradeDuration
// Closes trade when trade duration exceeds maximum duration set (4days)
但是当我 运行 策略时关闭逻辑没有执行,因为我的交易开放时间超过最大持续时间。
有什么方法可以查看公式的每个元素计算的值,以便我可以看到错误在哪里(我怀疑它可能是时间元素)。或者谁能看出我的代码哪里出错了?
我有以下脚本运行打算在交易开始 4 天后关闭交易。
TimeDiff = time - time[1]
MinutesPerBar = TimeDiff / 60000
//calcuates how long one bar is in minutes
BarsSinceSwingLongCondition = barssince(SwingLongCondition)
// Calculates how many bars have passed since open of trade
CurrentSwingTradeDuration = BarsSinceSwingLongCondition * MinutesPerBar
//calculates the duration that the trade has been opened for (minutes*number of bars)
MaximumSwingTradeDuration = 4*1440
// Sets maximum trade duration. Set at 4 Days in minutes
SwingLongCloseLogic3 = CurrentSwingTradeDuration > MaximumSwingTradeDuration
// Closes trade when trade duration exceeds maximum duration set (4days)
但是当我 运行 策略时关闭逻辑没有执行,因为我的交易开放时间超过最大持续时间。
有什么方法可以查看公式的每个元素计算的值,以便我可以看到错误在哪里(我怀疑它可能是时间元素)。或者谁能看出我的代码哪里出错了?