Gamestudio Links
Zorro Links
Newest Posts
Zorro version 3.0 prerelease!
by jcl. 02/12/26 14:05
MarginCost discrepancy?
by jcl. 02/12/26 14:02
Hedge on FXCM, 4 or 5?
by qin. 02/11/26 14:12
CMC MT4 CFD vs FX Active - what's better?
by mayarik. 02/11/26 11:00
print a "still alive" log
by qin. 02/10/26 12:16
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (TipmyPip, Quad), 7,695 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
ApprenticeInMuc, PatrickH90, USER0328, Sfrdragon, mayarik
19198 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,811
Chicago
AndrewAMD Offline OP
Serious User
AndrewAMD  Offline OP
Serious User

Joined: Feb 2017
Posts: 1,811
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: 599
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 599
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