I noticed the method BrokerTrade for writing broker APIs does not work when partially closing a trade manually. It will only work when closing it fully. Do you confirm it is currently the case and not me doing something wrong? If it is, it would be interesting to have this functionality in the future.
Last edited by byakuren81; 03/13/2214:27.
Re: BrokerTrade and manual partial closing
[Re: byakuren81]
#485464 03/14/2216:0603/14/2216:06
I am not sure because I think no one so far had the idea to close a trade manually partially. But BrokerTrade should still work, unless the API is NFA compliant or does otherwise not support BrokerTrade.
Re: BrokerTrade and manual partial closing
[Re: byakuren81]
#485469 03/14/2219:1803/14/2219:18
Thank you for your answer but I can confirm it does not work. My broker is not NFA compliant. When I partially close a trade manually from the broker GUI, for instance 1 lot out of 3 initially opened, my BrokerTrade method returns -1 to tell Zorro 1 lot of this position has been closed, then during the next calls to BrokerTrade it returns 2 but Zorro trading engine does not update the TradeLots value on this trade and keeps the value 3. When I close this trade through the Zorro GUI by clicking on Stop and Yes to the question "Close open trades?", my BrokerSell2 method gets 3 as nAmount argument showing this trade was not updated.
Re: BrokerTrade and manual partial closing
[Re: byakuren81]
#485471 03/14/2221:3503/14/2221:35
That is what I do now but still Zorro does not update the tray closing a trade, it keeps the opening size in memory even if I return at some point a smaller positive number, so I conclude that partially closing a trade manually does not work. However, it works without issue when fully closing manually.
Last edited by byakuren81; 03/17/2220:28.
Re: BrokerTrade and manual partial closing
[Re: Petra]
#485499 03/17/2220:2803/17/2220:28