fxDreema

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

    Expire order in n bars *** SOLVED ***

    Questions & Answers
    2
    5
    1289
    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.
    • T
      trader.philipps last edited by trader.philipps

      Hi, I currently try to find an easy way to expire an order (best on the BUY or SELL block defined) after n bars (eg. after 50 bars) regardless of if it is in profit or loss.
      Has someone a quick solution? By custom MQL code I might calculate the current chart timeframe to minutes and multiply by my bar expiry value.

      For example for an M15 chart I might calculate 5015 minutes. For an H1 chart it would be 5060 minutes and so on.

      Is there an easier way I don't see right now?

      I like to share my knowledge, but expect the others to contribute as well.

      T roar 2 Replies Last reply Reply Quote 0
      • T
        trader.philipps @trader.philipps last edited by

        @trader-philipps Okay, I shouldn't answer my questions by myself, but writing the issue down gave me the hint. For everyone who is interested, I solved the issue with the period() function that gives back an integer value in minutes for the current chart timeframe. In fxdreema it looks like that now.

        0_1579098018045_c79d2931-21e1-40a2-9da8-3ed5f5e92b19-image.png

        ciOrderExpirationBars is an integer constant were the user can set the number of bars in the EA's parameters.

        I like to share my knowledge, but expect the others to contribute as well.

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

          Hi!

          I think this candle ID function gets the "candle age" of each trade
          0_1579098210211_a2730340-cb6a-4338-8bbe-54846e6f50a0-image.png

          Need small help? Tag me in your post
          Need big help? https://www.fiverr.com/big_algo/automate-your-winning-strategy-in-mql4-or-mql5

          1 Reply Last reply Reply Quote 0
          • roar
            roar @trader.philipps last edited by

            @trader-philipps Does the expiration mode account for closed market time? Just curious

            Need small help? Tag me in your post
            Need big help? https://www.fiverr.com/big_algo/automate-your-winning-strategy-in-mql4-or-mql5

            T 1 Reply Last reply Reply Quote 0
            • T
              trader.philipps @roar last edited by trader.philipps

              @roar It depends on specifying yes or no here..

              0_1579098606232_b34ade5f-fbf3-4325-a781-c58354bfc877-image.png

              But to be honest I don't know what the broker does with it as the expiration is send with the ordersend of the order.

              I like to share my knowledge, but expect the others to contribute as well.

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

              Online Users

              E
              A
              E
              M
              F
              K
              C

              17
              Online

              146.7k
              Users

              22.4k
              Topics

              122.6k
              Posts

              Powered by NodeBB Forums | Contributors