Z12 - Open trades not found after restart

Posted By: dpn

Z12 - Open trades not found after restart - 12/07/20 11:17

Hello to the Community.

Could someone help me to understand what is wrong?
(For better understanding see also the annexed file)

I’ve Zorro 2.30 running Z12 on my PCs;

I stop the trading on Saturday morning, when markets are closed;

When I restart to trade on Sunday evening, when markets are still closed but ready to open, Zorro seems unable to found “all” the previous trades opened in the past, even if the old trades are still opened and appear on the terminal (MT5);

Don’t worry, lets Zorro run: Once the markets start, some other positions are correctly opened and appear on the terminal, but strange looping messages are shown on the “Experts” tab of the terminal: the open positions are unknown to Zorro…because (seems) there is a discrepancy between “ticket” and “order” number;

Three weeks of test, three stop and start on the weekend, three times the same behaviour;

Tested with two different brokers, with different leverages, one real account and two demo account, on a laptop and on a workstation, single and multiple Zorro’s instances, in the same PC or separately: same behaviour as above described.

Suggestions?
Thank you

Attached picture real-1.jpg
Posted By: danatrader

Re: Z12 - Open trades not found after restart - 12/07/20 11:29

I would try the beta, there where some issues in the last versions on resuming trades.
Make backup of your folder and copy Beta version over it and try again.

Make backup of your *.trd files too (all of them).
Posted By: dpn

Re: Z12 - Open trades not found after restart - 12/07/20 11:36

Thank you, danatrader

I will try soon.
Posted By: danatrader

Re: Z12 - Open trades not found after restart - 12/07/20 11:41

Be aware, you can only resume the trades of one trd file.
So maybe consider that, the more trades are opened with resume not working, the more you may loose.
Posted By: dpn

Re: Z12 - Open trades not found after restart - 12/07/20 14:15

Done.

Updated with latest version 2 34 1,
the trd files have been restored in the proper folders,
old MT5 plugin overwritten.

It seems that only phantom trades are acknowledged (ref. annexed).

Bad story

Probably, last "STOP TRADE" command has definitely overwritten the old TRD files, so the previous trd file containing the "NOT FOUND" trades is probably lost .

Thank you very much for your support, but I think it would be better to close manually all the open trades and start again, with the latest version of Zorro.

Attached picture updated 2020-12-07 145535.jpg
Attached picture updated1 2020-12-07 145812.jpg
Posted By: danatrader

Re: Z12 - Open trades not found after restart - 12/07/20 15:03

My hint, don't close, set a apropriate SL and trail on the unmanaged trades.
And set up some daily copy of *.trd files appending date / time.
Posted By: dpn

Re: Z12 - Open trades not found after restart - 12/07/20 18:18

Ok, you are right danatrader,

On the real account I'll follow your hint.

On the demo accounts I have closed all the trades (not found and phantom), killed all the orphaned trades on the terminal, re-tested Z12 with the new capital and restarted Zorro, in order to see quite soon, on next week end, if the problem will be still present or not. I will keep you informed.

Ok for the daily copy of *.trd files, but...i know the old DOS command "append": is there a similar function also for Zorro? I must deeply study the manual.


Thank you &
Best regards
Posted By: danatrader

Re: Z12 - Open trades not found after restart - 12/08/20 20:27

I use that in my run function, just some rough thing, not very sophisticated.
But not possible with Z12

if(day(0) != day(1) and Live) //save trd file once per day
file_copy("C:\\Users\\Administrator\\Desktop\\TRD\\MyStrategy\\MyStrategy.trd", "C:\\Users\\Administrator\\Desktop\\Zorro\\Data\\MyStrategy.trd");


adding a date in cmd is awkward, just use some simple freeware / opensource tool.

The above folder is then synced to my clouddrive.
Posted By: jcl

Re: Z12 - Open trades not found after restart - 12/10/20 12:18

Zorro automatically continues all open trades. So the problem has a different reason that you can see in the log. For instance, removing the .trd file, or continuing the same script on a different account.
Anyway stopping a live trading system with no good reason is a bad idea. But when it still accidentally happens, don't restart it on the weekend. Wait until Monday. On the weekend broker servers might be offline and therefore history not available and trades not be recognized.
Posted By: dpn

Re: Z12 - Open trades not found after restart - 12/10/20 20:15

Hello, JCL

I will follow your hint;

certainly the problem is from my side, but it is not so easy to found the solution when the cause is unknow;

for example, after a sincronized restarting of 2 Zorro instances running Z12, two MT5 running, the result is that:
- in one MT5 the "expert" tab is full of Zorro' complaints; it seems that the orders have 10 digits and the tickets only 9, so Zorro cannot find the entered trades.
- In the other MT5 it seems all ok, for now.
(ref.annexed)

suggestions are appreciated.

Thanks

Attached picture 1A.jpg
Attached picture 1B.jpg
Attached picture 2A.jpg
Attached picture 2B.jpg
Posted By: jcl

Re: Z12 - Open trades not found after restart - 12/11/20 12:08

Do not run the same script multiple times. Either rename it or run it from different folders. If your MT5 broker uses order tickets that exceed the int range, make sure that you are using the latest MQL5 library, zmq4.mq5 from August 2020 or later. Earlier libraries were int-only.
Posted By: dpn

Re: Z12 - Open trades not found after restart - 02/15/21 18:59

Hello Sirs,

after your suggestions, I downloaded and reinstalled both the MT5 and ZorroS platforms;

I launched only one Zorro's instance with Z12 and everything worked fine for about a month;

the trades have been entered succesfully;

total or partial closings have been carried out correctly.

Unfortunately I was forced to upgrade (win10 home edition cannot allow to disable the updates, or probably yes tampering some dwords in the filesystem);

before the win_update, I stopped and restarted trading (without closing open positions) for 5 or 6 times, finding that "all" the transactions were resumed correctly;

some seconds later, after stopping trading (without closing open positions), I stopped Zorro to restart it immediately: Only phantom trades were resumed, but not the real ones.

I have now only installed one instance of Zorro + MT5 on AWS EC2, so that I can set it to avoid win_updates.

I am thinking that when the next official version of Zorro will be released, I will be forced to stop and restart Zorro;

I would not like to face the same problems of "not resumed" real trades, to be closed manually.
© 2024 lite-C Forums