fxDreema

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

    CROSS ABOVE CROSS BELOW

    Questions & Answers
    2
    17
    4997
    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.
    • G
      ggrobot last edited by

      In the description it says that the cross area is calculated but comparing the previous bar with the last bar . what does that mean , that the closure of the last - closure of the previous gives a number? width?? i tried to set it a condition close trade when cross above or below a MA but the closure doesnt happen on cross of the indicator but more far... as if it doesnt care about the indicator but waits a kind of calculation. can anyone help me with this?

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

        just leave the width to 1.
        https://fxdreema.com/shared/HiuKscOsd
        ^This closes your trades when price crosses 20 MA

        You can make a shared copy of your project from Projects menu at top left

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

          it does do it like that , my test is exactly what your link shows, but it does not close the price when it crosses the MA20. for some reason it takes the width of the canlde and the width of the previous candle and if in that price area there is a cross at MA20 it wont close it. It closes it only if the price is away from the width of the 2 candles X , X-1 and if there is a cross then it closses it. this is helpful in ranging situations as it will not close it if it is in the same price level no matter the swings it does up and down MA20 but in other cases it does not close it properly. if you move your arrow on the width 1 there is an explanation.
          aM I RIGHT ON THE ABOVE ASSUMPTIONS??

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

            I didn't quite catch what you mean 😄
            But I think the "cross" system just compares the current candle and last candle:
            if last candle close is below MA, and current candle is above MA, crossing must have happened.
            ^You can also do this with two simple condition blocks, without crossing condition

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

              if you try it you will see that if the price is in the range of the candle width that we opened the trade it wont close the trade no matter if there is a cross on MA20 , in order to do so as i saw in the strategy tester it needs to be away from the width of the canlde that we opened the trade and then only if there is a cross away from the width of the candle we opened the trade it closes it.

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

                Ok, well, that's strange.
                I assume you mean candle height, width is always the chart period (M5, M30..)

                Try making a cross condition with two blocks:

                1. previous candle (ID1) is below ma
                2. current candle (ID0) is above ma

                Does the trade close correctly with this setup?

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

                  it will close it but in a swing up and down it will open and close all the time!! while the cross above would mean the whole body to be up or down

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

                    I don't know your trade opening logic, but maybe you should use the previous candle on closing - set candle id 1.

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

                      can the canlde total size solve this ??

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

                        Probably.

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

                          because sometimes it closes above or below MA but the body still touches it and this happens mostly in swings up and down.

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

                            But you do understand, the ea runs on every tick
                            So if the body touches the MA, it has crossed crossed it at some time.
                            If you dont want it to act so fast, maybe use the envelopes indicator instead of ma?
                            You can also run the ea on every bar only, maybe it helps you in this case.

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

                              how do i run on every bar??

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

                                just put an "once per bar" block on top of your logic tree

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

                                  by putting above the once per bar even though i am on tick event?

                                  1 Reply Last reply Reply Quote 0
                                  • G
                                    ggrobot last edited by

                                    thank you...

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

                                      Right.
                                      I personally use "once per bar" on my every ea, everything starts with that block. It has sooo many benefits

                                      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
                                      • 1 / 1
                                      • First post
                                        Last post

                                      Online Users

                                      K
                                      A
                                      D
                                      S
                                      G

                                      18
                                      Online

                                      146.7k
                                      Users

                                      22.4k
                                      Topics

                                      122.6k
                                      Posts

                                      Powered by NodeBB Forums | Contributors