PyneComp v6.0.80: more published Pine scripts now convert and compile cleanly, and inputs…
Fixes
- A global
x := input.*()orx += input.*()always ran with its default value and ignored your settings. It now reads your setting, andxkeeps its earlier value until the reassignment. - Scripts with an unused helper function no longer fail to compile with a type error such as “The branches of ‘?:’ have incompatible types”. TradingView doesn’t report these either.
- Converting older scripts no longer fails on a v4
for while = 0 to nloop, a line that ends in a comparison operator (v >), or legacykagi(...)calls. - Converted scripts no longer contain a typeless
nain bool positions (array.new_bool(n, na), bool parameters, bool reassignments) or a bare pivot used as a condition (if ph), both of which v6 rejects. - Calls that repeat an argument by name, such as
input.int(7, "A", title = "B"), now convert for every built-in, not only a handful.strategy.close("L", cond, comment = c)keeps itscomment. - A local variable next to a parenthesized expression is no longer renamed to
ta.dev, and a bool cast in one function no longer leaks into the values of another. - A
switchwith itsdefaultbranch on its own line no longer crashes the conversion, and its layout now matches TradingView’s. for k in m.keys()no longer typeskas the map’s value type.- In the editor, a reference to a variable no longer points at the wrong place in the script.