Gamestudio Links
Zorro Links
Newest Posts
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
folder management functions
by 7th_zorro. 04/15/24 10:10
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
LPDIRECT3DCUBETEXTUR
E9

by Ayumi. 04/12/24 11:00
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 04/11/24 14:56
SGT_FW
by Aku_Aku. 04/10/24 16:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (7th_zorro, Quad), 373 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
11honza11, ccorrea, sakolin, rajesh7827, juergen_wue
19045 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,724
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,724
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