fxDreema

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

    How to set close trade condition for moving average crossover

    Questions & Answers
    close trades close condition
    3
    13
    4371
    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.
    • rogerthat
      rogerthat last edited by

      Hi guys. I'm having some difficulty with trades closing the moment the EA opens when I use the EA setup in the instructions section of this website. I'm using the moving average crossover strategy and would like to have the current trade close the moment the moving average crosses the opposite direction. BUT what happens instead when I use the setup in the instructions section of the website is that the moment the EA opens a trade it automatically closes it. It does this multiple times until it finally blows the trading account. I expected this to happen because the setup in the description does not make much sense. One can add a buy/sell condition ( for example when the fast period moving average crosses above slow period moving average) but the ' close trades " block is just attached to the buy now or sell now block, which confuses the EA to do opposite things. BUY and close or SELL and close. Here is the link to the EA : https://fxdreema.com/shared/xbLKxBHdb

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

        @rogerthat Keep the "no Trade" and "close trade" separate for buying and selling, with respect to the sequence of conditions that must be activated first. Always specify candle ID 1 when you use the indicators. This screenshot is for buy orders and close sell orders

        0_1607449493010_ma_cross.JPG

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

          https://fxdreema.com/shared/8Cn7r82gb
          your blocks should be arranged this way

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

            @ambrogio Hey man. Thank you for the response. I see that you filter the close trades to sells only that is linked to the "BUY Now" block which makes much more sense. BUT in the EA uploaded by admin it has it set for either buys or sells. I just want to understand why he says that will work.

            A 1 Reply Last reply Reply Quote -1
            • rogerthat
              rogerthat @OD last edited by

              @od Thanks dude. Can you please tell me, why did you change the no trade to once per block?

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

                @rogerthat said in How to set close trade condition for moving average crossover:

                @ambrogio Hey man. Thank you for the response. I see that you filter the close trades to sells only that is linked to the "BUY Now" block which makes much more sense. BUT in the EA uploaded by admin it has it set for either buys or sells. I just want to understand why he says that will work.

                The administrator is very lazy (by his own admission) :))) , even in the condition block does not put candle ID 1.

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

                  @rogerthat The once per bar block sets ur condition to open trades when the condition happens once per candlestick...this is in order to avoid opening many trades at once since the condition could happen more than once in one candlestick period hence opening too many unwanted trades

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

                    @od remember to specify candle ID 1 in the condition block, otherwise problems like this happen, two consecutive trades without the first one being closed

                    0_1607459479662_ma_cross.JPG

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

                      @od Thanks for your help , I will test it in my demo. Quick question though... With the setting of " Once per bar" will the EA take another trade on the following candle? I only want it to take one trade once the crossover occurred.
                      I would also like to know will I be able to set another condition to let the EA only take a trade once the candle has closed above ( in the case of a buy) above the slow moving average after the crossover has occurred. Because sometimes the moving average crosses over whilst the candle is still open, but if the candle closes the two EMAs no longer crosses each other and the price moves into the opposite direction. To be safe as a condition I would like to have the candle closed above the slow moving average ,and as a second condition to have the fast and slow EMA to cross. Could you please advise how do I go about doing this. Thank you.

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

                        @ambrogio Thank you dude. I have tested it and forgot add candle ID 1 and my EA opened 12 trades at once almost blowing my account. So thanks for the heads up. Another quick question, I hope you can help me:

                        I would also like to know will I be able to set another condition to let the EA only take a trade once the candle has closed above ( in the case of a buy) above the slow moving average after the crossover has occurred. Because sometimes the moving average crosses over whilst the candle is still open, but if the candle closes the two EMAs no longer crosses each other and the price moves into the opposite direction. To be safe as a condition I would like to have the candle closed above the slow moving average ,and as a second condition to have the fast and slow EMA to cross. Could you please advise how do I go about doing this. Thank you.

                        I would like to know will I be able to set another condition to let the EA only take a trade once the current candle or previous candle has closed above ( in the case of a buy) the slow moving average after the crossover has occurred. Because sometimes the moving average crosses over whilst the candle is still open, but if the candle closes the two EMAs no longer crosses each other and the price moves into the opposite direction. To be safe as a condition I would like to have the candle closed above the slow moving average ,and as a second condition to have the fast and slow EMA to cross. Could you please advise how do I go about doing this. Thank you. Much appreciated.

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

                          @rogerthat For that case you'll have to use candle ID 1 in your moving averages crossover block then create another block where the previous candle should be above the slow moving average..use is above for all blocks and your candle IDs should be 1

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

                            @od Thank you. Can you please tell if this is correct?0_1607481445432_new EA.JPG

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

                              @rogerthat Switch the no trade block with a once per bar block to avoid opening many trades once then create a similar one for sell trades

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

                              Online Users

                              M
                              K
                              F
                              Z
                              S
                              C
                              P

                              18
                              Online

                              146.7k
                              Users

                              22.4k
                              Topics

                              122.6k
                              Posts

                              Powered by NodeBB Forums | Contributors