Gamestudio Links
Zorro Links
Newest Posts
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
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Trading Journey
by howardR. 04/24/24 20:04
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (howardR, AndrewAMD, EternallyCurious, Petra, 1 invisible), 791 guests, and 4 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
Zorro loses control of MT5 #486520
09/01/22 07:30
09/01/22 07:30
Joined: Sep 2022
Posts: 7
S
Sunbuddy Offline OP
Newbie
Sunbuddy  Offline OP
Newbie
S

Joined: Sep 2022
Posts: 7
Sooo hi all,
Thankyou in advance for answering my question...

I've attached an image for discussion about the log error messages.


Zorro 2.5.1
Mt5 bridge s/w

Attached Files zed-0.pngzed-01.pngzed-02.png
Re: Zorro loses control of MT5 [Re: Sunbuddy] #486521
09/01/22 08:48
09/01/22 08:48
Joined: Aug 2017
Posts: 294
Netherlands
G
Grant Offline
Member
Grant  Offline
Member
G

Joined: Aug 2017
Posts: 294
Netherlands
Post your question or issue

Re: Zorro loses control of MT5 [Re: Sunbuddy] #486523
09/01/22 09:40
09/01/22 09:40
Joined: Sep 2022
Posts: 7
S
Sunbuddy Offline OP
Newbie
Sunbuddy  Offline OP
Newbie
S

Joined: Sep 2022
Posts: 7
the log error messages, indicate Zorro has lost control of MT5, thats the issue...:-)

Re: Zorro loses control of MT5 [Re: Sunbuddy] #486524
09/01/22 11:16
09/01/22 11:16
Joined: Aug 2022
Posts: 65
alun Offline
Junior Member
alun  Offline
Junior Member

Joined: Aug 2022
Posts: 65
From my perspective, it looks like Zorro tries to close a trade which has been already closed manually - as I don't see any open trades on the chart.

And it fails to do so.

Or what message do you mean in particular?

Have you seen the trade was open before?

Re: Zorro loses control of MT5 [Re: alun] #486525
09/01/22 11:52
09/01/22 11:52
Joined: Aug 2017
Posts: 294
Netherlands
G
Grant Offline
Member
Grant  Offline
Member
G

Joined: Aug 2017
Posts: 294
Netherlands
If this is the actual case and Sunbuddy is running a single(!) asset strategy, then it's best to remove all related *.trd, *.bak & *.dbl files from the zorro/data directory and restart Zorro. Make sure you make a backup before doing so.

Re: Zorro loses control of MT5 [Re: Sunbuddy] #486527
09/01/22 12:58
09/01/22 12:58
Joined: Sep 2022
Posts: 7
S
Sunbuddy Offline OP
Newbie
Sunbuddy  Offline OP
Newbie
S

Joined: Sep 2022
Posts: 7
Hi Thanks for trying to help. My response to your assumptions is below.

"Zorro tries to close a trade which has been already closed manually".... MT5 appears to be closing the trade first as the stop has been transmitted to the MT5 terminal and its faster than Zorro....

"If this is the actual case and Sunbuddy is running a single(!) asset strategy,"...mmm, I didn't make up the problem for my own enjoyment I can assure you.... It is the martingale strategy straight out of the box so nothing fancy except I changed the bars to 1 minute to see if this software was still full of bugs like it was many years ago when I last tried it. This time I'm persisting....for a while....

Re: Zorro loses control of MT5 [Re: Sunbuddy] #486528
09/01/22 13:12
09/01/22 13:12
Joined: Aug 2022
Posts: 65
alun Offline
Junior Member
alun  Offline
Junior Member

Joined: Aug 2022
Posts: 65
Originally Posted by Sunbuddy
MT5 appears to be closing the trade first as the stop has been transmitted to the MT5 terminal and its faster than Zorro....


sounds legit, well, if it's trying to close already closed by SL trade that's sounds like a bug

I've also started to connect it with MT4 and had quite a lot of issues - but managed to fix them https://opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=486526

You could try with MT4 or wait from someone else's answers.

I know that current last version of Zorro is not considered stable, but I'm not sure how to download the latest stable anyway.

Re: Zorro loses control of MT5 [Re: Sunbuddy] #486529
09/01/22 13:23
09/01/22 13:23
Joined: Aug 2022
Posts: 65
alun Offline
Junior Member
alun  Offline
Junior Member

Joined: Aug 2022
Posts: 65
Also you're using this one right?

Code
// Perfect martingale system ///////////////////

function run()
{
	set(PLOTNOW);
//	BarPeriod = 1440;
	BarPeriod = 1;
	Stop = TakeProfit = ATR(100);
	Lots = pow(2,LossStreakTotal); // the martingale formula...
	
// wait until last stop/profit target was hit
	if(NumOpenTotal == 0) {
		if(random() < 0)
			enterShort();
		else 
			enterLong();
	}	
}


I'm a new to Zorro as well but it looks like it only sets up SL and TP and should delegate this to broker - don't manage the trade itself.

Maybe there is some flag needed to set this up explicitly?

Re: Zorro loses control of MT5 [Re: Sunbuddy] #486530
09/01/22 13:28
09/01/22 13:28
Joined: Aug 2022
Posts: 65
alun Offline
Junior Member
alun  Offline
Junior Member

