fxDreema

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

    self updating/refreshing grid, compare two groups of trades

    Questions & Answers
    10
    449
    423928
    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.
    • fxDreema
      fxDreema last edited by

      It works for me, it does what is expected from these blocks, which is adding new trade after the price goes at 20 pips above or below the last trade

      the project: https://fxdreema.com/shared/jUe1CQnEc
      the result: http://prntscr.com/42jny4

      Notice this option: http://prntscr.com/42joch With it, it detects when the price is 20 pips from open price below or above - both are valid, it's not only below or only above.

      1 Reply Last reply Reply Quote 0
      • R
        ramsay09 last edited by

        Thank you so far. The first step is done.

        Now I need the parameters "pips away from open-price", "take profit" and "lot size" as dependence of trend, messured for example with "Check average profit from "n" trades".

        Parameters should range between min and max (custom input).
        These dynamic parameters can be percentage value of last Trades parameter for instance 120% of last value or something like every 2 Trades (custom input) +10 pips (custom input) and for lots +0.01 lot (custom input).

        What I mean is as long as "Check average profit from "n" trades" is true (trend is valid) the value of "pips away from open-price" should decrease each trade and visa verse. How is this realizable? How can i get acces to "pips away from open-price" ? Variables?

        https://fxdreema.com/shared/HYwwr0Nvc

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

          pips away from open price is:

          • for sells: OpenPrice - Bid
          • for buys: Ask - OpenPrice
            ... converted into pips

          Parameters from the last trade can be get, but there is no information there for how Open Price was related to the previous trade. Comparing it's Open Price to the Open Price of the previously placed trade may give something, and things go complex here.
          Another way is to use variables to hold/increment/reset/use these % values, which means that when the EA is turned off this memory will be gone... if that matters.

          It's a bit easier for SL/TP... if they does not move. SL/TP are also price levels and nothing else, but we often compare these to the open price. If there is some trailing stop, getting SL from the last closed trade will give different values every time. Not to mention the situation where SL can go on the other side of Open Price using trailing stop. In this case how much is the SL? There are workarounds here, but again things are going to be complex 🙂

          In "Buy/Sell pending orders in grid" there are gradation settings for open price, SL, TP and lot size. What about these?

          1 Reply Last reply Reply Quote 0
          • R
            ramsay09 last edited by

            yes, "Buy/Sell pending orders in grid" got almost everything I need but this block should work like the two trees are working properly now. I need every 10 to X pips a buy and sell order it does not matter if market is rising or falling. To prevent exponential losses in placing orders against the market i need to increase gap, TP and lot size between orders against the market as long as trend is valid detected by orders in profit. I need these values dynamic. There will be no stop loss but something like "check unrealized profits".

            I know this is complex but everything else is not really profitable. If it is not possible to create this EA I have to hire someone to recode a free EA, I like very much (Super Money Grid) or to code a similar one. The only disadvantages of this EA is not to place orders in market direction and not to increase gap and TP automaticly. Super Money Grid is very vulnerable for strong trending market situations. But this only mentioning in passing.

            What do you think is this, first, above mentioned realizable?

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

              If everything else is not really profitable, I wonder why this will be : ))) Just kidding, I don't really believe in Forex :))

              So, what are you looking for - data from the last closed trade? This is what I think you want to use. And this can be read using "For each Closed Trade", but I some variables needs to be used because after this block you will use "For each Trade" and it will overwrite all the other pink stuff (pink blocks and pink (in loop) options in Condition).

              Here are some of the native functions that can be used for calculations (look at the list on the left side): http://docs.mql4.com/trading/orderstoploss For example OrderStopLoss() gives you SL level of the currently loaded order/trade.

              1 Reply Last reply Reply Quote 0
              • R
                ramsay09 last edited by

                Well I found out that grid trading is simple and efficient. The Market is not pressed into concepts. Just drop a Grid, wait and take profit of "every" movement. It works fine if there will be not the little thing with strong trending markets situations.

                I found another way to avoid exponential growing losses. EA will check if profit is < -50 pips, > -50 pips, > -100 pips, > -150 pips if true EA will set "pips away..." to 10 pips, 20 pips, 40 pips, 80 pips. That will happen similar to TP and lot size.

                Could you explain how set "pips away.." after "current unrealized profits" or similar block is true/open? Variables will work I think but how to do this?

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

                  There are different ways to modify variables: https://fxdreema.com/demo/mt4-variables

                  1 Reply Last reply Reply Quote 0
                  • R
                    ramsay09 last edited by

                    The thing with Variables i do later. But what are the blue lables P1, P2, P3,... ?

                    I also need a betting sequence on buy and sell which works as follows:
                    the increment of lot size should work only on trades in loss and trades in profit should not decrement lot size.
                    I have tried the following:
                    https://fxdreema.com/shared/TQ38fzN2

                    but this have on effect at all. Is not every sequence number a multiplator for lot size? For instance 0.01*3 = 0.03 lot. Is it permisible to set sequence on profit to "0"?

                    Thanks.

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

                      P1, P2, P3 - these represents input parameters of the blocks.

                      Dalembert block, and all the blocks in the category that no longer exists work ONLY when all trades from the group are closed. You know, these are betting systems after all, which means that you bet, then wait to see if that bet will win or lose and after that you bet again depending on the last bet. If you open 2 or more trades at the same time, this is something else that is not Dalembert, Martingale ot any other betting system.

                      But now those betting systems are in Buy now and Sell now, and I allowed them to work with currently running trades... somehow. When going to create a new trade it will check the last running trade first. If there are no running trades then it will go to check the last closed trade, which is the normal situation.

                      For anything other than that I think some variable should be used. By the way check "Betting: Custom sequence" option.

                      1 Reply Last reply Reply Quote 0
                      • R
                        ramsay09 last edited by

                        unfortunately increasing the grid size by percentage or in steps is not helpful. Therefore I have to intervene more manually. What is a good way to make something like :
                        enable buy grid / enable sell grid
                        Pause grid (no more trades)
                        close buy grid trades / close sell grid trades
                        enable MA cross filter

                        I mean something like setting true or false as custom input to turn on and off functions, blocks or trees?

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

                          Define some Constant (because you can choose it's name, the way it will appear in inputs) and then use it in Condition.

                          http://prntscr.com/45o7j5

                          Well, I'm mixing boolean with numeric a little bit, but boolean 0 or 1 (false or true) which are basically numbers. You can place that constant at Value -> Boolean on the left side in Condition, but there is some visual bug that I need to inspect and that's why I'm using numeric.

                          And you can use numeric values where 1 can mean something, 2 - something else, 3 - different thing...

                          1 Reply Last reply Reply Quote 0
                          • R
                            ramsay09 last edited by

                            Thank you, works fine.
                            But how to realize something like "do not sell above price". Here I need current price value to compare with constant (this is changeable on the fly). I did not find where/how to get current price value.

                            What would you suggest?

                            By the way is there a block or something to detect or calculate support and resistence? If not what "way" would you suggest to realize that?

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

                              "Sell now" is used to sell, this block creates a new trade every time it runs. Run this block 10 times and you will get 10 trades. Run this blok 1 time and you will get 1 trade. Don't run this block at all and you will get nothing.

                              There is a block called "Condition" which is used to compare two values. When the comparison is true - it's orange output becomes active and the next block is run. Otherwise it's yellow output is active.

                              In the same block under "Market properties" you can find Ask and Bid. These are basically the current price. Yes, there are 2 current prices actually. Or Candle -> Candle Close.

                              1 Reply Last reply Reply Quote 0
                              • R
                                ramsay09 last edited by

                                thanks so far.

                                Is there a way to realize "Check current unrealized profit" (pips as sum of all profits) as trailing Stop or trailing TP? Using Trailing Stop for Groups have different results. I need a hint if it is possible. Mybe something with variables, formulas, flags, conditions... . I need something like after sum of profit was hitting 70 pips profit will be trailed with 20 pips.

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

                                  https://fxdreema.com/shared/hxkG9bOBc
                                  http://docs.mql4.com/trading/orderprofit

                                  1 Reply Last reply Reply Quote 0
                                  • R
                                    ramsay09 last edited by

                                    thanks. I will try to implement trailing stop later.

                                    Now I have the problem that there is something not working properly and I do not know whats wrong. Could you look over, please (left buy-side only).

                                    What I am expecting (with the default constant values) is the EA is working on "double sided" mode and on "buy now linear" mode but it is working on trading mode ("with market" condition). Earlier (on partly testings) it seems to work correctly.

                                    https://fxdreema.com/shared/FcgwQ3Dyb

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

                                      Maybe input parameters are cached and you think that the value is 1, but it is 3?

                                      1 Reply Last reply Reply Quote 0
                                      • R
                                        ramsay09 last edited by

                                        Mybe, but what could be done to prevent that? What is the reason for that?

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

                                          MT saves last used parameters in ini files somewhere, so when you add the same EA next time it uses the last input parameters used. But you can always see what the input values are

                                          1 Reply Last reply Reply Quote 0
                                          • R
                                            ramsay09 last edited by

                                            If you mean MTs expert properties, this can not be the reason EA is not working because I allways klick reset button after restart MT. Logically everything seems ok, to ensure this I try to name everything as good as possible. You also did not see any logical mistake, do not you? I just try to become more and more familar with fxdreema but there are still many blocks and features I did not touch.

                                            p.s.

                                            "pips away..." / "buy grid double sided" makes problems. I took dynamic size and as input formula result. When I substitut it with numeric value it works as it should. But the variable "grid space" gets the right calculated value and was used properly. The grid space was ok. What is wrong here? Please, look over when you have time.

                                            1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 3
                                            • 4
                                            • 5
                                            • 22
                                            • 23
                                            • 2 / 23
                                            • First post
                                              Last post

                                            Online Users

                                            G
                                            Y
                                            C
                                            S
                                            S
                                            S
                                            A

                                            29
                                            Online

                                            146.7k
                                            Users

                                            22.4k
                                            Topics

                                            122.6k
                                            Posts

                                            Powered by NodeBB Forums | Contributors