Here there is something similar

https://fxdreema.com/forum/topic/7991/close-trade

only that, instead of closing the trade, you should change the parameter to open it. But I think it's the same logic. Check it out