How to controle Trade and Pendings?
-
I have this problem: to get a signal, if the first order (market order) will be closed by the take profit from the blocks sell- or buy now.
A trade Start with a fix take profit. In the same time starting two peending orders.
The trade will be closed by take profit. So, I need a signal to close the two pending orders.Can you give an example to controle this???

regards,
Dieter -
Two ways to do that. One way is in "on Tick" to ask for "No trade is running" and then "Delete pending orders", if the strategy can work like this of course. And another way is in "on Trade" to wait for event "(on trade) Trade closed" and then again "Delete pending orders", and this method is similar to the first one because in order to detect that event somewhere in the code there is something that checks for new events on every tick. The first method will be faster in backtest I think.
-
Thank you,
the first methode withe the good backtest time seems to be the best.

Good Work!