Global takeprofit for grid
-
Hello everyone, how can i set a global tp for a grid recalculating it automatically for each new grid step?
-
That depends on how that TP is supposed to be calculated. In pips? In money? In confirmed equity?
-
I calculate it in money
-
@pippoio Then you need this block:

You will need to create as many groups as independent grids you need. In my example, all trades belonging to grid (group) 1 will be closed as soon as their combined net profit is €50.00.
-
i already use this but i need a tp level drawed on chart
-
Why do you need it drawn? You can simply insert the value into a variable.
-
if all trades have a tp is more reliable, metatrader closes them even if the app is closed
-
Yes, but you don't need a visual line to do that. Can can use a variable and store the value in it.
-
Yes, the line was to make me understand, I'm interested in the calculation to set a global tp in a grid. I'm fine with both the calculation in money or pips
-
Ok. so let's move step by step. Do you have an initial project to begin with?
-

-
@pippoio @l-andorrà is talking about a shared project link, rather than a picture, this way people can see what each block is doing.
-
Exactly.
-
-
Ok. Some initial hints. You can remove blocks 29, 35 and 41, they are redundant. Can you please confirm the current structure works as designed? I don't see any issue at first glance.
-
Yes, the current structure work correctly but tp is "hidden"
-
Ok. Now the tough part begins. Those are my first questions: a) Is there any max limit to the open trades in both directions at the same time? In other words which is the biggest grid the EA is supposed to create?
-
There's not a limit
-
This means there is potentially an infinite number of open trades with an infinite number or grid trades in the opposite direction. Is that correct?
-
yes until the end of the free margin