fxDreema

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

    Problem with conditions

    Questions & Answers
    2
    15
    2562
    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.
    • T
      thierrybl last edited by

      Hello,

      I have a problem when I put a condition to open an order.
      My rules are very simple : when a bear candle is followed by a bull candle : buy
      when a bull candle is followed by a bear candle : sell

      So far it works fine. If I add a condition (for example if price is over MA 100) after yhe candle block, no order are open. I tried to add condition to the buys, and only sells open.

      I don't know if i can share my project somewhere to be more clear.

      Thanks for your help

      Thierry

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

        Maybe the condition is somehow wrong? I can see your project, but there is no condition at the moment. By the way blocks 8 and 9 are not to be used there, these are actually for pending orders. But if you have some pending orders anyway, you should also put "For each Pending Order" to select the pending order(s) to be modified.

        1 Reply Last reply Reply Quote 0
        • T
          thierrybl last edited by

          Thnaks for your answer. The project you see is not the last project I work on. Indeed I work also on local version. I can join the current versionHedge no Bias v2-3.xml so you can have a look.
          Thanks

          Thierry

          ......
          Hedge no Bias v2-3.xml

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

            http://prntscr.com/3lr7tx
            Those are unfortunately called "global variables", but they are different kind of global variables: https://fxdreema.com/documentation/proj ... metatrader
            Use Value -> Numeric there (it will work with boolean)

            1 Reply Last reply Reply Quote 0
            • T
              thierrybl last edited by

              Hi,

              I am not sure to understand your answer.
              I modified the EA as I understood, but it didn't change anything.

              ......
              Hedge no Bias v2-4.xml

              1 Reply Last reply Reply Quote 0
              • T
                thierrybl last edited by

                I change the numeric value from 0 to 1 and it seems to work now

                1 Reply Last reply Reply Quote 0
                • T
                  thierrybl last edited by

                  Thanks a lot for your help. This part works fine now.
                  The other step is to put a new condition : Buy order only if previous or current candle high is the high of the week (or day). Reverse for sell.
                  I really can't figure out how to determine that condition in dreema.

                  Thanks

                  Thierry

                  I join the last version of my EA :

                  ......
                  Hedge no Bias v2-4.xml

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

                    Somewhere in Condition -> Market properties you can find Lowest/Highest options, or just use the High point of the weekly candle. Compare this value to the current candle high, and I guess it will work that way.

                    1 Reply Last reply Reply Quote 0
                    • T
                      thierrybl last edited by

                      Hello,

                      I come back to you because I can't understand why the weekly condition doesn't work.
                      I compare the weekly candle high (or low) with the candle (shift 2) high, and if condition is met, it goes to next condition. If condition is not met, it goes to check Weekly's high with Candle (shift 1). If condition still not met =>message.
                      Everything seems very logical, but it always go to message, even if conditions are ok.
                      I spent the weekend over it, and didn't find the solution.

                      thanks for you're help

                      Thierry

                      EA dreema.jpg

                      ......
                      EA dreema.jpg

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

                        Don't use "==" to compare price levels, ever. Use anything else, because the chance to have two prices exactly the same is small, especially when prices are like 1.23456. There is no guarantee that you will receive tick at price 1.23456. The tick can contain price 1.23455 or 1.23457 which is similar, but not exactly the same! Prices are not like 1, 2, 3, 4, 5.... they are like 1, 2, 4, 2, 6, 7, 9...

                        1 Reply Last reply Reply Quote 0
                        • T
                          thierrybl last edited by

                          Yes I understand but in that case, if previous candle high is the high of the week, it is the same price precise to the pip on the 2 candles

                          1 Reply Last reply Reply Quote 0
                          • T
                            thierrybl last edited by

                            I'm thinking about something. As I backtest, the weekly high or low is already settled and while testing the current W high/low is not the same that we'll have at the end of the week.
                            Maybe that while testing, the weekly reference is the candle already close (it's not supposed to but ...), even if prices didn't reach it yet during the test. Do you think it's possible ?

                            thanks

                            Thierry

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

                              Interesting... it looks that weekly and monthly data can't be accessed when backtesting, it returns 0. It's ok on real testing, so I probably need to add some function to calculate weekly and monthly data based on daily when backtesting 😮 Those russians are always missing something.
                              http://forum.mql4.com/57611

                              I don't know when will I do that fix, but for now if you don't care about mondays I can suggest to look at the last 7 days:
                              https://fxdreema.com/shared/Imrkebc3

                              1 Reply Last reply Reply Quote 0
                              • T
                                thierrybl last edited by

                                __Interesting... it looks that weekly and monthly data can't be accessed when backtesting, it returns 0. It's ok on real testing, so I probably need to add some function to calculate weekly and monthly data based on daily when backtesting 😮 Those russians are always missing something.
                                http://forum.mql4.com/57611

                                I don't know when will I do that fix, but for now if you don't care about mondays I can suggest to look at the last 7 days:
                                https://fxdreema.com/shared/Imrkebc3[/quote:3nm0rr29]

                                Thanks for your answer. I will test it live to see if it works ok. But maybe I did something wrong so I enclose my EA so you can have a look if you have time.

                                Hedge no Bias v2-5.xml

                                I'm afraid that testing on 7 days will give wrong results as weekly calculation goes from Monday to Friday. But thanks you for the piece of code. It will be useful for visualising on the graph.

                                Thierry

                                ......
                                Hedge no Bias v2-5.xml

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

                                  You can use this "Indicator tester" block to see any numeric thing as a line (or numbers below the candles). Maybe this can help: http://www.mql5.com/en/code/8198. I didn't tested it, but it looks simple so it should work 🙂

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

                                  Online Users

                                  W
                                  M
                                  Y
                                  J
                                  N
                                  G
                                  A
                                  E
                                  I
                                  A

                                  23
                                  Online

                                  146.8k
                                  Users

                                  22.4k
                                  Topics

                                  122.6k
                                  Posts

                                  Powered by NodeBB Forums | Contributors