fxDreema

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

    Custom trade entry for limited amount of candles

    Questions & Answers
    4
    20
    3202
    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.
    • C
      CaesarCrypto last edited by

      Dear all,

      For my system I'm looking to implement a rule based on 2 indicators. So my 2 indicators need to give a signal before i take a trade. When the 1st indicator gives a signal and the 2nd not I only wait 1 candle for the 2nd indi to catch up. So when the 2nd indi also gives a signal on the next candle I take the trade, but not if it takes more than 1 candle to catch up.

      Is there a block that I can use to accomplish this? To make it more clear, it should work like below:

      Situation 1

      Candle 1:

      • 1st indicator gives signal
      • 2nd indicator gives signal

      open trade

      Situation 2

      Candle 1:

      • 1st indicator gives signal
      • 2nd indicator no signal

      no trade

      Candle 2:

      • 1st indicator gives signal
      • 2nd indicator gives signal

      open trade

      Situation 3

      Candle 1:

      • 1st indicator gives signal
      • 2nd indicator no signal
        => no trade

      Candle 2:

      • 1st indicator gives signal
      • 2nd indicator no signal
        => no trade

      Candle 3:

      • 1st indicator gives signal
      • 2nd indicator gives signal
        => no trade

      Thanks already for all the help you gave me!

      Cheers

      1 Reply Last reply Reply Quote 0
      • Fabien S
        Fabien S last edited by

        i havent yet build something like this but if I would i would use this block in combination with your entry system, you can adjust how many candles are in the calculation
        0_1573053613096_Bildschirmfoto 2019-11-06 um 16.18.58.png

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

          Search the forum for candle ID, that will help in this project. Your entry logic is this:
          0_1573054106802_b61f7a87-6a30-4beb-bc34-6d072a22db01-image.png

          Need small help? Tag me in your post
          Need big help? https://www.fiverr.com/big_algo/automate-your-winning-strategy-in-mql4-or-mql5

          1 Reply Last reply Reply Quote 0
          • C
            CaesarCrypto last edited by

            @roar thank you for the reply.

            But I thought that the current candle is ID0, candle ID1 was the previous candle and candle ID2 the candle before that?
            I think I read it somewhere on this forum or is this not correct?

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

              Yes, that is correct. I thought you would want to use ID1 as a base, because a signal on ID0 can change before the candle completes...

              But either way, use ID0 together with ID1, or use ID1 together with ID2

              Need small help? Tag me in your post
              Need big help? https://www.fiverr.com/big_algo/automate-your-winning-strategy-in-mql4-or-mql5

              1 Reply Last reply Reply Quote 0
              • C
                CaesarCrypto last edited by

                @roar I tried what you said but I think i'm still doing something wrong because it isn't working in the backtest.

                0_1573078465463_d0c55afe-1ece-4f71-97d5-559a3b2cf315-image.png

                So I need a cross on my indicator at the bottom (didi) + red volume line above the orange line in the 2nd to last indi (wae) + price to have closed below the MA for a sell order. On Candle 1 the cross on the bottom indi (didi( has happened + volume (wae) is ok but price has not yet closed below the MA. So no trade is correct.

                But on current candle 0 the price has crossed below the MA and still bottom indi (didi) green line is below red and volume is ok. So on candle 0 a sell trade should open but this is not working. So I used the candle ID1 for the didi indicator cross and candle ID 0 for the other indicators as you can see in my shared project below.

                Can you see what I am doing wrong?

                Thanks already for all the help!

                This is a share of my project:

                https://fxdreema.com/shared/UD2eAPmue

                C C 2 Replies Last reply Reply Quote 0
                • C
                  CPxiom @CaesarCrypto last edited by

                  @caesarcrypto I guess the problem is usage of ID 0. In case of a buy signal let's say with MA cross for example, on ID0, candle can rise, touch (cross) the MA, then, on the same candle, it reverses, and where it was bullish, you end up with a bearish with a wick touching the MA. And it goes down.
                  In other terms, ID 0 is repainting. Id 1 is a closed candle that doesn't change, so the signal is more reliable.

                  1 Reply Last reply Reply Quote 1
                  • C
                    CaesarCrypto last edited by

                    @CPxiom yes I know that can happen, thats why my ea only runs and does the check on the last minutes of the daily candle. So the chances of a retrace are minimal.

                    C 1 Reply Last reply Reply Quote 0
                    • C
                      CPxiom @CaesarCrypto last edited by

                      @caesarcrypto That's very smart technique.
                      Then... Check if GMT matches correctly the time. I personally use server time... that's the same from the market watch window. So I'm not confused. (Because here we have winter time, summer time... )
                      Also I read somewhere that the backtest uses other time... so maybe that's the problem. Try forward testing on demo account.

                      1 Reply Last reply Reply Quote 0
                      • C
                        CaesarCrypto last edited by

                        I have a specific indicator that counts down the time based on the NY close time and that way i checked that the ea runs exactly at 20 minutes before candle close.

                        C 1 Reply Last reply Reply Quote 0
                        • C
                          CaesarCrypto @CaesarCrypto last edited by

                          @caesarcrypto said in Custom trade entry for limited amount of candles:

                          @roar I tried what you said but I think i'm still doing something wrong because it isn't working in the backtest.

                          0_1573078465463_d0c55afe-1ece-4f71-97d5-559a3b2cf315-image.png

                          So I need a cross on my indicator at the bottom (didi) + red volume line above the orange line in the 2nd to last indi (wae) + price to have closed below the MA for a sell order. On Candle 1 the cross on the bottom indi (didi( has happened + volume (wae) is ok but price has not yet closed below the MA. So no trade is correct.

                          But on current candle 0 the price has crossed below the MA and still bottom indi (didi) green line is below red and volume is ok. So on candle 0 a sell trade should open but this is not working. So I used the candle ID1 for the didi indicator cross and candle ID 0 for the other indicators as you can see in my shared project below.

                          Can you see what I am doing wrong?

                          Thanks already for all the help!

                          This is a share of my project:

                          https://fxdreema.com/shared/UD2eAPmue

                          I repost this hoping someone can help me with this.

                          Thanks!

                          1 Reply Last reply Reply Quote 0
                          • C
                            CPxiom @CaesarCrypto last edited by

                            @caesarcrypto Today I had some problems (bug?) with crossovers. I see in your project you use crossovers. Maybe that's it. If anyone else also had problems, please report.
                            On the forum I run into a thread that states that only one or two crossover can be used in a project??
                            Until now, I didn't count my crossovers in a project, and can't remember if had such problems, and maybe if I did, not having enough experience, probably I changed something else, and something else... and who knows, ended up not needing the crossovers, and managed to get some project work.
                            But there IS a problem with the crossovers.
                            As a workaround, I used CandleID2 and CandleID1 under and above MA for example, and the EA started working!

                            Try it out and let us know, and if someone else had this problem, we should report as a bug... if it's not by design, or some limitation...

                            1 Reply Last reply Reply Quote 0
                            • C
                              CaesarCrypto last edited by

                              @CPxiom I tried that but that doesn't solve the problem as you can see below still no trade. Btw for me it is candle ID1 and ID0 because I work in the close on the candle.

                              0_1573211176065_fe9c5731-f145-4938-990f-171d68877ae3-image.png

                              This is the shared file:
                              https://fxdreema.com/shared/4ymVZJxoe

                              C 1 Reply Last reply Reply Quote 0
                              • C
                                CPxiom @CaesarCrypto last edited by CPxiom

                                @caesarcrypto There still is a usage of crossover on block 29. For a upwards crossover you should put that to "Is Below" (ID1)... then the next one "is above"(ID0).
                                So basically change block 29 to is above, as you did with P-BL.

                                1 Reply Last reply Reply Quote 0
                                • C
                                  CaesarCrypto last edited by

                                  @CPxiom I thaught that should be a problem because that one is of buy trades and this example is about sell trades. But I can try

                                  1 Reply Last reply Reply Quote 0
                                  • C
                                    CaesarCrypto last edited by

                                    @CPxiom Even when I remove block 29 completely out of the system the same issue persists..

                                    C 1 Reply Last reply Reply Quote 0
                                    • C
                                      CPxiom @CaesarCrypto last edited by

                                      @caesarcrypto Ok... Try to move Once a day block, right before buy/sell... So the Ea could check until conditions are true, and then... once a day, do a trade.
                                      Because maybe it checks just once a day. Don't know for sure, but try.

                                      1 Reply Last reply Reply Quote 0
                                      • C
                                        CaesarCrypto last edited by

                                        @CPxiom I think that will give another problem because during a whole day candle price can drop below the MA and back above it towards the end of the candle. I want the EA to do the check only at 23:40 GMT and not before that time and only want a trade when the current price is below the MA at 23:40 GMT while the candle close of the previous day was above the same MA.

                                        I think thats a pretty logical requirement and it thaught it would be a very simple condition but the opposite seems to be true 🙂

                                        C 1 Reply Last reply Reply Quote 0
                                        • C
                                          CPxiom @CaesarCrypto last edited by

                                          @caesarcrypto Yes, but even if the candle does that, if it not yet 23:40 GMT it doesn't open a trade. So it will keep checking until a trade is done, once a day. And when that happens it is passed 23:40. This is just to not check just one tick...

                                          1 Reply Last reply Reply Quote 0
                                          • C
                                            CaesarCrypto last edited by

                                            I changed the position of the once per day candle but it gave the exact same results as before.
                                            Only now the backtest took 10 times longer to complete

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

                                            Online Users

                                            S
                                            M
                                            2
                                            M
                                            M
                                            N
                                            B

                                            20
                                            Online

                                            146.6k
                                            Users

                                            22.4k
                                            Topics

                                            122.6k
                                            Posts

                                            Powered by NodeBB Forums | Contributors