CRUCIAL - EOF in MQL code doesnt work 100%

on my demo acc i can still see strategies which will not close trades on EOF at 21:00



this closing method is on every of my strategies, but now i can see still open trades


there is still some problem in MQL code


in old SQ this works 100% but in SQX still not


using B119 MQL code with 


int sqMaxEntrySlippage = 0;          //zero means unlimited slippage
int sqMaxCloseSlippage = 0;          //zero means unlimited slippage

Attachments
EOF MQL.jpg
(158.54 KiB)
  • Votes +1
  • Project StrategyQuant X
  • Type Bug
  • Status Fixed
  • Priority Normal

History

h
#1

hankeys

30.03.2019 23:07

Task created

h
#2

hankeys

01.04.2019 21:08
its about problem with a portfolio of strategies, when 10 retries in OrderReliable library is not enough


could devteam make clear what these settings of the library means?


int retry_attempts = 10;

double sleep_time = 8.0;

double sleep_maximum = 25.0;


time is in seconds?


what will be your recommendation to make sure that every order will be executed in a portfolio? shorten the time or higher number of attempts?


thx

MF
#3

Mark Fric

02.04.2019 11:21

Status changed from New to Waiting for information

so are you sure it is caused by many strategies ending at the same time on Friday?

Do you see some error messages in logs?


10 retry attempts should be enough, but I'd say 8 seconds mean and 25 seconds maximum sleep time is too long. It could be somehting like 2 and 10 seconds.

h
#4

hankeys

02.04.2019 11:39
i am facing this on demo acc, where 50-60 strategies are running at the same time and every strategy has close at 21:00


if i will have portfolio of 20 strategies (which could be the number of strategies in a real portfolio), maybe 10 retries will be enough - who knows?


we need to think about it what to set up to original SQX MQL code without need to change the template


yes there are errors on the log "trade context is busy" and after 10 retries it ends


so you suggest to increase the number of retries and lower the time values to 2-10?

MF
#5

Mark Fric

02.04.2019 12:14
I changed it in default code like this:

int retry_attempts = 20;

double sleep_time = 1.0;

double sleep_maximum = 10.0;

h
#6

hankeys

02.04.2019 12:41
OK, i will change for myself in the template to see if it helps on the next Friday
MF
#7

Mark Fric

03.04.2019 13:57

Status changed from Waiting for information to Fixed

BS
#8

BobS

05.04.2019 08:50
Voted for this task.
h
#9

hankeys

06.04.2019 10:58
i made the changes as stated


int  retry_attempts  = 20;

double  sleep_time  = 1.0;

double  sleep_maximum  = 10.0;


and still having closed all open or pending orders


even after 20 retries its still "trade context is busy"


so if anyone will be using big portfolios of 50 strategies could have these problems.


And i am using these bigger portfolios which can have 50+ strategies on real accs


we need to find better way


on the old SQ MQL code we have made own changes in MQL code, if error - retry on next tick with random time in ms until its OK. I can have 99 strs in one MT and never have these problems - everything is closed on friday - no open or pending orders - it works 100%


Order reliable library seems doesnt work 100%


to the next week i will try change retries to 100 and i will see in the log how many retries need to be done on these ptfs

MF
#10

Mark Fric

10.04.2019 08:07
if you could send me your reliable code that you used for SQ3 strategies I can look at it and possibly make some changes in OrderReliable library.


Otherwise, maybe increasing attempts to 100 could help. Could you send me a log from Friday so I an see how it is trying and fialing?

You can send it to support address with note to forward it to me, or you can attach it here.


Mark

h
#11

hankeys

10.04.2019 12:26
posláno na support

Votes: +1

Drop files to upload

or

choose files

Max size: 5MB

Not allowed: exe, msi, application, reg, php, js, htaccess, htpasswd, gitignore

...
Wait please