Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 600 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
BrokerTrade and manual partial closing #485459
03/13/22 14:23
03/13/22 14:23
Joined: Jan 2014
Posts: 86
London City
B
byakuren81 Offline OP
Junior Member
byakuren81  Offline OP
Junior Member
B

Joined: Jan 2014
Posts: 86
London City
Hello,

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/22 14:27.
Re: BrokerTrade and manual partial closing [Re: byakuren81] #485464
03/14/22 16:06
03/14/22 16:06
Joined: Apr 2008
Posts: 585
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 585
Austria
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/22 19:18
03/14/22 19:18
Joined: Jan 2014
Posts: 86
London City
B
byakuren81 Offline OP
Junior Member
byakuren81  Offline OP
Junior Member
B

Joined: Jan 2014
Posts: 86
London City
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/22 21:35
03/14/22 21:35
Joined: Apr 2008
Posts: 585
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 585
Austria
What plugin are you using? If Brokertrade returns wrong values you should report it.

Re: BrokerTrade and manual partial closing [Re: byakuren81] #485473
03/15/22 07:36
03/15/22 07:36
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
If you wrote that function yourself: make sure that it really returns the number of open contracts when the trade is open. -1 would be wrong.

https://zorro-project.com/manual/en/brokerplugin.htm

Re: BrokerTrade and manual partial closing [Re: byakuren81] #485498
03/17/22 20:12
03/17/22 20:12
Joined: Jan 2014
Posts: 86
London City
B
byakuren81 Offline OP
Junior Member
byakuren81  Offline OP
Junior Member
B

Joined: Jan 2014
Posts: 86
London City
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/22 20:28.
Re: BrokerTrade and manual partial closing [Re: Petra] #485499
03/17/22 20:28
03/17/22 20:28
Joined: Jan 2014
Posts: 86
London City
B
byakuren81 Offline OP
Junior Member
byakuren81  Offline OP
Junior Member
B

Joined: Jan 2014
Posts: 86
London City
My own plugin.

Re: BrokerTrade and manual partial closing [Re: byakuren81] #485503
03/18/22 09:29
03/18/22 09:29
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
Ok, we'll check that. If it is indeed not supported, it will be implemented. It is probably no big deal.

Re: BrokerTrade and manual partial closing [Re: jcl] #485515
03/18/22 19:22
03/18/22 19:22
Joined: Jan 2014
Posts: 86
London City
B
byakuren81 Offline OP
Junior Member
byakuren81  Offline OP
Junior Member
B

Joined: Jan 2014
Posts: 86
London City
Thank you, anyway the most important is to be able to fully close a trade manually and this works well.

Re: BrokerTrade and manual partial closing [Re: byakuren81] #485517
03/19/22 09:39
03/19/22 09:39
Joined: Jul 2017
Posts: 784
Z
Zheka Offline
User
Zheka  Offline
User
Z

Joined: Jul 2017
Posts: 784
I too noticed Zorro "losing" a partially closed trade with MT4/5 plugin, unless Hedge>=4. Fixing that would be great.


Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1