fxDreema

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

    Modify (Move) Pending Order to certain price level

    Questions & Answers
    2
    36
    14761
    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.
    • K
      kevin last edited by

      __But you can delete them ๐Ÿ˜ฎ

      I don't know what to tell you. This is only 1 step that you are explaining. But if there are more steps, the way to do things can be very different. Otherwise in my latest example I think I'm showing how to put 3 orders over 3 another orders. Of course, mine are all from the same Group.[/quote:16o3hnri]

      Ok, I will write the steps and hopefully, you will have the courage and enthusiasm to go through them all - hence, my PMs ๐Ÿ™‚

      1. Create Initial Grid
        1.1) 3 STARTING buy pending orders above mid price in 5 pip increments (TP of all the buy pending orders 5 pips above the pending orders/ SL of sell pending orders at this level too)
        1.2) 3 STARTING sell pending orders below mid price in 5 pip increments (TP of all sell pending orders 5 pips below the pending orders/ SL of all buy pending orders at this level too)

      This was the initial grid. Now here is where the fun starts.

      When price hits 1st buy pending order level - ea should create another 3 sell pending orders at the same levels where the STARTING SELL pending orders are. When price hits 2nd buy pending order level - again, ea creates another 3 sell pending orders at the STARTING SELL levels. Same applied to 3rd buy pending order level - ea places another 3 sell pending orders at the STARTING sell levels.

      The reverse happens when price triggers sell pending orders - 1st level - ea places 3 buy pending orders at the STARTING BUYS levels. Same applies when it hits 2nd and 3rd level.

      For each pending order at that particular level, the ea will create 3 COUNTER pending orders at the opposite levels.
      This it it, I think I described it as best as I could. Picture here: http://imgur.com/a5hzTlB

      Please, it may seem complex, but it is not THAT complicated. It definitely isnt rocket science and I would be grateful if this amazing software would build this nice EA ๐Ÿ™‚

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

        Haha, I didn't even noticed that you are the one who is writing me these PMs ๐Ÿ˜„

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

          And what happens if all 3 Buy orders are turned into trades and you have 0 Buy orders and 9 Sell orders? Is the strategy like endless loop of doing the same stuff again and again (creating orders again and again), or there is only 1 iteration and the maximum number of pending orders at a time is 9?

          1 Reply Last reply Reply Quote 0
          • K
            kevin last edited by

            __And what happens if all 3 Buy orders are turned into trades and you have 0 Buy orders and 9 Sell orders? Is the strategy like endless loop of doing the same stuff again and again (creating orders again and again), or there is only 1 iteration and the maximum number of pending orders at a time is 9?[/quote๐Ÿ˜ zwlo6lj]

            There is no limit to creation of orders (OR actually there is, that being your margin - which is the only drawback of the strategy). So yes, it is an endless loop of creating orders. Here, this is an example of what happens when the price goes UP, DOWN and all the way UP again, through all the levels. http://imgur.com/I6PaIS3

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

              You are searching for problems with this strategy. At some point pending orders will start to fail triggering because of not enough money, and then... who knows.

              Here is something you can play with - https://fxdreema.com/shared/4KGmUO93
              But if each new order is copy of old one, I don't understand when new levels of orders are created.

              And again, my idea is to teach you how things work, so you can always make everything yourself. The example above works like this:

              • Initial orders are created - 3 Buys and 3 Sells
              • Then, on every new tick, if new trade is created, block 6 is reached once. So, for each new trade, depending on its type (Buy or Sell), 3 new orders are created.
              • Why only 3 new orders are created even if you have 6 Sell orders and the third Buy order is triggering? Because of blocks 8 and 11. If they don't exists, the amount of new orders will be the same as the amount of orders at the time.
              1 Reply Last reply Reply Quote 0
              • fxDreema
                fxDreema last edited by

                "once per trade/order" is sensitive block. It has internal memory where it remembers which trade/order passed. But this memory is in the RAM and if the EA is restarted, the memory is cleared. That's why there is an option inside... you will see what is the option. The idea is to prevent this block from passing again and again for the same trades/orders every time the EA is restarted. If the EA does not work with trades created before it's start, then these blocks will not pass for these trades and there is no chance for doing something again and again on every restart ๐Ÿ™‚

                1 Reply Last reply Reply Quote 0
                • K
                  kevin last edited by

                  Thank you! I shall test this and report back ๐Ÿ™‚

                  I think you got what it is all about ๐Ÿ™‚ This strategy is a cleverly hidden martingale. Maybe you now see how the orders are multiplying on either side. So as long as there is enough money, I will always win, I even proved it mathematically, I did the calculations. Also, this will work perfectly in a trending market, because I need the price to reach TP/SL ASAP. In a ranging market, I may expect a call from Mr.Margin. However, I aim to make a certain amount of profit, then withdraw and start again, as far as money-management goes. So yeah, this is what Im playing with for weeks now ๐Ÿ˜„

                  I would also like to add that I appreciate your approach, time and help ๐Ÿ™‚ Your explanations are great and helpful

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

                    Haha, Martingale is also provem mathematically... until you run out of money ๐Ÿ˜† Every mathematical strategy has some weakness, specific series of events that lead to crash ๐Ÿ˜„

                    If you ever decide to put this EA to work, put different checks. Maximum number of trades, minimum Equity... things like that. With so many trades and orders there is some chance for things to go very wrong.

                    N 1 Reply Last reply Reply Quote 0
                    • K
                      kevin last edited by

                      Well, these blocks you gave me really are a step forward. However, there is a slight error they cause. That is, when price hits for example the 1st sell level - a sell position opens (logically) - and the EA creates 3 Buy pending orders at the buy levels. That is great.

                      But when price reverses, hits the 1st BUY Level, the EA creates SELL pending orders only at the lower two levels - misses out the 1st one.

                      I think this is because of the "For each pending order" blocks, particularly 7 and 10. When price reverses from the opened sell position and hits BUY Level, the three sell levels are now like this: 1st Sell position 2nd Sell pending order 3rd Sell pending order. Therefore, the EA creates sell pending orders only at the lower two levels (Because "For Each pending order" - Level 1 Sell is no longer a pending order but an opened position).

                      Picture here: http://imgur.com/a/T4Wjp (NOTE: See the small Arrows created by the orders)

                      1 Reply Last reply Reply Quote 0
                      • K
                        kevin last edited by

                        Please read the post above as well ๐Ÿ™‚

                        TEST REPORT:
                        Positives: Orders open exactly at the levels where they should. (What this means that "order on order" is truly precisely placed to the point)

                        Negatives: They do not open in the correct count (now, too many orders open) All is caused by the "For each pending order" block.

                        Please, take the time to go through these pictures thoroughly. It will help you understand the problem better.
                        This is a scenario where price goes up through all three buy levels.
                        What EA does WRONG: http://imgur.com/a/VZiCa

                        What EA should do CORRECTLY: http://imgur.com/a/3p9NC

                        Dont get confused now, here is the continuation. Remember, in the above scenario, price went up through all three buy levels. Now, imagine that it reverses, and goes through all three SELL levels. In the picture, take a look at the numbering (order) of actions (In green circles)
                        Picture here: http://imgur.com/a/Zsqly

                        Basically, the blocks "For Each pending order" (Blocks 7 and 10) are causing a little bit of chaos.
                        __ The CORRECT WAY IS:
                        Each time a position is opened on a certain level, 1 COUNTER pending order is created on each of the opposite levels (3 Counter pending orders in total) __

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

                          Well, obviously what I do in my EA is to copy the existing orders. If only 2 Buy orders exists, then only 2 new orders will be created. This does not mean that we can't also "copy" the existing trade (if 2 orders and 1 trade exists). You can get any value from any existing trade or order. Also, you can get values from history (closed) trades. Just look at the names of these "For each... " blocks.

                          I told you before this - everything I want is to show you how things work in general, so you can then make your EAs easily ๐Ÿ™‚

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

                            Try this: http://prntscr.com/bvf9pn Or better this: http://prntscr.com/bvfaee I didn't tried it, but I guess it will work

                            1 Reply Last reply Reply Quote 0
                            • K
                              kevin last edited by

                              __Try this: http://prntscr.com/bvf9pn Or better this: http://prntscr.com/bvfaee I didn't tried it, but I guess it will work[/quote:1b5qjvpb]

                              Ok, I will test it out.

                              When Im thinking about it, I logically would like to use blocks under "On Trade" - "Trade created" - because this is when I would like the EA to place 1 COUNTER pending order on each of the opposite levels. (Totaling 3 pending orders, because 3 levels)

                              How do I make these pending orders EXACTLY on the same price level as the initial ones though? That is what I would like to solve.

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

                                Instead of "(in loop)..." use "(on Trade) Event Data" when the block is in "on Trade" and you want to get values from the trade that caused the event

                                1 Reply Last reply Reply Quote 0
                                • K
                                  kevin last edited by

                                  After weeks of trying and testing various versions, it now opens orders over orders, like I wanted but not in the correct amount. This is what I have: https://fxdreema.com/shared/W4vgNMRkc. I have reached the conclusion that it just does not work

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

                                    What does not work?

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

                                    Online Users

                                    E
                                    L
                                    G
                                    K
                                    E
                                    S
                                    E
                                    P
                                    G
                                    R
                                    N
                                    S
                                    E
                                    E
                                    M
                                    O
                                    B

                                    31
                                    Online

                                    146.7k
                                    Users

                                    22.4k
                                    Topics

                                    122.6k
                                    Posts

                                    Powered by NodeBB Forums | Contributors