Gamestudio Links
Zorro Links
Newest Posts
Camera always moves upwards?
by clonman. 11/13/25 14:04
brokerCommand PLOT_HLINE parameters
by M_D. 11/13/25 10:42
ZorroGPT
by TipmyPip. 11/10/25 11:04
Training with the R bridge does not work
by frutza. 11/05/25 00:46
Zorro 2.70
by opm. 10/24/25 03:44
Alpaca Plugin v1.4.0
by TipmyPip. 10/20/25 18:04
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
5 registered members (Grant, AndrewAMD, ozgur, Quad, TipmyPip), 29,980 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sheliepaley, Blueguy, blobplayintennis, someone2, NotEBspark
19177 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
GTC Orders and BrokerTrade #486271
07/10/22 18:15
07/10/22 18:15
Joined: Aug 2021
Posts: 101
M
MegaTanker Offline OP
Member
MegaTanker  Offline OP
Member
M

Joined: Aug 2021
Posts: 101
I'm trying to write BrokerBuy2 such that the Zorro process doesn't block while waiting for feedback from the broker about the order. So BrokerBuy2 returns the trade id immediately so that Zorro can then query the status with BrokerTrade. But this is not working as I would expect it to. When I leave the pFill pointer alone in BrokerBuy2 before returning, Zorro assumes the trade was completely filled (which it isn't actually), but when I set pFill = 0, Zorro correctly prints "Long %0..." in the message log but then never calls BrokerTrade afterwards so it never learns the status of the trade. With pFill untouched, Zorro does call BrokerTrade repeatedly.

I would want the fill to be 0 in Zorro until it actually is partially or fully filled.

Re: GTC Orders and BrokerTrade [Re: MegaTanker] #486272
07/11/22 01:21
07/11/22 01:21
Joined: Feb 2017
Posts: 1,809
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,809
Chicago
You might need the TR_GTC flag set for TradeMode.
https://zorro-project.com/manual/en/trademode.htm

Re: GTC Orders and BrokerTrade [Re: MegaTanker] #486274
07/11/22 07:10
07/11/22 07:10
Joined: Jul 2000
Posts: 28,029
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,029
Frankfurt
Yes. pFill must be set to the actuall fill amount. BrokerTrade updates the fill amount, and is always called unless the trade was rejected, cancelled, or closed.

Re: GTC Orders and BrokerTrade [Re: MegaTanker] #486275
07/11/22 07:25
07/11/22 07:25
Joined: Aug 2021
Posts: 101
M
MegaTanker Offline OP
Member
MegaTanker  Offline OP
Member
M

Joined: Aug 2021
Posts: 101
I did set the TR_GTC flag before but did not change the OrderDuration which appears to be 0 by default. So probably Zorro saw the trade as closed because the plugin returned 0 fill and the order immediately timed out on Zorro's side. Will try changing that later.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1