Reply

[ARGENT!] Need help!!!, cant trade like this anymore, sometimes SL/TP wont set!

20 replies

Karish

Customer, bbp_participant, community, sq-ultimate, 444 replies.

Visit profile

6 years ago #201579

Cant trade like this anymore, sometimes SL/TP wont set!,

how to fix that damn thing?!

 

somebody got any “Retry” code replacement that proven to work so i can replace the original OrderModify function?

 

any alternatives?, thanks…

0

Mark Fric

Administrator, sq-ultimate, 2 replies.

Visit profile

6 years ago #201599

can you tell me what exactly is happening?

SL/PT is sometimes not set when the initial order is placed?

I’ll look at it and add some retries when SL/PT is not placed, I’ll publish it later today or tomorrow.

 

 

Mark
StrategyQuant architect

0

Karish

Customer, bbp_participant, community, sq-ultimate, 444 replies.

Visit profile

6 years ago #201602

can you tell me what exactly is happening? SL/PT is sometimes not set when the initial order is placed? I’ll look at it and add some retries when SL/PT is not placed, I’ll publish it later today or tomorrow.

Thanks Mark, please do, that happens sometimes i dont know why,

a retry function is A MUST,

an official version of a fixed code from you will be just awesome,

 

here are the stuff i noticed maybe i am wrong but it happened to me:

• OrderSend – does it retries correct? (there is already a retry function before it sends the ordersend [3 retries])

 

• OrderModify – here is the very buggy part (sometimes SL/TP not set at all, sometimes SL set but TP do not and sometimes TP set but SL not, *retry function of couple times is a must! + from what i understand the calculation of the SL/TP is wrong especially when using ATR as SL/TP !!)

 

• OrderClose – retry function of couple times is a must!

 

• OrderClose – retry function of couple times is a must!

 

 

*There are couple of “OrderModify” functions for Modify after OrderSend + Modify for Trailing + Modify for BreakEven + etc..*

0

Karish

Customer, bbp_participant, community, sq-ultimate, 444 replies.

Visit profile

6 years ago #201605

• OrderClose – retry function of couple times is a must!

 

by accident i wrote “OrderClose” twice,

it should be:

• OrderClose – retry function of couple times is a must!

OrderDelete – retry function of couple times is a must!

0

Mark Fric

Administrator, sq-ultimate, 2 replies.

Visit profile

6 years ago #201606

ok, I made the fix. It tries to set SL & PT 5 times, and if it fails it deletes the order.

 

To make it work please save this file to {SQ3}\code\Mql_MT4 folder, overwriting the old one.

 

I didn’t release it as a global update yet, because it changes how some things work, especially it deletes the order is SL is not set.
Do you think I should release it as an automatic update for SQ 3?

 

 

Mark
StrategyQuant architect

0

Karish

Customer, bbp_participant, community, sq-ultimate, 444 replies.

Visit profile

6 years ago #201609

Thank you for your time and effort Mark,

i think that the closure/delete of the order after some retries will be very bad because the results from SQ to MT4 will not match by logic,

 

please give your review about my function and solution to this, i have not tried all the “While loop retry” thingy yet,

but when i updated my code to use “if(CheckTradeContext()>=0)” before every OrderSend/OrderModify/OrderClose/OrderDelete it seems to slove the problem, i have also added “RefreshRates();” here and there to aid the process,

 

though when relaying only on “if(CheckTradeContext()>=0)” it might return an error and it will skip another chance to modify the order again, thus thats what causes the SL=0/TP=0 or even both =0 and it wont be trying to modify them again,

same thing goes for OrderClose and OrderDelete,

 

so recently i just have finished the “retry” thingy, though i have not tested it with the “retries” yet,

right now the portfolio on my VPS is only using “if(CheckTradeContext()>=0)” before every OrderSend/OrderModify/OrderClose/OrderDelete ,

seems like it is working fine, though when it will give an error when trying to modify/close/delete an order it will not try again cause i still not updated the EAs on my VPS to use the “retry” version, so that will be a sad thing to see, though i am waiting to see if it will still work good like it is right now without the “retries”..

 

 

any way please give a review about my solution for this problem, the code of the function is here:

https://paste.ofcode.org/36AZzdDnpypf4VQYgvAJ47d

 

the full “MT4Functions.INC” code of mine with all the functions fixed here:

https://paste.ofcode.org/38dDjfmXeVsGCE4wYUccXbD

 

*NOTE this is the code of version 3.8.1!, NOT 3.8.2 since i have not updated yet,

 

Could you give me the full changelog of what has been changed in version 3.8.2? and what is the reason of this update?,

i’ve seen a new function added also, called: “changePendingOrder”

 

Thanks, will wait for your response.

0

Karish

Customer, bbp_participant, community, sq-ultimate, 444 replies.

Visit profile

6 years ago #201611

