Gamestudio Links
Zorro Links
Newest Posts
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Data from CSV not parsed correctly
by EternallyCurious. 04/20/24 21:39
M1 Oversampling
by 11honza11. 04/20/24 20:57
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
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (rki, AndrewAMD), 426 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 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....

Page 1 of 2 1 2

Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1