Price difference percentage calculator

I want to calculate price difference percentages between two legs on the current price of taken entries. Im not able to square off this position with this condition and able to square off position with time >= 1430

Looks like your coding is wrong to calculate%.

For current price you have to use LTP

you cannot calculate untill your trade is executed and your code is also notcorrect