Add volume
-
Hi fxdreema,
Will "add volume" become available to pending orders in the near future?
Kind regards,
Kris -
Interesting idea when the block doesn't work for pending orders. I will think about it. But I think you can do that today if you want. I guess there are 2 ways - to add new pending order or to close the old one and replace it with another. While you are in the loop (For each Pending Order), you can use the attributes of the currently loaded order (OpenPrice, SL, TP...) and make another one with the same attributes.
-
Thanks I will try to do that!
The pending order "cycle" I am trying to create is a series of 12 pending orders (each with a different tp/sl). When one of the orders takes profit, it should be put back into the pending order list. Right now, I was thinking of giving each p/o an individual group number, and then have the EA check per group number if it t/p. When that value is true, there would be a new block of 12 p/o's with the same values (different group numbers again) with the t/p check, and so on and so on and so on. Downside is the maximum amount of cycles = the amount of pending order blocks created. Perhaps I could get it to work with the loop you suggested.
-
@fxDreema I am having trouble getting the loop to work, would you be able to elaborate with making a short example of what you wrote above? I am not asking you to make it for me, just a short example to get me on the way.
Thanks in advance!
-
bumping this one...anyone have an example for me how to use the "for each pending order loop" like fxdreema here described? Pulling my hair out here trying to understand how this block works to create a cycle.
-
So, if one trade closes, you want to use its Open Price to make an order at that price? You can try this in "on Trade", something like this:

Above I was thinking about something else, like adding extra pending order to existing one. Now I don't think you want that. I think you want to replace a closed trade with a pending order.
-
Hi there!
Thanks again for your thoughts

What I want is this:
pending order triggers -> pending order takes profit -> pending order with the same settings is created.
I have about 12 pending orders with different entry prices and take profits per trade. The entry prices and take profits will always have the same price offset and will depend on the entry of the buy or sell order.
This loop should last untill a (parent) buy or sell order with a specific take profit (10 pips) is closed by take profit.
I was trying to work around the add volume only being available for trades, but I am now also learning to code MQL4 so I am hopefull that if this is not achievable in fxdreema I will eventually be able to code it myself, although that will probably take a lot of time before I am there

Happy Saturday!
-
You will want to use group numbers (#) for differentiating between the "parent" and "secondary" orders. Then use logic like "parent trade is running -> keep x amount of secondary orders in place -> if there is more than x amount orders, close the oldest and repeat loop (see picture)"
hope this helps some

-
By "add to volume" I understand opening more and more trades and actually increasing the Buy or the Sell position. Normally this also has negative meaning, because it is well known that people often add more and more lots while losing, to cover their previous losses, which sometimes leads to margin call
Otherwise pending orders are just potential trades in the future, they don't have actual volume until they are triggered.This is what I was thinking - https://fxdreema.com/shared/A5VpH9l1e
Here is how one of my order is triggered, became a trade, then closed by TP, this triggered "on Trade" event and in "on Trade" a new pending order is created with the same parameters as the trade.

-
@fxDreema Thanks for explaining! I now see that I had interpreted the add volume wrong and that it won't lead to what I am trying to do here

@roar thanks very much for your explanation, that actually helped a lot. I am still not getting the results I want, but now I do think it's achievable, so I'm back to the drawing board with this. Thanks again!
-
Dear @fxdreema my ea is opening ten trades when the signal come. But I want to open per trade adding 0,01 lots. For example,
1th: 0,01
2nd: 0.02
3rd: 0.03
4th: 0.04
5th: 0.05
6th: 0.06
7th: 0.07
8th: 0.08
9th: 0.09
10th: 0.10This is for the one signal. For another sell and buy signal, it will repeat and start this trades again.
Could you please help me about it.
Besides, when i complete my little ea, i will purchase full version of your ea builder.
Thank you..