fxDreema

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

    Multiple conditions in parallel (OR condition) for BUY orders

    Questions & Answers
    4
    11
    2882
    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.
    • L
      leventecsibi last edited by leventecsibi

      Hi there,

      I've been struggling with this for quite a while and just couldn't get my head around what's going on here. I'm building an EA which is using the CCI indicator. When a BUY trade is opened, my EA should continuously monitor the values of the CCI: when CCI falls below a specified constant, the trade should be closed.

      Let's suppose these constants are 75, 50, and 25. This means the EA would close the BUY trade the very moment CCI falls below 75, 50, or 25 the first time. If the upward trend is strong, CCI will rush up to approximately 100 and as the bullish momentum is fading away, CCI will reach 75 from above, thus activating the exit condition. In the case of a somewhat weaker bullish trend, CCI might rebound around 65 and reaching 50 from above, thus activating the second exit condition. The third exit condition (for CCI=25) is analogous.

      As you can see in the attached image, my idea was setting up an If Trade condition on top which is set to only detect if the trade is a BUY order, and then having the three conditions in parallel, i.e. as OR conditions. However, to my surprise, this didn't work out as I expected. Instead, only the rightmost (third) condition was activated to close the trades every time. Thus the EA doesn't seem to detect CCI passing through +75 from above and CCI passing through +50 from above.

      I included the settings of each of my blocks too to give you a better understanding of what I'm facing.

      Have you encountered this before? Am I wrong in my logic somewhere? Is there any other way you would solve this?

      Thank you so much for your help!

      0_1585769387720_867ea90e-974c-4411-ab10-5ce7ddc6d5fa-image.png

      1 Reply Last reply Reply Quote 0
      • J
        josecortesllobat last edited by

        @leventecsibi

        You will have to see if you have set the CANDLE ID in the "Condition" block in order to specify in which candle the condition must to be checked out.

        https://fxdreema.com/instructions/builder/indicators#3

        1 Reply Last reply Reply Quote 0
        • L
          leventecsibi last edited by leventecsibi

          Hi @josecortesllobat

          Thank you for your answer. Honestly, I don't see how that might affect my conditions and result in only the last one out of the three being evaluated but I'm yet a beginner in fxdreema so it might be that I overlooked something. 🙂

          Here's a screenshot of the Condition block's settings. All the others are identical except for the threshold values (75, 50, 25).

          0_1585818148711_e55b6e54-df9b-4260-a9e0-44119249cc7f-image.png

          1 Reply Last reply Reply Quote 0
          • L
            leventecsibi last edited by leventecsibi

            Well, I was tinkering quite a bit by now and when I change all Candle ID values to 1, it does work. However, this implementation now differs from my original objective. I want to close the trade immediately when the CCI falls below 75 (or 50 or 25). Forcing the EA to only exit the trade after the candle is closed involves an unnecessary risk and an increase in drawdowns.

            Here's an example to best describe why I wanted the Candle ID = 0, and how setting its value to 1 might hurt my trade:

            Let's imagine a bullish trend gradually building up. My EA joins the bullish trend at some point, the value of the CCI is constantly increasing and is now somewhere in the range 80-90. Then, a sudden bearish sentiment breaks the trend and a long bearish candle appears, pushing down the CCI from, say, 85 to a mere 70. Ideally, I would want to exit the very moment CCI reaches 74.999 as that's my signal that the bearish momentum has weakened. However, with Candle ID set to 1, my EA is forced to wait until the end of the candle and face an already-too-low CCI and an already-too-low price value when closing the trade.

            I hope it is clear. Does anyone have any suggestions on how to overcome this?

            @fxdreema, is this implemented?

            S 1 Reply Last reply Reply Quote 0
            • J
              josecortesllobat last edited by josecortesllobat

              Candle 0 is still being formed. So the indicators values might change as well.

              https://fxdreema.com/instructions/builder/crossover

              L 1 Reply Last reply Reply Quote 0
              • S
                seb 0 @leventecsibi last edited by

                @leventecsibi
                This is one of the simplest way : https://fxdreema.com/shared/MxS8fjy5

                L 1 Reply Last reply Reply Quote 1
                • L
                  leventecsibi @josecortesllobat last edited by

                  @josecortesllobat

                  Yes, I know that. But that's the point. If the currently forming indicator falls below 75 at any point, I want out of the trade because that's enough signal for me that the trend has probably weakened.

                  It seems this can't be done via the terminal though. I'm wondering what else options I might have to solve this.

                  1 Reply Last reply Reply Quote 0
                  • l'andorrà
                    l'andorrà last edited by l'andorrà

                    You can alway try this, but results can be very weird:

                    0_1585848006876_01.png

                    (English) I will try to help everyone in these fxDreema forums. But if you want to learn how to use the platform in depth or more quickly, I can help you with my introductory fxDreema course in English at https://www.theandorraninvestor.eu.

                    (Català) Miraré d’ajudar tothom en aquests fòrums d’fxDreema. Tanmateix, si vols aprendre a fer servir la plataforma amb més profunditat o més de pressa, t’hi puc ajudar amb el meu curs d’introducció a fxDeema en català a https://www.theandorraninvestor.eu/ca.

                    (Español) Intentaré ayudar a todo el mundo en estos foros de fxDreema. Sin embargo, si quieres aprender a usar la plataforma en profundidad o más deprisa, te puedo ayudar con mi curso de introducción a fxDreema en español en https://www.theandorraninvestor.eu/es.

                    S 1 Reply Last reply Reply Quote 0
                    • S
                      seb 0 @l'andorrà last edited by

                      @l-andorrà
                      Are you sure 😛 the CCC indicator isn't plotted on the main window

                      1 Reply Last reply Reply Quote 0
                      • l'andorrà
                        l'andorrà last edited by

                        Ooops, you're right! XD

                        (English) I will try to help everyone in these fxDreema forums. But if you want to learn how to use the platform in depth or more quickly, I can help you with my introductory fxDreema course in English at https://www.theandorraninvestor.eu.

                        (Català) Miraré d’ajudar tothom en aquests fòrums d’fxDreema. Tanmateix, si vols aprendre a fer servir la plataforma amb més profunditat o més de pressa, t’hi puc ajudar amb el meu curs d’introducció a fxDeema en català a https://www.theandorraninvestor.eu/ca.

                        (Español) Intentaré ayudar a todo el mundo en estos foros de fxDreema. Sin embargo, si quieres aprender a usar la plataforma en profundidad o más deprisa, te puedo ayudar con mi curso de introducción a fxDreema en español en https://www.theandorraninvestor.eu/es.

                        1 Reply Last reply Reply Quote 0
                        • L
                          leventecsibi @seb 0 last edited by

                          Hi @seb-0 , thanks a ton, I finally had time to check it out and it works perfectly. I also learned some new practices from your code (I'm still a newbie), so thank you for that as well!

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

                          Online Users

                          K
                          M
                          B
                          A
                          C
                          A

                          19
                          Online

                          146.7k
                          Users

                          22.4k
                          Topics

                          122.6k
                          Posts

                          Powered by NodeBB Forums | Contributors