fxDreema

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

    How to implement Fill Or Kill (FOK)?Close all trades if trade x is closed?

    Questions & Answers
    2
    3
    875
    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.
    • S
      semicon64 last edited by semicon64

      Hey Guys,

      Unfortunately I struggle implementing following:

      I open a new buy trade with Group 1 and with Stop-Loss set to X.

      If trade with group 2 is closed, close any further trade. (including remaining Group 1 trades)

      So its not about when profit is reached nor when stoploss is reached. I only want to check when trades from group 2 are closed that automatically the trades of group 1 must also be closed.

      After that the condition block on the left should restart (as my screenshot)

      However the implementation is not working, I get a cycle error and it opens millions of new trades.

      Here is a very simple example:
      https://i.imgur.com/XJv0wQN.png

      The methods on the right standalone did not work, they do create a loop and open/close new trade every tick and the programm crashes.

      Sincerely and thanks in advance!

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

        If you want to close group 1 when you have 0 trades from group 2, I think this is easy - just put "No trade" (for group 2) and "Close trades" (for group 1) after that.

        If your logic is something else, you can also try it in "on Trade" - there you can detect when a trade was closed (as an event) and do something when that happens.

        1 Reply Last reply Reply Quote 0
        • S
          semicon64 last edited by semicon64

          I will test the ON Trade one and give feedback 🙂

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

          Online Users

          A
          L
          S

          18
          Online

          146.7k
          Users

          22.4k
          Topics

          122.6k
          Posts

          Powered by NodeBB Forums | Contributors