Gamestudio Links
Zorro Links
Newest Posts
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Data from CSV not parsed correctly
by EternallyCurious. 04/25/24 10:20
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (EternallyCurious, AndrewAMD, TipmyPip, Quad), 889 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Z12 duplicate trade ID ? #462074
09/06/16 20:51
09/06/16 20:51
Joined: Jul 2016
Posts: 93
Düsseldorf, Germany
M
mhdus Offline OP
Junior Member
mhdus  Offline OP
Junior Member
M

Joined: Jul 2016
Posts: 93
Düsseldorf, Germany
I noticed 2x2 duplicate trade IDs in the Z12 status page and apparently resulting wrong values for current price, risk, etc.:

Trade ID Lots Entry Time Entry Price Stop Trail Target Risk Profit Pips
[AUD/USD:NET:S1501] 3521501 3 29.08. 00:14 0.753 0.7685 1.0542 - - - - - - - - -8079$ -413$ -154.1p
[XAU/USD:NET:L5440] 3525440 1 29.08. 20:14 1323 1350 926 - - - - - - - - -3553$ 236$ 2643.2p
[XAG/USD:NET:S1212] 3531212 1 30.08. 16:14 18.655 20.07 26.12 - - - - - - - - -3359$ -638$ -142.3p
[GBP/USD:NET:L5090] 3545090 2 01.09. 12:09 1314 1350 0.9276 - - - - - - - - -23559869$ 319$ 177.7p
[EUR/USD:NET:L5089] 3545089 1 01.09. 20:09 1.1201 1.1252 0.7841 - - - - - - - - -3002$ 43$ 48.7p
[XAU/USD:NET:L5090] 3545090 1 01.09. 20:09 1314 1350 920 - - - - - - - - -3523$ 319$ 3572.0p
[EUR/USD:NET:L5995] 3545995 2 02.09. 00:09 1.12 1.1252 0.784 - - - - - - - - -6004$ 89$ 49.7p
[USD/CAD:NET:S5490] 3565490 1 02.09. 16:03 1.3431 1.3427 1.8203 - - - - - - - - -3293$ -2$ -2.7p
[USD/JPY:NET:S5122] 3555122 2 05.09. 12:03 103.27 102.07 144.58 - - - - - - - - -7174$ 209$ 120.1p
[GBP/USD:CY:L4238] 3564238 1 06.09. 14:37 1.3426 1.343 0.9399 - - - - - - - - -3612$ 1$ 1.2p
[EUR/USD:NET:L4898] 3564898 1 06.09. 16:20 1.1241 1.1252 0.7868 - - - - - - - - -3002$ 9$ 9.9p
[GBP/USD:NET:L5490] 3565490 1 06.09. 20:20 1.3429 1.3429 0.9401 - - - - - - - - -3583$ -2$ -2.1p
[USD/JPY:NET:S5492] 3565492 2 06.09. 20:20 102.01 102.07 142.82 - - - - - - - - -7114$ -11$ -6.3p
{AUD/USD:CY:s4502} 54502 3 29.08. 00:14 0.753 0.7684 0.7757 0.7303 - - - - -614$ -432$ -161.2p
...

In the MT4 Trade window both trades are having different and unique Order IDs (1st GBP/USD: 3542722, USD/CAD: 3550943).

Any ideas how this could have happened and/or how to diagnose further?
As far as I remember, I might have experienced a crash/reboot of my VPS, so maybe it relates to a buggy Z12.trd file. Any general recommendations how to recover from such a situation - without closing all trades and restarting completely fresh?

Last edited by mhdus; 09/06/16 21:46.
Re: Z12 duplicate trade ID ? [Re: mhdus] #462078
09/07/16 08:03
09/07/16 08:03
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
Frankfurt
Close all 4 trades in the MT4 console. The other trades may stay open. The positions will be automaticalle re-adjusted by Zorro when a trade with that asset is opened or closed the next time. - We had already a report by another user with the same issue, also after a VPS crash. We're currently checking what exactly happened and how it can be prevented.

