Issues with Once per bar
-
I am having some issues with "Once per bar" block. I am not sure if this is a bug or I am doing something incorrectly.
This is what I am trying to do:
Whenever a new H4 candle bar opens, I have a condition to check if the previous bar was a "Bull" or a "Bear. I do this by comparing the Open and Close price of Candle(1) I believe this is the right way to do this since Candle(0) is the current candle that might have just opened. I do not know what is going on but it works sometimes and does not work sometimes. Any ideas of such a behavior or if I can try something else to get the same result?
-

-

-
It depends on the context and the whole structure. Can you please share your project?
-
Thanks for your reply. Can you please explain what you mean by depends on the context? here is the full blocks screenshot. I just added the alerts block to see if I get those alerts to validate even if the Condition block is running.
-

-
Place the "Once per bar" block between the Condition block and the other blocks. I'm unsure of the need to place it before the condition block as I assume it is the deleting of orders and creating of new orders that you want to only happen once per bar. If so, it doesn't matter how often the Condition block passes as long as the subsequent actions only happen once per bar.
-
@bluemoon Are working the condition blocks on candle ID 0? If so I recommend you to change them to candle ID 1.