fxDreema

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

    Why is this EA not taking trades when it is supposed to

    Questions & Answers
    3
    42
    5251
    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.
    • OD
      OD last edited by OD

      0_1650834269382_66a7abe7-34c8-44ed-846b-4fb3b8699fa9-image.png Order number 8 should open when order number 5 opens in the backtest result above because they have the same open price and were placed at the same time. It does not open and gets deleted .
      0_1650834542188_2f0fc2a3-a37f-4ced-a226-0eac47ac28eb-image.png
      This is the same backtest when the EA takes the trades as it should .

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

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

        @od this happens because you have choose "create OCO order" (One Cancels Other)

        0_1650836541430_sgabello2.PNG

        when one buy order is triggered, a sells pending order is deleted, and viceversa

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

          @ambrogio Yes that is how it should work. The buy stop order (5) and sell limit order (8) have the same open price at the same time but the sell limit order (8) does not open. Some times the OCO works sometimes it does not. Orders like order number (7) above should have been deleted if only order (8) could have opened. Choosing the OCO order is the whole strategy mechanism but it works flawlessly sometimes only. What could be making it skip some trades?

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

            @od i see that you are using "mid price" for pending orders only now. Don't do it. Always use Ask price for buys orders and Bid price for sells orders. You will see that all is fine. The spread will be calculated by the platform (in my case spread = 1.5 pips). Look at this screenshot, orders #13 #14 #15 #16

            0_1650886781479_sgabello2.PNG

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

              @ambrogio I was using the mid price since each of the two pending orders can open a buy or sell. After changing as said it now takes the trades even if with spreads but sometimes the other order is not cancelled.
              0_1650895520468_f44e1d96-dba1-415a-ad6f-069e46fb7236-image.png
              For example the orders highlighted above should both be deleted when the sell stop and buy limit orders (86&87) open trades. But order 85 is not deleted and it ends up opening a trade when it should not.https://fxdreema.com/shared/L2dT0Ck4

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

                @ambrogio Again if you could, is there a way you can show me how to close partially these trades after 20 pips while maintaining the stop loss level of the parent trade.

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

                  @od said in Why is this EA not taking trades when it is supposed to:

                  @ambrogio I was using the mid price since each of the two pending orders can open a buy or sell. After changing as said it now takes the trades even if with spreads but sometimes the other order is not cancelled.
                  0_1650895520468_f44e1d96-dba1-415a-ad6f-069e46fb7236-image.png
                  For example the orders highlighted above should both be deleted when the sell stop and buy limit orders (86&87) open trades. But order 85 is not deleted and it ends up opening a trade when it should not.https://fxdreema.com/shared/L2dT0Ck4

                  I repeat myself: DON'T use the mid price. Please, make as i suggested you, try it and check.

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

                    @ambrogio Am not using mid price it is changed

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

                      @od in the buys block put Ask price

                      0_1650900218046_sgabello2.PNG

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

                        @ambrogiohttps I have done that still the issue of not deleting some trades is still there. I don't see the bid and ask price as the issue since the two pending order blocks should be opening opposite trades at the same price.https://fxdreema.com/shared/aJc6IRtid
                        0_1650916389511_0e8edb2a-fd77-40db-91fe-7bb9db37c7b6-image.png
                        This is from a backtest after changing all open prices to ask. Still as you can see order number 45 wasn't deleted.

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

                          @od how much is the spread?

                          OD 2 Replies Last reply Reply Quote 0
                          • OD
                            OD @ambrogio last edited by

                            @ambrogio Just using the current spreads not fixed

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

                              @ambrogio Do you think there may be a bug in the OCO

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

                                @od i've tested your last project, no problem for me

                                0_1650921972670_sgabello2.PNG

                                OD 1 Reply Last reply Reply Quote 0
                                • Y
                                  Youngtreptrader @OD last edited by

                                  @od can u test m project and help? i have complie error from custom indicator

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

                                    @ambrogio It is just a screenshot , it works well up to a point then stops. Do you have a complete results which I can compare .

                                    A 1 Reply Last reply Reply Quote 0
                                    • OD
                                      OD @Youngtreptrader last edited by

                                      @youngtreptrader can u create another thread ? someone who can will from there..

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

                                        @od said in Why is this EA not taking trades when it is supposed to:

                                        @ambrogio It is just a screenshot , it works well up to a point then stops. Do you have a complete results which I can compare .

                                        Maybe you have some problems with the platform or historical data.....i don't know.

                                        OD 2 Replies Last reply Reply Quote 0
                                        • OD
                                          OD @ambrogio last edited by

                                          @ambrogio Did you use every tick to backtest?

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

                                            @ambrogio Plus I've tried making the trades close partially with no success . Kindly if you can try it out please do as you say maybe it is my platform or historical with issues I don't know.

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

                                            Online Users

                                            J
                                            T
                                            J
                                            B

                                            26
                                            Online

                                            146.7k
                                            Users

                                            22.4k
                                            Topics

                                            122.6k
                                            Posts

                                            Powered by NodeBB Forums | Contributors