fxDreema

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

    How to skip 1st trade signal?

    Questions & Answers
    2
    16
    2771
    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.
    • B
      biztet last edited by

      Hi. I'm testing few MACD settings for EA.
      The problem is, how can I skip trade for first signal when the signal line crosses main line from either above or below 0 level in MACD.

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

        @biztet what do you mean by first signal? The first trade when you run a backtest?

        Or do you mean to skip the crossing candle and only trade when its confirmed?

        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
        • B
          biztet last edited by biztet

          Hi roar. Let's say on macd have multiple line crossing during downtrend or uptrend. I just don't want to trade on the first cross.

          *multiple crossing above 0 level or below 0 level.

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

            @biztet Ok, so to formalize the problem:

            • if macd has been rising or falling for n continuous bars, dont trade cross
            • if macd has been rising or falling for less than n continuous bars, trade the cross

            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
            • roar
              roar last edited by

              https://fxdreema.com/builder/shared/Ywd5JdNdb

              This one buys the 2nd and later crosses when 1st cross has happened after 15 candles of negative macd.

              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
              • B
                biztet last edited by

                It's like this picture.
                Blue circle is first signal when macd above 0 level. I want to skip the blue.
                And the greens are 2nd&3rd signal that will open trade.0_1581682532590_Screenshot_20200214_201250.jpg

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

                  @biztet ah, I see. That case is simplier:
                  https://fxdreema.com/builder/shared/09jozbiRd

                  0_1581683175259_fc316bde-df5f-4693-bead-0901d451f252-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
                  • B
                    biztet last edited by

                    Great roar, thanks.
                    I just wondering why it doesn't open a trade during backtest..
                    I only duplicate it and reverse the signal for sell..

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

                      @biztet To get sell trades, just replace the buy block with sell block and leave other blocks as they are.
                      To make sure everything is copied 1:1, you can use 2 browser tabs and literally copy-paste the blocks all at once.

                      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
                      • B
                        biztet last edited by biztet

                        wouldn't it be like hedging then?
                        i did like you guide me to but some part its hedging,
                        and no trade when macd level below 0.
                        but when i change 1 block with condition < 0, no trade at all.

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

                          @biztet said in How to skip 1st trade signal?:

                          wouldn't it be like hedging then?
                          i did like you guide me to but some part its hedging,

                          Well, I dont know your strategy and what kind of system you want to build.

                          and no trade when macd level below 0.
                          but when i change 1 block with condition < 0, no trade at all.

                          I designed the system this way. You must somehow tell the computer when a new series of trades begins. The code doesnt understand if you just say "first trade", there is only one first trade in all eternity. I solved this by setting the > 0 rule, but there are other options as well.

                          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
                          • B
                            biztet last edited by

                            Could you please explain the function of
                            Counter : Reset ?
                            Counter : Count n pass ?
                            How it works?

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

                              The EA code is run on every new tick, again and again. Once per bar restricts the flow to one tick per bar.

                              Now, if all its above conditions are true, the counter block increases its internal counter (0,1,2,3,4....)
                              In this case, the counter block counts only 1 tick (one bar and one macd cross because our conditions) and passes the next time, because it has reached the number 1.

                              The reset block is just for cleaning up unwanted effects, because the counter doesnt care if there's a million bars difference between the count increases.

                              I don't know if my explanation helps any bit, I'm too tired to think straight lol

                              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
                              • B
                                biztet last edited by

                                Much Better!
                                So i understand here that the Counter Reset is not really necessary, right?
                                Now i get it. Thank you so much for the explaination.

                                I have another question. Still thinking of catching the news candle.
                                Is there any way we can set this,
                                within 1sec/2sec from open candle, if the pips away from open price let say more than 5pips,
                                then we open trade.
                                Buy if the price > open price
                                Sell if the price < open price
                                and close trade on new candle.

                                If possible i want to try this.

                                I have tried Seconds filter + pips away from open price,
                                but seems not catching any.

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

                                  @biztet said in How to skip 1st trade signal?:

                                  Much Better!
                                  So i understand here that the Counter Reset is not really necessary, right?

                                  Well, the system has to know when the "trade streak" ends and new one begins. If you dont reset it, the EA will skip first macd cross and then trade every other cross for the next million years. I guess that's not what youre after here?

                                  I have another question. Still thinking of catching the news candle.
                                  within 1sec/2sec from open candle, if the pips away from open price let say more than 5pips,
                                  then we open trade.
                                  Buy if the price > open price
                                  Sell if the price < open price
                                  and close trade on new candle.

                                  By using the second filter and the counter blocks, this should work:
                                  https://fxdreema.com/shared/FyO3ZKGod

                                  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
                                  • B
                                    biztet last edited by

                                    Hi roar, i'm just back from my parents house.
                                    And just a few minutes back doing backtest using "your EA".
                                    It seems like you've just make me a BONUS EA!
                                    Thanks a lot. I'm going to start FT this week. Thanks again.

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

                                    Online Users

                                    E
                                    H

                                    13
                                    Online

                                    146.7k
                                    Users

                                    22.4k
                                    Topics

                                    122.6k
                                    Posts

                                    Powered by NodeBB Forums | Contributors