Ditto - Empty4 to Oanda Trade Copier - As Low as 0.00001

Post Reply
Jonah
Trader
Posts: 47
Joined: Sat May 11, 2013 4:13 pm
Location: Las Vegas

Ditto - Empty4 to Oanda Trade Copier - As Low as 0.00001

Post by Jonah »

BigRunner » Wed Apr 03, 2019 10:58 pm wrote:Hello.

I tested the new ditto.exe. When I set a pending order, ditto link continues copying the same pending order to v20, over and over until the application is killed.
I have not experienced this error myself, so when I get a chance I will try to replicate it in order to find a solution. Thank you for the bug report.
-- Lonnie.

"Give a man a program, frustrate him for a day. Teach a man to program, frustrate him for a lifetime." (Muhammad Waseem)
User avatar
cozybooks
Trader
Posts: 301
Joined: Wed Mar 27, 2013 1:33 am

Ditto - Empty4 to Oanda Trade Copier - As Low as 0.00001

Post by cozybooks »

HI Lonnie,

I was down to two live ditto sessions running. One is running my Peaky Fifo account. There aren't many trades and they don't happen that often. Ditto has been freezing about once per week on that account on average.

My other account has many trades opening daily. I am not using pending trades at all. Ditto on that platform has been locking up about once per day. When I say locking up, the time is no longer progressing on the EA screen, even though my other charts are still running fine.

On a few occasions, the experts tab on the Empty4 platform shows an error on setting the timer as the last entry from Ditto. I haven't been able to pin down if this happens very quickly after the EA starts or only much later on. Most of the time, however, there has been no error in the log file or message in the EA tab on the Empty4 platform. The last entry on Ditto will be for a valid trade, but nothing happens after that and at some point the EA just stops advancing or copying trades.

When I am back home, I'll try to see if there is a close time proximity between the last valid trade and Ditto freezing

Thanks,
STeve
User avatar
tomele
Administrator
Posts: 1208
Joined: Tue May 17, 2016 3:40 pm
Location: Germany, Forest of Odes, Defending the Limes

Ditto - Empty4 to Oanda Trade Copier - As Low as 0.00001

Post by tomele »

Hi guys.

Sifting through all the posts, I do a little stop here. One question: Does this problem mainly occur on VPS's?

Cheers
Thomas
Happy pippin, Thomas :-BD

It ain't what you don't know that gets you into trouble.
It's what you know for sure that just ain't so.
(Mark Twain)

Keep the coder going: Donate
User avatar
cozybooks
Trader
Posts: 301
Joined: Wed Mar 27, 2013 1:33 am

Ditto - Empty4 to Oanda Trade Copier - As Low as 0.00001

Post by cozybooks »

From my end, with the freezing of the Ditto EA, I am not using a VPS, although that is the eventual goal. It is running live accounts on two separate Windows 10 workstations in my office.

Thanks, Thomas, for any thoughts you can lend!
Steve
Foreverforex
Trader
Posts: 164
Joined: Wed Nov 28, 2012 6:48 am

Ditto - Empty4 to Oanda Trade Copier - As Low as 0.00001

Post by Foreverforex »

tomele » Thu Apr 04, 2019 11:09 am wrote:Hi guys.

Sifting through all the posts, I do a little stop here. One question: Does this problem mainly occur on VPS's?

Cheers
Thomas
on my end, YES! it ran flawlessly for about 16 hours on VPS, then started with the 1000's of orders thing.
User avatar
tomele
Administrator
Posts: 1208
Joined: Tue May 17, 2016 3:40 pm
Location: Germany, Forest of Odes, Defending the Limes

Ditto - Empty4 to Oanda Trade Copier - As Low as 0.00001

Post by tomele »

Well ...

There can be a problem on VPS's when no free handles exist to create a timer. I have written a workaround for that problem. I have never observed the problem on workstations. But one never knows.

Add the following code to your program. Then replace your EventSetTimer(xx) call with a SecureSetTimer(xx) call. You can have only one such call. Otherwise your trouble comes from not reading the MQL4 manual properly.

Code: Select all

bool SecureSetTimer(int seconds) 
{
   int error=-1;
   int counter=1;
   
   do
   {
      EventKillTimer();
      ResetLastError();
      EventSetTimer(seconds);
      error=GetLastError();
      Print("SecureSetTimer, attempt=",counter,", error=",error);
      if(error!=0) Sleep(1000);
      counter++;
   }
   while(error!=0 && !IsStopped() && counter<100);
   
   return(error==0);
}
Happy pippin, Thomas :-BD

It ain't what you don't know that gets you into trouble.
It's what you know for sure that just ain't so.
(Mark Twain)

Keep the coder going: Donate
Foreverforex
Trader
Posts: 164
Joined: Wed Nov 28, 2012 6:48 am

Ditto - Empty4 to Oanda Trade Copier - As Low as 0.00001

Post by Foreverforex »

Thanks, Thomas!

Hopefully, Lonnie will be able to implement this bit of code and we can give it a try.

Cheers,

Kris
Jonah
Trader
Posts: 47
Joined: Sat May 11, 2013 4:13 pm
Location: Las Vegas

Ditto - Empty4 to Oanda Trade Copier - As Low as 0.00001

Post by Jonah »

tomele » Thu Apr 04, 2019 11:51 am wrote:Well ...

There can be a problem on VPS's when no free handles exist to create a timer. I have written a workaround for that problem. I have never observed the problem on workstations. But one never knows.

Add the following code to your program. Then replace your EventSetTimer(xx) call with a SecureSetTimer(xx) call. You can have only one such call. Otherwise your trouble comes from not reading the MQL4 manual properly.....
Thank you for the code, Thomas!!! New version has been uploaded.
-- Lonnie.

"Give a man a program, frustrate him for a day. Teach a man to program, frustrate him for a lifetime." (Muhammad Waseem)
Foreverforex
Trader
Posts: 164
Joined: Wed Nov 28, 2012 6:48 am

Ditto - Empty4 to Oanda Trade Copier - As Low as 0.00001

Post by Foreverforex »

Amazing! Very exciting! Thank you!

:clap: :yahoo: :good:
Foreverforex
Trader
Posts: 164
Joined: Wed Nov 28, 2012 6:48 am

Ditto - Empty4 to Oanda Trade Copier - As Low as 0.00001

Post by Foreverforex »

hmmm. curious to see how latest version is working for everyone. Not so much for me.

fired up dittolink, opened fine. put ditto on chart and it loaded current open trades into the table on the chart, and got green "Satus Okay. Monitoring Long and Short Trades for All Activity" message on top left, but no trades are being sent to my Oanda account.

I entered a couple of manually trades to test it and they're not showing up in the ditto ea chart table, so activity is not being ready by the EA. Seem to have gone from 1000s of trades being sent, to zero trades being sent. :roll:

I'm on Oanda Empty4, so should be sending pending trades. Magic Number set to 0, so all trades, manual or EA triggered, should be going through as well...

cozybooks & BigRunner - have you given it a spin yet?
Post Reply

Return to “Automated trading systems”