Please help to code this strategy

I want to exit from long and short position once price moved 1.5% higher than brought/sold price.


tatamotors  --brought price=250,i want to exit/sell if it price reaches 253.75

                    short price =250,i want to exit/buy if it price reaches 246.25

you can use price alert indicator and can only generate alerts when price reaches manually.