Also i noticed that pending orders sometimes wont delete themselves, and the EA keeps opening new pending orders without removing the older pending order/s, even if the order already converted into a market order..

ill try to fix it somehow, maybe i should update the the EAs on my VPS to the latest version with the “retrying” loop..

0

Karish

Customer, bbp_participant, community, sq-ultimate, 444 replies.

Visit profile

6 years ago #201613

I installed the newest 3.8.2 version with the new code and everything,

trying to make the “Retry” system working but without any success..

 

could somebody help?, Mark if you have any time..?
i modified the “OrderModify/OrderClose/OrderDelete” functions,
*”OrderSend” stayed the same.

you can use the CTRL+F feature inside the code and see what has been changed,

 

what i need is that all the “OrderModify/OrderClose/OrderDelete” functions will have a fully working “Retry” loop system,

it means that each “OrderModify/OrderClose/OrderDelete” will have a retry of 100 times with a pause (“Sleep()”) of 15 sec or so between each retry, so that there will be NO possibility of an order that stays without SL/TP or both, or an order that should have been closed/deleted and haven’t done that.

 

like i said the post above here are the problems:

  • • OrderModify – here is the very buggy part (sometimes SL/TP not set at all, sometimes SL set but TP do not and sometimes TP set but SL not, *retry function of couple times is a must! + from what i understand the calculation of the SL/TP is wrong especially when using ATR as SL/TP !!)
  • • OrderClose – retry function of couple times is a must!
  • • OrderDelete – retry function of couple times is a must!

 

please help and lets make an updated version of the code, hopefully a new 3.8.3 with all those bugs fixed..

Thank you for your time and effort.

 

The EA:
https://paste.ofcode.org/8Zm8acSG3ZbjyMRYd3AZ23

 

BTW!* – Found something that could help us out here:

http://www.stevehopwoodforex.com/phpBB3/viewtopic.php?f=15&t=525&hilit=OrderReliable

 

0

FILIPE BONALDO ACERBI

Customer, bbp_participant, community, 27 replies.

Visit profile

6 years ago #201617

Hello Karish

I had the same problem with order modify/delete with my broker. Every new day, I receive the message “market Busy” for the initial 2 mins of the day and the EA fails to change/delete orders. I have EAs running on daily timeframe, so, if it fails at the beginning of the day, it will never change/delete orders. So I implement retry loops for all functions and I don´t have problems anymore. It will make 60 retries for every 30 seconds until change/delete orders. Generally, the EA tries 4 to 6 times to successfully change the order. If you want, try to use this “MT4Functions.inc” attached.

Attachments:
You must be logged in to view attached files.

0

Karish

Customer, bbp_participant, community, sq-ultimate, 444 replies.

Visit profile

6 years ago #201620

Oh nice, thank you for your contribution to this topic Filipe!,

i’ll check it right away :), ill report back if it solved those issues

0

Karish

Customer, bbp_participant, community, sq-ultimate, 444 replies.

Visit profile

6 years ago #201626

Filipe!, thank you my friend, it seems to solve the Backtesting errors completely,

i’ll update the EX4 files of my portfolio right now, lets see what happens, i’ll post again with the result,

 

thanks again for sharing and helping me out 🙂

0

Karish

Customer, bbp_participant, community, sq-ultimate, 444 replies.

Visit profile

6 years ago #201628

Keep getting those Errors though,

it was even before the “retry” loop functions that has been added:

 

does it happen to you too?

Attachments:
You must be logged in to view attached files.

0

FILIPE BONALDO ACERBI

Customer, bbp_participant, community, 27 replies.

Visit profile

6 years ago #201650

Generally error 1 is when the EA is trying to set the same values of TP and ST that already setted. It´s not the case?

0

Karish

Customer, bbp_participant, community, sq-ultimate, 444 replies.

Visit profile

6 years ago #201652

I have some free time right now, ill check what i can do to fix this thing,

thanks for your reply mate.

0

mabi

Customer, bbp_participant, community, 261 replies.

Visit profile

6 years ago #201653

Mark it would be good if this MT4 problem could be solved once and for all for SQ3 and  for SQ4 as well. This is a big problem with the  Mt4 platform and as well impacted by connection issues and shitty VPS shared cores performance. This is a problem indeed and has a direct impact on live trade performance versus back tested performance for the same look back period.

0

Karish

Customer, bbp_participant, community, sq-ultimate, 444 replies.

Visit profile

6 years ago #201657

@mabi is right, i am correctly working to improve the overall code, i found some bugs here and there, adding few things to fix those problems, if the dev team wont release any fixes to the code, i will publish mine thats ok,

i think we should work together and solve the bugs inside the code,

i will open a topic on that subject as soon as ill finish working on the code, later on today, so the published code will be open for everybody to improve the excising (minimized) bugs in compair to the official 3.8.2’s bugs.

0

Viewing 15 replies - 1 through 15 (of 20 total)

1 2