### **Describe the bug** The bar evaluated in the `strategy` function is using the value of the next bar in the future. ### **To Reproduce** 1. Create a simple strategy: ```python """ @pyne """ from pynecore.lib import bar_index, open, script, strategy @script.strategy() def main(): if bar_index < 10: print("----------------------------------------") print("bar_index=", bar_index, " open=", open) if bar_index == 3: strategy.entry(id="unique-trade-id", direction=strategy.long) return {} ``` 2. Add a debug print statement in `pynecore/lib/strategy/__init__.py:534`: ```python print('pynecore/lib/strategy/__init__.py:534') print('price=',price, ' h=', h, ' l=', l) ``` 3. Execute the script: `uv run pyne run simple ccxt_kraken_USD_JPY_15` ### **Expected behavior** The strategy should use the value of the current bar. ### **Screenshots** Execution log: <img width="636" height="309" alt="Image" src="https://github.com/user-attachments/assets/63275f3b-b095-4a81-b8cc-a448afe81f22" /> ### **Environment:** - **OS:** macOS - **Version:** 15.5 (24F74) - **Python version:** 3.13 - **How you ran the script:** cli `pyne run` ### **Additional context** version: ``` name = "pynesys-pynecore" version = "6.3.1"
Activity