Bar shift issue, why this happen?
Federico Libra: Why this happen?
Use the debugger or print out your variables, including _LastError and prices and find out why. Do you really expect us to debug your code for you?
Code debugging - Developing programs - MetaEditor Help
Error Handling and Logging in MQL5 - MQL5 Articles (2015)
Tracing, Debugging and Structural Analysis of Source Code - MQL5 Articles (2011)
Introduction to MQL5: How to write simple Expert Advisor and Custom Indicator - MQL5 Articles (2010)
In the first code the condition open_b is verified, in the second never. The only difference is the bar shift, I need one more condition on the 0 bar so I incremented the bar by 1. Why this happen?