pending orders
-
hello can someone help me please, what i want to do is
*1: open buy position and pending sell limit order with 10 pips difference on the same time
*2: when the sell limit order is activated i want to put a buy stop order with 10 pips difference from the first pending order (sell limit ) please if anyone can help i'll be so thankful
thank you -
what you tried to do for now? can you post example?
-
what i want to do is :
-open a buy position at midnight 00:00
and put a sell limit order with 10 pips difference.
when the pending order is activated i want to put immediately a buy pending order one the same first buy position. -
maybe something like this:
https://fxdreema.com/shared/vTHzS6uXb
but you need modify it for your purposes ... and both section are used, on Tick and on Trade

-
You are the best Thank you so much i really appreciate it, just another question please.
when the buy pending order position is activated, how can i add another sell pending order on the same price of the first sell pending order.
i really appreciate your respond thank you so much. -
If a pending order is just deleted, I don't know how to then get it in MQL4. If a pending order is triggered (turned into a trade), then you can work with that trade.
How to get data from the latest trade/order/history trade?
It's good to understand what these blocks do: https://fxdreema.com/examples#Loop-(For each...)
So, depending on what you need to load (trade, pending order, history trade), you would use one of these darker pink blocks whose name starts with "For each...". To only load 1 trade (or order, depending on the block), open the block and set the value of 1 in "Not more than n ...." parameter. You will find this parameters, it's somewhere at the bottom.Ok, so now we have that dark pink block that is supposed to load the latest one trade, order or whatever. Then what?
- You can use any of the other light pink blocks, or...
- Let's say you have "Condition" block. You have a category "(in loop) Trade/Order in Loop". Go to that category and select any of the things that will appear. Now you have values such as SL, TP, Open Price, Close price and everything that belongs to the loaded trade or order. But guess what - you can use these in any other block, not only in "Condition". For example, you can get the Open Price of that latest trade and use that Open Price to open pending order on it. Just navigate to Open Price, but in let's say "Buy pending order" block. Something like this: http://prntscr.com/eybpt2
-
@fxDreema thank you so much for your respond but i think that i didn't give you a good explication:
what i want to do is :
1:open a buy position at midnight 00:00
and put a sell limit order with 10 pips difference.
2:when the sell pending order is activated i want to put immediately a buy stop pending order one the same first buy position.
3 and the same process again when the buy pending position is activated i want to put immeiately another sell pending order on the same price of the first pending sell position
thank you so much for your respond i rally apreciat it -
I always prefer to explain how things work in general

SL/TP of the trades is also important. And also what happens if that sell limit (in 2) for some reason is never reached... let's say that the price goes up
-
this was my reply, but it can crash, I have not tested it, no guarantee, it needs modifications:
https://fxdreema.com/shared/jltgTsAsd