How to place sl based on the entry price?

I want to exit the trade if the candle closes below the one that I entered, Is it possible to include this in the exit script?

You can use price Alert the code is below


The value of 8445.40  is just a place holder, replace it with values that are applicable

Thanks for the reply. For an individual trade that is fine, but for back testing? Is it not possible to store the entry price in a variable?