fxDreema

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

    Open and close

    Questions & Answers
    2
    13
    3107
    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.
    • ekanters
      ekanters last edited by

      On strategie tester this works perfect on a 4hr timeframe. The condition says to open trades at the opening of a new bar. But I have no clue why it is also closing trades on that event. The condition is a crossover and nowhere in these trades that condition changed at the time of closing. Neither was a target reached or a stop hit. (The same thing happens on 2 different broker platforms. Including one ECN broker)

      Up to now I am only testing with very small lots on live accounts.

      See pictures attached.

      ......
      Cody.png
      close.png

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

        You have connected "Close each trade" right after "Buy now" and "Sell now".
        When "Buy now" or "Sell now" creates it's trade, it continues to the orange output and what can be found there... "Close each trade". So, the result is that a newly created trade is immediately closed.

        If you want to close trades after another condition, place "Close each trade" on a different group of blocks with that condition.

        Also, instead of "Counter..." blocks, you can use blocks from "Manage trades/orders count" category.

        Don't test on live real account. First test on Strategy Tester (Visual mode is a good option), then on demo account... and if everything is fine for sure - on real account.

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

          More detailed picture of the buy and sell. The filters are on an in my opinion it can only close any buy or sell trade when the condition changed.
          Since the condition which is set at X< D or X > D never changed it should add a new trade instead of close an open trade.

          In other words it should work live as well. Condition is simple and stops are a good distance away.

          ......
          Details.png
          tradesrunning.png

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

            I don't understand what is the problem - trades are closed when no need to, or trades are not closed when need to?

            I will suggest to use "No trades...." blocks instead of these counters.

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

              There is no problem that is my problem 🙂 On the third picture from the top which was created in the strategy tester it does exactly what it needs to do. It closes at the right stops and it also closes any sell trades when a new buy comes on. It trails trades 100% right as seen on buy trade 3. So everything is as I want according to the blocks you provided. There are no closes on new bars. Its all perfect.

              But when going live it closes trades on new bars which it doesn't do in the tester. ( The tester is 100 right and so the Robot is 100% accurate)

              So nothing complicated at all.

              Only when going live its not doing what it should do.

              But I take your advice and do the following:

              1: I start over again with the same stuff and run it on tester and demo account.
              2: If that doesn't work I look over it again and again and let you know the outcome.
              3: When that doesn't work I try to find a way around it as you suggested.

              But this EA is perfect because have tested on many pairs and commodities and it makes good profits over a year of Data on all.
              So why change something that is good 🙂

              Again only live its acting weird. (Below another perfect picture of a perfect EA on the strategy tester.)

              ......
              perfect.png

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

                If something works on backtest and not love, then the first thing to see is if there are error messages.
                But I think it's something else. You are saying this:

                __
                But when going live it closes trades on new bars which it doesn't do in the tester.[/quote:1d19hf59]

                This probably means that your trades are closing right when a new bar opens, without any other condition. Can you check if there is another EA currently working on another chart, some EA that you forgot working?

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

                  Now that sound a bit like logic. I have 4 EA's open on 4 different pairs with 4 different magic nr's.

                  But just in case I will reastart the computer and EA's.

                  Indeed the only thing I can think of. Must be somewhere in that direction.

                  Will get back when I found the solution or... 😉

                  BTW I keep on testing live with 1 cent trades before going over to the real stuff.

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

                    Restarted everything and checked all. Have one EA running on a GBPUSD. Only that chart is open so it will be easy to find any errors when they happen. Next trade should start in 15 min and to see if it works will take at least 4hr or more.

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

                      By the way you can always test live on smaller timeframe where things happens much quickly, for example on M1. There is no reason to wait 4 hours if you can wait 1 minute (or 5-15 minutes if 1 minute candles are too small) 🙂

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

                        Well I be damned. Its working on 1 min gold live. (The GBP 4hr is in as it should) So in short like I said in the chat room, for whatever reason it looks like a computer keeps some old stuff from before in the back of its mind. Anyway its telling me that whenever you start an EA and have been playing before it is essential that you restart eveything clean before doing anything at all.

                        Almost certain now its not the program that remembers stuff from the past but the computer itself.

                        Thanks for that last and final tip that gave us the solution 🙂

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

                          Perfection as I said all along 🙂

                          ......
                          perf.png

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

                            Just to let you know:

                            That 4hr GBPUSD trade with the EA is also working perfect now.

                            Another indication something must have been somewhere in the computers mind.

                            Lesson learned is: When it's acting weird. RESTART ALL 🙂

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

                              Don't "panic" so much :)) It's normal to forget some EA working on another chart. This happens to me often, even when I use the Tester most of the time. Actually backtesting helps for this to happen, because there is new chart created on every backtest, and eventually you have tons of charts and you don't remember where EAs are and if there are any somewhere 🙂 So... closing all charts should be enough.

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

                              Online Users

                              R
                              A
                              E

                              9
                              Online

                              146.7k
                              Users

                              22.4k
                              Topics

                              122.6k
                              Posts

                              Powered by NodeBB Forums | Contributors