fxDreema

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

    Turing Off EA after set $/Pips made

    Questions & Answers
    4
    40
    11389
    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.
    • wadz91
      wadz91 @Pipologist last edited by

      @pipologist You should have shared the link from the beginning and yh simple thing but VERY COMPLEX work bro.

      I was still looking for (MAX 20 PIPS A DAY) MT4 EA to make but can't.

      Within 6 years I hope you found a solutation.

      All the best.

      Wadz

      l'andorrĂ  1 Reply Last reply Reply Quote 0
      • P
        Pipologist last edited by

        Is there a way to turn off the EA after a set number of profit ($ or Pips) is made for that day, or more accurately "Trade Cycle" ie. 9:00pm to 6:00am chart time
        Not just for only one trade, but a total of all profits made from multiple trades made through out the trade cycle.

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

          It's like every third question is about how to find some profit these days đŸ™‚ I think I'm gonna make some block tomorrow for this, because I'm tired to explain this over and over.

          Otherwise there are few ways I can suggest

          • to define Variable, to reset it at some time and then when a trade is closed to add it's profit to the variable
          • at any time to start looking into the closed trades and calculate the sum of their profits, and put that sum in a Variable again. I am talking for "For each Closed Trade" + other blocks here
          • also using a Variable, to set the value of a Variable at some time (9:00) to the current Balance or Equity at that time. Then at any given time to calculate Balance (or Equity) minus that value. Of course, we are talking for the global account balance/equity here.
          1 Reply Last reply Reply Quote 0
          • P
            Pipologist last edited by

            I tried to play with those ideas, but variables are not my thing i guess, so I would need some examples.
            I would guess that waiting for you to put a block together will be easier.

            Please let me know where you put the block and it's name when you get done making it.

            thx

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

              What do you want to calculate exactly?

              1 Reply Last reply Reply Quote 0
              • P
                Pipologist last edited by

                I want the EA to stop taking new trades after x number of pips are made for that day or trade cycle

                If there was a block that could calculate profit /pips made when the block was on, and another block that could reset that block, like in the "Counter" blocks.

                So the block would pass until the set number of profit/Pips were made, then it would not pass

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

                  I decided to add some Time filters in "Bucket of Closed Trades", because this block is more universal. Here is some example - https://fxdreema.com/shared/vG2Mmhzjd Here in the comment we can see the Count of closed trades since 00:00 of the current day. Profit can be calculated as well, I am showing Count because it's easier to see what is going on.

                  1 Reply Last reply Reply Quote 0
                  • P
                    Pipologist last edited by

                    I downloaded your example and ran it. It took trades and set TP/SL but looking at the blocks and watching the EA work I still could not figure it out.
                    "variables" and "Bucket of Closed Trades" are above me.
                    That being said, "Bucket of Closed Trades" implies the trade would be "closed" to get the info (profit/Pips) and I would like it to update per tick.
                    When pre-set profit/Pip is meet, i want it to close all trades and don't take any new trades until next trade cycle/day

                    Is there anyway that i could talk you into making a block that works as previously described:

                    "If there was a block that could calculate equity/pips made when the block was on, and another block that could reset that block, like in the "Counter" blocks.

                    So the block would pass until the set number of profit/Pips were made, then it would not pass"

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

                      What do you want to do exactly?

                      It's midnight, 00:00, a new day starts. The EA is working. Nothing happens until 08:02. At 08:02 a new trade is created... How this story continues?

                      1 Reply Last reply Reply Quote 0
                      • P
                        Pipologist last edited by

                        I'm thinking it would be best to set this up like your "Counter Blocks/Reset

                        First Block, lets call it "Profit" Block - When block is "Reset" The EA takes a snapshot of the account Equity (block passes) then monitors Equity until pre-selected increase/decrease in Equity is hit (then block does not pass)

                        Second Block, "Profit Reset" - It would be nice if this block could be triggered by another block passing to it, or Time, ie. 09:00 chart time

                        It would also be nice if the Profit Block could have the option of monitoring: Balance, Equity, or Pips.

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

                          https://fxdreema.com/shared/rmsdqn0uc

                          1 Reply Last reply Reply Quote 0
                          • P
                            Pipologist last edited by

                            That shows that the EA can see the info that is needed for the Equity option of the block, and I assume the same can be done for the Balance option of the block. Can This be done for the Pip option also?

                            I just finished the rest of my EA, just waiting for you to make the last two blocks.

                            Do you have an estimate on When you will be able to make the blocks?

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

                              What blocks? Early in the topic I mentioned this - post/11618

                              1 Reply Last reply Reply Quote 0
                              • P
                                Pipologist last edited by

                                Somehow I got confused.

                                I asked "Is there a way to turn off the EA after a set number of profit ($ or Pips) is made"

                                You said "It's like every third question is about how to find some profit these days đŸ™‚ I think I'm gonna make some** block **tomorrow for this, because I'm tired to explain this over and over."

                                You did give two examples:
                                https://fxdreema.com/shared/vG2Mmhzjd - as far as I can tell took trades and set SL/TP, also implies the trade would be closed before calculating

                                https://fxdreema.com/shared/rmsdqn0uc - Which show that it can add Equity, but I have no clue how to make this work for how I need it for. and is only one piece of what i need this block to do, I need it to Not Pass when "x" amount is reached, and time not just a candle

                                As I said before "variables and "Bucket of Closed Trades" are above me." If I could do this I would assume that I could code my own EA. Which I'm guessing most of the "every third question " people fall into.

                                When you asked "What do you want to do exactly?" I figured that you were still gonna make the Blocks, which is why I said:

                                "I'm thinking it would be best to set this up like your "Counter Blocks/Reset

                                First Block, lets call it "Profit" Block - When block is "Reset" The EA takes a snapshot of the account Equity (block passes) then monitors Equity until pre-selected increase/decrease in Equity is hit (then block does not pass)

                                Second Block, "Profit Reset" - It would be nice if this block could be triggered by another block passing to it, or Time, ie. 09:00 chart time

                                It would also be nice if the Profit Block could have the option of monitoring: Balance, Equity, or Pips."


                                I hope you reconsider making these blocks, If not to save your time trying to explain this every third question, but because I'm sure a lot of people will find these blocks useful.

                                Thx

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

                                  That's the problem with blocks - people eventually ask for one more option in them. So I am always trying to make things more universal, to be able to use one block in multiple ways.

                                  "Buckets of ..." is actually pretty easy. This block gets the existing trades (or closed trades, or pending orders)... let's say you have 5 of them... and creates a list of them. Then in "Condition" for this list of trades as a group you can get many things - profit, lots, stop-loss.... and for each of them you can get the average, max, min or total value.

                                  In this example https://fxdreema.com/shared/rmsdqn0uc I'm also showing things in general. This example uses one Variable and stores value to it once a day at 01:15. Then the value of that Variable can be read whenever you want. In the project I print in as a comment on the chart. This does not stop you from using it in a "Condition" block and compare it with some other value.

                                  1 Reply Last reply Reply Quote 0
                                  • P
                                    Pipologist last edited by

                                    I understand the problem with making blocks and giving them enough options to be useful and hopefully make your life easier by not having to help/answer the same question all of the time, as I'm the one that talked you into making 4 of your EA Generator blocks (Single Candle Template, Turn ON Blocks, Turn OFF blocks, Toggle Blocks) which I'm sure your users use all the time, and I would guess because this tread has 86 views at this point , they would use these two blocks too.

                                    But it is what it is, so before I have to hire a coder to make this EA lets see if you can help me figure this out how to put this together.

                                    So again, the end goal is to turn on and off some blocks (stop taking trades and close orders) when X amount of profit (Pips/$) is made from all trades (open or closed) through out the set trade Cycle. This would take 2 blocks with the requested blocks.

                                    I took my best guess at it with these 5 blocks. Can you please take a look at them and tell me what you think.

                                    EA - "Follow the money fixed"
                                    Area 4 - "Time to"

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

                                      It's so easy to get the current Account Balance, Account Equity, Account Profit or the total profit realized by group of closed trades. Or the total unrealized profit (by currently working trades). It's just a bit harder to get the profit of closed + working trades, bit it's not impossible. I just don't understand which of these variants do you want to use.

                                      Turning blocks on or off is pretty obvious. It's just action that can be done. What I don't understant is the profit calculation.... or whatever it is. Because I posted some example above of how to get shanpshot of Equity and then use it later.

                                      1 Reply Last reply Reply Quote 0
                                      • P
                                        Pipologist last edited by

                                        After some thought, the Example that you gave is a work around. And by that I mean I think it will work.I still have not figured it out yet, but the fact that you can take a snapshot of the equity and use it for reference to compare against, makes sense. so far i think i can figure out how to see it it's greater than >, but I'm still a little confused how to figure out how to say that it is X amount greater than (ie. >1000) I used the "Adjust" field but that is not adjustable in the input field of the EA.

                                        But here's the problem, because it looks at the equity, so any other trading on the account will effect this EA. Now this might be okay, but it might not.

                                        I started looking at Equity because I could see it in the terminal window, and thinking that it would be easy to reference, but I like the idea of Pips(price) better.

                                        So I guess the question is, is there a way to record price that starts at a set time and sees the total accumulated values of all trades taken regardless if the trade is closed or running?

                                        If so, then I would think that filters can be applied (Group, Market, and Type(Buy/Sell)

                                        It would also be nice to be able to use Equity. Maybe this could be done by the math of Lot size verses price. That way it will only see Equity of the trades taken by EA.

                                        Does any of this make sense? What do you think?

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

                                          Any numeric value can be stored in a Variable at any time, and then at any time it can be used or modified again - https://fxdreema.com/demo/mt4-variables

                                          If you want to get min/max/average lot/price/something else from a group of trades/orders/closed trades, I will suggest to use those blocks in "Buckets of Trades and Orders'" category. Each of them prepares a list of trades/orders and then in "Condition -> Buckets of Trades/Orders" some value can be get.

                                          1 Reply Last reply Reply Quote 0
                                          • P
                                            Pipologist last edited by

                                            Wow, I'm sorry. It seem that if I could have talked you in to making the blocks in the first place I would not have taken so much of your time.

                                            But the bottom line is that I guess I'm not that smart. I looked through each block in your example and loaded into my MT4 and watched it work, but I have no clue how that is supposed to help me accomplish my desired result. If I was a coder I'm sure using Variables and Constants It would make sense, but if I was a coder i probably would not need fxdreema.

                                            So myself and the 100+ people viewing this thread are not going to get the two blocks to accomplish this action easily, So I guess I'll resort back to the "workaround" and only be able to use just this EA on a MT4 account.

                                            So I think I got it to work, except that I can not adjust the amount of profit per trade cycle via the EA input. So I would have to have a different EA for each profit amount.
                                            Can you think of a workaround for the workaround so I can adjust it via the EA input.

                                            Using your example with "LastStoredEquity" I made a "Condition" block Account/Equity > Value/Numeric/LastStoredEquity w/Adjust 1000.

                                            Is that going to work? and is there a way to make the "Adjust" 1000 adjustable via EA input?

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

                                            Online Users

                                            O
                                            B
                                            M
                                            Z
                                            S
                                            S
                                            T
                                            G
                                            B
                                            A
                                            P
                                            I

                                            22
                                            Online

                                            146.7k
                                            Users

                                            22.4k
                                            Topics

                                            122.6k
                                            Posts

                                            Powered by NodeBB Forums | Contributors