As I calculate the exact price with the profit at 0, having many open positions with different sizes?
-
Hi everyone, I ask you if anyone knows how to visualize the exact price in relation to the profit of many open trades that have different distances, pips and sizes. I tried to use the bucket (average price) but the calculation is not accurate. It is not correct, because the average of the prices is not equal to the average of the profit. I need to know how to calculate (having many open positions with different sizes) the exact price of the profit at 0 €.
Please have been trying for 2 weeks, but I can't
AleX -
@alex222 I'm not completely sure what you exactly mean. Can you please provide a numerical example?
-
Please see the photo, I have a bucket with all these operations.
How do I know the exact price when it will reach € 0.27 (or € 0.00)? -
@alex222 You can get it this way:

This structure will search for all open trades right now and will wait until profit is the amount you want. Below that second block you can connect a 'close trades' block and that will close all your open immediately.
-
Hi @alex222 ,
If I get you right, you need the average profit of open trades, related to their open price and the lot size; which is calculated via block named 'Check profit (unrealized)' with the example setup below.
In this example, buy trades are treated as a position. Their lot size and the open prices are considered in calculation of average open price of all open buy trades. You can configure money or pips as your profit target (or to take whatever action desired).

I hope this helps.
Regards.
Notify: @l-andorrà
-
hi guys, thanks for the answer. This module, I had taken into consideration, but it does not tell me the price, It just makes a comparison.
I want a price that I will then put on the Take Profit.
I really think this module is missing
if you have other ideas I accept them -
@alex222 Try This in a bull market moment or change sell grid with a buy grid Average_Price.In this case we have only one grid with one position type.
-
Hi Miki,
the average of the prices is not equal to the average of the profit.
it is the same only if the grid has the same size and the same distances.
so i can't use it.
@paragorundu & @l-andorrà , understood what I need, but I need the exact price when the average reaches 0 profit. But it seems to me that this module does not exist. -
@alex222 the distance between the orders does not matter because the price open of each is taken and the average price across all orders, based on volume is returned. The horizontal line marks profit 0. If you use mt4 change "For each Position" block with "For each Trade" block.
-
@miki Miki, sorry
I did not notice your link, I try it -
@miki
yesssssssssss works, you are great

-
-
hi, is possible this system add tp and sl?
@miki said in As I calculate the exact price with the profit at 0, having many open positions with different sizes?:
@alex222 Try This in a bull market moment or change sell grid with a buy grid Average_Price.In this case we have only one grid with one position type.
-
@miki hi, this code not work on mq4!!!
-
@miki said in As I calculate the exact price with the profit at 0, having many open positions with different sizes?:
@alex222 Try This in a bull market moment or change sell grid with a buy grid Average_Price.In this case we have only one grid with one position type.
Hi, this code not work on mq4, not load volume, results zero, and error formula divide
-
@duepips But what do you exactly need?
-
@l-andorrà said in As I calculate the exact price with the profit at 0, having many open positions with different sizes?:
But what do you exactly need?
the same function but on mq4
-
@duepips Those blocks are the ones for mq4.
-
@l-andorrà said in As I calculate the exact price with the profit at 0, having many open positions with different sizes?:
Those blocks are the ones for mq4.
ok, in fact it seemed to me precisely for mq4, now I try to load in on init, perhaps on tick it doesn't work with mq4, thanks