fxDreema

    • Register
    • Login
    • Search
    • Back to the main page
    • Categories
    • Recent
    • Tags
    • Popular
    • Search

    Bollinger band EA not firing all signals

    Bug Reports
    5
    25
    5675
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • E
      Eric 0 last edited by

      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

      A 1 Reply Last reply Reply Quote 0
      • A
        ambrogio @Eric 0 last edited by

        @eric-0 show the conditions of your EA

        1 Reply Last reply Reply Quote 0
        • E
          Eric 0 last edited by

          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!

          A 1 Reply Last reply Reply Quote 0
          • A
            ambrogio @Eric 0 last edited by

            @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

            0_1546076975101_Cattura.JPG

            1 Reply Last reply Reply Quote 0
            • A
              ambrogio last edited by

              0_1546077052613_Cattura.JPG

              1 Reply Last reply Reply Quote 0
              • E
                Eric 0 last edited by

                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.

                1 Reply Last reply Reply Quote 0
                • E
                  Eric 0 last edited by

                  Here is a screenshot of missed trades:
                  0_1546095091307_48a59518-3730-4cac-896b-fe63bde54b79-image.png

                  As you can see, the price closed above the upper band in one of the instances.

                  Here is another example:
                  0_1546095213974_ac0813cd-b564-4675-a1b2-f46c1d1eb170-image.png

                  1 Reply Last reply Reply Quote 0
                  • E
                    Eric 0 last edited by Eric 0

                    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.

                    A 1 Reply Last reply Reply Quote 0
                    • A
                      ambrogio @Eric 0 last edited by

                      @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

                      0_1546105679335_Cattura.JPG

                      1 Reply Last reply Reply Quote 0
                      • E
                        Eric 0 last edited by Eric 0

                        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.

                        1 Reply Last reply Reply Quote 0
                        • E
                          Eric 0 last edited by

                          (I don't know if you maybe have a practical solution to overcome this obstacle?)

                          A 1 Reply Last reply Reply Quote 0
                          • A
                            ambrogio @Eric 0 last edited by

                            @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

                            1 Reply Last reply Reply Quote 0
                            • E
                              Eric 0 last edited by

                              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.

                              1 Reply Last reply Reply Quote 0
                              • E
                                Eric 0 last edited by

                                (Although the example I just gave you is on a moving average, the principle is the same as with bollinger bands)

                                1 Reply Last reply Reply Quote 0
                                • E
                                  Eric 0 last edited by

                                  0_1546113151697_d1e7f364-afd9-4c09-9bd6-08517ea70c51-image.png

                                  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.

                                  A 1 Reply Last reply Reply Quote 0
                                  • A
                                    ambrogio @Eric 0 last edited by

                                    @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

                                    1 Reply Last reply Reply Quote 0
                                    • E
                                      Eric 0 last edited by

                                      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.

                                      A 1 Reply Last reply Reply Quote 0
                                      • A
                                        ambrogio @Eric 0 last edited by

                                        @eric-0 it may be that the administrator @fxDreema has a better explanation

                                        1 Reply Last reply Reply Quote 0
                                        • E
                                          Eric 0 last edited by

                                          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.

                                          A 1 Reply Last reply Reply Quote 0
                                          • A
                                            ambrogio @Eric 0 last edited by

                                            @eric-0 I tagged him above, he should see

                                            1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 1 / 2
                                            • First post
                                              Last post

                                            Online Users

                                            H
                                            R
                                            A

                                            9
                                            Online

                                            146.7k
                                            Users

                                            22.4k
                                            Topics

                                            122.6k
                                            Posts

                                            Powered by NodeBB Forums | Contributors