Joined: Aug 2022
Posts: 65
One of the things with MT5 to try is to add `set(PLOTNOW + NFA)` since MT5 works with positions not individual trades AFAIK

https://zorro-project.com/manual/

Re: Zorro loses control of MT5 [Re: alun] #486535
09/03/22 02:04
09/03/22 02:04
Joined: Sep 2022
Posts: 7
S
Sunbuddy Offline OP
Newbie
Sunbuddy  Offline OP
Newbie
S

Joined: Sep 2022
Posts: 7
So as I read in the Zorro manual it manages its own Stop and TakeProfit, yet in this case it passes the stop to MT5 but not the TakeProfit. (BTW please will someone try it on their own machine and confirm they have the same issue using the martingale strategy on 1 minute BarPeriod?)

Also I didn't mention but this:
if(NumOpenTotal == 0) {
if(random() < 0)
enterShort();
else
enterLong();
Also seems to wait till the next bar.... That's also a bug in my opinion as you ought to have to program the wait till the next bar and normally checking for (NumOpenTotal == 0) ought to be on the next tick.....

STILL NO ANSWER on this issue yet just conjecture....

Re: Zorro loses control of MT5 [Re: Sunbuddy] #486537
09/03/22 12:51
09/03/22 12:51
Joined: Apr 2008
Posts: 586
Austria
Petra Online
Support
Petra  Online
Support

Joined: Apr 2008
Posts: 586
Austria
NFA flag is for NFA compliant brokers only, MT5 is normally not used by NFA brokers.

MT5 will never stop a Zorro trade unless you have either intentionally set it, or something was wrong with the stop value, like too close or at the wrong side of the price. Then you can indeed get the effect that Zorro and MT5 close the same trade at same time. It is not harmful but produces a warning. Read the manual about stop and tp and how they work.

If you tried Zorro in the past and were unsuccessful, I dont think that you will have more success today unless you find out what failed the first time. If you think it was a bug, just check out the bug list, all Zorro bugs are there.

The other problem was not understandable to me, maybe you should explain in detail what you want to do and in which way it did not work. I suppose you confused bars and ticks.

Re: Zorro loses control of MT5 [Re: Petra] #486552
09/05/22 04:55
09/05/22 04:55
Joined: Sep 2022
Posts: 7
S
Sunbuddy Offline OP
Newbie
Sunbuddy  Offline OP
Newbie
S

Joined: Sep 2022
Posts: 7
I'd already tested the manual Buy/Sell function of Zorro and it worked correctly... the next step was to test an automated system on demo, in this case it FAILED.
The setup was the standard martingale strategy supplied with the Zorro application. I supplied the version information in the first post. In this case Zorro failed to close the trade as either MT5 or Zorro had already closed the trade. Then consequently Zorro assumed the trade was still open and did not place a new trade. This is all documented in the images I posted in the first post. I guess all I'd like to do is have one of the standard trading programs shipped with Zorro work correctly on one minute bars on demo.

I don't want to raise any further issues I observed until this basic issue is resolved.

Re: Zorro loses control of MT5 [Re: Sunbuddy] #486579
09/07/22 03:04
09/07/22 03:04
Joined: Sep 2022
Posts: 7
S
Sunbuddy Offline OP
Newbie
Sunbuddy  Offline OP
Newbie
S

Joined: Sep 2022
Posts: 7
Oh well, another day has gone past and still no resolution to a simple operation via the MT5 bridge using off the shelf software from the producer.....I genuinely would love to use this product, it is an exciting solution to a number of outstanding problems for retail traders....Once again I'm the bridesmaid....

Re: Zorro loses control of MT5 [Re: Sunbuddy] #486582
09/07/22 08:21
09/07/22 08:21
Joined: Aug 2017
Posts: 294
Netherlands
G
Grant Offline
Member
Grant  Offline
Member
G

Joined: Aug 2017
Posts: 294
Netherlands
Why not use the MT4 bridge in the meantime till this MT5 issue is fixed?

Re: Zorro loses control of MT5 [Re: Grant] #486635
09/13/22 03:42
09/13/22 03:42
Joined: Sep 2022
Posts: 7
S
Sunbuddy Offline OP
Newbie
Sunbuddy  Offline OP
Newbie
S

Joined: Sep 2022
Posts: 7
Well Ok I'll give it a go.

Last edited by Sunbuddy; 09/13/22 03:43.
Re: Zorro loses control of MT5 [Re: Sunbuddy] #486640
09/13/22 10:40
09/13/22 10:40
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Switching to MT4 will probably not help. All included scripts are only guaranteed to work when unmodified. When you modify parameters, like the bar period, you usually must also adapt other parameters, like the stop and TP distances. Or alternatively, set StopFactor = 0 to prevent that MT5 opens and closes a trade immediately, which is likely the problem reason here. Generally, whenever you change something, think about possible side effects.

If you cannot fix it this way, the problem might have a different reason. Then someone else has to look into it. Send us a bug report with all required data, especially the experts log and journal, and your MT5 broker name and version number.

Page 1 of 2 1 2

Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1