Total lots open on screen?
-
Is it possible to see the total lots open on the current pair on screen? I can't find a block for that.
-
You can try this.

You'll have to create a variable (I called it Lots) in which the current volum will have to be inserted every tick.
-
@l-andorrà that one doesn't seem to work. It just gives me 0.01 lots on the screen even if I have more than that in my open trades on the same pair as the EA is attached to.
-
Weird. Can you please include a screenshot and the messages log?
-
@brad-0 Yes, that is what it will do. In the loop the "Modify Variables" block will read the size of each order in turn and place that value in the variable, over-writing the previous entry from the previously checked order. Therefore, if each of your orders is 0.01 Lots, that is the value of the Lots variable at any time there is a live trade.
The problem you present is not as easy to solve as it seems, but I suggest it could be done by using the "For each trade" block followed by a "Once per Trade/Order" block and then the formula block which would need to take the volume of each trade in turn - set up the left operand as pulling the value of the "Lots" variable, which will be zero initially and add to it the right operand to get the lot size of each trade (as @l-andorrà set up the modify variables above). As the loop runs through each trade the volume of each will be added to the variable and the comment will display this.
However, there are problems with this approach, as you will need to consider how, after each trade is closed, its volume is removed from the variable. Not impossible, but not straightforward.
The difficulty is not an issue with fxDreema, but with MQL4 itself and even if one were to write a script in MQL4 directly you would need to create a loop to add the volumes of each trade individually as each is a seperate entity and, unlike say the Equity figure, MT4 does record the sum of the volume of all trades as a single value.
I would be delighted to be proved wrong on the above, but I think it is a more challenging problem than it first appears.
-
You are right CPBonzo. I didn't consider the closed trades. Those lots would still be added to the "Lots" variable. Certainly not a trivial issue to deal with. More thinking is required.
-
Try this (I didn't test it).
-
@cpbonzo i think this works if you build it on Tick
http://icecream.me/3667bc72f68bc9c5efd536c23df8b574 -
@hadees Yes, you're right and that is much more straightforward than the approach I suggested. Thank you
-
Thanx a lot. Finally I had time to test this and it seems to work. Now I will try to make it work the way I want.