Zorro loses control of MT5

Posted By: Sunbuddy

Zorro loses control of MT5 - 09/01/22 07:30

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 picture zed-0.png
Attached picture zed-01.png
Attached picture zed-02.png
Posted By: Grant

Re: Zorro loses control of MT5 - 09/01/22 08:48

Post your question or issue
Posted By: Sunbuddy

Re: Zorro loses control of MT5 - 09/01/22 09:40

the log error messages, indicate Zorro has lost control of MT5, thats the issue...:-)
Posted By: alun

Re: Zorro loses control of MT5 - 09/01/22 11:16

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?
Posted By: Grant

Re: Zorro loses control of MT5 - 09/01/22 11:52

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.
Posted By: Sunbuddy

Re: Zorro loses control of MT5 - 09/01/22 12:58

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....
Posted By: alun

Re: Zorro loses control of MT5 - 09/01/22 13:12

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.
Posted By: alun

Re: Zorro loses control of MT5 - 09/01/22 13:23

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?
Posted By: alun

Re: Zorro loses control of MT5 - 09/01/22 13:28

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/
Posted By: Sunbuddy

Re: Zorro loses control of MT5 - 09/03/22 02:04

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....
Posted By: Petra

Re: Zorro loses control of MT5 - 09/03/22 12:51

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.
Posted By: Sunbuddy

Re: Zorro loses control of MT5 - 09/05/22 04:55

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.
Posted By: Sunbuddy

Re: Zorro loses control of MT5 - 09/07/22 03:04

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....
Posted By: Grant

Re: Zorro loses control of MT5 - 09/07/22 08:21

Why not use the MT4 bridge in the meantime till this MT5 issue is fixed?
Posted By: Sunbuddy

Re: Zorro loses control of MT5 - 09/13/22 03:42

Well Ok I'll give it a go.
Posted By: jcl

Re: Zorro loses control of MT5 - 09/13/22 10:40

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.
© 2024 lite-C Forums