fxDreema

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

    Is there a way to configure the EA to wait for 3 consecutive losses and then enter orders?

    Questions & Answers
    6
    51
    11865
    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
      CPxiom @trader.philipps last edited by CPxiom

      @trader-philipps I'm looking forward to take this further. This is "linked" to something that I was researching, but maybe a different thread would be more appropriate to it. With your pre-latest modifications (didn't test the latest for now), live loss count, and virtual win count, it's practically almost done. At the moment, I'm researching how to add a chart subwindow, and plot a combined equity line, if you know what I mean :). Awesome project!

      T 1 Reply Last reply Reply Quote 0
      • T
        trader.philipps @CPxiom last edited by

        @cpxiom Go ahead and open a new thread. As ms specify how that equity line should look like.

        I like to share my knowledge, but expect the others to contribute as well.

        C 2 Replies Last reply Reply Quote 0
        • C
          CPxiom @trader.philipps last edited by

          @trader-philipps 0_1575495867585_Equity_Balance2_CPmod.mq4

          1 Reply Last reply Reply Quote 0
          • C
            CPxiom @trader.philipps last edited by CPxiom

            This is a work in progress, as a variant to stop the live trades. Decided to keep it on this thread, as it's a continuation.
            @trader-philipps Made a few steps further.
            Managed to write pips difference in a Global Variable. Used a custom mql block, couldn't manage to do it with the yellow block. But this works fine, and it's not complicated.
            Made an indicator that reads the Global Variable, and plots virtual pips equity.
            Also the indicator has an MA for the virtual equity line.
            Everything works great, except one problem. The virtual equity line is reset to zero, right before new value is fed.
            I figure this issue is coming from EA (the figuring out one), because in order to calculate BuyOpen and BuyClose, there probably is a reset to 0, which is fed to the Global variable.
            Don't know how to solve this.... tried with storage variable != 0 as filter condition, but it doesn't work... and maybe this is the case only for this EA (the figuring out one), so no problem for the final EA.
            If not... anyone, please help 🙂
            This is the updated figuring out project: https://fxdreema.com/shared/MTRaFRHgd
            This is the indicator: 0_1575599188206_VirtualPipsEquity.mq4

            0_1575599247548_Screen Shot 2019-12-06 at 03.58.34.png

            T 1 Reply Last reply Reply Quote 0
            • T
              trader.philipps @CPxiom last edited by

              @cpxiom Wow, you're quick!

              Block to use in order to set global variables should be this one ...

              0_1575600875075_134ce1c9-865c-42a8-bf6f-fe5da932e5ac-image.png.

              The rest of the project I didn'z understand from first read, but I have a guess ;-))

              I like to share my knowledge, but expect the others to contribute as well.

              C 1 Reply Last reply Reply Quote 0
              • C
                CPxiom @trader.philipps last edited by

                @trader-philipps I went trough a lot of trial and error, tried that one too, but settled at some point with the custom mql block. It worked, it's simple, so I went further.
                That project is the same one with the trend lines which show the trades. I worked on this one, for testing purposes, so it's not important.
                For what is worked on, only the last area is important. That's the only change.

                Problem is with that reset to zero of the virtual equity line. Why is that happening?
                I tried to give a condition in the indicator also, with if global variable !=0, but didn't had an effect. Tried to filter in the EA also with same principle, but no effect. Maybe it has something to do with EMPTY_VALUE, don't know. Thinking if could use it somewhere instead of 0, or the other way around? Will research further tomorrow.

                T 1 Reply Last reply Reply Quote 0
                • T
                  trader.philipps @CPxiom last edited by

                  @cpxiom Is the shared project link right? I don't see where you actually reset openprice or closeprice? Wher do you call your indicator? or do I need to put it to the chart by myself? I looked as this link https://fxdreema.com/shared/MTRaFRHgd

                  I like to share my knowledge, but expect the others to contribute as well.

                  C 1 Reply Last reply Reply Quote 0
                  • C
                    CPxiom @trader.philipps last edited by CPxiom

                    @trader-philipps Yes, the link is right, and the indicator has to be added manually in the tester. This can be done automatically via add template block on init, (by making a template with the indicator attached) but as this is just for testing purposes I kept the focus on what I was working on.
                    The reset thing... is just a "hunch" on what could be the problem of the equity line resetting to zero, every time before some new number of pips is fed, then plotted.
                    I'm not doing the reset, it's unintentional (not a block). Maybe I'm wrong, but I figured that -maybe- before new calculus the variables are reset to 0, and that data(0) is fed to the global variable... and as consequence the equity line from the indicator, is rising let's say +15 pips, then stays like that, then goes to 0, and then plots -5 pips let's say, then 0, then.... etc.
                    Although... this reset to 0 before a new subtraction calculus is normal behavior for the formula for the variable. So I will try to modify the indicator today, I tend to say that it's more likely that there could be the problem.
                    The covered steps are writing to global variable, and reading global variable from indicator. So problem is the plotted line. I tend to say now that it's the indicator... Will see today.

                    T 1 Reply Last reply Reply Quote 0
                    • T
                      trader.philipps @CPxiom last edited by

                      @cpxiom Mabe for start beginb with a balance curve rather than an equity curve. That means you just update the realized profits or losses instead of equity change during an open trade. In that case the indicator can keep it's own calculations and you can just write + n pips or - m pips to the global variable. once the indicator picks that variable up, it could reset the variable to 0. That would work at least with one close trade at a time.
                      Later on you might have 2 buffers (or arrays) in the indicator. One for balance and one for equity (and maybe a 3rd one for open trades). In that case you can reset the equity to balance value once open trades equals 0.
                      What do you think?

                      I like to share my knowledge, but expect the others to contribute as well.

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

                        @trader-philipps Yes... I was referring to a "closed equity"(balance) line.
                        The "GV_vEq" is the difference from close and open price in pips. Didn't had time to work on this yet. And I'm not a programmer, so it's taking longer time than normally. Understand it a bit, but I'm a beginner at mql4. But, I have a habit... doing something until it works. 🙂

                        T 1 Reply Last reply Reply Quote 0
                        • T
                          trader.philipps @CPxiom last edited by

                          @cpxiom Passion is always a good attitude 😉

                          I like to share my knowledge, but expect the others to contribute as well.

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

                          Online Users

                          K
                          C
                          E
                          M
                          F
                          T

                          17
                          Online

                          146.6k
                          Users

                          22.4k
                          Topics

                          122.6k
                          Posts

                          Powered by NodeBB Forums | Contributors