fxDreema

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

    Move stop loss to last take profit

    Questions & Answers
    2
    3
    890
    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.
    • X
      Xander last edited by

      Hi All. I am busy with an EA designed to open two positions. Each position will have an initial stop loss of 20 pips. Then if first target is at 10 pips the first trade will be closed and the second's stop loss moved to a loss of 10 pips. This part is working fine. Where I am stuck is I need a condition that if the new stop loss is greater then 10 pips (the first target) then the second trade should be auto closed (this happens sometimes due spread spikes). The numbers used above are just examples they are variable depending on the trade. I have tried the below but it does not work for some reason?

      0_1554640341639_2254de98-60e5-4d80-b6b3-b0235d158f47-image.png

      Any suggestions are welcome.

      1 Reply Last reply Reply Quote 0
      • X
        Xander last edited by

        Apologies one more thing, the reason I use the formula is because these blocks trigger when the first trade closes, so the open range should be equal to the profit of the first trade

        1 Reply Last reply Reply Quote 0
        • W
          windsor-2003 last edited by

          After modifying the stop loss of the second trade, calculate the distance between the new stop loss and the entry price. If that distance is less than or equal to -10 pips (i.e., SL is more than 10 pips away in loss), close the second trade.

          You can use "For Each Trade" block with Skip every "n" trade = 1 — this will select the second trade.

          Then, use "Pips away from Stop Loss" or "Pips away from Open Price" to calculate how far the stop loss is from the entry.
          If the pips from SL > first target (e.g., 10 pips), use a "Close Trade" block to close the second trade automatically.

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

          Online Users

          C
          I
          I
          E
          E
          O
          O
          D
          F
          K

          22
          Online

          146.6k
          Users

          22.4k
          Topics

          122.6k
          Posts

          Powered by NodeBB Forums | Contributors