Trailing stoploss in API code

@Tradehull_Imran dear please check my code for trailing stoploss
# :white_check_mark: Adjust SL Based on Trade Type
if trade[“type”] == “BUY”:
new_trailing_sl = last_price - sl_points # :white_check_mark: SL moves UP for LONG trades
if new_trailing_sl > old_sl: # :white_check_mark: Ensure SL moves in the right direction
try:
tsl.modify_order(order_id=trade[‘sl_order_id’],stop_loss=new_trailing_sl)
trade[“sl”] = new_trailing_sl
print(f":arrows_counterclockwise: Updated SL for {stock_name}: {old_sl} → {new_trailing_sl}")

Hi @prajak_amrute ,

On high level the code seems to be right.

for order modify code right
how can i place super order ?