B004
strategy property set twice
Severity Error
The same property appears twice in the strategy declaration. Only one value can be in effect, and the Strategy Tester’s Properties tab has to show which one.
Remove one of the lines.
Failing example
script "Breakout"
strategy (
initialCapital = 10_000.0
commission = commission.percent(0.04)
commission = commission.percent(0.055)
)
data chart = subscribe(data.ohlcv)
state prevHigh: float? = null
on chart.close {
if chart.close > prevHigh {
strategy.entry("Break", direction.long)
}
prevHigh = ta.highest(chart.high, 20)
}Fixed example
script "Breakout"
strategy (
initialCapital = 10_000.0
commission = commission.percent(0.055)
)
data chart = subscribe(data.ohlcv)
state prevHigh: float? = null
on chart.close {
if chart.close > prevHigh {
strategy.entry("Break", direction.long)
}
prevHigh = ta.highest(chart.high, 20)
}