Gamestudio Links
Zorro Links
Newest Posts
ZorroGPT
by TipmyPip. 03/05/26 02:58
zorro with ccxt?
by opm. 03/03/26 03:17
WFO Training with parallel cores Zorro64
by Martin_HH. 02/26/26 16:03
Zorro version 3.0 prerelease!
by TipmyPip. 02/25/26 16:38
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (TipmyPip, AndrewAMD), 5,678 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
the1, alx, ApprenticeInMuc, PatrickH90, USER0328
19200 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
BrokerTrade() is fundamentally flawed. #487821
10/08/23 21:04
10/08/23 21:04
Joined: Feb 2017
Posts: 1,813
Chicago
AndrewAMD Online OP
Serious User
AndrewAMD  Online OP
Serious User

Joined: Feb 2017
Posts: 1,813
Chicago
My proposal is that BrokerTrade receives an additional return code to indicate that an order is expired/cancelled/rejected/dead while 100% unfilled.

Here's why:

BrokerTrade returns the following, according to the docs:
a) Number of contracts or lots (as in BrokerBuy2) currently filled for the order
b) Negative number of filled contracts or lots when the position was closed.
c) -1 when the position was closed at an unknown fill amount. Zorro will then assume that the order was completely filled.
d) NAY (defined in trading.h) when the order or trade state was unavailable. Zorro will then assume that the order was completely filled.

So what of the case of, say, a tif=DAY order with lots=10 that expires completely unfilled. Well, it could return 0 to indicate 0 lots have been filled, but it does not establish the end of the order. Or it could return NAY, but then Zorro will assume the order was completely filled.

Therefore one good solution is to add another return, maybe call it NAY_UNFILLED to say definitively that the order is both dead and unfilled.

Re: BrokerTrade() is fundamentally flawed. [Re: AndrewAMD] #487824
10/09/23 09:25
10/09/23 09:25
Joined: Apr 2008
Posts: 600
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 600
Austria
A rejected order returns 0 at BrokerBuy2. But it is true, there is no return code for an order that was accepted, but unfilled and later cancelled. I will forward this request to the developers to implement such a code.


Moderated by  Petra 

Gamestudio download | 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