fxDreema

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

    New option to my EA. Help required.

    Questions & Answers
    3
    14
    3345
    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.
    • isp00rt
      isp00rt last edited by

      Hi all,

      I successfully created this semiautomatic EA designed to partially close a trade when the TP is reached, then the SL is moved to break even and finally the EA itself is terminated. Lot size, price level (pending order only) and TP/SL distances are manually inserted.

      https://fxdreema.com/shared/5nQEv0R9e

      I want to add a new feature but I don't know how to deal with it. When I designed it I didn't take into account a situation that happened to me recently. When the price reaches the SL before having reached the TP, a new trade is immediately launched but I don't want that to be done. I would like the EA is terminated when that situation is done.

      I tried to use the "For each closed trade" globe, but it doesn't work. A new trade is launched and the EA is terminated immediately after!

      Any suggestion?

      1 Reply Last reply Reply Quote 0
      • fxDreema
        fxDreema last edited by

        Your project has all input parameters to 0, so instead of putting pending orders it gives tons of errors. I don't want to assume what your input parameters are. There is also no real TP.

        But be careful in "pips-away from the open price" block. This block can behave very differently with different settings. The first parameter is described (click on its title). "Pips away" is also important, its value can be positive, or negative if you want to detect movement in the other direction (when the price is going towards SL).
        Also "Open price belongs to" is important when the block is working with trade that was result from partial close or it was added to another trade.

        Look for errors! Again, this EA doesn't work for me, but not because of the way blocks are connected.

        isp00rt 1 Reply Last reply Reply Quote 0
        • M
          miro1360 last edited by

          0_1485567375040_upload-ea1f0901-bc94-4a81-8600-6e8814bb378d

          Between trading and gambling is a very small gap, be careful.

          isp00rt 1 Reply Last reply Reply Quote 0
          • isp00rt
            isp00rt @fxDreema last edited by

            @fxDreema

            @fxDreema said in New option to my EA. Help required.:

            Your project has all input parameters to 0, so instead of putting pending orders it gives tons of errors. I don't want to assume what your input parameters are. There is also no real TP.

            But be careful in "pips-away from the open price" block. This block can behave very differently with different settings. The first parameter is described (click on its title). "Pips away" is also important, its value can be positive, or negative if you want to detect movement in the other direction (when the price is going towards SL).
            Also "Open price belongs to" is important when the block is working with trade that was result from partial close or it was added to another trade.

            Look for errors! Again, this EA doesn't work for me, but not because of the way blocks are connected.

            Let me explain. All input parameters are 0 because I change them manually case by case. This is why I call it a semiautomatic EA. The truth is that is is a trade launcher with a moving SL, no more than that. And I can tell you it works perfectly with no errors so far. I agree there is no real TP. I call it so as an internal way to structure it. It's just a partial close. Once the partial close is reached, the SL is moved and the EA is terminated.

            What you suggest about pips away accepting negative values is very interesting. Can I insert an integer negative number at that parameter? If so this can be what I'm looking for.

            Thank you.

            1 Reply Last reply Reply Quote 0
            • isp00rt
              isp00rt @miro1360 last edited by

              @miro1360

              I'm sorry, but I cant find that "Trade closed" block. Where can I find it? Additionally, I guess there can be an additional problem by using it. What will happen when previous closed trades are listed at the platform? Will this block find them immediatey after launching my order and then will rapidly close it?

              Thank you

              1 Reply Last reply Reply Quote 0
              • M
                miro1360 last edited by

                try it in tester, it is best what you can do for answer to your question 🙂 ....
                and block Trade closed appear when you click into "on Trade" section

                Between trading and gambling is a very small gap, be careful.

                1 Reply Last reply Reply Quote 0
                • isp00rt
                  isp00rt last edited by

                  It worked!!! Thank you very much. 😙

                  1 Reply Last reply Reply Quote 0
                  • isp00rt
                    isp00rt last edited by

                    An unexpected problem has appeared. I did what su siggested:

                    https://fxdreema.com/shared/LTMBdKgZ

                    I don't know why but now a weird thing happens when the partial close is executed. According to the EA, the SL should be moved and the EA terminated, but none of it happens. Once the first TP is reached, the SL is not moved, the EA is not terminated but the popping message saying it's terminated appears!! 😦

                    I can't see why this is happening. It's an easy EA and all conditions are apparently correctly ordered. Could someone please help me?

                    1 Reply Last reply Reply Quote 0
                    • M
                      miro1360 last edited by

                      it is closed on SL 😄 because your SL is same value as pips away from open-price ....
                      next problem can be this On Trade section ... where trade is closed, it is terminated ...

                      Between trading and gambling is a very small gap, be careful.

                      1 Reply Last reply Reply Quote 0
                      • isp00rt
                        isp00rt last edited by

                        Sorry, I didn't explian myself properly. When blocks at the "On trade" section are erased, the EA works well except when the price reaches the SL BEFORE touching the TP (a new trade is created when I don't want that). This is why I added those blocks there. But now not only that problem is still active but the new one has appeared. So the situation is:

                        Problem 1. When price reaches TP, the SL is not moved at all now, whereas it was correctly moved before the "On trade" blocks were added. If I remove them it runs well, but then problem 2 happens.

                        Problem 2. If "On trade" blocks are erased, then a new trade is created if price touches the SL befor having touched the TP. As I said, this is not what I want.

                        So is there any way to fix both of them?

                        Thank you very much in advance.

                        1 Reply Last reply Reply Quote 0
                        • M
                          miro1360 last edited by

                          problem 1 ... if you switch these blocks (modify stops and close) like this?
                          0_1487855480037_upload-79e31add-66f5-47e0-bb76-405e43ac0753

                          problem 2 ...
                          if you change this to fully closed?
                          0_1487855702460_upload-5c96d3fe-c25a-4ae1-b61c-93c0df1f9d6b

                          Between trading and gambling is a very small gap, be careful.

                          1 Reply Last reply Reply Quote 0
                          • isp00rt
                            isp00rt last edited by

                            I will try it, but I don't understand two details:

                            Problem 1. As far as I know, changing the order of both blocks just modifies the order in whch both actions will be executed. If it didn't work befor, why should it work now?

                            Problem 2. What is the difference between the original "No matter how" option and this one? Does it include my partial close? Then I think this would be the reason it didn't work properly.

                            1 Reply Last reply Reply Quote 0
                            • M
                              miro1360 last edited by

                              1. because "on Trade" is called with your purple "close" block ... and it terminates EA before "modify stops" block is in action ...
                              2. this one you need play in deepness and test it because I have not test it at all 🙂 when you find solution, post it here

                              Between trading and gambling is a very small gap, be careful.

                              1 Reply Last reply Reply Quote 0
                              • isp00rt
                                isp00rt last edited by

                                As far as I tested it, it works well. More than ten trades including all possibilities (good and bad buy/sell) have been confirmed. So once more, tank you very much for your help. 😉

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

                                Online Users

                                F
                                R
                                S
                                D
                                V
                                O

                                13
                                Online

                                146.7k
                                Users

                                22.4k
                                Topics

                                122.6k
                                Posts

                                Powered by NodeBB Forums | Contributors