Hey, @kobiewel
Unfortunately, this is really vague and it's going to be really difficult to assist.
If you want an EA to open a trade at a chosen price, you can store the price you want to open trades at as a constant, or in a variable if you use some formula or indicator to calculate the price.
You can also store the SL in pips, price, etc in variables or constants also, depending on if you want to specify it or variables if you want to retrieve that value from something else like an indicator or a calculation of some type.
If the entry price and SL are stored in variables, as long as you don't have the loop set to recalculate these variables every time it passes through, then there's no issue placing trades at the same price (you could just use limit orders, also since everything is predefined, but that's your call).
I'm still not sure I fully understand your question, so my ability to answer is limited, but you might try something like
Condition True, change bool value from false to true.
Then have a condition near the top of your structure that says "If bool true" then have all your trade logic stuff over on the true side. That way if the bool is false, then it updates your conditions, but once the bool is true, it keeps following the trade logic stuff you define and not your conditions/variables.
I don't believe there's a way to tell if a TP was hit or not, but you can check if the trade was closed at a profit (and if the TP is the only profitable method for closing the trade, then checking that the trade was closed with profit should be enough).
For this part, you might do something like
If bool true,
place limit order at price/SL determined earlier.
Then you can elsewhere have an "if no trade/order", last trade closed with profit, then bool = false. That way it stops placing new orders. If trade was closed at a loss, then it leaves the bool true.
I'm sure there's pieces I'm missing, but this general logic should work. Because your question was kinda vague, this is about the best I can say. Hopefully, this helps you solve your problem, at least.