thank you for your attention. I know there may be better ways. But I want to know after which a position is opened, and the information about it and the closing commands of the position are calculated in several tps. Know that for example Is tp 1 closed or not? When I use close, unfortunately it compares the closing price of the candlestick, not the current price.
if tradeOn_short ==true and tp1Close_short == false
strategy.close(id="Si", when=close>stop, comment="LOSS") //close Unsuccessful entry
//tp1 Go to identify
strategy.exit ("SiT1", from_entry="Si", stop=stop, limit=tp1 , qty_percent=50)
tp1Close_short :=close <tp1