The Translator Got Better: One Fix, One Script That Used to Fail, Before and After
Your Pine strategy uses strategy.entry(..., when=...) . The converter passes when= through verbatim. The output compiles clean β and dies on the first bar with TypeError: entry() got an unexpected keyword argument 'when' . The fix is four lines of if . This post measures the before and the after, trade for trade.
This is the eighth post in a series where I convert Pine strategies to Python line by line. The last post was about 366 scripts that draw and never plot. This one is about a fix: one family of calls, one script that used to fail, and the check that proves the fixed version means the same thing as the Pine.
The short version.
Before: the converter passed when= through to PyneCore, which has no when parameter on any strategy.* function. The output compiled clean and died on the first bar: TypeError: entry() got an unexpected keyword argument 'when' .
After: the same script converts with zero diagnostics .β¦