B011
leverage out of range
Severity Error
leverage must lie between 1 and 125. Values below 1 are not leverage, and values above 125 exceed what any supported venue offers. Leverage determines the margin used per position and, with marginCall = true, where the emulator liquidates.
Choose a value from 1.0 to 125.0.
Failing example
script "Degen mode"
strategy (
initialCapital = 1_000.0
leverage = 200.0
)
data chart = subscribe(data.ohlcv)
on chart.close {
if chart.close > chart.open {
strategy.entry("Long", direction.long)
}
}Fixed example
script "Degen mode"
strategy (
initialCapital = 1_000.0
leverage = 20.0
)
data chart = subscribe(data.ohlcv)
on chart.close {
if chart.close > chart.open {
strategy.entry("Long", direction.long)
}
}