fxDreema

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

    Line cross entry EA to close trade if the lines uncross

    Questions & Answers
    4
    24
    13673
    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.
    • J
      Johntyr last edited by

      Hi all,

      I have a straight forward line cross EA that opens and closes trades when 2 lines cross.

      Occasionally a line cross will momentarily occur, thus triggering a trade and then the lines uncross and continue in the original direction. This leaves an open trade running in the wrong direction.

      I would like the trade to close if the lines uncross. Can anyone offer any suggestions how I may achieve this?

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

        @johntyr Two quick questions. Are those lines created manually or with a custom indicator? Are those lines trending or horizontal lines? They cannot be horizontal if they cross each other.

        (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.

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

          @l-andorrà They are 2 different cci lines (one fast, one slow) in a custom indicator in window. When they cross a trade is entered. But being fluid the fast line can cross occasionally and then uncross. I need to close if the lines uncross. I can not find anything to help do this, for example as in the' indicator appear', 'indicator disappear' blocks.

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

            @johntyr When you say 'uncross' do you mean crossing first and then uncrossing later? If so, what's the point of that?

            (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.

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

              Hi @l-andorrà , thanks for getting back. The line will cross the other momentarily on the same candle, long enough to trigger a trade, and then flick back to uncrossed again.

              If the price then continues in it's original direction a bad trade has occurred. I would like to close this trade immediately the line becomes uncrossed to try minimise the loss.

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

                @johntyr This raises anew problem. I don't know how to find two lines are crossed in fxDreema. An interesting question. Does anyone know?

                (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.

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

                  @l-andorrà This example explains what I mean. The line crosses, triggers a buy trade (as in the condition block attached) and then uncrosses. Crosses are not visible in the picture because of the line repainting.
                  When the uncross happens, I would like to do something, either close the false trade or reverse.
                  I cannot find anything in FxDreema to do this. A solution or any other suggestions are welcome.

                  0_1622802172488_9a8a0a34-4576-44b3-9596-26a81ead7967-image.png

                  0_1622801296557_ecd5c77e-2c4c-49cc-aa0a-707f4e068473-image.png

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

                    @johntyr You can use a boolean true/false and what for: a) a 'true' crossing, then if b) a 'false' happens within he same candle you can identify there was an uncrossing there.

                    (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.

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

                      @l-andorrà , Thank you, I did not give that approach a thought. I will set it up and let you know how it goes.

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

                        @johntyr Sure. Just share your results here, please.

                        (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.

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

                          Hi @l-andorrà , I have been trying to do what you suggested, not getting very far. I cannot yet get it to work. Project attached:

                          https://fxdreema.com/shared/JBMSxChyb

                          Am I heading in the right direction. Also I do not know how to make sure the actions happen within the current only. Your further help appreciated. Thanks.

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

                            @johntyr I don't understand wht a boolen and a numeric variables are used. They should be exactly the same one. Blocks 13 and 5 can be boolean too. There is no need to create a numeric variable then.

                            (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.

                            J 2 Replies Last reply Reply Quote 0
                            • J
                              Johntyr @l'andorrà last edited by

                              @l-andorrà Thank you. Sorry, typo, they were meant to be boolean. https://fxdreema.com/shared/NOD9Dzj9e . This des not not work as is, what do I need to change?

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

                                @l-andorrà 0_1623771399798_a84d2be4-f41f-41c6-850c-a14d89cde675-image.png

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

                                  @johntyr I forgot to ask what happens if more than one crossing/uncrossing happens before the candle is closed? Are ALL uncrossings considered?

                                  (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.

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

                                    @l-andorrà Thank you for getting back to me again. All crossings/uncrossings need to be considered. The most I have seen is about 3, which is tolerable.

                                    If possible they should be filtered but first things first. If I can get the reversals happening then I can then try filtering trades later.

                                    The main goal is to stay in the trade with the trend till it gives another reversal. As in the example above the move was correctly entered and moved 800 pips but all of that was a loss because of the pullback and false signal at the beginning.

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

                                      Can anyone help

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

                                        @johntyr Sorry, I forgot to reply. I recommend you the following (I used another indicator because I don't have yours):

                                        0_1624523150506_01.png

                                        Every time a crossing happens, the variable will add +1. If the variables moves from 0 to 1, that means there was 1 crossing, if it moves to 2 this means there was an uncrossing. Then toy can select another condition block to specufy how many 'uncrossings' you need.

                                        Obviously you will need to reinitialize the variable to zero when necessary.

                                        (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.

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

                                          Hi @l-andorrà , Thank you for getting back to me. I tried both your suggestions, true/false variables, and the crossing counter variables, and I am getting no where fast. I have attached both attempts. Obviously I am doing something critically wrong as I cannot get either to work. Can you point out the errors I am making. Once again, your help is very much appreciated.

                                          https://fxdreema.com/shared/rmiYadMPb

                                          XYON126 L 2 Replies Last reply Reply Quote 0
                                          • XYON126
                                            XYON126 @Johntyr last edited by XYON126

                                            Hi @johntyr! I have looked at your code and from my experience I see that you close with the closing block and option BUY or SELL, if in addition to this you differentiate the groups, you may function since the orders will be exclusive, since you do not have your indicator I have not been able to do tests but In the main blocks (57.58.59.60) in the group filter you give it a number identifying them that will also serve as a recurring filter. I hope I have helped you something. 😉

                                            Ah! Important point, although fxDreema has the option of crossing lines from top to bottom and quite the opposite, it is very important to know that since it is based on MQL4 / 5 in MQL4 / 5 there are no crosses, to make or identify a cross what is done is:

                                            1. Identify a line and ask if it is greater or less than the other line (refers to price).
                                            2. idem to the above.
                                              With this, MQL knows that one line or curve is above the other, now you have to do the same but asking if the upper line or curve is now lower and the opposite with the other. This is what in MQL identifies a cross, as you can see it is a bit chaotic and the problem is when both are in a vertical point, Mql does not recognize them and it is when it gives you a false Yes or No, this must be taken into account. since for your case you should also give width to the crossing area indicating how many candles there must be in one crossing or another.
                                            1 Reply Last reply Reply Quote 1
                                            • 1
                                            • 2
                                            • 1 / 2
                                            • First post
                                              Last post

                                            Online Users

                                            M
                                            R
                                            G
                                            T
                                            G
                                            Y
                                            C
                                            S
                                            S
                                            S
                                            A

                                            21
                                            Online

                                            146.7k
                                            Users

                                            22.4k
                                            Topics

                                            122.6k
                                            Posts

                                            Powered by NodeBB Forums | Contributors