How to write a strategy for exit to take a profit

I want to buy a stock if the CLOSE > EMA(CLOSE,15) and exit the position when I have 1% profit. How to write the exist signal since I will not know the value of buy. Is there a provision to do so in coding to know what value the buy was triggered

NaMasTe TraDeR,

LONG EXIT codes referring to your trade entry price cannot be coded on Tradescript Language.

Without this provision, writing independent Buy and Exit is of no use, since both are related execution. Is there a plan to provide such facility?