Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (ozgur, TipmyPip), 722 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 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 Offline
Serious User
AndrewAMD  Offline
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