Re: Z12 duplicate trade ID ? [Re: jcl] #462084
09/07/16 15:01
09/07/16 15:01
Joined: Apr 2016
Posts: 27
Frankfurt, Germany
M
MIGI Offline
Newbie
MIGI  Offline
Newbie
M

Joined: Apr 2016
Posts: 27
Frankfurt, Germany
In MT4 the MagicNumber can be used to prevent duplicate orders/positions.

Here is a piece of code that I use in my RangeTrader to find all orders/postions after a restart:

void Synchronize( int MagicNumber )
{
for ( int Count = OrdersTotal(); Count > 0; Count-- )
{
if ( OrderSelect( ( Count - 1 ), SELECT_BY_POS, MODE_TRADES ) != true ) continue;
if ( OrderSymbol() != Symbol() ) continue;
if ( OrderMagicNumber() != MagicNumber ) continue;

switch ( OrderType() )
{
case OP_BUY :
case OP_BUYLIMIT :
case OP_BUYSTOP : Trade.Long = OrderTicket();

break;

case OP_SELL :
case OP_SELLLIMIT:
case OP_SELLSTOP : Trade.Short = OrderTicket();

break;
}
}

LogTicket( Trade.Long, "Synchronize(Long)", ERR_NO_ERROR );
LogTicket( Trade.Short, "Synchronize(Short)", ERR_NO_ERROR );
}

Re: Z12 duplicate trade ID ? [Re: MIGI] #462222
09/14/16 14:06
09/14/16 14:06
Joined: Jul 2016
Posts: 93
Düsseldorf, Germany
M
mhdus Offline OP
Junior Member
mhdus  Offline OP
Junior Member
M

Joined: Jul 2016
Posts: 93
Düsseldorf, Germany
Again I have a duplicate Trade ID ... this time I'm sure there was no issue with the VPS. While it might be challenging to ultimately fix this it would be good to provide a way of automatically watching for such duplicates and throw an alarm once it happens.
(Otherwise Z12 is working quite well recently ...)

Re: Z12 duplicate trade ID ? [Re: mhdus] #462228
09/15/16 05:44
09/15/16 05:44
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
Frankfurt
Yes, we'll detect duplicate IDs in the next version, 1.52.

Re: Z12 duplicate trade ID ? [Re: jcl] #462253
09/16/16 20:08
09/16/16 20:08
Joined: Jul 2016
Posts: 93
Düsseldorf, Germany
M
mhdus Offline OP
Junior Member
mhdus  Offline OP
Junior Member
M

Joined: Jul 2016
Posts: 93
Düsseldorf, Germany
Had another one. Maybe the duplicates are somehow related to a partial close? See below.

In MT4 the GBP/USD position is dated 2016.09.15 09:07:48 and the US30 position is dated 2016.09.15 13:07:47. Time difference between broker's server and VPS is 2h: UTC vs. CEST (when starting the strategy Zorro reported !MT4 time zone shift -1 at UTC ... is this the reason why the time difference between the trade open timestamps in MT4 and Zorro is just 1h ?). I'm running Zorro S 1.46.3. Maybe this helps.

Friday 16.09.16 Profit +786$ ----
{GBP/USD:ES:s9934} Cover 6@1.3237: -122$ at 00:08
{GBP/USD:ES:l0337} Long 5@1.3237 Risk 1011$ .
[GBP/USD:NET:S0426] Cover 3@1.3237: +51.07 at 00:08
[GBP/USD:NET:S3806] Cover 4@1.3237: -147$ at 00:08
[GBP/USD:NET:S7488] Cover part 4@1.3237: +115$ at 00:08..................................................

[Fri 16.09.16 04:08] 14847 +3586 +799 !6/4...................................................................................
[Fri 16.09.16 08:08] 15038 +3586 +906 !6/4
{EUR/USD:HU:s0538} Short 4@1.1237 Risk 1221$ ts.
[EUR/USD:NET:S4320] Short 4@1.1237 Pool trade........................................................................................................................................

[Fri 16.09.16 12:08] 15218 +3586 +989 !8/3
{GBP/USD:ES:l0337} Sell 5@1.3174: -289$ at 12:08
{GBP/USD:ES:s0639} Short 6@1.3174 Risk 1197$ .
[GBP/USD:NET:S7675] Short 11@1.3174 Pool trade....................................................................................................................................


