Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
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
3 registered members (AndrewAMD, alibaba, Quad), 761 guests, and 2 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
Assigning a custom trade ID? #468075
09/16/17 22:31
09/16/17 22:31
Joined: Sep 2017
Posts: 235
H
Hredot Offline OP
Member
Hredot  Offline OP
Member
H

Joined: Sep 2017
Posts: 235
When testing my scripts with a simple reversal algorithm, I notice that out of 1400 trades roughly 50 duplicate IDs appear (Zorro 1.60).
Clearly there is some bug in the ID generator. Is there a way to assign user defined IDs to the trades? I did not see any way to pass an ID to the EnterLong or EnterShort routines.

Re: Assigning a custom trade ID? [Re: Hredot] #468080
09/17/17 17:14
09/17/17 17:14
Joined: Aug 2017
Posts: 58
P
pascalx Offline
Junior Member
pascalx  Offline
Junior Member
P

Joined: Aug 2017
Posts: 58
Hi. What do you need the ID for tho?

trading.h

Quote:

typedef struct TRADE
{
int nID; // active trade id, or 0 for pending trades; can change when trades are partially closed
// ...
}


I don't know what happens if you overwrite it. Maybe undefined behaviour.

Re: Assigning a custom trade ID? [Re: Hredot] #468081
09/17/17 18:32
09/17/17 18:32
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
Originally Posted By: Hredot
When testing my scripts with a simple reversal algorithm, I notice that out of 1400 trades roughly 50 duplicate IDs appear (Zorro 1.60).
Clearly there is some bug in the ID generator. Is there a way to assign user defined IDs to the trades? I did not see any way to pass an ID to the EnterLong or EnterShort routines.
Trade ID's are defined in the Broker plugin. They either relay an actual trade number or use a counter. Who's your broker?

Re: Assigning a custom trade ID? [Re: AndrewAMD] #468082
09/17/17 18:42
09/17/17 18:42
Joined: Sep 2017
Posts: 235
H
Hredot Offline OP
Member
Hredot  Offline OP
Member
H

Joined: Sep 2017
Posts: 235
Oh I see, I was using the IB demo setting.
Thank you for the explanation!
I guess identical ids only appear consecutively, non-overlapping, so it is not an issue actually.


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