Close deal instead of position - page 4

 
doshur:

Terms aside. Lets use layman terms.

In my given example. I buy at price 100 (1 lot) and at 50 (1 lot). My average open price would be 75 correct?

When the price is at 75 and I decided to close 1 lot. For the closed position of 1 lot, my profit would be 0 correct?

If you will sell 2 lots you will close position and profit is 0. Closing 1 lot you will still have position Buy with lot 1, opened price 75 and current profit 0.
 

therefore the proposed solution from AmitJamuda does not work

I have to do this in MT4. 

 
angevoyageur:
That makes no sense. There is only 1 position with an open price who is calculated by averaging price of deals with in direction. When you make a deal with out direction, P/L is calculated by the difference between the open price of the position and the price of the out deal. The volume of the position is reduced by the volume of this out deal and the open price doesn't change.
got your point, you are right!!!!!
 
doshur:

therefore the proposed solution from AmitJamuda does not work

I have to do this in MT4. 

the solution will work if you use mql5 file system.
 

After a good 5 years and this is possible in mt5

But I have fallen back to the good old mt4

 
It all depends on point of view: it doesn't matter to the terminal which position the deal belongs to. Does it make it bigger or smaller.
However, for me, in order to assess the effectiveness of a strategy, it is important to know which open deal a given operation belongs to. And for this purpose, the only tool is MagicNumber. I don't think it's the best, because I have to assign this number to the order number first, and it "costs" calculation time.
Reason: