Skip to content
Discussion options

You must be logged in to vote

Thank you for the report! I've investigated this and it's not a bug - it's the correct Pine
Script behavior.

What's happening

When you call strategy.entry() at bar 3, the order is created but fills on the next bar (bar
4) using bar 4's prices. This matches TradingView exactly.

Why the output looks confusing

The execution order at each bar is:

  1. Process pending orders (fills orders from previous bar)
  2. Run user script (may create new orders for next bar)

So your debug output actually shows:
bar_index= 3 open= 1.0762 # User script at bar 3 (creates order)
pynecore/lib/strategy/init.py:534 # START of bar 4: processes bar 3's order
price= 1.07712 h= 1.0768 l= 1.077 # Using bar 4's values - CORR…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@takumi-miyajima
Comment options

Answer selected by wallneradam
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #31 on August 16, 2025 19:43.