Summary
pynesys-pynecore==6.4.8 raises TypeError: 'bool' object is not callable at main-scope barstate.isconfirmed references in PyneComp-emitted strategy scripts, outside request.security.
This reproduces on both cached PyneComp v6.0.31 output and freshly recompiled PyneComp v6.0.33 output. A hand-written minimal @script.indicator using barstate.isconfirmed runs successfully on the same v6.4.8 venv, so the failure appears to be an interaction between the compiled-strategy output shape and the v6.4.6+ AST/module-property transformation pipeline.
Environment
- OS: Windows
- Python: 3.13
- Runtime:
pynesys-pynecore==6.4.8
- Compiler outputs tested:
- Cached PyneComp v6.0.31
- Fresh PyneComp v6.0.33, recompiled 2026-05-24 via
pyne compile --force
Reproduction
Using fresh v6.4.8 runtime:
pyne -w <workdir> run TH_v1_2.py BINANCE_BTCUSDTP_30m_full.ohlcv
pyne -w <workdir> run WW.py BINANCE_BTCUSDTP_30m_full.ohlcv
Observed errors
TH:
File: scripts/TH_v1_2.py:546 in main
if barstate.isconfirmed and bar_index >= 12:
TypeError: 'bool' object is not callable
WW:
File: scripts/WW.py:147 in main
if barstate.isconfirmed:
TypeError: 'bool' object is not callable
Control (proves it's an interaction, not the property itself)
The hand-written minimal script below runs successfully on the same v6.4.8 venv:
from pynecore.lib import barstate, close, plot, script
@script.indicator("barstate minimal")
def main():
plot(1 if barstate.isconfirmed else 0, "confirmed")
Likely cause
The runtime's module-property transformer appears to rewrite barstate.isconfirmed into a call form, but the runtime initializes lib.barstate.isconfirmed = True as a bool in pynecore/core/script_runner.py. That creates a callable/non-callable mismatch for this compiled strategy shape.
This has the same surface symptom as the older request.security subprocess issue, but this repro is outside request.security; the TH/WW scripts do not use HTF security calls.
Suggested resolution
Either:
- Restore backward-compatible handling for compiled strategy references to
barstate.isconfirmed, or
- Change runtime initialization so the AST-transformed call contract receives a callable marker, or
- Document the exact compiler/runtime compatibility boundary if a newer PyneComp output shape is required.
Note: a fresh PyneComp v6.0.33 recompile still reproduces, so "recompile with current PyneSys" did not resolve this in the 2026-05-24 test.
Summary
pynesys-pynecore==6.4.8raisesTypeError: 'bool' object is not callableat main-scopebarstate.isconfirmedreferences in PyneComp-emitted strategy scripts, outsiderequest.security.This reproduces on both cached PyneComp v6.0.31 output and freshly recompiled PyneComp v6.0.33 output. A hand-written minimal
@script.indicatorusingbarstate.isconfirmedruns successfully on the same v6.4.8 venv, so the failure appears to be an interaction between the compiled-strategy output shape and the v6.4.6+ AST/module-property transformation pipeline.Environment
pynesys-pynecore==6.4.8pyne compile --forceReproduction
Using fresh v6.4.8 runtime:
Observed errors
TH:
WW:
Control (proves it's an interaction, not the property itself)
The hand-written minimal script below runs successfully on the same v6.4.8 venv:
Likely cause
The runtime's module-property transformer appears to rewrite
barstate.isconfirmedinto a call form, but the runtime initializeslib.barstate.isconfirmed = Trueas a bool inpynecore/core/script_runner.py. That creates a callable/non-callable mismatch for this compiled strategy shape.This has the same surface symptom as the older
request.securitysubprocess issue, but this repro is outsiderequest.security; the TH/WW scripts do not use HTF security calls.Suggested resolution
Either:
barstate.isconfirmed, orNote: a fresh PyneComp v6.0.33 recompile still reproduces, so "recompile with current PyneSys" did not resolve this in the 2026-05-24 test.