fxDreema

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

    Please help me how to resend pending order?

    Questions & Answers
    2
    4
    716
    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.
    • Z
      zoom20092 last edited by

      lf pending order active then price going to stoploss.
      l want lt to re open pending order (same last order).
      (If order tap stoploss EA will re open pending order again again).

      How to do it?

      https://fxdreema.com/shared/XolEYQuee

      Sorry for my English
      Thank you very much

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

        What is closed by SL is the trade that is result from your pending order, so you are going to work with it. There are different ways to do that.

        • Use "on Trade" event to detect when the trade is closed by SL. The downside is that this event is generated by the EA in the moment when the trade is closed, so if for some reason the EA is not working at that moment (you have closed MT or remover the EA from the chart), the event will be missed.

        • Do it under "on Tick". You can check if there is no trade at the moment, then check the last closed trade - if it was closed on loss, create new pending order using the same parameters from that closed trade (Open price, SL, TP and lot size). There are no events you can miss here, but imagine if you close the EA for some hours and then run it again - it will create a pending order where the last closed trade was, but hours later the price will be... who knows where.

        1 Reply Last reply Reply Quote 0
        • Z
          zoom20092 last edited by

          https://fxdreema.com/shared/IWHwTqTbd

          I had to try but not working maybe l do something wrong.

          Can you modify my project to working on reopen function.

          Please help me.
          Thank you very much.

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

            https://fxdreema.com/shared/vdsS1O2Ec

            Something like this, but not this. The problem here is that new pending orders are created every day, and at that time there can be an old trade still running. Then, because I used "No trade/order exists", a new pending order is created when everything is closed (no orders, no trades) and at these moments the last closed trade is... who knows how old is it. Some trades will be missed.

            https://fxdreema.com/shared/0FhOX0hN

            This is similar, but not the same. Note that "once per trade" have memory that is cleared when the EA is reloaded.

            At least you can get some idea 🙂

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

            Online Users

            F
            W
            C

            11
            Online

            146.8k
            Users

            22.4k
            Topics

            122.6k
            Posts

            Powered by NodeBB Forums | Contributors