Stop making exit call if there is no buy call


Hello Team,

I have written the code to buy the stock on particular condition and same to get exit if the target is achieved. I want to know how to get exit and call stop loss hit if there is any buy call.
How system will come to know that there is buy call already has been placed so don’t make another buy call.


this cannot be done without using for loop.

You will need to share code and screenshots of errors you are facing.