“Is bar open” function not working properly
I have created an ea to place stop orders at the beginning of the bar if a series of rules are ocurring. The problem is that the “is bar open” function is not working properly, filtering out the trades. If I place the ea on my chart and my rules are happening, the ea will open orders regardless if the bar is at the middle of life.
Please help me look into this.
I need to place trades with this bot when I´m away from my computer.
Your EA only takes one trade, because once it enters a position, the NoRepetition rule assigns Norepvar = 1. Then the GoLong and GoShort rules will not trade when that variable equals 1.
If you are assigning the value to the variable norepvar = 1 when the market is long or short, you need to assign the variable back to 0 when the market is flat. Otherwise, once one order is placed and the market is not flat anymore, then that variable of norepvar will always be 1 and then no trade will be taken again. So put in the THEN statement to Assign Variable = 0 when it is not in any market psotion.
But to be honest, this rule is not needed. The condition you have int he rule of Market = flat already does this, meaning you are not in any trades. So the rule of norepition, it is giving the same condition ensuring that you are not in any trades. I would suggest removing it. But if I am not understanding its true purpose, please let me know and explain what your trying to do with it.
Viewing 2 posts - 1 through 2 (of 2 total)