Can I get in the market one bar earlier?
Author: mrsic
Creation Date: 2/14/2021 12:32 PM
profile picture

mrsic

#1
Hello,

i can't see the error, maybe someone can help me.
I mean there is no error in the code (I hope so), but logical error.

I want display the annotate bar, which is fine. But i want see this after current Close and get next day at open into the market. Just one day earlier. See attachment.
CODE:
Please log in to see this code.

Thanks.
profile picture

Eugene

#2
Hello,

You cannot enter on this bar anyhow since the trading system's rules use this bar's close price. Doing otherwise would make the code peek into the future. So issuing an order for the next bar is correct.
profile picture

mrsic

#3
Thanks Eugene.
profile picture

Eugene

#4
You're welcome Damir.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).