[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 297

 

Good evening all!

Please advise how to specify the number of lots, which should be used to open an order? (we plan to use 10% of available funds to trade on the account)

 

Please advise why is it possible that the script from the simpleopen.mq4 tutorial is not executed (order opener).

I have tried to run it through my EA, I have seen a nice smile on my face but nothing happens.

 
Boneshapper:

Please advise why I can not execute the script from the tutorial simpleopen.mq4.

I have tried to run it through my EA, I got a smile on my face, but nothing happens.


Maybe, the script was written a long time ago and had 4 digits, now it has 5. 10 times stops and takeovers should be increased.
 

Please advise. I have encountered a problem today. I opened several orders with different values (15 orders) and now I have to close all of them. While the script was dealing with small ones, the biggest one retraced by 20 pips and thus I got a total loss instead of profit.

Question - is there any way to influence the order in which orders are closed (so that orders of larger volume are the first to be closed)?

If anyone has such a script as an example, can I have a look at it?

Thank you

 
Slepoy:

Please advise. I have encountered a problem today. I opened several orders with different values (15 orders) and now I have to close all of them. While the script was dealing with small ones, the biggest one retraced by 20 pips and thus I got a total loss instead of profit.

Question - is there any way to influence the order in which orders are closed (so that orders of larger volume are the first to be closed)?

If anyone has such a script as an example, can I have a look at it?

Thank you


Everything can be done, but "everything" takes time as usual
 
Slepoy:

Please advise. I have encountered a problem today. I opened several orders with different values (15 orders) and now I have to close all of them. While the script was dealing with small ones, the biggest one retraced by 20 pips and thus I got a total loss instead of profit.

Question - is there any way to influence the order in which orders are closed (so that orders of larger volume are the first to be closed)?

If anyone has such a script as an example, can I have a look at it?

Thank you

There is a function here that closes higher volume orders first: https://www.mql5.com/ru/forum/131859
 

Professionals, tell me. The indicator draws objects named, say, ST-1, ST-2, ST-3.... Sometimes you need to delete them. As far as I understand, it can be done with ObjectDelete(). But how can I get objects named ST-* to be deleted? Thank you...

 
Slepoy:

Pro tip. I have encountered a problem today. I opened several orders with different values (15 orders) and asked the script to close all the orders. While I tried to close the small ones, the order got rolled back by 20 pips and thus I got a total loss instead of profit.

Question - is there any way to influence the order in which orders are closed (so that orders of larger volume are the first to be closed)?

And if anyone has such a script as an example, may I have a look at it?

Thank you

sort the orders in the closing list... by lot size.

as an option.

;)

 
kon12:

Professionals, tell me. The indicator draws objects named, say, ST-1, ST-2, ST-3.... Sometimes you need to delete them. As far as I understand, it can be done with ObjectDelete(). But how can I get objects named ST-* to be deleted? Thank you...


Do a loop on listing all objects and, if the name starts with "ST-", delete.
 
Roger:

Do a loop through listing all objects and, if the name starts with "ST-", delete.
Right?
for (int i=ObjectsTotal()-1; i>=0 ; i--)
      {if (StringFind (ObjectName(i), "ST") >= 0) ObjectDelete (ObjectName(i)) ;}
Reason: