Expert help needed for get correct result

@beppe
@Yogyatrader
Need expert help..

Below given example, at 11:30am nifty was traded at price 10730 with High 10780 and Low 10720

I have short nifty at price 10730 with SL 10790 and with target 10650. After that nifty made a high 10795 and later made a low 10640, but my current logic showing - Target Achieved. But actually loss the trade.

I want proper logic to correct result.

Thank you in advance.

Personal coding requirement will not be provided on public forum.

You can visit this forum for for more details