Equity and balance graph - page 15

 
alexx_v писал(а) >>

I haven't noticed any errors on version 7, neither with nor without oncoming traffic, everything is clear and correct, just right on the nose :) ...

I propose to make such a test:

Open a LARGE amount of opposite positions in a demo - for example, 10-15 pairs, hold them for a while to let the price run back and forth for an hour or so, and then close them all with one command through the menu "close overlapped orders".

I think you will be surprised by the result :)

 
Batman >> :

I suggest we do a test like this:

It's pretty much the same way, I just close it with a script or the advisor closes it by itself :) the result has never surprised me :)

 

How about closing like I suggested? It surprises me.

 
alexx_v >> :

I haven't noticed any bugs in version 7, neither with nor without counterparts, everything is accurate and straight to the point :) but in version 8...

well, I'm sticking with 7 :)

>> what about the candles?

 
OZ0 писал(а) >>

What about the candles?

Apparently, the task was really difficult - it's not easy to get it right away, or maybe more important things are distracting...

I am very curious, for some reason no one has commented on the miracles with both versions when closing overlapped positions via menu.

By the way, I have a related question for experienced programmers - is it possible to close such poses programmatically from the Expert Advisor?

I must have some MultipleCloseBy() function, but I have not yet found any signs of its existence :( Although it works via menu, how quickly!!!

 
Batman писал(а) >>...

Exactly, and the task is not easy and there are other things to do.

What miracles are you referring to? I made an experiment with closing two opposing positions - I did not see anything supernatural. Equity and balance jump up by the value of spread after closing, no wonder. For this purpose, MQL has only the OrderCloseBy function that closes two opposite positions (you must be aware of it). For the organization of closing many such positions, a separate function must be developed on the basis of the aforementioned one.

 

I see what the problem is!

This picture shows the chart after the indicator has been installed. The display is not correct because the order with zero volume is not taken into account.

This is the chart that should be in fact. This screenshot was taken right after closing the positions.

The trick is that after such closing one of the opposite orders changes its volume - it becomes zero.

The trick is to read the comment where the ticket of the hedging order is specified. I will correct it in the new version.

 
Xupypr писал(а) >>

... MQL only has the OrderCloseBy function for this purpose

... To arrange closing of a lot of such positions, we have to write a separate function based on the above.

Everything is clear with OrderCloseBy, but ... Since the terminal allows closing of all overlapped positions through the menu without specifying certain pairs, it means that it is possible to do this programmatically, but it is not documented...

So, I have to invent a "push-button"... But I can't do it yet. :(

 

The new version of the indicator now looks like this

 
Thank you, Igor, I will try it out