| stevehopwoodforex.com https://www.stevehopwoodforex.com/phpBB3/ Print view |
|
| Modifying the SL of multiple orders https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=1591 |
Page 1 of 2 |
| Author: | szfxtrader [ Sat Mar 09, 2013 3:14 pm ] |
| Post subject: | Modifying the SL of multiple orders |
Hello! I would like to modify the SL of some orders to the same level, if you know how I can do that, please let me know, thanks in advance. Example: Order 1 = 1.3050 Order 2 = 1.3000 Order 3 = 1.2990 Order 4 = 1.2970 Let's say the market price is now at 1.3090 and I would like to set the SL @ 1.3050 for the orders 2,3 and 4. |
|
| Author: | phil_trade [ Sat Mar 09, 2013 4:55 pm ] |
| Post subject: | Re: Modifying the SL of multiple orders |
Hi you can such functions to retrieve the SL you want and then modify your orders Code: Select all |
|
| Author: | szfxtrader [ Sat Mar 09, 2013 11:03 pm ] |
| Post subject: | Re: Modifying the SL of multiple orders |
Thanks a lot for your reply! Could you also please let me know how I can change the SL to the same level? I am asking you it because I was able to find the highest or lowest level for the SL(Long/Short), but when the EA goes to update the orders using that number, it is sending me an error 130, thanks in advance! |
|
| Author: | dietcoke [ Sat Mar 09, 2013 11:12 pm ] |
| Post subject: | Re: Modifying the SL of multiple orders |
error 130 usually occurs when your attempted stoploss is too close to the current price. the stop loss has to be bigger than the brokers STOPLEVEL |
|
| Author: | mobthehop [ Sun Mar 10, 2013 1:27 am ] |
| Post subject: | Re: Modifying the SL of multiple orders |
SZ - if I have need to (manually) adjust multiple orders of one pair I usually use one of these scripts (!) - maybe there is a snippet in there that helps... dietcoke - thanks for the code - went straight into my snippet collection! Mop |
|
| Author: | dietcoke [ Sun Mar 10, 2013 11:23 am ] |
| Post subject: | Re: Modifying the SL of multiple orders |
Not mine, mop. It was Phils code |
|
| Author: | szfxtrader [ Sun Mar 10, 2013 11:28 am ] |
| Post subject: | Re: Modifying the SL of multiple orders |
Thanks for all the replies! I will be more clear. Let's say I have 4 orders and 3 of those are protected by BE(+5 pips), the BE will be activated just after +25pis, then I want to change the SL of the 4 and 3 to the same level of the order 2. I've wrote the following code but it is not working properly. Thanks in advance for all the replies! Code: Select all |
|
| Author: | dietcoke [ Sun Mar 10, 2013 12:49 pm ] |
| Post subject: | Re: Modifying the SL of multiple orders |
It's not clear from your description what you're trying to do? Are you trying to set your SL for all 4 trades so the basket closes at breakeven? when you post code, try warpping your code in code tags. its easier to read eg. Code: Select all |
|
| Author: | szfxtrader [ Sun Mar 10, 2013 3:05 pm ] |
| Post subject: | Re: Modifying the SL of multiple orders |
Thanks for your reply! I will try to explain it again. Let's say I have 4 long orders Order 1 = 1.3050 Order 2 = 1.3000 - SL gain = 1.3005 Order 3 = 1.2990 - SL gain = 1.2990 Order 4 = 1.2970 - SL gain = 1.2975 Now the market price is 1.3030 and my highest SL gain level = 1.3005(order 1), I would like to change the SL gain of the order 3 and 4 for the same level(1.3005), I want to do that because if the markets moves back to the 1.3005, it will close the orders 2, 3 and 4, later on the EA will build a new long grid until it can close all the orders(including order 1 that was left opened). Thanks in advance for all replies! |
|
| Author: | mobthehop [ Sun Mar 10, 2013 4:44 pm ] |
| Post subject: | Re: Modifying the SL of multiple orders |
SZ, if you combine the code provided by dietcoke /Phil and the recoursing of orders from the scripts i posted it should work - but you probably want to add a check that the new SL is not in conflict with your brokers min stoplevel or freezelevel (see http://docs.mql4.com/constants/marketinfo) as also pointed out by dietcoke Cheers |
|
| All times are UTC | Page 1 of 2 |
|
Powered by phpBB® Forum Software © phpBB Limited |
|