Bollinger band EA not firing all signals
-
Hi guys!
I built a Bollinger band EA that needs to execute trades when the price dips below the bottom band in the current candle. For some reason, the EA only takes some of the signals. I can't understand why.
Maybe someone has a tip or explanation for me, please?
Eric -
@eric-0 show the conditions of your EA
-
Here is the EA: https://fxdreema.com/shared/cGHzLEbSc
The first block is 'No Trade'
2nd block is 'Once per bar'
Then it splits into two columns - one for buy and one for sell
1st block in the buy column: condition that checks when the current market price dips below/equal to the lower Bollinger band (standard bollinger band settings)
1st block in sell column: checks for price above/equal to upper bollinger band
2nd block in buy column: buys when the preceding blocks are true
2nd block in the sell column: sells when the preceding blocks are true.Thanks for your attention!
-
@eric-0 when you put the condition "no trade buy or sell", if there is an open buy order your expert does not open the trade sell even if the condition is reached
then divide the "no trade" block, try this
-

-
Thanks for your help and suggestions, Ambrogio.
The issue is not the 'trade overlap', though. There is some other obscure reason for some trades not being opened. When I get home I will send you a screenshot. I will also follow your advice with splitting the buy/sell signals. Thanks for that handy tip.
-
Here is a screenshot of missed trades:

As you can see, the price closed above the upper band in one of the instances.
Here is another example:

-
I just noticed that sometimes the EA doesn't open the trade before the candle closes. But when there was a short trade running that hit its stop loss above the upper band, the next short trade is executed immediately without waiting for the candle to close. Very strange. Do you think this could be a problem with the MT4 backtester? Perhaps this problem will not exist with demo/live trading.
-
@eric-0 sorry, I had not seen this error, all the indicators work on closing the previous candle (except fractal and someone else), so the "candle ID" box must be set to 1

-
Are you saying that it is not possible to generate a buy or sell signal with price data of the current candle with the bollinger indicator? Because that is actually what I would like to achieve. I am aware of the candle ID function. That is why I put zero in those boxes to open trades when the price touches the bollinger band's upper/lower bands.
-
(I don't know if you maybe have a practical solution to overcome this obstacle?)
-
@eric-0 this is not an obstacle, it is science of mathematics :
if I ask you how big is the current candle? you do not have answers because no has yet formed, it does not exist, so no candle no value of the indicator
in the current candle you definitely have the values of the bands referred to the candle 1, or candle 2 , 3 ecc -
I understand what you're saying. But with a candle that isn't closed yet, the bollinger band indicator displays values of the upper and lower bands based on the current market price which is used for the calculation. So what I'm saying is that although the candle has not closed yet, MT4 calculates the current bollinger values on the current market price which acts as the close price of the candle, even though it hasn't closed yet.
To give you an example, I built an EA that doesn't use a take profit, but it closes the trade when the price breaches the 5-period moving average of the current daily candle. When you backtest this strategy, you can actually see how the EA uses the MA value of the current candle, even though the candle is not closed yet. So, this EA effectively uses candle number zero for its calculations.
-
(Although the example I just gave you is on a moving average, the principle is the same as with bollinger bands)
-

In this screenshot, you can see that the crosshair is on the current candle (which has not closed yet) and this displays the current values in the data window. So here you can see that the price is currently above the current value of the upper bollinger band. So this would have triggered a sell trade, even though the candle has not yet closed yet.
-
@eric-0 but you can see doing the backtest of the indicator, that on the ID0 candle the price moves continuously and even the bands do it all the time, so you have opened this thread, sometimes the order is taken sometimes not
-
I understand that the price could sometimes 'miss' the upper/lower band because itself and the bands move all the time. But the fact of the matter is, that when the price is actually above the upper band or below the lower band, a trade needs to take place every time (if all other criteria are met, obviously). And that is the problem, this is not happening.
So that tells us that there is a program error in that the candle ID0 setting is not performing its function like it should be doing. Like I mentioned to you earlier, I have built other robots using candle ID0 that work 100% every time.
-
-
Okay, I also thought of asking him. I'm new on the forum, how can I contact him?
And I really appreciate your efforts and help. Thanks a lot. -
@eric-0 I tagged him above, he should see