fxDreema

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

    EAs working together. Could there be confusion in the price values sent or received?

    Questions & Answers
    2
    14
    2854
    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
      josecortesllobat last edited by

      Hi

      I have an EA portfolio working on the same demo account in the same MT5 terminal. The configuration is such as

      EA1 EURUSD H8 MagicNumber = 200
      EA1 GBPUSD H8 MagicNumber = 210
      EA1 USDCHF H8 MagicNumber = 220
      EA2 AUDUSD H8 MagicNumber = 230
      EA2 EURUSD H8 MagicNumber = 240
      EA2 USDCAD H8 MagicNumber = 250
      EA2 USDCHF H8 MagicNumber = 260
      EA3 AUDUSD H8 MagicNumber = 270
      EA3 EURUSD H4 MagicNumber = 280
      EA3 GBPUSD H4 MagicNumber = 290
      EA3 USDCAD H4 MagicNumber = 201
      EA4 GBPUSD H8 MagicNumber = 211
      EA4 USDCHF H4 MagicNumber = 221

      Each EA writes some data (OpenPrice, TPs, SL, etc.) in a Comment when the position is opened using the "Comment (ugly)" block.

      The EAs open positions per their logic and set up the postion magic number as MagicNumber+Group#. Everything seems to be right. But I have noticed that the values written in the "Comment (ugly)" block does not make sense in some cases.

      0_1525934635565_7fd31bae-92cb-492b-bf8a-721e55f26732-image.png

      At the same time, there was a position opened in the AUDUSD pair:

      0_1525934841274_adec80e6-531b-41bb-a14b-6de397278fab-image.png

      The EAs move the SL level at the beginning of a new bar and Modify the position of the trade. But the position in the EURUSD is modified wrongly

      0_1525935441953_377d5b83-4e12-4700-a05e-a3f5d9e577bd-image.png

      It seems as it took the TP values from the AUDUSD pair.

      That happened after this event

      0_1525935524703_9c836dff-7534-4acc-aa3f-7dcb22f6cd01-image.png

      Something strane took place with the modify of the SL/TP when they were set to 0.0000

      0_1525935650140_9e225304-483d-47ba-86c3-10ae7fca34a8-image.png

      I am not sure if this behavior are provoked by the EAs but it happened in different broker´s demo account using the same portfolio.

      Any idea on that?

      Thanks

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

        group number is part of magic number ... so better is explanation with example:

        magic:100 + no group =>> magic:100
        magic:200 + group:1 =>>> magic:201
        magic:210 + group:2 =>>> magic:212
        ... and so on

        (real magic number = magic from settings + group)

        https://fxdreema.com/tutorial/builder/groups-and-magic-numbers

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

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

          Hi @miro1360

          Thanks for your answer.

          I know it how it works and I am pretty sure that each EA opens the postions with the right real magic number such as:

          Group #11 (EA magic number on settings is 200) --> 211
          Group #11 (EA magic number on settings is 201) --> 212

          That is fine for each EA working and for each position opened.

          What I am not able to understand is why the EA attached to the EURUSD pair is taking the TP values from the EA attached to the AUDUSD pair when the position is being modified. It is very sure that both EA have different magic number set in the input parameters.

          What I have found is that the EURUSD and AUDUSD positions were opened at the same time:

          0_1525946630990_54aa4d12-c652-4774-8728-ae3e31354f09-image.png

          So I don't know why the TP level of the EA working on the EURUSD chart is modified with the values of the AUDUSD.

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

            how TPi_Price calculation looks like exactly?

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

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

              Hi @miro1360

              Here you have how the TakeProfit levels are calculated:

              TPi_Price = OpenPrice +/- TPi (points)

              TP1 (PIPS) = 5
              TP1 (Points) = TP1 (PIPS) x Point Size (5 digits -> 0.0001) = 5 x 0.0001 = 0.0005 points
              OP (PRICE) = 1.00000

              TP1_Price (buy position) = 1.00000 + 0.0005 = 1.00050
              TP1_Price (sell position) = 1.00000 - 0.0005 = 0.99950

              and so on.

              0_1525984531389_99c3858d-f022-4d5d-ad4a-852263a0b2b2-image.png

              The TP levels are placed correctly when the positions are opened even though there are other positions opened at the same time in different pairs. But, the issue takes place when the position has to be modified when a condition to move it is triggered. In this case, it seems that the TPi levels are taken from the values of other EA. Is this posible? Because it should not be possible if everything Works correctly.

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

                ho are you working with this pink loop?
                are you correctly selecting trade with dark pink block before? (For each trade) ...

                if not, here is how selection is working:
                http://fxdreema.com/forum/topic/4246/example-for-each-trade

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

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

                  It is not a pink block, it is a formula block where the TPi_Price variable is set.

                  0_1525990636826_2433fa95-11cc-4dc3-b051-ef0d9c161c23-image.png

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

                    Hi @miro1360

                    When the position is modified by the trailing stop condition, there seems to be a confusion in the TP values between different EAs.

                    0_1526023670565_7e37eff0-8836-4a7d-bb0b-3662d2a8ce39-image.png

                    I think this confusion in the TP prices calculation is happening when trades are opened at the same time by different EAs in the same terminal. Because initially the TPs are set correctly but incorrectly when the position has to be modified TPi calculation takes place when the positions are opened and it is not updated or recalculated.

                    I would like to check if this happens if I split the portfolio in many terminals but most probably will be that my VPS hangs.

                    Thanks

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

                      you need somehow understand how these "pink" things are working 😄
                      ... anywhere before Condition block, modify variable block or formula block must be the right trade preselected with dark ping block "For each Trade" ...

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

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

                        Hi @miro1360

                        I really apreciate your help.

                        What I am not able to understand is why one EA with its own MagicNumber can take any value of other EA with a different MagicNumber. I don´t know how the workflow of sending commands to the server Works but I used to think that the commands sent by one EA is exclusively of that EA.

                        I have modified the "Modify Stops" block using the pink ones for the Trailing Stop Condition

                        0_1526035066308_5c2ea79f-4f77-4224-9157-77fd52b9bc00-image.png

                        But it was required to add a value in the Take Profit because with No Change option and "For each trade" I got that the TP was modified to 0.00000. There is something in the forum about it.

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

                          when pink block is used incorrectly, maybe it can cause issue 😄
                          ...

                          this is how can you use Modify variables or Formula block with pink For each Trade selection block ...

                          0_1526035925982_66b7d1bc-2376-47e6-8ee2-1713014299d4-image.png

                          I dont know if admin repairs this issue with null TP, maybe sometimes ..

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

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

                            Hi @miro1360

                            Thanks for your example.

                            I was looking for a way to get the Take Profit level for each opened position and you have given it to me. Because when each position is opened the TPi_Price is calculated by the sell/buy block and I can get it by using your example avoiding its calculation and reducing the project blocks number.

                            MANY THANKS!!!

                            I will update the post with the test results.

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

                              Hi @miro1360

                              As you suggested, I shifted the blue blocks by the pink ones (modify stops) to see the result of this shift. Right now I have the one EA working in 4 different pairs at the same time.

                              There is one trade opened (4 postions at the beginning, 1 reached its TP1) in one pair and nothing on the rest. It seems that the OrderModify by trailing stop is working correctly and the SL level are modified but not the TP that keeps the original value as happened when more than one trade was opened at the same time in by different EAs.

                              0_1526321750386_ffd13b3b-5548-42c2-9937-150d07321067-image.png

                              But I cannot be sure if that is due to

                              • Shift to pink blocks
                              • No other trades were opened at the same time

                              The section that seems it is not working both now and before is the conditions set in the "On trade" section

                              0_1526321912992_05df6b98-532f-462f-ab05-6da9ca24ed9c-image.png

                              Stops levels are not modified by a closing trade detection and I don't know how to figure this out. This conditions are very necessary for the EA's behavior.

                              Any help Will be very appreciate.

                              Thanks

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

                                somewhere must be logic error 😄 try to find it with simplification of EA 🙂

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

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

                                Online Users

                                E
                                R
                                F
                                ح
                                H
                                J
                                P
                                B
                                B

                                17
                                Online

                                146.7k
                                Users

                                22.4k
                                Topics

                                122.6k
                                Posts

                                Powered by NodeBB Forums | Contributors