fxDreema

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

    How to do one trade per contition?

    Questions & Answers
    4
    13
    2696
    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.
    • D
      DIVYESH3190 @eos3000 last edited by

      how to do this
      i have same problem

      give me a images

      1 Reply Last reply Reply Quote 0
      • E
        eos3000 last edited by

        Hi!

        I´m making a simple robot with SAR. The conditions are:
        -When SAR < Candle = buy

        • When SAR > Candle = sell

        But the problem is that when the transaction closes (TP, SL or Manually), another trade opens again. I want to open ONCE for each condition. I want that when closed wait for a new different condition (the opposite condition).

        How can I do?

        Thanks.

        ......
        1.mq4

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

          Block "Once per bar"?

          1 Reply Last reply Reply Quote 0
          • E
            eos3000 last edited by

            Hi, thanks for your time.

            If I take the block "once per bar", the condition before could be still present.

            The question is once the robot closes the transaction don´t open it again if still the condition. Once trade per condition and then the robot waits to the opposite condition. Once buy, once sell.
            Another way that I could serve: When the condition mets, open a trade and then go to wait the opposite condition.

            It´s possible?

            Thanks for you patience.

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

              Try this:

              No trade is running (set this to Buys) -> Condition (to buy) -> Close trades -> Buy now
              No trade is running (set this to Sells) -> Condition (to sell) -> Close trades -> Sell now

              1 Reply Last reply Reply Quote 0
              • E
                eos3000 last edited by

                It doesn´t works, but tanks.

                It´s supose to be something like this but it doesn´t works neither, I don´t know why.

                No trade is running > Condition > Counter Pass Once (ID= 1) > Counter reset (ID =2) > Buy
                No trade is running > Condition > Counter Pass Once (ID= 2) > Counter reset (ID =1) > Sell

                Every time it Buy, it prepare to the following condition (sell), but just once per condition. When the trade is finish, the robot waits to the opposite condition.
                I think that´s it´s the logical chain of blocks, but It´s doesn´t works. The robot buys a lot times in the same condition.

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

                  It works for me:
                  https://fxdreema.com/shared/A7q8CbIUd
                  http://prntscr.com/7200fu

                  1 Reply Last reply Reply Quote 0
                  • E
                    eos3000 last edited by

                    Hi,

                    Yes, you are right, but if the trade closes, the robot opens again in the same condition. I need that if it closes, it doesn´t open again in this same condition. It has to wait to the opposite condition to open a new trade.

                    I´m tying to do this with counters and reset counters, but the robot continues to opens again once the trade closed (if the condition persist).

                    https://fxdreema.com/shared/iO3JXwpfd

                    It is something wrong in this robot?

                    And the question is ONE trade for each condition.

                    I now it´s a little complicated... 😳

                    Thanks for your patience.

                    Very good software. Now I´m a member! 😄

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

                      There was a special block for this in the past, but I decided to remove it. The problem for me is that temporary variables are used to remember the current state, and imagine what happens when you restart the EA - they reset. Now I believe that it's better to use the trades as a storage for the current state, to check for their count and properties before doing something.

                      So, counters are probably working, but I'm not thinking in this direction. If you think that this works for you, fine.

                      Here is another way - to check what was the type of the last closed trade before checking conditions. If it was Sell - you are going to check conditions to Buy. There is a block with stupid name for this - "Check last closed type"

                      In your project I don't like these "check type" blocks placed there. These are supposed to work in different scenario. And by the way, there are filters in "Close trades" to choose what to close - Buys or Sells.

                      1 Reply Last reply Reply Quote 0
                      • E
                        eos3000 last edited by

                        Finally... 😮 we did it! 😆

                        That´s it.... perfect! 😄

                        Thank you so so much!!!!!!!

                        D 2 Replies Last reply Reply Quote 0
                        • D
                          DIVYESH3190 @eos3000 last edited by

                          sir plz anser

                          1 Reply Last reply Reply Quote 0
                          • A
                            amanaman last edited by

                            i need one too,plss

                            1 Reply Last reply Reply Quote 0
                            • A
                              amanaman last edited by

                              once for trade block
                              can some give me an axample?

                              plss

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

                              Online Users

                              E
                              M
                              F
                              A

                              15
                              Online

                              146.6k
                              Users

                              22.4k
                              Topics

                              122.6k
                              Posts

                              Powered by NodeBB Forums | Contributors