Here is an example of how I would like for the Martingale to work.
The Blue line is the AveragePrice; if price were to go to that point, the $$ of our trade is $0.00.
TP is a fixed distance that we set and this is based on the AveragePrice calculation.
For this case, say if price goes up again and another position is opened (based on my multiplier, next lot is 1.38), then AveragePrice is now higher. Likewise for the TP, it will go higher because it just follows AveragePrice.
This TP is set for all the opened positions; the same for all the positions opened by the EA.
Meaning, the positions 0.37 and below (in the picture) will close with losses BUT the overall trade is still profitable because of the bigger lot sizes above (Martingale).
I hope it is clearer now