Trade ID Lots Entry Time Entry Price Stop Trail Target Risk Profit Pips
[EUR/USD:NET:S1108] 3581108 16 09.09. 00:08 1.1265 1.1157 1.5772 - - - - - - - - -64022$ 1547$ 108.9p
[XAU/USD:NET:L1513] 3581513 2 09.09. 04:08 1339 1309 937 - - - - - - - - -7130$ -536$ -3019.8p
[UK100:NET:S2557] 3582557 3 09.09. 08:08 6853 6720 9594 - - - - - - - - -9707$ 464$ 1311.8p
[EUR/USD:NET:S7579] 3587579 8 12.09. 00:08 1.1238 1.1157 1.5733 - - - - - - - - -32011$ 575$ 80.8p
[XAU/USD:NET:L8720] 3598720 2 13.09. 08:08 1331 1309 932 - - - - - - - - -7116$ -392$ -2203.4p
[SPX500:NET:L1317] 3611317 1 14.09. 16:08 2134 2137 1494 - - - - - - - - -14213$ 73$ 328.2p
[XAU/USD:NET:L1318] 3611318 2 14.09. 16:08 1324 1309 927 - - - - - - - - -7057$ -270$ -1518.7p
[AUD/USD:NET:L4900] 3614900 8 15.09. 04:08 0.7464 0.7489 0.5225 - - - - - - - - -15940$ 176$ 24.8p
[USD/JPY:NET:S4902] 3614902 4 15.09. 04:08 102.29 102.34 143.21 - - - - - - - - -14237$ -19$ -5.4p
[GBP/USD:NET:S7488] 3617488 2 15.09. 08:08 18066 18132 1.8502 - - - - - - - - +321737811$ 117$ 65.7p
[US30:NET:L7488] 3617488 2 15.09. 12:08 18066 18133 12646 - - - - - - - - -9640$ 117$ 658.4p

[EUR/USD:NET:S4320] 3624320 4 16.09. 08:08 1.1237 1.1157 1.5732 - - - - - - - - -16005$ 286$ 80.5p
[GBP/USD:NET:S7675] 3627675 11 16.09. 12:08 1.3174 1.3087 1.8443 - - - - - - - - -51637$ 842$ 86.0p
{EUR/USD:CY:s6804} 56804 4 08.09. 00:08 1.124 1.1157 1.1599 1.0882 - - - - -1280$ 292$ 82.0p

Re: Z12 duplicate trade ID ? [Re: mhdus] #462258
09/17/16 10:00
09/17/16 10:00
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
Frankfurt
Which of the two trades has the correct ID in the MT4 terminal? The GBP or the US30 trade?

Re: Z12 duplicate trade ID ? [Re: jcl] #462264
09/17/16 19:28
09/17/16 19:28
Joined: Jul 2016
Posts: 93
Düsseldorf, Germany
M
mhdus Offline OP
Junior Member
mhdus  Offline OP
Junior Member
M

Joined: Jul 2016
Posts: 93
Düsseldorf, Germany
the US30 trade had ID 3617488 (in the meantime I have closed both trades)

Re: Z12 duplicate trade ID ? [Re: mhdus] #462288
09/19/16 09:49
09/19/16 09:49
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
Frankfurt
Hmm, the trade ID normally changes when a trade is only partically closed, so that would be a hint why this happens - but it does not happen here when I test it. Maybe it is broker dependent. Which broker are you using?

Re: Z12 duplicate trade ID ? [Re: jcl] #462289
09/19/16 10:00
09/19/16 10:00
Joined: Jul 2016
Posts: 93
Düsseldorf, Germany
M
mhdus Offline OP
Junior Member
mhdus  Offline OP
Junior Member
M

Joined: Jul 2016
Posts: 93
Düsseldorf, Germany
I'm using IG here. But I will transition to FXCM soon to get Microlots and rid of the MT4 requirement. Nevertheless, I would be happy to support debugging if you let me know what additional data you need and how to capture. I had such duplicates now 3 times in less than 4 weeks trading Z12, so a "good" chance to capture another event soon...

Page 1 of 2 1 2

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