Forex EXIT price calculator - Need help. Any ideas?

Hey guys, I hope you are all well.

Let’s say you use a martingale strategy and have multiple positions open for the same pair, each one a certain amount of pips above/below the other. Is there a way to create a function that will tell you at exactly what price you have to get out, in order to make a certain amount of profit?

So let’s say I want to close all positions once all the open trades for that pair total $200 profit (even the negative positions), at what price will I have to set the TP to for every single trade (it will be the same for all trades)?

Do you guys get where I am going with this? Does anyone know where to point me to?

Any help would be appreciated!

Martingale is gambling, and opening multiple position on one pair is highly risky

Your opinion is respected.