Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
basik85278
by basik85278. 04/28/24 08:56
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (SBGuy, Quad), 768 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 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,725
Chicago
AndrewAMD Online OP
Serious User
AndrewAMD  Online OP
Serious User

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

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