How to implement Fill Or Kill (FOK)?Close all trades if trade x is closed?
-
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.pngThe 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!
-
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.
-
I will test the ON Trade one and give feedback
