fxDreema

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

    MT5 projects only: "For each closed position" not working properly when "Buy/sell pending order" blocks are used

    Bug Reports
    2
    9
    2964
    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.
    • M
      moreirajbn last edited by moreirajbn

      Hi @fxDreema

      It seems like the "For each *** position" blocks (and other blocks related to trade history) are not working properly when I use "Buy/sell pending order". It seems to start passing only after a number of positions (opened from pending orders) have been closed, and it doesn't respect the rules under "loop settings", because the information I need (profit) only updates after several positions have been closed, even though I choose only 1 in "Not more than "n" history trades". It works perfectly when "buy/sell now" blocks are used.

      Can you please check that?

      See images below

      The project: http://fxdreema.com/shared/Hlsgw9H9c
      0_1523745619895_Screen Shot 2018-04-15 at 00.40.07.png

      Closed positions, but no comments shown
      0_1523745667843_Screen Shot 2018-04-15 at 00.36.22.png

      Comments appear after many positions are closed
      0_1523745698878_Screen Shot 2018-04-15 at 00.38.14.png

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

        This is where it appears to me:
        0_1523911656686_0034a552-80e8-46e1-8e7d-02ae1e3292fc-image.png

        What if you move the chart left-right with the mouse a little bit? Sometimes objects are printed with delay in MT5.

        M 1 Reply Last reply Reply Quote 0
        • M
          moreirajbn @fxDreema last edited by moreirajbn

          @fxdreema

          I tried and it still doesn't work. I used the comment block to illustrate the problem I'm having.. but in fact it seems to be a problem with the history of trades created from pending orders.... for example, the martingale function doesn't work on the "buy/sell pending order" blocks. For example: fxdreema.com/shared/D4HmSiFE

          The martingale doesn't add lots after loss... or whenever I try to search history trades with "for each position" or "bucket of position", it never gives the right results when the history is made of trades created from pending orders. I tried in 4 different computers and the problem is the same.. can you please check if , the martingale on pending orders work for you? fxdreema.com/shared/D4HmSiFE . (it's onTick)

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

            I think that the problems happen when the orders have expiration, I will make some tests to see what is wrong.

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

              I don't know what happens, but I was able to see the problem (always 0.1 lots in Martingale) once and then magically everything works fine. Very strange, I think this happened with your "Comment" example, and also few months before when another guy reported something like this. I wonder what someone else can see - is there a problem?

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

                Ok, here is mine easy to test example - https://fxdreema.com/shared/mRvSlNKW Now I got the problem every time and also quickly.

                • Initially I create 1 pending order and 1 trade. The order has expiration of 12 minutes and expires before the trade is closed by SL.
                • After that in "on Tick" a new order is created and the EA is self terminated.

                That second order is expected to have lot size of 0.2 lots, but it opens 0.1 lots. If I remove block 2 (the first pending order that expires) everything is fine with the second order, it opens 0.2 lots. So it looks that something is wrong with that first order, maybe because of the expiration.

                I'm sleepy now and I think I am going to sleep, but I will try to fix this problem tomorrow.

                M 1 Reply Last reply Reply Quote 0
                • M
                  moreirajbn @fxDreema last edited by

                  @fxdreema

                  Great if you can look it up...

                  Maybe this can help you further: I also thought the expiration was the problem, but at least here it's not. I tried without expiration and problem continues... I also made another type of expiration (blocks: "for each pending order -> check age (open time, pass if older than X min) -> delete pending orders"), and the problem continues as wells.

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

                    I think I fixed these problems.

                    For Martingale in the "pending order" blocks, I'm confused how it should work. Normally this strategy requires one position at a time. But these are pending orders - they don't even exist. If you place a new pending order with Martingale, what should be its lot size, from where it should be calculated - from some previous position or from the previous pending order? And I think that every answer to this question is correct and incorrect, because Martingale is not supposed to work like that 🙂

                    M 1 Reply Last reply Reply Quote 0
                    • M
                      moreirajbn @fxDreema last edited by moreirajbn

                      @fxdreema

                      I agree that there is no golden rule on how martingale should work. In my opinion the EA should look at the lot size and overall outcome (profit/loss) of the previous position, independently of how it was open (market or pending order) to decide on the next pending order's lot size, but this is just my opinion.

                      Either way, now that the function is working (I've tested a "simple martingale" from pending orders at least) the user can see how the block behaves and decide for himself what to do...

                      As always, fxDreema empowering trader's creativity... best tool on the whole internet 🙂

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

                      Online Users

                      L

                      8
                      Online

                      146.8k
                      Users

                      22.4k
                      Topics

                      122.6k
                      Posts

                      Powered by NodeBB Forums | Contributors