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

      I transformed it a little bit so I can understand the structure better... https://fxdreema.com/shared/pJh3SS0pb

      So the problem is not in blocks 185, 186 and 187, it is in blocks 184, 180 and 181... depending on which one is used?

      Then I think the problem is this. Variable "grid_space" is the difference between two price levels, let's say 1.5 and 1.4, divided by 20. Now, 1.5-1.4=0.1 and 0.1/20=0.005. Variable "grid_space" is a value similar to 0.005. I call this price fraction, difference between two price levels. The problem is that "pips away" blocks accept pips value, something like 10 or 20 or 30. I can add option to accept price fraction, but... you know, at the beginning I wanted to add as many options as I can, but now I am the opposite 🙂 Well, if you do grid_space*10000 I think it will work.

      I actually have special functions to conver these values, but I will not recommend to use any of these functions, because I can eventually change them in future. In other words, I will not support these functions. So the value 10000 is accurate for most markets (symbols), and if you really want to make the EA symbol-independent, then there is a function toPips() 🙂

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

        thank you for help, it is working now but I have to go more in detail.

        Trailing stop is not a good idea but I think an ATR stop could work better. I have tried to create an ATR stop but it is working a little bit strange. http://prntscr.com/495t2o
        What would you suggest to improve to make an ATR stop that is not moving back and working as trend following stop?

        The another thing is to make "For each trade" and its blocks running/working on after an interruption. For instance if price is going below a resistence value (condition), "For each trade" stops but when price is above resistence value again "For each trade" is not going on with buying. http://prntscr.com/49601d . How that could be solved?

        https://fxdreema.com/shared/2SiPR6fSb

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

          There are blocks for trailing stop - one for each trade individually, one for group of trades... and also for another situations. ATR gives you values in that format which I call "price fraction" or "digits" (if there is something not updated by me somewhere). You can try these.

          In block 15 I can see you are using constant, which is... constant, remains the same. Or at least it should remain the same, better don't try to modify constants. This is the only block before "For each trade", so if there is some problem with running "For each Trade", I think the problem is in this block.

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

            The atr Stop at the left lower corner is not working (no backtest graph). There is backtest graph and arrows are drawn correctly when I connect "enable_atr" and "close buy trades" together. But there is already connection because of the flags. I do not know what is wrong. Could you help, please.

            http://prntscr.com/4a5oyc

            https://fxdreema.com/shared/5qu3M9rib

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

              Damn, this project has now too many variables, formulas and flags. I think it needs reorganization, some areas with descriptions.

              With so many global variables and start points (blocks connected only from their output) out there, blocks numbers matters. Blocks with lower number are executed first. Maybe this is the problem.

              Organize this stuff somehow, make some order. I will spend more time getting basic idea of what is going on 🙂

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

                Suggestions to reduce blocks and complexity are very welcome :).

                p.s.

                This is also not working.

                https://fxdreema.com/shared/hM7pa9eVb

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

                  And very hard to do actually. As a programmer in the beginning I was exactly like that, everything was chaotic. It is very easy to fill the program with stuff at the beginning, the problem starts after that. It's really bad when everything is spaghetti and some problem must be fixed or something new must be added. I fix something... something else crashes. I update something... it's getting even more chaotic and also something else crashes.

                  Now I'm training myself to make some order, and basically that's why I'm not updating fxDreema very often. Well, also because people don't ask for it, because there are already too many things for them. But I have some updates in mind that I want to become true.

                  I reorganized visually one of your projects before just to be able to understand it, I know that is possible 🙂

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

                    I understand you very well but you shoud really feel encouraged to improve fxdreema because it is an intuitive and efficient tool to build EAs ones you get familar with it. I personally like it more and more. The EA I am building has just 50%-70% of functionallity but it is usable for me at this state.

                    But I would like to have the EA working at the following state:
                    https://fxdreema.com/shared/VZzVfHhpb to test it and to finde more ideas to improve it later. It seems the flags and the connection between the atr-tree and "check current unrealized profit" makes problems. The atr-tree itself and everything else is working. What timeframe would you estimate to solve the problems to make the EA running at this state?

                    Thank you for your effort, help and patience :).

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

                      I told you that such a mess is bad, here is the same thing (I hope) with some order: https://fxdreema.com/shared/zP3UMbSPc
                      Export .mq4 file and import it in your profile to work with this project.

                      • When you only need to separate buys from sells, there is no need to use groups. Use groups when you want to separate buys from buys and sells from sells.
                      • I don't know where the trailing stop should be - after some conditions or working directly. I used *10000 to convert ATR values into "pips", because there is no "price fraction" option at the moment in trailing stop block.
                      • Something is wrong with blocks "Buy TP as sum" and "Sell TP as sum" - they calculate take-profits, but trades are all created without any stops initially, so these blocks don't have the chance to pass.
                      • In blocks 46 and 66 I used "Trading model" reversed with *(-1) in both cases.
                      • atr_stop_buy_grid and atr_stop_sell_grid are now defined, but not used.
                      • I didn't tested all the possible situations, but I edited many things and there is a chance for something to be wrong somewhere.
                      1 Reply Last reply Reply Quote 0
                      • R
                        ramsay09 last edited by

                        thank you, everythink is working fine but the atr stop. The Trailing stop you have created is not similar to an atr stop. You wrote you did not know where the stop should be or something like that. I have created the atr stop again but it is still not working. In the following I will explain how the atr stop should work. Maybe you have a solution the stop will work:

                        • when atr stop is enabled it should start to work after "Buy TP as sum" has reached 50 pips
                        • "atr indicator value X factor (3)" is written to atr_1
                        • now, to create a stop loss band for buy trades it is substracted from current market price. But this band is running always parallel to market price and will be never touched.
                        • to make this working as a stop this stop band have to be buffered into "atr_stop_buy_grid" after a comparision to its last value. This is because the stop should only rise and not fall below its last value. "atr_stop_buy_grid" gets only a new value if it is biger than last value otherwise it will not change.
                        • than market is compared with stop value. If true (market below stop) orders should close.
                        • in case orders could be closed "atr_stop_buy_grid" gets value "0" again and everything starts from beginning.

                        This is working correctly but as it seems not in direct connection to "Buy TP as sum". The stop is pictured correctly but the orders do not close after stop was hit.

                        Suggestions are welcome :).

                        https://fxdreema.com/shared/yBPhFexO

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

                          What's wrong with the trailing stop block, it can work with virtual stops as well 🙂

                          On the Buy side, when the price is going up block 402 passes often (better use > in it), but then when the price starts to fall down it does not pass. You want to modify "atr_stop_buy_grid" when needed, but check it all the time in order to close trades.

                          The answer: Break the connection between 403 and 404 🙂

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

                            thank you so far. The Trailing stop does not deliver the same results as the atr stop does, but it does not matter the atr and parabolic are working fine.

                            Everything else seems to working properly but now I have realized that block 523 and 524 are creating something like jumping lot size and are not working according to the selected settings. Could you look over what is wrong, please (the old version does not have that problem).

                            https://fxdreema.com/shared/N2HjkNFxe

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

                              You tried that Trailing stop? It's not only what it sounds like, it can follow the ATR levels or the levels of any similar indicator. As a result SL is placed at the newest ATR level. I think you are trying to make it the hard way. Yes, normally the Trailing stop block moves SL at fixed pips distance, but this block is one of these with many options. It can also trail TP, which sounds the opposite of Trailing Stop.

                              I don't know, I have this: http://prntscr.com/4em4c5
                              Some trades are opened at some levels and I don't even see how they can close. Also I think that Martingale should be used when there are no trades opened, which is not the case here. Now it gets lot size from the last opened trade, I enabled this because some people wanted it, and this is... I don't know, I can't get it.

                              Please, learn one simple thing. When you want to add something new to the project, try the new thing in another EA, only the thing, as simple as possible, with only few blocks. Then if it does not work you will know it and you will be sure where is the problem. Because now... you are adding something new over something complex and then you try it... things are getting more and more complex and hard to debug. I believe In this case you are going nowhere 🙂

                              By the way, define "jumping lot size". I can see you have added fixed lots on loss, which turns Martingale into something that is called Grand Martingale. If you don't realize that you may think that these 0.01 are something else... initial or something.

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

                                Yes, I have tried it but the results were differet to "my" atr stop. The atr stop-logic is not the problem it works fine. The most benefit of my creation is that it is plottable (so I can see what is going on) and I can use a special caracteristic whitch is useful for gridtrading and for other "protection logic" I will create later. But the trailing TP sounds very interesting 🙂 .How does it work? A TP is usually always in front of market. Could you explain how it works.

                                It seems many things are going more and more wrong but logically everything should work and it was working correctly for some time. I have rearranged an old version was working correctly appart from the atr stop (at that time). But it seems I did something wrong because the grid space "grid_space_factor" is not working when buy and sell grid is enabled. If one of them is disabled everything is working fine. I do not see the problem. Could you look over, please. https://fxdreema.com/shared/ATiPJuVEc
                                This is at least what I need.

                                You are right I have to go on very carefully but usually I try something and as long as it is not working or is not usefull I disable these blocks and the last time I look very carefully if everything is still working as it should. Sometims (not this time) it helps to delete a block and load/create it again. Do you think it could help to rebuild everything, the whole EA from begining? Logicaly everything seems to be OK and it was working.

                                Well, the martingale thing is just something to increase lot size, usually 0.01 (custom) in market and agaist market direction. Lot size count should start from beginning after trades have been closed. On jumping lot size I mean the rise of lot size is not linear like 0.01, 0.02, 0.03, reset, 0.01, 0.02, ... but something like 0.01, 0.02, 0.03, 0.01, 0.05, 0.01, 0.01, 0.01, 0.15, ... what I saw on block 523/4 (new created blocks, but did not help). https://fxdreema.com/shared/csDwp1txb

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

                                  Trailing TP is the same as SL, but the opposite - moving TP when losing. If someone needs it, who knows.

                                  Why don't you try things in separate EA before using them in that EA. Try how martingale works in separate, then when you see that it's working - add it here. At least this is what I do when something does not appear to work, and when I simplify things the problem shows up.

                                  Martingale. Before creating a new trade, the lot size of the previous one is checked. The previous one that is from the same group! No matter buy or sell. So you can have Buy and Sell blocks that can all work with the same Martingale. But when you have different groups, each group is individual.
                                  I removed these groups before, I don't know why you want to work with them. Now they separate the logic for Martingale. This is something that you may want actually, but I'm not sure that this is true.

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

                                    I have a working version, finally. I will keep that version as a basic EA and do not touch it. A copy of this as a working EA (building up) and an another copy as test/experimenting version. I would like to keep the Group number because I do not know what I will try to create in the future, maybe it will be nececary to seperate everything.

                                    I did not find out how to display current profit and loss. How could I realize that.

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

                                      I decided to create some EA builder when I found myself trying to create multifunctional EA back then 🙂

                                      "Comment on chart"?

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

                                        Yes, of course "Comment on chart" but where to get the values. The other values I have displayed were constants, variables or formula results. Which block delivers current profit and loss (buys and sells, not whole account or something) that could be used for "Comment on chart" or how to used it there. I would like to see the current profit/loss of current running buy trades and sell trades.

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

                                          There is no such thing 🙂 There is a block that calculates this, but everything that it does is hidden from other blocks.

                                          But I was thinking about that, I have 2 ways of doing it and I can't decide which is better. I mean... to get data from group of trades - profit, count, average profit, stuff like this.

                                          1. In Condition, adding the ability to filter trades as a group and get some property.
                                          2. Similar to trade loop, using block like "Select Group of Trades" to select the group of trades and calculate all the properties, then getting properties from special category in Condition.

                                          Why I can't decide which one to do...

                                          1. If you have selected the same group of trades in both sides of Condition, it will recalculate the same stuff twice. Not to mention if you have other Condition blocks. This will make the EA slow on backtest. Also the need to set filters again and again...
                                          2. In this way you can calculate all parameters once in a single block "Select Group of Trades" and then use any parameter multiple times without making the EA increasingly slower. The problem is that many people will not get the idea. And the other problem appears when you want to compare things from two groups of trades - when you get properties in Condition, which group they belongs to?
                                          1 Reply Last reply Reply Quote 0
                                          • fxDreema
                                            fxDreema last edited by

                                            By the way you can try the "iExposure" indicator, it comes with MT4

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

                                            Online Users

                                            A
                                            S
                                            B
                                            A

                                            13
                                            Online

                                            146.7k
                                            Users

                                            22.4k
                                            Topics

                                            122.6k
                                            Posts

                                            Powered by NodeBB Forums | Contributors